Skip to contentSkip to conversation

drivers/acpi changes for SMBIOS and System Firmware

RFC PATCH In review Prarit Bhargava 1 participant 1 message May 31, 2011

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

RFC PATCH 4/35 drivers/acpi changes for SMBIOS and System Firmware

drivers/acpi changes for SMBIOS and System Firmware interface

---
 drivers/acpi/battery.c           |    5 +-
 drivers/acpi/blacklist.c         |  125 ++++++++++++++++++-------------------
 drivers/acpi/bus.c               |   16 +++---
 drivers/acpi/ec.c                |  101 ++++++++++++++++++++++---------
 drivers/acpi/osl.c               |   17 +++---
 drivers/acpi/pci_irq.c           |   27 ++++----
 drivers/acpi/pci_slot.c          |   12 ++--
 drivers/acpi/processor_core.c    |   25 +++++---
 drivers/acpi/processor_driver.c  |    1 -
 drivers/acpi/processor_idle.c    |   51 +++++++++++-----
 drivers/acpi/scan.c              |    4 +-
 drivers/acpi/sleep.c             |   46 +++++++-------
 drivers/acpi/thermal.c           |   42 +++++++------
 drivers/acpi/video.c             |   28 ++++----
 drivers/acpi/video_detect.c      |    3 +-
 drivers/hwmon/acpi_power_meter.c |   15 +++--
 16 files changed, 292 insertions(+), 226 deletions(-)
drivers/acpi/battery.c +2 -3
index fcc13ac..cf4faba 100644
@@ -31,7 +31,7 @@
 #include <linux/types.h>
 #include <linux/jiffies.h>
 #include <linux/async.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include <linux/slab.h>
 #include <linux/suspend.h>
 
@@ -575,9 +575,8 @@ static void sysfs_remove_battery(struct acpi_battery *battery)
 
 static void acpi_battery_quirks(struct acpi_battery *battery)
 {
-	if (dmi_name_in_vendors("Acer") && battery->power_unit) {
+	if (sysfw_vendor_is("Acer") && battery->power_unit)
 		set_bit(ACPI_BATTERY_QUIRK_SIGNED16_CURRENT, &battery->flags);
-	}
 }
 
 /*
drivers/acpi/blacklist.c +61 -64

257 lines not on this page · raw message

drivers/acpi/bus.c +8 -8
index d1e06c1..09ad035 100644
@@ -39,7 +39,7 @@
 #include <linux/pci.h>
 #include <acpi/acpi_bus.h>
 #include <acpi/acpi_drivers.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include <linux/suspend.h>
 
 #include "internal.h"
@@ -55,7 +55,7 @@ EXPORT_SYMBOL(acpi_root_dir);
 
 
 #ifdef CONFIG_X86
-static int set_copy_dsdt(const struct dmi_system_id *id)
+static int set_copy_dsdt(const struct sysfw_id *id)
 {
 	printk(KERN_NOTICE "%s detected - "
 		"force copy of DSDT to local memory\n", id->ident);
@@ -63,7 +63,7 @@ static int set_copy_dsdt(const struct dmi_system_id *id)
 	return 0;
 }
 
-static struct dmi_system_id dsdt_dmi_table[] __initdata = {
+static struct sysfw_id dsdt_id_table[] __initdata = {
 	/*
 	 * Invoke DSDT corruption work-around on all Toshiba Satellite.
 	 * https://bugzilla.kernel.org/show_bug.cgi?id=14679
@@ -72,14 +72,14 @@ static struct dmi_system_id dsdt_dmi_table[] __initdata = {
 	 .callback = set_copy_dsdt,
 	 .ident = "TOSHIBA Satellite",
 	 .matches = {
-		DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
-		DMI_MATCH(DMI_PRODUCT_NAME, "Satellite"),
+		SYSFW_MATCH(SYSFW_SYS_VENDOR, "TOSHIBA"),
+		SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Satellite"),
 		},
 	},
 	{}
 };
 #else
-static struct dmi_system_id dsdt_dmi_table[] __initdata = {
+static struct sysfw_id dsdt_id_table[] __initdata = {
 	{}
 };
 #endif
@@ -856,10 +856,10 @@ void __init acpi_early_init(void)
 	acpi_gbl_permanent_mmap = 1;
 
 	/*
-	 * If the machine falls into the DMI check table,
+	 * If the machine falls into the SMBIOS check table,
 	 * DSDT will be copied to memory
 	 */
