All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrey Panin <pazke@donpac.ru>
To: Andrew Morton <akpm@osdl.org>, linux-kernel@vger.kernel.org
Subject: [PATCH 2/6] 2.6.7-mm1, port sonypi driver to new DMI probing
Date: Wed, 23 Jun 2004 16:44:38 +0400	[thread overview]
Message-ID: <10879946781111@donpac.ru> (raw)
In-Reply-To: <10879946751497@donpac.ru>


This patch ports sonypi driver to new DMI probing API and removes
is_sony_vaio_laptop global variable.

Signed-off-by: Andrey Panin <pazke@donpac.ru>

 arch/i386/kernel/dmi_scan.c   |   24 ------------------------
 arch/i386/kernel/i386_ksyms.c |    3 ---
 drivers/char/sonypi.c         |   18 +++++++++++++++---
 include/asm-i386/system.h     |    1 -
 4 files changed, 15 insertions(+), 31 deletions(-)

diff -urpN -X /usr/share/dontdiff linux-2.6.7-mm1.vanilla/arch/i386/kernel/dmi_scan.c linux-2.6.7-mm1/arch/i386/kernel/dmi_scan.c
--- linux-2.6.7-mm1.vanilla/arch/i386/kernel/dmi_scan.c	Sun May 23 22:13:30 2004
+++ linux-2.6.7-mm1/arch/i386/kernel/dmi_scan.c	Sun May 23 22:14:34 2004
@@ -19,7 +19,6 @@ EXPORT_SYMBOL(dmi_broken);
 unsigned int i8042_dmi_noloop = 0;
 EXPORT_SYMBOL(i8042_dmi_noloop);
 
-int is_sony_vaio_laptop;
 int is_unsafe_smbus;
 int es7000_plat = 0;
 
@@ -340,24 +339,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_blacklist *d)
-{
-	if (is_sony_vaio_laptop == 0)
-	{
-		is_sony_vaio_laptop = 1;
-		printk(KERN_INFO "%s laptop detected.\n", d->ident);
-	}
-	return 0;
-}
-
-/*
  * Several HP Proliant (and maybe other OSB4/ProFusion) systems
  * shouldn't use the AUX LoopBack command, or they crash or reboot.
  */
@@ -651,11 +632,6 @@ static __initdata struct dmi_blacklist d
 	{ apm_likes_to_melt, "AMI Bios", { /* APM idle hangs */
 			MATCH(DMI_BIOS_VENDOR, "American Megatrends Inc."),
 			MATCH(DMI_BIOS_VERSION, "0AASNP05"), 
-			NO_MATCH, NO_MATCH,
-			} },
-	{ sony_vaio_laptop, "Sony Vaio", { /* This is a Sony Vaio laptop */
-			MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
-			MATCH(DMI_PRODUCT_NAME, "PCG-"),
 			NO_MATCH, NO_MATCH,
 			} },
 	{ swab_apm_power_in_minutes, "Sony VAIO", { /* Handle problems with APM on Sony Vaio PCG-N505X(DE) */
diff -urpN -X /usr/share/dontdiff linux-2.6.7-mm1.vanilla/arch/i386/kernel/i386_ksyms.c linux-2.6.7-mm1/arch/i386/kernel/i386_ksyms.c
--- linux-2.6.7-mm1.vanilla/arch/i386/kernel/i386_ksyms.c	Sun May 23 22:02:03 2004
+++ linux-2.6.7-mm1/arch/i386/kernel/i386_ksyms.c	Sun May 23 22:14:34 2004
@@ -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.7-mm1.vanilla/drivers/char/sonypi.c linux-2.6.7-mm1/drivers/char/sonypi.c
--- linux-2.6.7-mm1.vanilla/drivers/char/sonypi.c	Sun May 23 22:02:14 2004
+++ linux-2.6.7-mm1/drivers/char/sonypi.c	Sun May 23 22:14:34 2004
@@ -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>
@@ -820,10 +821,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);
diff -urpN -X /usr/share/dontdiff linux-2.6.7-mm1.vanilla/include/asm-i386/system.h linux-2.6.7-mm1/include/asm-i386/system.h
--- linux-2.6.7-mm1.vanilla/include/asm-i386/system.h	Sun May 23 22:02:53 2004
+++ linux-2.6.7-mm1/include/asm-i386/system.h	Sun May 23 22:14:34 2004
@@ -466,7 +466,6 @@ void disable_hlt(void);
 void enable_hlt(void);
 
 extern unsigned long dmi_broken;
-extern int is_sony_vaio_laptop;
 extern int es7000_plat;
 
 #define BROKEN_ACPI_Sx		0x0001


  reply	other threads:[~2004-06-23 12:46 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-23 12:44 [PATCH 0/6] 2.6.7-mm1, port Acer laptop irq routing workaround to new DMI probing Andrey Panin
2004-06-23 12:44 ` [PATCH 1/6] 2.6.7-mm1, port PnP BIOS driver " Andrey Panin
2004-06-23 12:44   ` Andrey Panin [this message]
2004-06-23 12:44     ` [PATCH 3/6] 2.6.7-mm1, port PIIX4 SMBUS " Andrey Panin
2004-06-23 12:44       ` [PATCH 4/6] 2.6.7-mm1, port powernow-k7 " Andrey Panin
2004-06-23 12:44         ` [PATCH 5/6] 2.6.7-mm1, remove unused ASUS K7V-RM DMI quirk Andrey Panin
2004-06-23 12:44           ` [PATCH 6/6] 2.6.7-mm1, port APM BIOS driver to new DMI probing Andrey Panin
2004-06-23 14:53           ` [PATCH 5/6] 2.6.7-mm1, remove unused ASUS K7V-RM DMI quirk Jeff Garzik
2004-06-23 16:53             ` Len Brown
2004-06-24 19:57               ` Pavel Machek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=10879946781111@donpac.ru \
    --to=pazke@donpac.ru \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.