lkml.org 
[lkml]   [2004]   [May]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH 6/6] Port PIIX4 I2C driver to new DMI probing
Date
From
diff -urN -X /usr/share/dontdiff linux-2.6.6-rc3.vanlila/arch/i386/kernel/dmi_scan.c linux-2.6.6-rc3/arch/i386/kernel/dmi_scan.c
--- linux-2.6.6-rc3.vanlila/arch/i386/kernel/dmi_scan.c 2004-05-05 22:27:49.000000000 +0400
+++ linux-2.6.6-rc3/arch/i386/kernel/dmi_scan.c 2004-05-05 22:28:57.000000000 +0400
@@ -15,7 +15,6 @@
unsigned long dmi_broken;
EXPORT_SYMBOL(dmi_broken);

-int is_unsafe_smbus;
int es7000_plat = 0;

struct dmi_header
@@ -221,19 +220,6 @@
return 0;
}

-/*
- * Don't access SMBus on IBM systems which get corrupted eeproms
- */
-
-static __init int disable_smbus(struct dmi_system_id *d)
-{
- if (is_unsafe_smbus == 0) {
- is_unsafe_smbus = 1;
- printk(KERN_INFO "%s machine detected. Disabling SMBus accesses.\n", d->ident);
- }
- return 0;
-}
-
/*
* The Intel 440GX hall of shame.
*
@@ -476,14 +462,6 @@
#endif

/*
- * SMBus / sensors settings
- */
-
- { disable_smbus, "IBM", {
- DMI_MATCH(DMI_SYS_VENDOR, "IBM"),
- } },
-
- /*
* Some Athlon laptops have really fucked PST tables.
* A BIOS update is all that can save them.
* Mention this, and disable cpufreq.
@@ -711,5 +689,3 @@
else
printk(KERN_INFO "DMI not present.\n");
}
-
-EXPORT_SYMBOL(is_unsafe_smbus);
diff -urN -X /usr/share/dontdiff linux-2.6.6-rc3.vanlila/drivers/i2c/busses/i2c-piix4.c linux-2.6.6-rc3/drivers/i2c/busses/i2c-piix4.c
--- linux-2.6.6-rc3.vanlila/drivers/i2c/busses/i2c-piix4.c 2004-05-05 20:15:38.000000000 +0400
+++ linux-2.6.6-rc3/drivers/i2c/busses/i2c-piix4.c 2004-05-05 22:32:23.000000000 +0400
@@ -40,6 +40,7 @@
#include <linux/i2c.h>
#include <linux/init.h>
#include <linux/apm_bios.h>
+#include <linux/dmi.h>
#include <asm/io.h>


@@ -114,18 +115,13 @@
static unsigned short piix4_smba = 0;
static struct i2c_adapter piix4_adapter;

-/*
- * Get DMI information.
- */
-static int __devinit ibm_dmi_probe(void)
-{
-#ifdef CONFIG_X86
- extern int is_unsafe_smbus;
- return is_unsafe_smbus;
-#else
- return 0;
-#endif
-}
+static struct dmi_system_id __devinitdata piix4_dmi_table[] = {
+ {
+ .ident = "IBM",
+ .matches = { DMI_MATCH(DMI_SYS_VENDOR, "IBM"), },
+ },
+ { },
+};

static int __devinit piix4_setup(struct pci_dev *PIIX4_dev,
const struct pci_device_id *id)
@@ -138,7 +134,8 @@

dev_info(&PIIX4_dev->dev, "Found %s device\n", pci_name(PIIX4_dev));

- if(ibm_dmi_probe()) {
+ /* Don't access SMBus on IBM systems which get corrupted eeproms */
+ if (dmi_check_system(piix4_dmi_table)) {
dev_err(&PIIX4_dev->dev, "IBM Laptop detected; this module "
"may corrupt your serial eeprom! Refusing to load "
"module!\n");
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:02    [W:0.060 / U:0.444 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site