-	dmi_check_system(dsdt_dmi_table);
+	sysfw_callback(dsdt_id_table);
 
 	status = acpi_reallocate_root_table();
 	if (ACPI_FAILURE(status)) {
drivers/acpi/ec.c +72 -29

155 lines not on this page · raw message

drivers/acpi/osl.c +9 -8
index 52ca964..bbf1c68 100644
@@ -141,13 +141,13 @@ static void __init acpi_osi_setup_late(void);
  * BIOS writers should NOT query _OSI(Linux) on future systems.
  * Linux will complain on the console when it sees it, and return FALSE.
  * To get Linux to return TRUE for your system  will require
- * a kernel source update to add a DMI entry,
+ * a kernel source update to add a SMBIOS entry,
  * or boot with "acpi_osi=Linux"
  */
 
 static struct osi_linux {
 	unsigned int	enable:1;
-	unsigned int	dmi:1;
+	unsigned int	smbios:1;
 	unsigned int	cmdline:1;
 } osi_linux = {0, 0, 0};
 
@@ -159,7 +159,7 @@ static u32 acpi_osi_handler(acpi_string interface, u32 supported)
 			"BIOS _OSI(Linux) query %s%s\n",
 			osi_linux.enable ? "honored" : "ignored",
 			osi_linux.cmdline ? " via cmdline" :
-			osi_linux.dmi ? " via DMI" : "");
+			osi_linux.smbios ? " via SMBIOS" : "");
 	}
 
 	return supported;
@@ -1133,21 +1133,22 @@ static void __init set_osi_linux(unsigned int enable)
 
 static void __init acpi_cmdline_osi_linux(unsigned int enable)
 {
-	osi_linux.cmdline = 1;	/* cmdline set the default and override DMI */
-	osi_linux.dmi = 0;
+	/* cmdline set the default and override SMBIOS */
+	osi_linux.cmdline = 1;
+	osi_linux.smbios = 0;
 	set_osi_linux(enable);
 
 	return;
 }
 
-void __init acpi_dmi_osi_linux(int enable, const struct dmi_system_id *d)
+void __init acpi_smbios_osi_linux(int enable, const struct sysfw_id *d)
 {
-	printk(KERN_NOTICE PREFIX "DMI detected: %s\n", d->ident);
+	printk(KERN_NOTICE PREFIX "SMBIOS detected: %s\n", d->ident);
 
 	if (enable == -1)
 		return;
 
-	osi_linux.dmi = 1;	/* DMI knows that this box asks OSI(Linux) */
+	osi_linux.smbios = 1;	/* SMBIOS knows that this box asks OSI(Linux) */
 	set_osi_linux(enable);
 
 	return;
drivers/acpi/pci_irq.c +14 -13
index f907cfb..a33989f 100644
@@ -27,7 +27,7 @@
  */
 
 
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/init.h>
@@ -88,44 +88,45 @@ static struct acpi_prt_entry *acpi_pci_irq_find_prt_entry(struct pci_dev *dev,
 }
 
 /* http://bugzilla.kernel.org/show_bug.cgi?id=4773 */
-static const struct dmi_system_id medion_md9580[] = {
+static const struct sysfw_id medion_md9580[] = {
 	{
 		.ident = "Medion MD9580-F laptop",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "MEDIONNB"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "A555"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "MEDIONNB"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "A555"),
 		},
 	},
 	{ }
 };
 
 /* http://bugzilla.kernel.org/show_bug.cgi?id=5044 */
-static const struct dmi_system_id dell_optiplex[] = {
+static const struct sysfw_id dell_optiplex[] = {
 	{
 		.ident = "Dell Optiplex GX1",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex GX1 600S+"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR,
+				    "Dell Computer Corporation"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "OptiPlex GX1 600S+"),
 		},
 	},
 	{ }
 };
 
 /* http://bugzilla.kernel.org/show_bug.cgi?id=10138 */
