[PATCH 3/8] 2.6.3-rc3-mm1, Port sonypi driver to new DMI probing

From: Andrey Panin
Date: Fri May 07 2004 - 03:43:48 EST


diff -urpN -X /usr/share/dontdiff linux-2.6.6-rc3-mm1.vanulla/arch/i386/kernel/dmi_scan.c linux-2.6.6-rc3-mm1/arch/i386/kernel/dmi_scan.c
--- linux-2.6.6-rc3-mm1.vanulla/arch/i386/kernel/dmi_scan.c 2004-05-07 10:55:56.000000000 +0400
+++ linux-2.6.6-rc3-mm1/arch/i386/kernel/dmi_scan.c 2004-05-07 10:56:29.000000000 +0400
@@ -16,7 +16,6 @@
unsigned long dmi_broken;
EXPORT_SYMBOL(dmi_broken);

-int is_sony_vaio_laptop;
int is_unsafe_smbus;
int es7000_plat = 0;

@@ -360,24 +359,6 @@ static __init int broken_apm_power(struc
}

/*
- * Check for a Sony Vaio system
- *
- * On a Sony system we want to enable the use of the sonypi
- * driver for Sony-specific goodies like the camera and jogdial.
- * We also want to avoid using certain functions of the PnP BIOS.
- */
-
-static __init int sony_vaio_laptop(struct dmi_system_id *d)
-{
- if (is_sony_vaio_laptop == 0)
- {
- is_sony_vaio_laptop = 1;
- printk(KERN_INFO "%s laptop detected.\n", d->ident);
- }
- return 0;
-}
-
-/*
* This bios swaps the APM minute reporting bytes over (Many sony laptops
* have this problem).
*/
@@ -653,10 +634,6 @@ static __initdata struct dmi_system_id d
DMI_MATCH(DMI_BIOS_VENDOR, "American Megatrends Inc."),
DMI_MATCH(DMI_BIOS_VERSION, "0AASNP05"),
} },
- { sony_vaio_laptop, "Sony Vaio", { /* This is a Sony Vaio laptop */
- DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
- DMI_MATCH(DMI_PRODUCT_NAME, "PCG-"),
- } },
{ swab_apm_power_in_minutes, "Sony VAIO", { /* Handle problems with APM on Sony Vaio PCG-N505X(DE) */
DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
DMI_MATCH(DMI_BIOS_VERSION, "R0206H"),
diff -urpN -X /usr/share/dontdiff linux-2.6.6-rc3-mm1.vanulla/arch/i386/kernel/i386_ksyms.c linux-2.6.6-rc3-mm1/arch/i386/kernel/i386_ksyms.c
--- linux-2.6.6-rc3-mm1.vanulla/arch/i386/kernel/i386_ksyms.c 2004-05-07 09:45:23.000000000 +0400
+++ linux-2.6.6-rc3-mm1/arch/i386/kernel/i386_ksyms.c 2004-05-07 10:56:29.000000000 +0400
@@ -187,9 +187,6 @@ EXPORT_SYMBOL_NOVERS(memcmp);
EXPORT_SYMBOL(atomic_dec_and_lock);
#endif

-extern int is_sony_vaio_laptop;
-EXPORT_SYMBOL(is_sony_vaio_laptop);
-
EXPORT_SYMBOL(__PAGE_KERNEL);

#ifdef CONFIG_HIGHMEM
diff -urpN -X /usr/share/dontdiff linux-2.6.6-rc3-mm1.vanulla/drivers/char/sonypi.c linux-2.6.6-rc3-mm1/drivers/char/sonypi.c
--- linux-2.6.6-rc3-mm1.vanulla/drivers/char/sonypi.c 2004-04-04 07:37:37.000000000 +0400
+++ linux-2.6.6-rc3-mm1/drivers/char/sonypi.c 2004-05-07 10:56:29.000000000 +0400
@@ -43,6 +43,7 @@
#include <linux/delay.h>
#include <linux/wait.h>
#include <linux/acpi.h>
+#include <linux/dmi.h>

#include <asm/uaccess.h>
#include <asm/io.h>
@@ -818,10 +819,21 @@ static void __devexit sonypi_remove(void
printk(KERN_INFO "sonypi: removed.\n");
}

-static int __init sonypi_init_module(void) {
- struct pci_dev *pcidev = NULL;
+static struct dmi_system_id __initdata sonypi_dmi_table[] = {
+ {
+ .ident = "Sony Vaio",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "PCG-"),
+ },
+ },
+ { }
+};

- if (is_sony_vaio_laptop) {
+static int __init sonypi_init_module(void)
+{
+ struct pci_dev *pcidev = NULL;
+ if (dmi_check_system(sonypi_dmi_table)) {
pcidev = pci_find_device(PCI_VENDOR_ID_INTEL,
PCI_DEVICE_ID_INTEL_82371AB_3,
NULL);

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/