-static const struct dmi_system_id hp_t5710[] = {
+static const struct sysfw_id hp_t5710[] = {
 	{
 		.ident = "HP t5710",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "hp t5000 series"),
-			DMI_MATCH(DMI_BOARD_NAME, "098Ch"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Hewlett-Packard"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "hp t5000 series"),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "098Ch"),
 		},
 	},
 	{ }
 };
 
 struct prt_quirk {
-	const struct dmi_system_id *system;
+	const struct sysfw_id *system;
 	unsigned int		segment;
 	unsigned int		bus;
 	unsigned int		device;
@@ -166,7 +167,7 @@ static void do_prt_fixups(struct acpi_prt_entry *entry,
 		if (!prt->source)
 			continue;
 
-		if (dmi_check_system(quirk->system) &&
+		if (sysfw_callback(quirk->system) &&
 		    entry->id.segment == quirk->segment &&
 		    entry->id.bus == quirk->bus &&
 		    entry->id.device == quirk->device &&
drivers/acpi/pci_slot.c +6 -6
index 07f7fea..1db7f02 100644
@@ -32,7 +32,7 @@
 #include <linux/acpi.h>
 #include <acpi/acpi_bus.h>
 #include <acpi/acpi_drivers.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 
 static int debug;
 static int check_sta_before_sun;
@@ -329,14 +329,14 @@ acpi_pci_slot_remove(acpi_handle handle)
 	mutex_unlock(&slot_list_lock);
 }
 
-static int do_sta_before_sun(const struct dmi_system_id *d)
+static int do_sta_before_sun(const struct sysfw_id *d)
 {
 	info("%s detected: will evaluate _STA before calling _SUN\n", d->ident);
 	check_sta_before_sun = 1;
 	return 0;
 }
 
-static struct dmi_system_id acpi_pci_slot_dmi_table[] __initdata = {
+static struct sysfw_id acpi_pci_slot_id_table[] __initdata = {
 	/*
 	 * Fujitsu Primequest machines will return 1023 to indicate an
 	 * error if the _SUN method is evaluated on SxFy objects that
@@ -347,8 +347,8 @@ static struct dmi_system_id acpi_pci_slot_dmi_table[] __initdata = {
 	 .callback = do_sta_before_sun,
 	 .ident = "Fujitsu PRIMEQUEST",
 	 .matches = {
-		DMI_MATCH(DMI_BIOS_VENDOR, "FUJITSU LIMITED"),
-		DMI_MATCH(DMI_BIOS_VERSION, "PRIMEQUEST"),
+		SYSFW_MATCH(SYSFW_BIOS_VENDOR, "FUJITSU LIMITED"),
+		SYSFW_MATCH(SYSFW_BIOS_VERSION, "PRIMEQUEST"),
 		},
 	},
 	{}
@@ -357,7 +357,7 @@ static struct dmi_system_id acpi_pci_slot_dmi_table[] __initdata = {
 static int __init
 acpi_pci_slot_init(void)
 {
-	dmi_check_system(acpi_pci_slot_dmi_table);
+	sysfw_callback(acpi_pci_slot_id_table);
 	acpi_pci_register_driver(&acpi_pci_slot_driver);
 	return 0;
 }
drivers/acpi/processor_core.c +15 -10
index 02d2a4c..ab3955a 100644
@@ -7,7 +7,7 @@
  *	Venkatesh Pallipadi <[email protected]>
  *	- Added _PDC for platforms with Intel CPUs
  */
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include <linux/slab.h>
 
 #include <acpi/acpi_drivers.h>
@@ -19,7 +19,7 @@
 #define _COMPONENT		ACPI_PROCESSOR_COMPONENT
 ACPI_MODULE_NAME("processor_core");
 
-static int __init set_no_mwait(const struct dmi_system_id *id)
+static int __init set_no_mwait(const struct sysfw_id *id)
 {
 	printk(KERN_NOTICE PREFIX "%s detected - "
 		"disabling mwait for CPU C-states\n", id->ident);
@@ -27,13 +27,18 @@ static int __init set_no_mwait(const struct dmi_system_id *id)
 	return 0;
 }
 
-static struct dmi_system_id __initdata processor_idle_dmi_table[] = {
+static struct sysfw_id __initdata processor_idle_id_table[] = {
 	{
-	set_no_mwait, "Extensa 5220", {
-	DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
-	DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
-	DMI_MATCH(DMI_PRODUCT_VERSION, "0100"),
-	DMI_MATCH(DMI_BOARD_NAME, "Columbia") }, NULL},
+		.callback = set_no_mwait,
+		.ident = "Extensa 5220",
+		.matches = {
+			SYSFW_MATCH(SYSFW_BIOS_VENDOR,
+				    "Phoenix Technologies LTD"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Acer"),
+			SYSFW_MATCH(SYSFW_PRODUCT_VERSION, "0100"),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "Columbia")
+		}
+	},
 	{},
 };
 
@@ -343,10 +348,10 @@ early_init_pdc(acpi_handle handle, u32 lvl, void *context, void **rv)
 void __init acpi_early_processor_set_pdc(void)
 {
 	/*
-	 * Check whether the system is DMI table. If yes, OSPM
+	 * Check whether the system is SMBIOS table. If yes, OSPM
 	 * should not use mwait for CPU-states.
 	 */
-	dmi_check_system(processor_idle_dmi_table);
+	sysfw_callback(processor_idle_id_table);
 
 	acpi_walk_namespace(ACPI_TYPE_PROCESSOR, ACPI_ROOT_OBJECT,
 			    ACPI_UINT32_MAX,
drivers/acpi/processor_driver.c +0 -1
index a4e0f1b..a78045e 100644
@@ -40,7 +40,6 @@
 #include <linux/pm.h>
 #include <linux/cpufreq.h>
 #include <linux/cpu.h>
-#include <linux/dmi.h>
 #include <linux/moduleparam.h>
 #include <linux/cpuidle.h>
 #include <linux/slab.h>
drivers/acpi/processor_idle.c +35 -16

75 lines not on this page · raw message

drivers/acpi/scan.c +2 -2
index 449c556..ff94b79 100644
@@ -9,7 +9,7 @@
 #include <linux/acpi.h>
 #include <linux/signal.h>
 #include <linux/kthread.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 
 #include <acpi/acpi_drivers.h>
 
@@ -1083,7 +1083,7 @@ static int acpi_ibm_smbus_match(struct acpi_device *device)
 	struct acpi_buffer path = {ACPI_ALLOCATE_BUFFER, NULL};
 	int result;
 
-	if (!dmi_name_in_vendors("IBM"))
+	if (!sysfw_vendor_is("IBM"))
 		return -ENODEV;
 
 	/* Look for SMBS object */
drivers/acpi/sleep.c +23 -23

127 lines not on this page · raw message

drivers/acpi/thermal.c +22 -20

106 lines not on this page · raw message

drivers/acpi/video.c +14 -14
index db39e9e..b28912b 100644
@@ -38,7 +38,7 @@
 #include <linux/pci_ids.h>
 #include <linux/slab.h>
 #include <asm/uaccess.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include <acpi/acpi_bus.h>
 #include <acpi/acpi_drivers.h>
 #include <linux/suspend.h>
@@ -384,13 +384,13 @@ acpi_video_device_lcd_set_level(struct acpi_video_device *device, int level)
  */
 
 static int bqc_offset_aml_bug_workaround;
-static int __init video_set_bqc_offset(const struct dmi_system_id *d)
+static int __init video_set_bqc_offset(const struct sysfw_id *d)
 {
 	bqc_offset_aml_bug_workaround = 9;
 	return 0;
 }
 
-static struct dmi_system_id video_dmi_table[] __initdata = {
+static struct sysfw_id video_id_table[] __initdata = {
 	/*
 	 * Broken _BQC workaround http://bugzilla.kernel.org/show_bug.cgi?id=13121
 	 */
@@ -398,40 +398,40 @@ static struct dmi_system_id video_dmi_table[] __initdata = {
 	 .callback = video_set_bqc_offset,
 	 .ident = "Acer Aspire 5720",
 	 .matches = {
-		DMI_MATCH(DMI_BOARD_VENDOR, "Acer"),
-		DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5720"),
+		SYSFW_MATCH(SYSFW_BOARD_VENDOR, "Acer"),
+		SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Aspire 5720"),
 		},
 	},
 	{
 	 .callback = video_set_bqc_offset,
 	 .ident = "Acer Aspire 5710Z",
 	 .matches = {
-		DMI_MATCH(DMI_BOARD_VENDOR, "Acer"),
-		DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5710Z"),
+		SYSFW_MATCH(SYSFW_BOARD_VENDOR, "Acer"),
+		SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Aspire 5710Z"),
 		},
 	},
 	{
 	 .callback = video_set_bqc_offset,
 	 .ident = "eMachines E510",
 	 .matches = {
-		DMI_MATCH(DMI_BOARD_VENDOR, "EMACHINES"),
-		DMI_MATCH(DMI_PRODUCT_NAME, "eMachines E510"),
+		SYSFW_MATCH(SYSFW_BOARD_VENDOR, "EMACHINES"),
+		SYSFW_MATCH(SYSFW_PRODUCT_NAME, "eMachines E510"),
 		},
 	},
 	{
 	 .callback = video_set_bqc_offset,
 	 .ident = "Acer Aspire 5315",
 	 .matches = {
-		DMI_MATCH(DMI_BOARD_VENDOR, "Acer"),
-		DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5315"),
+		SYSFW_MATCH(SYSFW_BOARD_VENDOR, "Acer"),
+		SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Aspire 5315"),
 		},
 	},
 	{
 	 .callback = video_set_bqc_offset,
 	 .ident = "Acer Aspire 7720",
 	 .matches = {
-		DMI_MATCH(DMI_BOARD_VENDOR, "Acer"),
-		DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 7720"),
+		SYSFW_MATCH(SYSFW_BOARD_VENDOR, "Acer"),
+		SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Aspire 7720"),
 		},
 	},
 	{}
@@ -1801,7 +1801,7 @@ EXPORT_SYMBOL(acpi_video_unregister);
 
 static int __init acpi_video_init(void)
 {
-	dmi_check_system(video_dmi_table);
+	sysfw_callback(video_id_table);
 
 	if (intel_opregion_present())
 		return 0;
drivers/acpi/video_detect.c +1 -2
index 5af3479..41f0d10 100644
@@ -34,7 +34,6 @@
  */
 
 #include <linux/acpi.h>
-#include <linux/dmi.h>
 #include <linux/pci.h>
 
 #define PREFIX "ACPI: "
@@ -158,7 +157,7 @@ long acpi_video_get_capabilities(acpi_handle graphics_handle)
 		/* Add blacklists here. Be careful to use the right *DMI* bits
 		 * to still be able to override logic via boot params, e.g.:
 		 *
-		 *   if (dmi_name_in_vendors("XY")) {
+		 *   if (smbios_vendor_is("XY")) {
 		 *	acpi_video_support |=
 		 *		ACPI_VIDEO_BACKLIGHT_DMI_VENDOR;
 		 *}
drivers/hwmon/acpi_power_meter.c +8 -7
index 66f6729..47175c6 100644
@@ -24,7 +24,7 @@
 #include <linux/hwmon-sysfs.h>
 #include <linux/jiffies.h>
 #include <linux/mutex.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include <linux/slab.h>
 #include <linux/kdev_t.h>
 #include <linux/sched.h>
@@ -975,17 +975,18 @@ static struct acpi_driver acpi_power_meter_driver = {
 };
 
 /* Module init/exit routines */
-static int __init enable_cap_knobs(const struct dmi_system_id *d)
+static int __init enable_cap_knobs(const struct sysfw_id *d)
 {
 	cap_in_hardware = 1;
 	return 0;
 }
 
-static struct dmi_system_id __initdata pm_dmi_table[] = {
+static struct sysfw_id __initdata pm_id_table[] = {
 	{
-		enable_cap_knobs, "IBM Active Energy Manager",
-		{
-			DMI_MATCH(DMI_SYS_VENDOR, "IBM")
+		.callback = enable_cap_knobs,
+		.ident = "IBM Active Energy Manager",
+		.matches = {
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "IBM")
 		},
 	},
 	{}
@@ -998,7 +999,7 @@ static int __init acpi_power_meter_init(void)
 	if (acpi_disabled)
 		return -ENODEV;
 
-	dmi_check_system(pm_dmi_table);
+	sysfw_callback(pm_id_table);
 
 	result = acpi_bus_register_driver(&acpi_power_meter_driver);
 	if (result < 0)
Signature · 1 line
1.7.5.1