linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/34] System Firmware and SMBIOS Support [v3]
@ 2011-07-18 13:08 Prarit Bhargava
  2011-07-18 13:08 ` [PATCH 01/34] System Firmware Interface Prarit Bhargava
                   ` (33 more replies)
  0 siblings, 34 replies; 48+ messages in thread
From: Prarit Bhargava @ 2011-07-18 13:08 UTC (permalink / raw)
  To: linux-kernel; +Cc: Prarit Bhargava

[Sorry if anyone receives this twice.  It didn't make it to LKML the first
time.]

This change is targeted for 3.2 in order to give is "soak" time in linux-next.

DMI, or the Desktop Management Interface, provides access to OEM and hardware
specific details about the x86 or ia64 system the kernel is currently runnig
on.  DMI has been deprecated since 2003, which was the last update of the DMI
Specification.

The System Management BIOS, or SMBIOS, supercedes DMI -- the SMBIOS tables
include the possibility of a _DMI_ entry and tables.  However, in the
Linux kernel we do not access any of the DMI data and only access SMBIOS data.

Currently, the kernel uses dmi_* functions (as defined in
drivers/firmware/dmi_scan.c) to access the data.  The functions allow kernel
subsystems and modules to set specific options based on the platform and BIOS
version.

The dmi_* functions in the kernel fail in several ways.  First, as
mentioned the dmi_* functions are really accessing SMBIOS data.  The existing
code queries for the _SMB_ entry and determines data access after that.  The
existing dmi_* functions create an array of x86 and ia64 specific entries
which are defined as part of x86 and ia64 specific udev entries, and allows
drivers and subsystems to make platform specific decisions.  In addition to
the arch specific code, the dmi_* code creates a list of "devices" to which
makes updating very difficult and does not easily scale.

Another key issue with the existing code is that several drivers do their
own search through the SMBIOS, for example, see drivers/pci/hotplug/cpqphp*.c.

Three months (or so) ago I proposed a patch which was based on a simple request
from a colleague --  create a sysfs file that would export the SMBIOS version.
This simple request was not something that was easy to do given the layout of
the existing DMI code.  The request resulted in having to create a new smbios
class within the kernel, and essentially doing a separate search through
memory.

This new patchset reworks the existing DMI code into two separate layers.  It is
based off of the feedback I received previously when discussing the SMBIOS
version patch on LKML.

The first layer is the System Firmware Interface, which is based upon Alan
Cox's suggestion of a common platform driver (unfortunately, platform driver
is already defined and used within the kernel).  This is meant to be an
arch independent subsystem in the kernel for all arches.  It is a common
interface which provides access to specific system values in the kernel such
as the Chassis Manufacturer, the BIOS developer, or the BIOS date.  The
System Firmware Interface, or sysfw allows for easy updating by simply adding
fields to an array in include/linux/mod_devicetable.h.
Standard simple searching functions, sysfw_lookup() and sysfw_callback()
are provided to the kernel and modules.  sysfw_callback() is similar to
dmi_check_system() but the new function allows for exact matching which some
drivers required.

The second layer introduced in this patchset is the SMBIOS sysfw driver.  This
driver (obviously) registers with the interface and also provides it's own
interface.  The reason for the separate interface is that specific drivers
have their own need to search the SMBIOS for OEM or platform specific
information (see, for example, drivers/watchdog/hpwdt.c, or
drivers/pci/pci-label.c).  This new driver provides a function, smbios_walk()
which allows individual drivers or subsystems to traverse the SMBIOS table
looking for OEM or platform specific data.  The new SMBIOS driver can be
easily updated by adding SMBIOS structure information to the smbios_struct
union in include/linux/smbios.h.

These changes are now targeted for 3.2 and if there are no objections (there
have been none for v1 and v2) I will request a pull for linux-next during
the 3.1 merge window.

A git tree with these changes has been set up here:

git://git.kernel.org/pub/scm/linux/kernel/git/prarit/smbios.git

with the latest changes in the smbios-3.0-rc7-v3 branch.

Prarit Bhargava (34):
  System Firmware Interface
  New SMBIOS driver for x86 and ia64.
  arch specific changes for SMBIOS and System Firmware
  drivers/acpi changes for SMBIOS and System Firmware interface
  drivers/ata changes for SMBIOS and System Firmware
  drivers/floppy changes for SMBIOS and System Firmware
  drivers/char changes for SMBIOS and System Firmware
  drivers/crypto changes for SMBIOS and System Firmware
  drivers/gpio changes for SMBIOS and System Firmware
  drivers/gpu changes for SMBIOS and System Firmware
  drivers/hwmon changes for SMBIOS and System Firmware
  drivers/i2c changes for SMBIOS and System Firmware
  drivers/ide changes for SMBIOS and System Firmware
  drivers/input changes for SMBIOS and System Firmware
  drivers/leds changes for SMBIOS and System Firmware
  drivers/media changes for SMBIOS and System Firmware
  drivers/misc changes for SMBIOS and System Firmware
  drivers/mtd changes for SMBIOS and System Firmware
  drivers/net changes for SMBIOS and System Firmware
  drivers/pci changes for SMBIOS and System Firmware
  drivers/platform changes for SMBIOS and System  Firmware
  drivers/pnp changes for SMBIOS and System Firmware
  drivers/power changes for SMBIOS and System Firmware
  drivers/rtc changes for SMBIOS and System Firmware
  drivers/staging changes for SMBIOS and System Firmware
  drivers/tty changes for SMBIOS and System Firmware
  drivers/usb changes for SMBIOS and System Firmware
  drivers/video changes for SMBIOS and System Firmware
  drivers/w1 changes for SMBIOS and System Firmware
  drivers/watchdog changes for SMBIOS and System Firmware
  include/linux/acpi.h changes for SMBIOS and System Firmware
  Kernel panic changes for SMBIOS and System Firmware
  sound/pci/hda changes for SMBIOS and System Firmware
  Remove old DMI & SMBIOS code and make SMBIOS default on

 Documentation/ABI/obsolete/sysfs-dmi           |   40 ++
 Documentation/ABI/testing/sysfw-smbios         |   36 ++
 arch/ia64/Kconfig                              |    5 +
 arch/ia64/include/asm/dmi.h                    |   12 -
 arch/ia64/include/asm/smbios.h                 |   12 +
 arch/ia64/kernel/setup.c                       |    8 +-
 arch/x86/Kconfig                               |    9 +-
 arch/x86/include/asm/dmi.h                     |   19 -
 arch/x86/include/asm/mmconfig.h                |    4 +-
 arch/x86/include/asm/pci_x86.h                 |    6 +-
 arch/x86/include/asm/smbios.h                  |   19 +
 arch/x86/kernel/acpi/boot.c                    |  177 +++---
 arch/x86/kernel/acpi/sleep.c                   |    1 -
 arch/x86/kernel/apic/apic.c                    |   20 +-
 arch/x86/kernel/apic/bigsmp_32.c               |   37 +-
 arch/x86/kernel/apm_32.c                       |  391 ++++++++-----
 arch/x86/kernel/cpu/amd.c                      |    2 +-
 arch/x86/kernel/cpu/vmware.c                   |   17 +-
 arch/x86/kernel/io_delay.c                     |   42 +-
 arch/x86/kernel/mmconf-fam10h_64.c             |   28 +-
 arch/x86/kernel/probe_roms.c                   |    1 -
 arch/x86/kernel/process.c                      |    8 +-
 arch/x86/kernel/reboot.c                       |  132 +++--
 arch/x86/kernel/setup.c                        |   14 +-
 arch/x86/kernel/tsc.c                          |   16 +-
 arch/x86/pci/acpi.c                            |   18 +-
 arch/x86/pci/broadcom_bus.c                    |    1 -
 arch/x86/pci/common.c                          |  163 +++---
 arch/x86/pci/direct.c                          |    7 +-
 arch/x86/pci/fixup.c                           |   33 +-
 arch/x86/pci/init.c                            |    4 +-
 arch/x86/pci/irq.c                             |   26 +-
 arch/x86/pci/mmconfig-shared.c                 |   10 +-
 arch/x86/pci/mrst.c                            |    1 -
 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                         |   33 +-
 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/ata/acard-ahci.c                       |    1 -
 drivers/ata/ahci.c                             |  177 +++---
 drivers/ata/ata_piix.c                         |  154 +++---
 drivers/ata/pata_ali.c                         |   18 +-
 drivers/ata/pata_cs5530.c                      |   12 +-
 drivers/ata/pata_rdc.c                         |    1 -
 drivers/ata/pata_sch.c                         |    1 -
 drivers/ata/pata_via.c                         |   14 +-
 drivers/ata/sata_sil.c                         |   19 +-
 drivers/block/floppy.c                         |    1 -
 drivers/char/i8k.c                             |   75 ++--
 drivers/char/ipmi/ipmi_si_intf.c               |  159 +++---
 drivers/char/sonypi.c                          |   16 +-
 drivers/cpufreq/acpi-cpufreq.c                 |   16 +-
 drivers/cpufreq/powernow-k7.c                  |   14 +-
 drivers/crypto/amcc/crypto4xx_sa.c             |    1 -
 drivers/crypto/hifn_795x.c                     |    1 -
 drivers/firmware/Kconfig                       |   65 ++-
 drivers/firmware/Makefile                      |    8 +-
 drivers/firmware/dmi-id.c                      |  245 --------
 drivers/firmware/dmi-sysfs.c                   |  696 ----------------------
 drivers/firmware/dmi_scan.c                    |  751 ------------------------
 drivers/firmware/smbios-sysfs.c                |  705 ++++++++++++++++++++++
 drivers/firmware/smbios.c                      |  687 ++++++++++++++++++++++
 drivers/firmware/sysfw-sysfs.c                 |  306 ++++++++++
 drivers/firmware/sysfw.c                       |  168 ++++++
 drivers/gpio/basic_mmio_gpio.c                 |    1 -
 drivers/gpu/drm/i915/intel_lvds.c              |   81 ++--
 drivers/gpu/vga/vga_switcheroo.c               |    1 -
 drivers/hwmon/abituguru.c                      |   18 +-
 drivers/hwmon/abituguru3.c                     |   75 ++--
 drivers/hwmon/acpi_power_meter.c               |   15 +-
 drivers/hwmon/adcxx.c                          |    1 -
 drivers/hwmon/applesmc.c                       |   73 ++-
 drivers/hwmon/asus_atk0110.c                   |   10 +-
 drivers/hwmon/fschmd.c                         |  104 ++--
 drivers/hwmon/it87.c                           |   42 +-
 drivers/hwmon/lm70.c                           |    1 -
 drivers/i2c/busses/i2c-i801.c                  |   76 +--
 drivers/i2c/busses/i2c-nforce2.c               |   12 +-
 drivers/i2c/busses/i2c-piix4.c                 |   24 +-
 drivers/ide/alim15x3.c                         |   18 +-
 drivers/ide/ide-acpi.c                         |   16 +-
 drivers/ide/ide-gd.c                           |   10 +-
 drivers/ide/via82cxxx.c                        |   14 +-
 drivers/input/keyboard/atkbd.c                 |   80 ++--
 drivers/input/misc/wistron_btns.c              |  239 ++++----
 drivers/input/mouse/lifebook.c                 |   42 +-
 drivers/input/mouse/synaptics.c                |   44 +-
 drivers/input/serio/i8042-x86ia64io.h          |  367 ++++++------
 drivers/input/tablet/wacom.h                   |    1 -
 drivers/input/touchscreen/htcpen.c             |   13 +-
 drivers/leds/leds-clevo-mail.c                 |   78 ++--
 drivers/leds/leds-ss4200.c                     |   23 +-
 drivers/media/dvb/firewire/firedtv-fw.c        |    1 -
 drivers/media/dvb/firewire/firedtv.h           |    1 -
 drivers/media/video/cafe_ccic.c                |   14 +-
 drivers/media/video/gspca/m5602/m5602_ov9650.c |   46 +-
 drivers/media/video/gspca/m5602/m5602_ov9650.h |    2 +-
 drivers/media/video/gspca/m5602/m5602_s5k4aa.c |  102 ++--
 drivers/media/video/gspca/m5602/m5602_s5k4aa.h |    2 +-
 drivers/media/video/gspca/sn9c20x.c            |   30 +-
 drivers/media/video/pvrusb2/pvrusb2-devattr.h  |    1 -
 drivers/misc/eeprom/at24.c                     |    1 -
 drivers/misc/lis3lv02d/lis3lv02d.c             |    1 -
 drivers/misc/pch_phub.c                        |   14 +-
 drivers/mtd/devices/m25p80.c                   |    1 -
 drivers/net/skge.c                             |   11 +-
 drivers/net/via-rhine.c                        |   18 +-
 drivers/net/wireless/wl1251/sdio.c             |    1 -
 drivers/pci/dmar.c                             |   14 +-
 drivers/pci/hotplug/cpqphp.h                   |   81 +---
 drivers/pci/hotplug/cpqphp_core.c              |  207 +------
 drivers/pci/intel-iommu.c                      |   20 +-
 drivers/pci/pci-label.c                        |   82 ++--
 drivers/pci/pci.h                              |    2 +-
 drivers/pci/pcie/portdrv_pci.c                 |   26 +-
 drivers/pci/quirks.c                           |   29 +-
 drivers/platform/x86/acer-wmi.c                |  119 ++--
 drivers/platform/x86/acerhdf.c                 |   18 +-
 drivers/platform/x86/asus-laptop.c             |   29 +-
 drivers/platform/x86/compal-laptop.c           |  106 ++--
 drivers/platform/x86/dell-laptop.c             |   66 ++-
 drivers/platform/x86/dell-wmi.c                |   15 +-
 drivers/platform/x86/eeepc-laptop.c            |   58 ++-
 drivers/platform/x86/eeepc-wmi.c               |   30 +-
 drivers/platform/x86/fujitsu-laptop.c          |   41 +-
 drivers/platform/x86/hdaps.c                   |   76 ++--
 drivers/platform/x86/hp_accel.c                |   98 ++--
 drivers/platform/x86/ibm_rtl.c                 |   21 +-
 drivers/platform/x86/intel_oaktrail.c          |   15 +-
 drivers/platform/x86/msi-laptop.c              |  115 ++--
 drivers/platform/x86/samsung-laptop.c          |  183 +++---
 drivers/platform/x86/sony-laptop.c             |   16 +-
 drivers/platform/x86/thinkpad_acpi.c           |   64 +--
 drivers/pnp/pnpacpi/core.c                     |    1 -
 drivers/pnp/pnpbios/core.c                     |   20 +-
 drivers/power/max17042_battery.c               |    1 -
 drivers/rtc/rtc-cmos.c                         |    1 -
 drivers/rtc/rtc-mrst.c                         |    1 -
 drivers/staging/hv/hv_mouse.c                  |    1 -
 drivers/staging/hv/hv_timesource.c             |   18 +-
 drivers/staging/hv/hv_util.c                   |   17 +-
 drivers/staging/hv/netvsc_drv.c                |   17 +-
 drivers/staging/hv/vmbus_drv.c                 |    1 -
 drivers/tty/serial/pch_uart.c                  |   16 +-
 drivers/usb/host/pci-quirks.c                  |   19 +-
 drivers/usb/host/uhci-hcd.c                    |    2 +-
 drivers/usb/host/uhci-pci.c                    |   15 +-
 drivers/video/aty/atyfb_base.c                 |   18 +-
 drivers/video/backlight/kb3886_bl.c            |   13 +-
 drivers/video/efifb.c                          |  124 ++--
 drivers/w1/masters/ds2490.c                    |    1 -
 drivers/watchdog/hpwdt.c                       |   16 +-
 drivers/watchdog/ibmasr.c                      |    9 +-
 drivers/watchdog/sbc_fitpc2_wdt.c              |   22 +-
 include/linux/acpi.h                           |    2 +-
 include/linux/dmi.h                            |  139 -----
 include/linux/mod_devicetable.h                |   73 ++-
 include/linux/smbios.h                         |  243 ++++++++
 include/linux/sysfw.h                          |  113 ++++
 init/main.c                                    |    3 +
 kernel/panic.c                                 |    4 +-
 scripts/mod/file2alias.c                       |   52 +-
 sound/pci/hda/patch_sigmatel.c                 |   29 +-
 174 files changed, 5506 insertions(+), 4880 deletions(-)
 create mode 100644 Documentation/ABI/obsolete/sysfs-dmi
 create mode 100644 Documentation/ABI/testing/sysfw-smbios
 delete mode 100644 arch/ia64/include/asm/dmi.h
 create mode 100644 arch/ia64/include/asm/smbios.h
 delete mode 100644 arch/x86/include/asm/dmi.h
 create mode 100644 arch/x86/include/asm/smbios.h
 delete mode 100644 drivers/firmware/dmi-id.c
 delete mode 100644 drivers/firmware/dmi-sysfs.c
 delete mode 100644 drivers/firmware/dmi_scan.c
 create mode 100644 drivers/firmware/smbios-sysfs.c
 create mode 100644 drivers/firmware/smbios.c
 create mode 100644 drivers/firmware/sysfw-sysfs.c
 create mode 100644 drivers/firmware/sysfw.c
 delete mode 100644 include/linux/dmi.h
 create mode 100644 include/linux/smbios.h
 create mode 100644 include/linux/sysfw.h


^ permalink raw reply	[flat|nested] 48+ messages in thread

* [PATCH 01/34] System Firmware Interface
  2011-07-18 13:08 [PATCH 00/34] System Firmware and SMBIOS Support [v3] Prarit Bhargava
@ 2011-07-18 13:08 ` Prarit Bhargava
  2011-07-19  0:43   ` Andi Kleen
  2011-07-25 19:03   ` [lm-sensors] " Jean Delvare
  2011-07-18 13:08 ` [PATCH 02/34] New SMBIOS driver for x86 and ia64 Prarit Bhargava
                   ` (32 subsequent siblings)
  33 siblings, 2 replies; 48+ messages in thread
From: Prarit Bhargava @ 2011-07-18 13:08 UTC (permalink / raw)
  To: linux-kernel
  Cc: Prarit Bhargava, linux-ia64, x86, linux-acpi, linux-ide,
	openipmi-developer, platform-driver-x86, linux-crypto, dri-devel,
	lm-sensors, linux-i2c, linux-input, linux-media, netdev,
	linux-pci, rtc-linux, evel, linux-usb, device-drivers-devel,
	linux-watchdog, grant.likely, dz, rpurdie, eric.piel, abelay,
	johnpol

This patch introduces a general System Firmware interface to the kernel, called
sysfw.

Inlcluded in this interface is the ability to search a standard set of fields,
sysfw_lookup().  The fields are currently based upon the x86 and ia64 SMBIOS
fields but exapandable to fields that other arches may introduce.  Also
included is  the ability to search and match against those fields, and run
a callback function against the matches, sysfw_callback().

Modify module code to use sysfw instead of old DMI interface.

[v2]: Modified sysfw_id to include up to 8 matches.  Almost all declarations of
sysfw_id are __init so the increased kernel image size isn't a big issue.

[v3]: Use sysfs bus instead of class, restore existing dmi class for backwards
compatibility.

Cc: linux-ia64@vger.kernel.org
Cc: x86@kernel.org
Cc: linux-acpi@vger.kernel.org
Cc: linux-ide@vger.kernel.org
Cc: openipmi-developer@lists.sourceforge.net
Cc: platform-driver-x86@vger.kernel.org
Cc: linux-crypto@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Cc: lm-sensors@lm-sensors.org
Cc: linux-i2c@vger.kernel.org
Cc: linux-ide@vger.kernel.org
Cc: linux-input@vger.kernel.org
Cc: linux-media@vger.kernel.org
Cc: netdev@vger.kernel.org
Cc: linux-pci@vger.kernel.org
Cc: rtc-linux@googlegroups.com
Cc: evel@driverdev.osuosl.org
Cc: linux-usb@vger.kernel.org
Cc: device-drivers-devel@blackfin.uclinux.org
Cc: linux-watchdog@vger.kernel.org
Cc: grant.likely@secretlab.ca
Cc: dz@debian.org
Cc: rpurdie@rpsys.net
Cc: eric.piel@tremplin-utc.net
Cc: abelay@mit.edu
Cc: johnpol@2ka.mipt.ru
Signed-off-by: Prarit Bhargava <prarit@redhat.com>
---
 drivers/firmware/Kconfig        |   25 +++
 drivers/firmware/Makefile       |    3 +-
 drivers/firmware/sysfw-sysfs.c  |  306 +++++++++++++++++++++++++++++++++++++++
 drivers/firmware/sysfw.c        |  168 +++++++++++++++++++++
 include/linux/mod_devicetable.h |   62 ++++++++
 include/linux/sysfw.h           |  113 ++++++++++++++
 init/main.c                     |    3 +
 scripts/mod/file2alias.c        |   52 ++++----
 8 files changed, 705 insertions(+), 27 deletions(-)
 create mode 100644 drivers/firmware/sysfw-sysfs.c
 create mode 100644 drivers/firmware/sysfw.c
 create mode 100644 include/linux/sysfw.h

diff --git a/drivers/firmware/Kconfig b/drivers/firmware/Kconfig
index efba163..79a1b9d 100644
--- a/drivers/firmware/Kconfig
+++ b/drivers/firmware/Kconfig
@@ -157,6 +157,31 @@ config SIGMA
 	  If unsure, say N here.  Drivers that need these helpers will select
 	  this option automatically.
 
+config SYSTEM_FIRMWARE
+	bool "System Firmware Interface"
+	default y
+	help
+	  Enables common System Firmware Interface to export system firmware
+	  (SMBIOS, DMI, etc.) information to kernel and userspace.
+
+config SYSTEM_FIRMWARE_SYSFS
+	bool "Export System Firmware identification via sysfs to userspace"
+	depends on SYSTEM_FIRMWARE
+	help
+	  Say Y here if you want to query system identification information
+	  from userspace through /sys/class/sysfw/id/ or if you want
+	  system firmware (sysfw) based module auto-loading.
+
+config SYSTEM_FIRMWARE_DMI_COMPAT
+	bool "Export dmi compatibility class in sysfs"
+	depends on SYSTEM_FIRMWARE
+	default y
+	help
+	  This exposes /sys/class/dmi/* as a pointer to the sysfw class for
+	  old software.  This is purely a backwards compatability feature and
+	  should not be used in new user space software.  Please see
+	  Documentation/ABI for details.
+
 source "drivers/firmware/google/Kconfig"
 
 endmenu
diff --git a/drivers/firmware/Makefile b/drivers/firmware/Makefile
index 47338c9..41bc64a 100644
--- a/drivers/firmware/Makefile
+++ b/drivers/firmware/Makefile
@@ -13,5 +13,6 @@ obj-$(CONFIG_ISCSI_IBFT_FIND)	+= iscsi_ibft_find.o
 obj-$(CONFIG_ISCSI_IBFT)	+= iscsi_ibft.o
 obj-$(CONFIG_FIRMWARE_MEMMAP)	+= memmap.o
 obj-$(CONFIG_SIGMA)		+= sigma.o
-
 obj-$(CONFIG_GOOGLE_FIRMWARE)	+= google/
+obj-$(CONFIG_SYSTEM_FIRMWARE)	+= sysfw.o
+obj-$(CONFIG_SYSTEM_FIRMWARE_SYSFS)	+= sysfw-sysfs.o
diff --git a/drivers/firmware/sysfw-sysfs.c b/drivers/firmware/sysfw-sysfs.c
new file mode 100644
index 0000000..48d7d07
--- /dev/null
+++ b/drivers/firmware/sysfw-sysfs.c
@@ -0,0 +1,306 @@
+/*
+ * Export sysfs sysfw_field's to userspace
+ *
+ * Updated 2011, Prarit Bhargava, prarit@redhat.com
+ * Copyright 2007, Lennart Poettering
+ *
+ * Licensed under GPLv2
+ */
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/sysfw.h>
+#include <linux/device.h>
+#include <linux/slab.h>
+#include <linux/sysfw.h>
+
+struct sysfw_device_attribute {
+	struct device_attribute dev_attr;
+	int field;
+};
+#define to_sysfw_dev_attr(_dev_attr) \
+	container_of(_dev_attr, struct sysfw_device_attribute, dev_attr)
+
+static ssize_t sys_sysfw_field_show(struct device *dev,
+				  struct device_attribute *attr,
+				  char *page)
+{
+	int field = to_sysfw_dev_attr(attr)->field;
+	ssize_t len;
+	len = scnprintf(page, PAGE_SIZE, "%s\n", sysfw_lookup(field));
+	page[len-1] = '\n';
+	return len;
+}
+
+#define SYSFW_ATTR(_name, _mode, _show, _field)			\
+	{ .dev_attr = __ATTR(_name, _mode, _show, NULL),	\
+	  .field = _field }
+
+#define DEFINE_SYSFW_ATTR_WITH_SHOW(_name, _mode, _field)		\
+static struct sysfw_device_attribute sys_sysfw_##_name##_attr =	\
+	SYSFW_ATTR(_name, _mode, sys_sysfw_field_show, _field);
+
+DEFINE_SYSFW_ATTR_WITH_SHOW(bios_vendor,	0444, SYSFW_BIOS_VENDOR);
+DEFINE_SYSFW_ATTR_WITH_SHOW(bios_version,	0444, SYSFW_BIOS_VERSION);
+DEFINE_SYSFW_ATTR_WITH_SHOW(bios_date,		0444, SYSFW_BIOS_DATE);
+DEFINE_SYSFW_ATTR_WITH_SHOW(sys_vendor,	0444, SYSFW_SYS_VENDOR);
+DEFINE_SYSFW_ATTR_WITH_SHOW(product_name,	0444, SYSFW_PRODUCT_NAME);
+DEFINE_SYSFW_ATTR_WITH_SHOW(product_version,	0444, SYSFW_PRODUCT_VERSION);
+DEFINE_SYSFW_ATTR_WITH_SHOW(product_serial,	0400, SYSFW_PRODUCT_SERIAL);
+DEFINE_SYSFW_ATTR_WITH_SHOW(product_uuid,	0400, SYSFW_PRODUCT_UUID);
+DEFINE_SYSFW_ATTR_WITH_SHOW(board_vendor,	0444, SYSFW_BOARD_VENDOR);
+DEFINE_SYSFW_ATTR_WITH_SHOW(board_name,	0444, SYSFW_BOARD_NAME);
+DEFINE_SYSFW_ATTR_WITH_SHOW(board_version,	0444, SYSFW_BOARD_VERSION);
+DEFINE_SYSFW_ATTR_WITH_SHOW(board_serial,	0400, SYSFW_BOARD_SERIAL);
+DEFINE_SYSFW_ATTR_WITH_SHOW(board_asset_tag,	0444, SYSFW_BOARD_ASSET_TAG);
+DEFINE_SYSFW_ATTR_WITH_SHOW(chassis_vendor,	0444, SYSFW_CHASSIS_VENDOR);
+DEFINE_SYSFW_ATTR_WITH_SHOW(chassis_type,	0444, SYSFW_CHASSIS_TYPE);
+DEFINE_SYSFW_ATTR_WITH_SHOW(chassis_version,	0444, SYSFW_CHASSIS_VERSION);
+DEFINE_SYSFW_ATTR_WITH_SHOW(chassis_serial,	0400, SYSFW_CHASSIS_SERIAL);
+DEFINE_SYSFW_ATTR_WITH_SHOW(chassis_asset_tag,	0444, SYSFW_CHASSIS_ASSET_TAG);
+
+static void ascii_filter(char *d, const char *s)
+{
+	/* Filter out characters we don't want to see in the modalias string */
+	for (; *s; s++)
+		if (*s > ' ' && *s < 127 && *s != ':')
+			*(d++) = *s;
+
+	*d = 0;
+}
+
+static ssize_t get_modalias(char *buffer, size_t buffer_size,
+			    struct device *dev)
+{
+	static const struct mafield {
+		const char *prefix;
+		int field;
+	} fields[] = {
+		{ "bvn", SYSFW_BIOS_VENDOR },
+		{ "bvr", SYSFW_BIOS_VERSION },
+		{ "bd",  SYSFW_BIOS_DATE },
+		{ "svn", SYSFW_SYS_VENDOR },
+		{ "pn",  SYSFW_PRODUCT_NAME },
+		{ "pvr", SYSFW_PRODUCT_VERSION },
+		{ "rvn", SYSFW_BOARD_VENDOR },
+		{ "rn",  SYSFW_BOARD_NAME },
+		{ "rvr", SYSFW_BOARD_VERSION },
+		{ "cvn", SYSFW_CHASSIS_VENDOR },
+		{ "ct",  SYSFW_CHASSIS_TYPE },
+		{ "cvr", SYSFW_CHASSIS_VERSION },
+		{ NULL,  SYSFW_NONE }
+	};
+	ssize_t l, left;
+	char *p;
+	const struct mafield *f;
+	const char *name = dev_name(dev);
+
+	left = buffer_size;
+	p = buffer;
+	name = dev_name(dev);
+	if (!strncmp(dev_name(dev), "sysfw", 5)) {
+		strcpy(buffer, "sysfw");
+		p += 5;
+		left -= 6;
+	}
+#ifdef CONFIG_SYSTEM_FIRMWARE_DMI_COMPAT
+	if (!strncmp(dev_name(dev), "id", 2)) { /* old dmi */
+		strcpy(buffer, "dmi");
+		p +=  3;
+		left -= 4;
+	}
+#endif
+
+	for (f = fields; f->prefix && left > 0; f++) {
+		const char *c;
+		char *t;
+
+		c = sysfw_lookup(f->field);
+		if (!c)
+			continue;
+
+		t = kmalloc(strlen(c) + 1, GFP_KERNEL);
+		if (!t)
+			break;
+		ascii_filter(t, c);
+		l = scnprintf(p, left, ":%s%s", f->prefix, t);
+		kfree(t);
+
+		p += l;
+		left -= l;
+	}
+
+	p[0] = ':';
+	p[1] = 0;
+
+	return p - buffer + 1;
+}
+
+static ssize_t sys_sysfw_modalias_show(struct device *dev,
+				       struct device_attribute *attr,
+				       char *page)
+{
+	ssize_t r;
+	r = get_modalias(page, PAGE_SIZE-1, dev);
+	page[r] = '\n';
+	page[r+1] = 0;
+	return r+1;
+}
+
+static struct device_attribute sys_sysfw_modalias_attr =
+	__ATTR(modalias, 0444, sys_sysfw_modalias_show, NULL);
+
+static struct attribute *sys_sysfw_attributes[SYSFW_STRING_MAX+2];
+
+static struct attribute_group sys_sysfw_attribute_group = {
+	.attrs = sys_sysfw_attributes,
+};
+
+static const struct attribute_group *sys_sysfw_attribute_groups[] = {
+	&sys_sysfw_attribute_group,
+	NULL
+};
+
+static void sys_sysfw_release(struct device *dev)
+{
+	/* nothing to do */
+	return;
+}
+
+static struct device_type sysfw_type = {
+	.groups = sys_sysfw_attribute_groups,
+	.release = sys_sysfw_release,
+};
+
+/* Initialization */
+
+#define ADD_SYSFW_ATTR(_name, _field) \
+	if (sysfw_lookup(_field)) \
+		sys_sysfw_attributes[i++] = \
+		&sys_sysfw_##_name##_attr.dev_attr.attr;
+
+/* In a separate function to keep gcc 3.2 happy - do NOT merge this in
+   sysfw_bus_init! */
+static void __init sysfw_id_init_attr_table(void)
+{
+	int i;
+
+	/* Not necessarily all SYSFW fields are available on all
+	 * systems, hence let's built an attribute table of just
+	 * what's available */
+	i = 0;
+	ADD_SYSFW_ATTR(bios_vendor,       SYSFW_BIOS_VENDOR);
+	ADD_SYSFW_ATTR(bios_version,      SYSFW_BIOS_VERSION);
+	ADD_SYSFW_ATTR(bios_date,         SYSFW_BIOS_DATE);
+	ADD_SYSFW_ATTR(sys_vendor,        SYSFW_SYS_VENDOR);
+	ADD_SYSFW_ATTR(product_name,      SYSFW_PRODUCT_NAME);
+	ADD_SYSFW_ATTR(product_version,   SYSFW_PRODUCT_VERSION);
+	ADD_SYSFW_ATTR(product_serial,    SYSFW_PRODUCT_SERIAL);
+	ADD_SYSFW_ATTR(product_uuid,      SYSFW_PRODUCT_UUID);
+	ADD_SYSFW_ATTR(board_vendor,      SYSFW_BOARD_VENDOR);
+	ADD_SYSFW_ATTR(board_name,        SYSFW_BOARD_NAME);
+	ADD_SYSFW_ATTR(board_version,     SYSFW_BOARD_VERSION);
+	ADD_SYSFW_ATTR(board_serial,      SYSFW_BOARD_SERIAL);
+	ADD_SYSFW_ATTR(board_asset_tag,   SYSFW_BOARD_ASSET_TAG);
+	ADD_SYSFW_ATTR(chassis_vendor,    SYSFW_CHASSIS_VENDOR);
+	ADD_SYSFW_ATTR(chassis_type,      SYSFW_CHASSIS_TYPE);
+	ADD_SYSFW_ATTR(chassis_version,   SYSFW_CHASSIS_VERSION);
+	ADD_SYSFW_ATTR(chassis_serial,    SYSFW_CHASSIS_SERIAL);
+	ADD_SYSFW_ATTR(chassis_asset_tag, SYSFW_CHASSIS_ASSET_TAG);
+	sys_sysfw_attributes[i++] = &sys_sysfw_modalias_attr.attr;
+}
+
+static int sysfw_dev_uevent(struct device *dev, struct kobj_uevent_env *env)
+{
+	ssize_t len;
+
+	if (add_uevent_var(env, "MODALIAS="))
+		return -ENOMEM;
+	len = get_modalias(&env->buf[env->buflen - 1],
+			   sizeof(env->buf) - env->buflen, dev);
+	if (len >= (sizeof(env->buf) - env->buflen))
+		return -ENOMEM;
+	env->buflen += len;
+	return 0;
+}
+
+#ifdef CONFIG_SYSTEM_FIRMWARE_DMI_COMPAT
+/* Hopefully someday we can get rid of this. */
+static struct class dmi_class = {
+	.name = "dmi",
+	.dev_release = (void(*)(struct device *)) kfree,
+	.dev_uevent = sysfw_dev_uevent,
+};
+
+static struct device dmi_dev = {
+	.class = &dmi_class,
+	.groups = sys_sysfw_attribute_groups,
+};
+
+static int __init sysfw_legacy_dmi(void)
+{
+	int ret;
+
+	ret = class_register(&dmi_class);
+	if (ret)
+		return ret;
+
+	dev_set_name(&dmi_dev, "id");
+	ret = device_register(&dmi_dev);
+	return ret;
+}
+#else
+static int __init sysfw_legacy_dmi(void)
+{
+	return 0;
+}
+#endif
+
+static int sysfw_bus_match(struct device *dev, struct device_driver *drv)
+{
+	return 1;
+}
+
+struct bus_type sysfw_bus_type = {
+	.name = "sysfw",
+	.match = sysfw_bus_match,
+	.uevent = sysfw_dev_uevent,
+};
+
+static struct device sysfw_dev = {
+	.bus = &sysfw_bus_type,
+	.type = &sysfw_type,
+};
+
+void sysfw_sysfs_device_init(const char *name)
+{
+	if (!dev_name(&sysfw_dev))
+		dev_set_name(&sysfw_dev, name);
+}
+
+static int __init sysfw_bus_init(void)
+{
+	int ret;
+
+	sysfw_id_init_attr_table();
+
+	ret = bus_register(&sysfw_bus_type);
+	if (ret)
+		return ret;
+
+	ret = device_register(&sysfw_dev);
+	if (ret) {
+		bus_unregister(&sysfw_bus_type);
+	}
+	return ret;
+
+	/* Failing to setup legacy DMI is NOT a fatal error */
+	ret = sysfw_legacy_dmi();
+	if (ret)
+		printk(KERN_ERR "SYSFW: DMI Legacy sysfs did not "
+		       "initialize.\n");
+
+	return 0;
+}
+arch_initcall(sysfw_bus_init);
diff --git a/drivers/firmware/sysfw.c b/drivers/firmware/sysfw.c
new file mode 100644
index 0000000..c37e19e
--- /dev/null
+++ b/drivers/firmware/sysfw.c
@@ -0,0 +1,168 @@
+/*
+ * System Firmware (sysfw) support
+ *
+ * started by Prarit Bhargava, Copyright (C) 2011 Red Hat, Inc.
+ *
+ * SYSFW interface to export commonly used values from System Firmware
+ *
+ * Some bits copied directly from original x86 and ia64 dmi*.c files
+ */
+#include <linux/device.h>
+#include <linux/errno.h>
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/mod_devicetable.h>
+#include <linux/slab.h>
+#include <linux/sysfw.h>
+
+/* Global sysfw instance */
+static struct sysfw_driver *sysfw;
+
+/**
+ * sysfw_driver_register - register a firmware driver
+ * @driver: sysfw_driver struct representing driver to register
+ *
+ * This function registers a sysfw driver.  Since the FW exists for the
+ * lifetime of the system there is no need for an unregister function.
+ */
+int __init sysfw_driver_register(struct sysfw_driver *driver)
+{
+	int ret;
+
+	if (!driver->init || !driver->name) {
+		WARN(1, "System Firmware Interface: driver error\n");
+		return -EFAULT;
+	}
+
+	if (sysfw) {
+		WARN(1, "System Firmware Interface: already registered\n");
+		return -EBUSY;
+	}
+
+	sysfw = driver;
+	ret = sysfw->init();
+	if (ret)
+		return -ENODEV;
+
+	return 0;
+}
+
+/* called in start_kernel(), after memory management has been initialized. */
+void __init sysfw_init_late(void)
+{
+	if (sysfw && sysfw->late)
+		sysfw->late();
+	sysfw_sysfs_device_init(sysfw->name);
+}
+
+/**
+ * sysfw_lookup - find a sysfw value for a given field.
+ * @field: field to lookup
+ *
+ * This function calls into the system firmware and returns an appropriate
+ * string.
+ */
+const char *sysfw_lookup(int field)
+{
+	if (sysfw && sysfw->lookup)
+		return sysfw->lookup(field);
+	return NULL;
+}
+EXPORT_SYMBOL_GPL(sysfw_lookup);
+
+/**
+ * sysfw_vendor_is - checks to see if the vendor fields in the firmware
+ * contain a string
+ * @str: string to search for
+ *
+ * Returns true/false if the string is in any of the SYSFW_*VENDOR* fields.
+ */
+bool sysfw_vendor_is(const char *str)
+{
+	static int fields[] = { SYSFW_BIOS_VENDOR, SYSFW_BIOS_VERSION,
+				SYSFW_SYS_VENDOR, SYSFW_PRODUCT_NAME,
+				SYSFW_PRODUCT_VERSION, SYSFW_BOARD_VENDOR,
+				SYSFW_BOARD_NAME, SYSFW_BOARD_VERSION,
+				SYSFW_NONE };
+	int i;
+
+	if (!sysfw)
+		return false;
+
+	if (!sysfw->lookup)
+		return false;
+
+	for (i = 0; fields[i] != SYSFW_NONE; i++) {
+		if (sysfw_lookup(i) && strstr(sysfw_lookup(i), str))
+			return true;
+	}
+	return false;
+}
+EXPORT_SYMBOL(sysfw_vendor_is);
+
+/**
+ * sysfw_get_date - returns the date of the firmware in YYYYMMDD format.
+ *
+ * Retuns the date the firmware was built in YYYYMMDD for easy comparisons.
+ */
+int sysfw_get_date(void)
+{
+	if (sysfw && sysfw->date)
+		return sysfw->date();
+	return 0;
+}
+EXPORT_SYMBOL(sysfw_get_date);
+
+/* compares and matches the strings in sysfw_id */
+static bool sysfw_match_fields(const struct sysfw_id *id, int exactmatch)
+{
+	int i;
+
+	for (i = 0; i < ARRAY_SIZE(id->matches); i++) {
+		int s = id->matches[i].slot;
+		if (s == SYSFW_NONE)
+			break;
+		if (!sysfw_lookup(s))
+			continue;
+		if (exactmatch &&
+		    !strcmp(sysfw_lookup(s), id->matches[i].substr))
+			continue;
+		if (!exactmatch &&
+		    strstr(sysfw_lookup(s), id->matches[i].substr))
+			continue;
+		/* No match */
+		return false;
+	}
+	return true;
+}
+
+static bool sysfw_is_end_of_table(const struct sysfw_id *id)
+{
+	return id->matches[0].slot == SYSFW_NONE;
+}
+
+/**
+ * sysfw_callback - go through a list and run a function on all matching ids
+ * @list: list of ids to search
+ *
+ * This function takes a list of fields and strings to compare, attempts to
+ * compare the strings to the sysfw fields and runs a callback function for
+ * each positive comparison.  The comparison can stop by returning 0 in
+ * the callback function.
+ */
+const struct sysfw_id *sysfw_callback(const struct sysfw_id *list)
+{
+	const struct sysfw_id *id;
+
+	if (!sysfw)
+		return NULL;
+
+	for (id = list; !sysfw_is_end_of_table(id); id++)
+		if (sysfw_match_fields(id, id->exactmatch)) {
+			if (id->callback)
+				id->callback(id);
+			return id;
+		}
+	return NULL;
+}
+EXPORT_SYMBOL(sysfw_callback);
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
index ae28e93..89153ad 100644
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
@@ -482,6 +482,68 @@ struct dmi_system_id {
 
 #define DMI_MATCH(a, b)	{ a, b }
 
+/*
+ * sysfw field - right now these are based on x86/ia64's SMBIOS fields.  But
+ * other arches are certainly welcome to add additional fields.  The
+ * sys_lookup() functions must be careful to return NULL on non-populated
+ * fields.
+ */
+enum sysfw_field {
+	SYSFW_NONE,
+	SYSFW_BIOS_VENDOR,
+	SYSFW_BIOS_VERSION,
+	SYSFW_BIOS_DATE,
+	SYSFW_SYS_VENDOR,
+	SYSFW_PRODUCT_NAME,
+	SYSFW_PRODUCT_VERSION,
+	SYSFW_PRODUCT_SERIAL,
+	SYSFW_PRODUCT_UUID,
+	SYSFW_BOARD_VENDOR,
+	SYSFW_BOARD_NAME,
+	SYSFW_BOARD_VERSION,
+	SYSFW_BOARD_SERIAL,
+	SYSFW_BOARD_ASSET_TAG,
+	SYSFW_CHASSIS_VENDOR,
+	SYSFW_CHASSIS_TYPE,
+	SYSFW_CHASSIS_VERSION,
+	SYSFW_CHASSIS_SERIAL,
+	SYSFW_CHASSIS_ASSET_TAG,
+	SYSFW_STRING_MAX,
+};
+
+struct sysfw_strmatch {
+	unsigned char slot;
+	char substr[79];
+};
+
+#ifndef __KERNEL__
+struct sysfw_id {
+	kernel_ulong_t callback;
+	kernel_ulong_t ident;
+	struct sysfw_strmatch matches[8];
+	kernel_ulong_t driver_data
+			__attribute__((aligned(sizeof(kernel_ulong_t))));
+	kernel_ulong_t exactmatch;
+};
+#else
+struct sysfw_id {
+	int (*callback)(const struct sysfw_id *);
+	const char *ident;
+	struct sysfw_strmatch matches[8];
+	void *driver_data;
+	kernel_ulong_t exactmatch;
+};
+/*
+ * struct sysfw_device_id appears during expansion of
+ * "MODULE_DEVICE_TABLE(sysfw, x)". Compiler doesn't look inside it
+ * but this is enough for gcc 3.4.6 to error out:
+ *	error: storage size of '__mod_sysfw_device_table' isn't known
+ */
+#define sysfw_device_id sysfw_system_id
+#endif
+
+#define SYSFW_MATCH(a, b)	{ a, b }
+
 #define PLATFORM_NAME_SIZE	20
 #define PLATFORM_MODULE_PREFIX	"platform:"
 
diff --git a/include/linux/sysfw.h b/include/linux/sysfw.h
new file mode 100644
index 0000000..8dcb674
--- /dev/null
+++ b/include/linux/sysfw.h
@@ -0,0 +1,113 @@
+/*
+ * include/linux/sysfw.h
+ *
+ * System Firmware (sysfw) Interface
+ */
+#ifndef _SYSFW_H
+#define _SYSFW_H
+
+#include <linux/mod_devicetable.h>
+
+/*
+ * sysfw_id and sysfw_field (the SYSFW_*) enums are defined in
+ * mod_devicetable.h
+ */
+
+/*
+ * sysfw_driver struct -- passed in to sysfw_init() by every firmware
+ * driver
+ */
+struct sysfw_driver {
+	const char *name;
+	/* find & evaluate firmware */
+	int (*init)(void);
+	/* late init, done after memory management is initialized */
+	int (*late)(void);
+	/* find a specific value in sysfw_field */
+	const char * (*lookup)(int field);
+	/* return date in YYYYMMDD format */
+	int (*date)(void);
+};
+
+#ifdef CONFIG_SYSTEM_FIRMWARE
+/**
+ * sysfw_driver_register - register a firmware driver
+ * @driver: sysfw_driver struct representing driver to register
+ *
+ * This function registers a sysfw driver.  Since the FW exists for the
+ * lifetime of the system there is no need for an unregister function.
+ */
+extern int sysfw_driver_register(struct sysfw_driver *driver);
+
+/**
+ * sysfw_lookup - find a sysfw value for a given field.
+ * @field: field to lookup
+ *
+ * This function calls into the system firmware and returns an appropriate
+ * string.
+ */
+extern const char *sysfw_lookup(int field);
+
+/**
+ * sysfw_get_date - returns the date of the firmware in YYYYMMDD format.
+ *
+ * Retuns the date the firmware was built in YYYYMMDD for easy comparisons.
+ */
+extern int sysfw_get_date(void);
+
+/**
+ * sysfw_vendor_is - checks to see if the vendor fields in the firmware
+ * contain a string
+ * @str: string to search for
+ *
+ * Returns true/false if the string is in any of the SYSFW_*VENDOR* fields.
+ */
+extern bool sysfw_vendor_is(const char *str);
+
+/**
+ * sysfw_callback - go through a list and run a function on all matching ids
+ * @list: list of ids to search
+ *
+ * This function takes a list of fields and strings to compare, attempts to
+ * compare the strings to the sysfw fields and runs a callback function for
+ * each positive comparison.  The comparison can stop by returning 0 in
+ * the callback function.  The function returns the first match in the list.
+ */
+extern const struct sysfw_id *sysfw_callback(const struct sysfw_id *list);
+
+/* Kernel internal only, run after memory management has been initialized */
+extern void sysfw_init_late(void);
+/* Kernel internal only, init's sysfs for the sysfw device */
+extern void sysfw_sysfs_device_init(const char *name);
+
+#else /* CONFIG_SYSTEM_FIRMWARE */
+
+static inline int sysfw_driver_register(struct sysfw_driver *driver)
+{
+	return -1;
+}
+static inline const char *sysfw_lookup(int field)
+{
+	return NULL;
+}
+static inline int sysfw_get_date(void)
+{
+	return 0;
+}
+static inline bool sysfw_vendor_is(const char *str)
+{
+	return false;
+}
+static const struct sysfw_id *sysfw_callback(const struct sysfw_id *list)
+{
+	return NULL;
+}
+static inline void sysfw_init_late(void)
+{
+	return;
+}
+#endif /* CONFIG_SYSTEM_FIRMWARE */
+
+#define sysfw_vendor_contains(str) sysfw_vendor_is(str)
+
+#endif /* _SYSFW_H */
diff --git a/init/main.c b/init/main.c
index d7211fa..8b99aeb 100644
--- a/init/main.c
+++ b/init/main.c
@@ -68,6 +68,7 @@
 #include <linux/shmem_fs.h>
 #include <linux/slab.h>
 #include <linux/perf_event.h>
+#include <linux/sysfw.h>
 
 #include <asm/io.h>
 #include <asm/bugs.h>
@@ -554,6 +555,8 @@ asmlinkage void __init start_kernel(void)
 
 	kmem_cache_init_late();
 
+	sysfw_init_late();
+
 	/*
 	 * HACK ALERT! This is early. We're enabling the console before
 	 * we've done PCI setups etc, and console_init() must be aware of
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index e26e2fb..92a27e3 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -753,26 +753,26 @@ static int do_spi_entry(const char *filename, struct spi_device_id *id,
 	return 1;
 }
 
-static const struct dmifield {
+static const struct sysfwfield {
 	const char *prefix;
 	int field;
-} dmi_fields[] = {
-	{ "bvn", DMI_BIOS_VENDOR },
-	{ "bvr", DMI_BIOS_VERSION },
-	{ "bd",  DMI_BIOS_DATE },
-	{ "svn", DMI_SYS_VENDOR },
-	{ "pn",  DMI_PRODUCT_NAME },
-	{ "pvr", DMI_PRODUCT_VERSION },
-	{ "rvn", DMI_BOARD_VENDOR },
-	{ "rn",  DMI_BOARD_NAME },
-	{ "rvr", DMI_BOARD_VERSION },
-	{ "cvn", DMI_CHASSIS_VENDOR },
-	{ "ct",  DMI_CHASSIS_TYPE },
-	{ "cvr", DMI_CHASSIS_VERSION },
-	{ NULL,  DMI_NONE }
+} sysfw_fields[] = {
+	{ "bvn", SYSFW_BIOS_VENDOR },
+	{ "bvr", SYSFW_BIOS_VERSION },
+	{ "bd",  SYSFW_BIOS_DATE },
+	{ "svn", SYSFW_SYS_VENDOR },
+	{ "pn",  SYSFW_PRODUCT_NAME },
+	{ "pvr", SYSFW_PRODUCT_VERSION },
+	{ "rvn", SYSFW_BOARD_VENDOR },
+	{ "rn",  SYSFW_BOARD_NAME },
+	{ "rvr", SYSFW_BOARD_VERSION },
+	{ "cvn", SYSFW_CHASSIS_VENDOR },
+	{ "ct",  SYSFW_CHASSIS_TYPE },
+	{ "cvr", SYSFW_CHASSIS_VERSION },
+	{ NULL,  SYSFW_NONE }
 };
 
-static void dmi_ascii_filter(char *d, const char *s)
+static void sysfw_ascii_filter(char *d, const char *s)
 {
 	/* Filter out characters we don't want to see in the modalias string */
 	for (; *s; s++)
@@ -783,20 +783,20 @@ static void dmi_ascii_filter(char *d, const char *s)
 }
 
 
-static int do_dmi_entry(const char *filename, struct dmi_system_id *id,
-			char *alias)
+static int do_sysfw_entry(const char *filename, struct sysfw_id *id,
+			  char *alias)
 {
 	int i, j;
 
-	sprintf(alias, "dmi*");
+	sprintf(alias, "sysfw*");
 
-	for (i = 0; i < ARRAY_SIZE(dmi_fields); i++) {
+	for (i = 0; i < ARRAY_SIZE(sysfw_fields); i++) {
 		for (j = 0; j < 4; j++) {
 			if (id->matches[j].slot &&
-			    id->matches[j].slot == dmi_fields[i].field) {
+			    id->matches[j].slot == sysfw_fields[i].field) {
 				sprintf(alias + strlen(alias), ":%s*",
-					dmi_fields[i].prefix);
-				dmi_ascii_filter(alias + strlen(alias),
+					sysfw_fields[i].prefix);
+				sysfw_ascii_filter(alias + strlen(alias),
 						 id->matches[j].substr);
 				strcat(alias, "*");
 			}
@@ -1002,10 +1002,10 @@ void handle_moddevtable(struct module *mod, struct elf_info *info,
 		do_table(symval, sym->st_size,
 			 sizeof(struct spi_device_id), "spi",
 			 do_spi_entry, mod);
-	else if (sym_is(symname, "__mod_dmi_device_table"))
+	else if (sym_is(symname, "__mod_sysfw_device_table"))
 		do_table(symval, sym->st_size,
-			 sizeof(struct dmi_system_id), "dmi",
-			 do_dmi_entry, mod);
+			 sizeof(struct sysfw_id), "sysfw",
+			 do_sysfw_entry, mod);
 	else if (sym_is(symname, "__mod_platform_device_table"))
 		do_table(symval, sym->st_size,
 			 sizeof(struct platform_device_id), "platform",
-- 
1.6.5.2


^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [PATCH 02/34] New SMBIOS driver for x86 and ia64.
  2011-07-18 13:08 [PATCH 00/34] System Firmware and SMBIOS Support [v3] Prarit Bhargava
  2011-07-18 13:08 ` [PATCH 01/34] System Firmware Interface Prarit Bhargava
@ 2011-07-18 13:08 ` Prarit Bhargava
  2011-07-18 13:08 ` [PATCH 03/34] arch specific changes for SMBIOS and System Firmware Prarit Bhargava
                   ` (31 subsequent siblings)
  33 siblings, 0 replies; 48+ messages in thread
From: Prarit Bhargava @ 2011-07-18 13:08 UTC (permalink / raw)
  To: linux-kernel
  Cc: Prarit Bhargava, linux-ia64, x86, linux-acpi, linux-ide,
	openipmi-developer, platform-driver-x86, linux-crypto, dri-devel,
	lm-sensors, linux-i2c, linux-input, linux-media, netdev,
	linux-pci, rtc-linux, evel, linux-usb, device-drivers-devel,
	linux-watchdog, grant.likely, dz, rpurdie, eric.piel, abelay,
	johnpol

This, along with the System Firmware (sysfw) interface replaces the existing
DMI code in the kernel.

This subsystem provides functionality for individual drivers to access
the SMBIOS structures for their own use, smbios_walk(), as well as some
helper functions for some kernel modules.

Cc: linux-ia64@vger.kernel.org
Cc: x86@kernel.org
Cc: linux-acpi@vger.kernel.org
Cc: linux-ide@vger.kernel.org
Cc: openipmi-developer@lists.sourceforge.net
Cc: platform-driver-x86@vger.kernel.org
Cc: linux-crypto@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Cc: lm-sensors@lm-sensors.org
Cc: linux-i2c@vger.kernel.org
Cc: linux-ide@vger.kernel.org
Cc: linux-input@vger.kernel.org
Cc: linux-media@vger.kernel.org
Cc: netdev@vger.kernel.org
Cc: linux-pci@vger.kernel.org
Cc: rtc-linux@googlegroups.com
Cc: evel@driverdev.osuosl.org
Cc: linux-usb@vger.kernel.org
Cc: device-drivers-devel@blackfin.uclinux.org
Cc: linux-watchdog@vger.kernel.org
Cc: grant.likely@secretlab.ca
Cc: dz@debian.org
Cc: rpurdie@rpsys.net
Cc: eric.piel@tremplin-utc.net
Cc: abelay@mit.edu
Cc: johnpol@2ka.mipt.ru
Signed-off-by: Prarit Bhargava <prarit@redhat.com>
---
 Documentation/ABI/obsolete/sysfs-dmi   |   40 ++
 Documentation/ABI/testing/sysfw-smbios |   36 ++
 arch/ia64/Kconfig                      |    5 +
 arch/ia64/include/asm/smbios.h         |   12 +
 arch/x86/Kconfig                       |   10 +
 arch/x86/include/asm/smbios.h          |   19 +
 drivers/firmware/Kconfig               |   20 +
 drivers/firmware/Makefile              |    2 +
 drivers/firmware/smbios-sysfs.c        |  705 ++++++++++++++++++++++++++++++++
 drivers/firmware/smbios.c              |  687 +++++++++++++++++++++++++++++++
 include/linux/smbios.h                 |  243 +++++++++++
 11 files changed, 1779 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/ABI/obsolete/sysfs-dmi
 create mode 100644 Documentation/ABI/testing/sysfw-smbios
 create mode 100644 arch/ia64/include/asm/smbios.h
 create mode 100644 arch/x86/include/asm/smbios.h
 create mode 100644 drivers/firmware/smbios-sysfs.c
 create mode 100644 drivers/firmware/smbios.c
 create mode 100644 include/linux/smbios.h

diff --git a/Documentation/ABI/obsolete/sysfs-dmi b/Documentation/ABI/obsolete/sysfs-dmi
new file mode 100644
index 0000000..547dc4b
--- /dev/null
+++ b/Documentation/ABI/obsolete/sysfs-dmi
@@ -0,0 +1,40 @@
+What:		/sys/class/dmi
+Date:		July 2011
+KernelVersion:	3.0
+Contact:	Prarit Bhargava <prarit@redhat.com>
+Description:
+		The dmi class is exported if CONFIG_SMBIOS_DMI_COMPAT is
+		set.
+
+		The DMI code currently exposes several values via sysfs.
+		These values are:
+
+		bios_date: The datestamp of the BIOS.
+		bios_vendor: The company that wrote the BIOS.
+		bios_version: The version of the BIOS.
+		board_asset_tag: A unique identifier for the system
+				 motherboard.
+		board_name: The name of the type of motherboard.
+		board_serial: The serial number of the motherboard.
+		board_vendor: The company that designed the motherboard.
+		board_version: The version of the motherboard.
+		chassis_asset_tag: A unique identifier for the chassis.
+		chassis_serial: The serial number of the chassis.
+		chassis_type: The type of chassis.
+		chassis_vendor: The company that designed the chassis.
+		chassis_version: The version of the chassis.
+		product_name: The name of the system as determined by the
+			      OEM.
+		product_serial: The serial number of the system.
+		product_uuid: A unique UUID for the system.
+		product_version: The version number of the system.
+		sys_vendor: The OEM company for the system.
+
+		In addition to these the standard class files are exposed
+		for DMI (uvent, power, subsystem) as well as a modalias
+		file.
+
+		The dmi class is deprecated and should not be used by new
+		code.  Existing code should be migrated to use
+		/sys/class/smbios/* which exposes the same data.
+		The dmi class link will be removed in July of 2013.
diff --git a/Documentation/ABI/testing/sysfw-smbios b/Documentation/ABI/testing/sysfw-smbios
new file mode 100644
index 0000000..c6045f1
--- /dev/null
+++ b/Documentation/ABI/testing/sysfw-smbios
@@ -0,0 +1,36 @@
+What:		/sys/bus/sysfw
+Date:		May 1 2011
+KernelVersion:	2.6.39
+Contact:	Prarit Bhargava <prarit@redhat.com>
+Description:
+		The dmi class is exported if CONFIG_SMBIOS is set.
+
+		The SMBIOS code currently exposes several values via sysfs
+		primarily for use by module handling code.
+
+		These values are:
+
+		bios_date: The datestamp of the BIOS.
+		bios_vendor: The company that wrote the BIOS.
+		bios_version: The version of the BIOS.
+		board_asset_tag: A unique identifier for the system
+				 motherboard.
+		board_name: The name of the type of motherboard.
+		board_serial: The serial number of the motherboard.
+		board_vendor: The company that designed the motherboard.
+		board_version: The version of the motherboard.
+		chassis_asset_tag: A unique identifier for the chassis.
+		chassis_serial: The serial number of the chassis.
+		chassis_type: The type of chassis.
+		chassis_vendor: The company that designed the chassis.
+		chassis_version: The version of the chassis.
+		product_name: The name of the system as determined by the
+			      OEM.
+		product_serial: The serial number of the system.
+		product_uuid: A unique UUID for the system.
+		product_version: The version number of the system.
+		sys_vendor: The OEM company for the system.
+
+		In addition to these the standard class files are exposed
+		for SMBIOS (uvent, power, subsystem) as well as a modalias
+		file.
diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig
index 38280ef..ac14d3c 100644
--- a/arch/ia64/Kconfig
+++ b/arch/ia64/Kconfig
@@ -93,6 +93,11 @@ config DMI
 	bool
 	default y
 
+config SMBIOS
+	bool
+	default y
+	depends on SYSTEM_FIRMWARE
+
 config EFI
 	bool
 	default y
diff --git a/arch/ia64/include/asm/smbios.h b/arch/ia64/include/asm/smbios.h
new file mode 100644
index 0000000..19c0019
--- /dev/null
+++ b/arch/ia64/include/asm/smbios.h
@@ -0,0 +1,12 @@
+#ifndef _ASM_SMBIOS_H
+#define _ASM_SMBIOS_H 1
+
+#include <linux/slab.h>
+#include <asm/io.h>
+
+/* Use normal IO mappings for SMBIOS */
+#define smbios_ioremap ioremap
+#define smbios_iounmap(x, l) iounmap(x)
+#define smbios_alloc(l) kmalloc(l, GFP_ATOMIC)
+
+#endif
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index da34972..e7cdde8 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -635,6 +635,16 @@ config DMI
 	  affected by entries in the DMI blacklist. Required by PNP
 	  BIOS code.
 
+config SMBIOS
+	depends on SYSTEM_FIRMWARE
+	bool "Enable SMBIOS scanning" if EXPERT
+	default y
+	---help---
+	  Enabled scanning of SMBIOS to identify machine quirks. Say Y
+	  here unless you have verified that your setup is not
+	  affected by entries in the SMBIOS blacklist. Required by PNP
+	  BIOS code.
+
 config GART_IOMMU
 	bool "GART IOMMU support" if EXPERT
 	default y
diff --git a/arch/x86/include/asm/smbios.h b/arch/x86/include/asm/smbios.h
new file mode 100644
index 0000000..767270b
--- /dev/null
+++ b/arch/x86/include/asm/smbios.h
@@ -0,0 +1,19 @@
+#ifndef _ASM_X86_SMBIOS_H
+#define _ASM_X86_SMBIOS_H
+
+#include <linux/compiler.h>
+#include <linux/init.h>
+
+#include <asm/io.h>
+#include <asm/setup.h>
+
+static __always_inline __init void *smbios_alloc(unsigned len)
+{
+	return extend_brk(len, sizeof(int));
+}
+
+/* Use early IO mappings for SMBIOS because it's initialized early */
+#define smbios_ioremap early_ioremap
+#define smbios_iounmap early_iounmap
+
+#endif /* _ASM_X86_SMBIOS_H */
diff --git a/drivers/firmware/Kconfig b/drivers/firmware/Kconfig
index 79a1b9d..23066d8 100644
--- a/drivers/firmware/Kconfig
+++ b/drivers/firmware/Kconfig
@@ -182,6 +182,26 @@ config SYSTEM_FIRMWARE_DMI_COMPAT
 	  should not be used in new user space software.  Please see
 	  Documentation/ABI for details.
 
+config SYSTEM_FIRMWARE_DMI_COMPAT
+	bool "Export dmi compatibility class in sysfs"
+	depends on SMBIOSID
+	default y
+	help
+	  This exposes /sys/class/dmi/* as a pointer to the sysfw class for
+	  old software.  This is purely a backwards compatability feature and
+	  should not be used in new user space software.  Please see
+	  Documentation/ABI for details.
+
+config SMBIOS_SYSFS
+	tristate "SMBIOS table support in sysfs"
+	depends on SYSFS && SMBIOS
+	help
+	  Say Y or M here to enable the exporting of the raw SMBIOS table
+	  data via sysfs.  This is useful for consuming the data without
+	  requiring any access to /dev/mem at all.  Tables are found
+	  under /sys/firmware/smbios when this option is enabled and
+	  loaded.
+
 source "drivers/firmware/google/Kconfig"
 
 endmenu
diff --git a/drivers/firmware/Makefile b/drivers/firmware/Makefile
index 41bc64a..5c9d81f 100644
--- a/drivers/firmware/Makefile
+++ b/drivers/firmware/Makefile
@@ -16,3 +16,5 @@ obj-$(CONFIG_SIGMA)		+= sigma.o
 obj-$(CONFIG_GOOGLE_FIRMWARE)	+= google/
 obj-$(CONFIG_SYSTEM_FIRMWARE)	+= sysfw.o
 obj-$(CONFIG_SYSTEM_FIRMWARE_SYSFS)	+= sysfw-sysfs.o
+obj-$(CONFIG_SMBIOS)		+= smbios.o
+obj-$(CONFIG_SMBIOS_SYSFS)	+= smbios-sysfs.o
diff --git a/drivers/firmware/smbios-sysfs.c b/drivers/firmware/smbios-sysfs.c
new file mode 100644
index 0000000..9fd36a6
--- /dev/null
+++ b/drivers/firmware/smbios-sysfs.c
@@ -0,0 +1,705 @@
+/*
+ * smbios-sysfs.c
+ *
+ * This module exports the SMBIOS tables read-only to userspace through the
+ * sysfs file system.
+ *
+ * Data is currently found below
+ *    /sys/firmware/smbios/...
+ *
+ * SMBIOS attributes are presented in attribute files with names
+ * formatted using %d-%d, so that the first integer indicates the
+ * structure type (0-255), and the second field is the instance of that
+ * entry.
+ *
+ * Copyright 2011 Google, Inc.
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/types.h>
+#include <linux/kobject.h>
+#include <linux/smbios.h>
+#include <linux/capability.h>
+#include <linux/slab.h>
+#include <linux/list.h>
+#include <linux/io.h>
+
+#define MAX_ENTRY_TYPE 255 /* Most of these aren't used, but we consider
+			      the top entry type is only 8 bits */
+
+struct smbios_sysfs_entry {
+	struct smbios_header dh;
+	struct kobject kobj;
+	int instance;
+	int position;
+	struct list_head list;
+	struct kobject *child;
+};
+
+/*
+ * Global list of smbios_sysfs_entry.  Even though this should only be
+ * manipulated at setup and teardown, the lazy nature of the kobject
+ * system means we get lazy removes.
+ */
+static LIST_HEAD(entry_list);
+static DEFINE_SPINLOCK(entry_list_lock);
+
+/* smbios_sysfs_attribute - Top level attribute. used by all entries. */
+struct smbios_sysfs_attribute {
+	struct attribute attr;
+	ssize_t (*show)(struct smbios_sysfs_entry *entry, char *buf);
+};
+
+#define SMBIOS_SYSFS_ATTR(_entry, _name) \
+struct smbios_sysfs_attribute smbios_sysfs_attr_##_entry##_##_name = { \
+	.attr = {.name = __stringify(_name), .mode = 0400}, \
+	.show = smbios_sysfs_##_entry##_##_name, \
+}
+
+/*
+ * smbios_sysfs_mapped_attribute - Attribute where we require the entry be
+ * mapped in.  Use in conjunction with smbios_sysfs_specialize_attr_ops.
+ */
+struct smbios_sysfs_mapped_attribute {
+	struct attribute attr;
+	ssize_t (*show)(struct smbios_sysfs_entry *entry,
+			const struct smbios_header *dh,
+			char *buf);
+};
+
+#define SMBIOS_SYSFS_MAPPED_ATTR(_entry, _name) \
+struct smbios_sysfs_mapped_attribute smbios_sysfs_attr_##_entry##_##_name = { \
+	.attr = {.name = __stringify(_name), .mode = 0400}, \
+	.show = smbios_sysfs_##_entry##_##_name, \
+}
+
+/*************************************************
+ * Generic SMBIOS entry support.
+ *************************************************/
+static void smbios_entry_free(struct kobject *kobj)
+{
+	kfree(kobj);
+}
+
+static struct smbios_sysfs_entry *to_entry(struct kobject *kobj)
+{
+	return container_of(kobj, struct smbios_sysfs_entry, kobj);
+}
+
+static struct smbios_sysfs_attribute *to_attr(struct attribute *attr)
+{
+	return container_of(attr, struct smbios_sysfs_attribute, attr);
+}
+
+static ssize_t smbios_sysfs_attr_show(struct kobject *kobj,
+				      struct attribute *_attr, char *buf)
+{
+	struct smbios_sysfs_entry *entry = to_entry(kobj);
+	struct smbios_sysfs_attribute *attr = to_attr(_attr);
+
+	/* SMBIOS stuff is only ever admin visible */
+	if (!capable(CAP_SYS_ADMIN))
+		return -EACCES;
+
+	return attr->show(entry, buf);
+}
+
+static const struct sysfs_ops smbios_sysfs_attr_ops = {
+	.show = smbios_sysfs_attr_show,
+};
+
+typedef ssize_t (*smbios_callback)(struct smbios_sysfs_entry *,
+				   const struct smbios_header *dh, void *);
+
+struct find_smbios_data {
+	struct smbios_sysfs_entry	*entry;
+	smbios_callback		callback;
+	void			*private;
+	int			instance_countdown;
+	ssize_t			ret;
+};
+
+static int find_smbios_entry_helper(const union smbios_struct *ss, void *_data)
+{
+	struct find_smbios_data *data = _data;
+	struct smbios_sysfs_entry *entry = data->entry;
+
+	/* Is this the entry we want? */
+	if (ss->header.type != entry->dh.type)
+		return SMBIOS_WALK_CONTINUE;
+
+	if (data->instance_countdown != 0) {
+		/* try the next instance? */
+		data->instance_countdown--;
+		return SMBIOS_WALK_CONTINUE;
+	}
+
+	/*
+	 * Don't ever revisit the instance.  Short circuit later
+	 * instances by letting the instance_countdown run negative
+	 */
+	data->instance_countdown--;
+
+	/* Found the entry */
+	data->ret = data->callback(entry, &ss->header, data->private);
+
+	return SMBIOS_WALK_STOP;
+}
+
+/* State for passing the read parameters through smbios_find_entry() */
+struct smbios_read_state {
+	char *buf;
+	loff_t pos;
+	size_t count;
+};
+
+static ssize_t find_smbios_entry(struct smbios_sysfs_entry *entry,
+				 smbios_callback callback, void *private)
+{
+	struct find_smbios_data data = {
+		.entry = entry,
+		.callback = callback,
+		.private = private,
+		.instance_countdown = entry->instance,
+		.ret = -EIO,  /* To signal the entry disappeared */
+	};
+	const union smbios_struct *ss;
+
+	ss = smbios_walk(find_smbios_entry_helper, &data);
+	if (!ss)
+		return -EINVAL;
+	return data.ret;
+}
+
+/*
+ * Calculate and return the byte length of the smbios entry identified by
+ * dh.  This includes both the formatted portion as well as the
+ * unformatted string space, including the two trailing nul characters.
+ */
+static size_t smbios_entry_length(const struct smbios_header *dh)
+{
+	const char *p = (const char *)dh;
+
+	p += dh->length;
+
+	while (p[0] || p[1])
+		p++;
+
+	return 2 + p - (const char *)dh;
+}
+
+/*************************************************
+ * Support bits for specialized SMBIOS entry support
+ *************************************************/
+struct smbios_entry_attr_show_data {
+	struct attribute *attr;
+	char *buf;
+};
+
+static ssize_t smbios_entry_attr_show_helper(struct smbios_sysfs_entry *entry,
+					     const struct smbios_header *dh,
+					     void *_data)
+{
+	struct smbios_entry_attr_show_data *data = _data;
+	struct smbios_sysfs_mapped_attribute *attr;
+
+	attr = container_of(data->attr,
+			    struct smbios_sysfs_mapped_attribute, attr);
+	return attr->show(entry, dh, data->buf);
+}
+
+static ssize_t smbios_entry_attr_show(struct kobject *kobj,
+				      struct attribute *attr,
+				      char *buf)
+{
+	struct smbios_entry_attr_show_data data = {
+		.attr = attr,
+		.buf  = buf,
+	};
+	/* Find the entry according to our parent and call the
+	 * normalized show method hanging off of the attribute */
+	return find_smbios_entry(to_entry(kobj->parent),
+				 smbios_entry_attr_show_helper, &data);
+}
+
+static const struct sysfs_ops smbios_sysfs_specialize_attr_ops = {
+	.show = smbios_entry_attr_show,
+};
+
+/*************************************************
+ * Specialized SMBIOS entry support.
+ *************************************************/
+
+/*** Type 15 - System Event Table ***/
+
+#define SMBIOS_SEL_ACCESS_METHOD_IO8	0x00
+#define SMBIOS_SEL_ACCESS_METHOD_IO2x8	0x01
+#define SMBIOS_SEL_ACCESS_METHOD_IO16	0x02
+#define SMBIOS_SEL_ACCESS_METHOD_PHYS32	0x03
+#define SMBIOS_SEL_ACCESS_METHOD_GPNV	0x04
+
+struct smbios_system_event_log {
+	struct smbios_header header;
+	u16	area_length;
+	u16	header_start_offset;
+	u16	data_start_offset;
+	u8	access_method;
+	u8	status;
+	u32	change_token;
+	union {
+		struct {
+			u16 index_addr;
+			u16 data_addr;
+		} io;
+		u32	phys_addr32;
+		u16	gpnv_handle;
+		u32	access_method_address;
+	};
+	u8	header_format;
+	u8	type_descriptors_supported_count;
+	u8	per_log_type_descriptor_length;
+	u8	supported_log_type_descriptos[0];
+} __packed;
+
+#define SMBIOS_SYSFS_SEL_FIELD(_field) \
+static ssize_t smbios_sysfs_sel_##_field(struct smbios_sysfs_entry *entry, \
+					 const struct smbios_header *dh, \
+					 char *buf) \
+{ \
+	struct smbios_system_event_log sel; \
+	if (sizeof(sel) > smbios_entry_length(dh)) \
+		return -EIO; \
+	memcpy(&sel, dh, sizeof(sel)); \
+	return sprintf(buf, "%u\n", sel._field); \
+} \
+static SMBIOS_SYSFS_MAPPED_ATTR(sel, _field)
+
+SMBIOS_SYSFS_SEL_FIELD(area_length);
+SMBIOS_SYSFS_SEL_FIELD(header_start_offset);
+SMBIOS_SYSFS_SEL_FIELD(data_start_offset);
+SMBIOS_SYSFS_SEL_FIELD(access_method);
+SMBIOS_SYSFS_SEL_FIELD(status);
+SMBIOS_SYSFS_SEL_FIELD(change_token);
+SMBIOS_SYSFS_SEL_FIELD(access_method_address);
+SMBIOS_SYSFS_SEL_FIELD(header_format);
+SMBIOS_SYSFS_SEL_FIELD(type_descriptors_supported_count);
+SMBIOS_SYSFS_SEL_FIELD(per_log_type_descriptor_length);
+
+static struct attribute *smbios_sysfs_sel_attrs[] = {
+	&smbios_sysfs_attr_sel_area_length.attr,
+	&smbios_sysfs_attr_sel_header_start_offset.attr,
+	&smbios_sysfs_attr_sel_data_start_offset.attr,
+	&smbios_sysfs_attr_sel_access_method.attr,
+	&smbios_sysfs_attr_sel_status.attr,
+	&smbios_sysfs_attr_sel_change_token.attr,
+	&smbios_sysfs_attr_sel_access_method_address.attr,
+	&smbios_sysfs_attr_sel_header_format.attr,
+	&smbios_sysfs_attr_sel_type_descriptors_supported_count.attr,
+	&smbios_sysfs_attr_sel_per_log_type_descriptor_length.attr,
+	NULL,
+};
+
+
+static struct kobj_type smbios_system_event_log_ktype = {
+	.release = smbios_entry_free,
+	.sysfs_ops = &smbios_sysfs_specialize_attr_ops,
+	.default_attrs = smbios_sysfs_sel_attrs,
+};
+
+typedef u8 (*sel_io_reader)(const struct smbios_system_event_log *sel,
+			    loff_t offset);
+
+static DEFINE_MUTEX(io_port_lock);
+
+static u8 read_sel_8bit_indexed_io(const struct smbios_system_event_log *sel,
+				   loff_t offset)
+{
+	u8 ret;
+
+	mutex_lock(&io_port_lock);
+	outb((u8)offset, sel->io.index_addr);
+	ret = inb(sel->io.data_addr);
+	mutex_unlock(&io_port_lock);
+	return ret;
+}
+
+static u8 read_sel_2x8bit_indexed_io(const struct smbios_system_event_log *sel,
+				     loff_t offset)
+{
+	u8 ret;
+
+	mutex_lock(&io_port_lock);
+	outb((u8)offset, sel->io.index_addr);
+	outb((u8)(offset >> 8), sel->io.index_addr + 1);
+	ret = inb(sel->io.data_addr);
+	mutex_unlock(&io_port_lock);
+	return ret;
+}
+
+static u8 read_sel_16bit_indexed_io(const struct smbios_system_event_log *sel,
+				    loff_t offset)
+{
+	u8 ret;
+
+	mutex_lock(&io_port_lock);
+	outw((u16)offset, sel->io.index_addr);
+	ret = inb(sel->io.data_addr);
+	mutex_unlock(&io_port_lock);
+	return ret;
+}
+
+static sel_io_reader sel_io_readers[] = {
+	[SMBIOS_SEL_ACCESS_METHOD_IO8]	= read_sel_8bit_indexed_io,
+	[SMBIOS_SEL_ACCESS_METHOD_IO2x8]	= read_sel_2x8bit_indexed_io,
+	[SMBIOS_SEL_ACCESS_METHOD_IO16]	= read_sel_16bit_indexed_io,
+};
+
+static ssize_t smbios_sel_raw_read_io(struct smbios_sysfs_entry *entry,
+				      const struct smbios_system_event_log *sel,
+				      char *buf, loff_t pos, size_t count)
+{
+	ssize_t wrote = 0;
+
+	sel_io_reader io_reader = sel_io_readers[sel->access_method];
+
+	while (count && pos < sel->area_length) {
+		count--;
+		*(buf++) = io_reader(sel, pos++);
+		wrote++;
+	}
+
+	return wrote;
+}
+
+static ssize_t smbios_sel_raw_read_phys32(struct smbios_sysfs_entry *entry,
+				      const struct smbios_system_event_log *sel,
+					  char *buf, loff_t pos, size_t count)
+{
+	u8 __iomem *mapped;
+	ssize_t wrote = 0;
+
+	mapped = ioremap(sel->access_method_address, sel->area_length);
+	if (!mapped)
+		return -EIO;
+
+	while (count && pos < sel->area_length) {
+		count--;
+		*(buf++) = readb(mapped + pos++);
+		wrote++;
+	}
+
+	iounmap(mapped);
+	return wrote;
+}
+
+static ssize_t smbios_sel_raw_read_helper(struct smbios_sysfs_entry *entry,
+					  const struct smbios_header *dh,
+					  void *_state)
+{
+	struct smbios_read_state *state = _state;
+	struct smbios_system_event_log sel;
+
+	if (sizeof(sel) > smbios_entry_length(dh))
+		return -EIO;
+
+	memcpy(&sel, dh, sizeof(sel));
+
+	switch (sel.access_method) {
+	case SMBIOS_SEL_ACCESS_METHOD_IO8:
+	case SMBIOS_SEL_ACCESS_METHOD_IO2x8:
+	case SMBIOS_SEL_ACCESS_METHOD_IO16:
+		return smbios_sel_raw_read_io(entry, &sel, state->buf,
+					      state->pos, state->count);
+	case SMBIOS_SEL_ACCESS_METHOD_PHYS32:
+		return smbios_sel_raw_read_phys32(entry, &sel, state->buf,
+						  state->pos, state->count);
+	case SMBIOS_SEL_ACCESS_METHOD_GPNV:
+		pr_info("smbios-sysfs: GPNV support missing.\n");
+		return -EIO;
+	default:
+		pr_info("smbios-sysfs: Unknown access method %02x\n",
+			sel.access_method);
+		return -EIO;
+	}
+}
+
+static ssize_t smbios_sel_raw_read(struct file *filp, struct kobject *kobj,
+				   struct bin_attribute *bin_attr,
+				   char *buf, loff_t pos, size_t count)
+{
+	struct smbios_sysfs_entry *entry = to_entry(kobj->parent);
+	struct smbios_read_state state = {
+		.buf = buf,
+		.pos = pos,
+		.count = count,
+	};
+
+	return find_smbios_entry(entry, smbios_sel_raw_read_helper, &state);
+}
+
+static struct bin_attribute smbios_sel_raw_attr = {
+	.attr = {.name = "raw_event_log", .mode = 0400},
+	.read = smbios_sel_raw_read,
+};
+
+static int smbios_system_event_log(struct smbios_sysfs_entry *entry)
+{
+	int ret;
+
+	entry->child = kzalloc(sizeof(*entry->child), GFP_KERNEL);
+	if (!entry->child)
+		return -ENOMEM;
+	ret = kobject_init_and_add(entry->child,
+				   &smbios_system_event_log_ktype,
+				   &entry->kobj,
+				   "system_event_log");
+	if (ret)
+		goto out_free;
+
+	ret = sysfs_create_bin_file(entry->child, &smbios_sel_raw_attr);
+	if (ret)
+		goto out_del;
+
+	return 0;
+
+out_del:
+	kobject_del(entry->child);
+out_free:
+	kfree(entry->child);
+	return ret;
+}
+
+/*************************************************
+ * Generic SMBIOS entry support.
+ *************************************************/
+
+static ssize_t smbios_sysfs_entry_length(struct smbios_sysfs_entry *entry,
+					 char *buf)
+{
+	return sprintf(buf, "%d\n", entry->dh.length);
+}
+
+static ssize_t smbios_sysfs_entry_handle(struct smbios_sysfs_entry *entry,
+					 char *buf)
+{
+	return sprintf(buf, "%d\n", entry->dh.handle);
+}
+
+static ssize_t smbios_sysfs_entry_type(struct smbios_sysfs_entry *entry,
+				       char *buf)
+{
+	return sprintf(buf, "%d\n", entry->dh.type);
+}
+
+static ssize_t smbios_sysfs_entry_instance(struct smbios_sysfs_entry *entry,
+					   char *buf)
+{
+	return sprintf(buf, "%d\n", entry->instance);
+}
+
+static ssize_t smbios_sysfs_entry_position(struct smbios_sysfs_entry *entry,
+					   char *buf)
+{
+	return sprintf(buf, "%d\n", entry->position);
+}
+
+static SMBIOS_SYSFS_ATTR(entry, length);
+static SMBIOS_SYSFS_ATTR(entry, handle);
+static SMBIOS_SYSFS_ATTR(entry, type);
+static SMBIOS_SYSFS_ATTR(entry, instance);
+static SMBIOS_SYSFS_ATTR(entry, position);
+
+static struct attribute *smbios_sysfs_entry_attrs[] = {
+	&smbios_sysfs_attr_entry_length.attr,
+	&smbios_sysfs_attr_entry_handle.attr,
+	&smbios_sysfs_attr_entry_type.attr,
+	&smbios_sysfs_attr_entry_instance.attr,
+	&smbios_sysfs_attr_entry_position.attr,
+	NULL,
+};
+
+static ssize_t smbios_entry_raw_read_helper(struct smbios_sysfs_entry *entry,
+					    const struct smbios_header *dh,
+					    void *_state)
+{
+	struct smbios_read_state *state = _state;
+	size_t entry_length;
+
+	entry_length = smbios_entry_length(dh);
+
+	return memory_read_from_buffer(state->buf, state->count,
+				       &state->pos, dh, entry_length);
+}
+
+static ssize_t smbios_entry_raw_read(struct file *filp,
+				     struct kobject *kobj,
+				     struct bin_attribute *bin_attr,
+				     char *buf, loff_t pos, size_t count)
+{
+	struct smbios_sysfs_entry *entry = to_entry(kobj);
+	struct smbios_read_state state = {
+		.buf = buf,
+		.pos = pos,
+		.count = count,
+	};
+
+	return find_smbios_entry(entry, smbios_entry_raw_read_helper, &state);
+}
+
+static const struct bin_attribute smbios_entry_raw_attr = {
+	.attr = {.name = "raw", .mode = 0400},
+	.read = smbios_entry_raw_read,
+};
+
+static void smbios_sysfs_entry_release(struct kobject *kobj)
+{
+	struct smbios_sysfs_entry *entry = to_entry(kobj);
+	sysfs_remove_bin_file(&entry->kobj, &smbios_entry_raw_attr);
+	spin_lock(&entry_list_lock);
+	list_del(&entry->list);
+	spin_unlock(&entry_list_lock);
+	kfree(entry);
+}
+
+static struct kobj_type smbios_sysfs_entry_ktype = {
+	.release = smbios_sysfs_entry_release,
+	.sysfs_ops = &smbios_sysfs_attr_ops,
+	.default_attrs = smbios_sysfs_entry_attrs,
+};
+
+static struct kobject *smbios_kobj;
+static struct kset *smbios_kset;
+
+/* Global count of all instances seen.  Only for setup */
+static int __initdata instance_counts[MAX_ENTRY_TYPE + 1];
+
+/* Global positional count of all entries seen.  Only for setup */
+static int __initdata position_count;
+
+static int __init smbios_sysfs_register_handle(const union smbios_struct *ss,
+					       void *_ret)
+{
+	struct smbios_sysfs_entry *entry;
+	int *ret = _ret;
+
+	/* Allocate and register a new entry into the entries set */
+	entry = kzalloc(sizeof(*entry), GFP_KERNEL);
+	if (!entry) {
+		*ret = -ENOMEM;
+		return SMBIOS_WALK_STOP;
+	}
+
+	/* Set the key */
+	memcpy(&entry->dh, &ss->header, sizeof(struct smbios_header));
+	entry->instance = instance_counts[ss->header.type]++;
+	entry->position = position_count++;
+
+	entry->kobj.kset = smbios_kset;
+	*ret = kobject_init_and_add(&entry->kobj, &smbios_sysfs_entry_ktype,
+				    NULL,
+				    "%d-%d", ss->header.type, entry->instance);
+
+	if (*ret) {
+		kfree(entry);
+		return SMBIOS_WALK_STOP;
+	}
+
+	/* Thread on the global list for cleanup */
+	spin_lock(&entry_list_lock);
+	list_add_tail(&entry->list, &entry_list);
+	spin_unlock(&entry_list_lock);
+
+	/* Handle specializations by type */
+	switch (ss->header.type) {
+	case 15:
+		/* System Event Log */
+		*ret = smbios_system_event_log(entry);
+		break;
+	default:
+		/* No specialization */
+		break;
+	}
+	if (*ret)
+		goto out_err;
+
+	/* Create the raw binary file to access the entry */
+	*ret = sysfs_create_bin_file(&entry->kobj, &smbios_entry_raw_attr);
+	if (*ret)
+		goto out_err;
+
+	return SMBIOS_WALK_CONTINUE;
+out_err:
+	kobject_put(entry->child);
+	kobject_put(&entry->kobj);
+	return SMBIOS_WALK_STOP;
+}
+
+static void cleanup_entry_list(void)
+{
+	struct smbios_sysfs_entry *entry, *next;
+
+	/* No locks, we are on our way out */
+	list_for_each_entry_safe(entry, next, &entry_list, list) {
+		kobject_put(entry->child);
+		kobject_put(&entry->kobj);
+	}
+}
+
+static int __init smbios_sysfs_init(void)
+{
+	int error = -ENOMEM;
+	int val, ret;
+	const union smbios_struct *ss;
+
+	/* Set up our directory */
+	smbios_kobj = kobject_create_and_add("smbios", firmware_kobj);
+	if (!smbios_kobj)
+		goto err;
+
+	smbios_kset = kset_create_and_add("entries", NULL, smbios_kobj);
+	if (!smbios_kset)
+		goto err;
+
+	val = 0;
+	ss = smbios_walk(smbios_sysfs_register_handle, &val);
+	if (ss) {
+		error = -EIO;
+		goto err;
+	}
+	if (val) {
+		error = val;
+		goto err;
+	}
+
+#ifdef CONFIG_SYSTEM_FIRMWARE_DMI_COMPAT
+	ret = sysfs_create_link(firmware_kobj, smbios_kobj, "dmi");
+	if (!ret)
+		pr_debug("smbios-sysfs: DMI compatibility failed.\n");
+#endif
+	pr_debug("smbios-sysfs: loaded.\n");
+
+	return 0;
+err:
+	cleanup_entry_list();
+	kset_unregister(smbios_kset);
+	kobject_put(smbios_kobj);
+	return error;
+}
+
+/* clean up everything. */
+static void __exit smbios_sysfs_exit(void)
+{
+	pr_debug("smbios-sysfs: unloading.\n");
+	cleanup_entry_list();
+	kset_unregister(smbios_kset);
+	kobject_put(smbios_kobj);
+}
+
+module_init(smbios_sysfs_init);
+module_exit(smbios_sysfs_exit);
+
+MODULE_AUTHOR("Mike Waychison <mikew@google.com>");
+MODULE_DESCRIPTION("SMBIOS sysfs support");
+MODULE_LICENSE("GPL");
diff --git a/drivers/firmware/smbios.c b/drivers/firmware/smbios.c
new file mode 100644
index 0000000..ff83ae5
--- /dev/null
+++ b/drivers/firmware/smbios.c
@@ -0,0 +1,687 @@
+/*
+ * SMBIOS support
+ *
+ * started by Prarit Bhargava, Copyright (C) 2011 Red Hat, Inc.
+ *
+ * SMBIOS interpretation
+ *
+ * Some bits copied directly from original dmi*.c files
+ */
+#include <linux/types.h>
+#include <linux/string.h>
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/ctype.h>
+#include <linux/smbios.h>
+#include <linux/efi.h>
+#include <linux/bootmem.h>
+#include <linux/sysfw.h>
+#include <linux/pci.h>
+
+#include <asm/smbios.h>
+
+/*
+ * "The SMBIOS Specification addresses how motherboard and system vendors
+ * present management information about their products in a standard format by
+ * extending the BIOS interface on x86 architecture systems. The information is
+ * intended to allow generic instrumentation to deliver this information to
+ * management applications that use DMI, CIM or direct access, eliminating the
+ * need for error prone operations like probing system hardware for presence
+ * detection."
+ *
+ * From http://www.dmtf.org/standards/smbios
+ *
+ * ... Grab the Spec.  It'll help.
+ */
+
+/*
+ * SMBIOS Structure Table Entry Point, STEP
+ */
+struct smbios_step {
+	char	anchor_string[4];	/* 0x0, always is "_SM_" */
+	u8	checksum;
+	u8	length;
+	u8	major;
+	u8	minor;
+	u16	max_size;
+	u8	eps_revision;
+	u8	reserved[5];
+	u8	dmi_string[5];		/* 0x10, always is "_DMI_" */
+	u8	intermediate_chksum;
+	u16	struct_len;
+	u32	struct_addr;
+	u16	num_structs;
+	u8	bcd_revision;
+} __packed;
+static struct smbios_step smbios_step;
+
+/* is there an SMBIOS? */
+int smbios_available;
+EXPORT_SYMBOL_GPL(smbios_available);
+
+/* Address of the actual SMBIOS struct */
+static unsigned long smbios_addr;
+
+/* Start address of the SMBIOS tables */
+static u32 smbios_base;
+/* Length of the all the SMBIOS tables */
+static u16 smbios_len;
+/* Number of SMBIOS tables */
+static u16 smbios_num;
+/*
+ * This is the BRK space or IO mapped address of the SMBIOS table.  SMBIOS is
+ * switched from BRK space and into the IO map in smbios_init_late().  After
+ * it is IO mapped, it MUST NOT be unmapped (o/w very bad things will happen).
+ */
+static u8 *smbios_map;
+
+/* We need to store the type field and the UUID somewhere. */
+static char smbios_type3_type[4];
+static char smbios_type1_uuid[16*2+4+1];
+
+/** find the first SMBIOS structure of a specific type */
+const union smbios_struct *smbios_find_struct(int type)
+{
+	int size = sizeof(struct smbios_header);
+	int i = 0;
+	u8 *data = smbios_map;
+	struct smbios_header *dm = NULL;
+
+	/*
+	 *	Stop when we see all the items the table claimed to have
+	 *	OR we run off the end of the table (also happens)
+	 */
+	while ((i < smbios_num) &&
+	       (data - smbios_map + size) <= smbios_len) {
+		dm = (struct smbios_header *)data;
+
+		/*
+		 *  We want to know the total length (formatted area and
+		 *  strings) before returning to make sure we don't return
+		 *  a partial structure
+		 */
+		data += dm->length;
+		while ((data - smbios_map < smbios_len - 1) &&
+		       (data[0] || data[1]))
+			data++;
+		if ((data - smbios_map < smbios_len - 1) &&
+		    (type == dm->type)) {
+			break;
+		}
+		data += 2;
+		i++;
+	}
+	/* just return the address */
+	return (const union smbios_struct *)dm;
+}
+
+static const char smbios_empty_string[] = "        ";
+
+/**
+ * smbios_get_string -- return a string from an SMBIOS structure
+ * @ss: pointer to structure being examined
+ * @s: number of string being examined
+ *
+ * This function returns a string within the structure ss.  Many SMBIOS
+ * structures have their strings at the end of the structure, and the location
+ * of each string is enumerated throughout the structure.
+ *
+ * For example,  The BIOS Information structure, type0, has the BIOS Version
+ * at offset 0x6, which contains a number enumerating the strings at the end
+ * of the structure.
+ *
+ * ie) s is an actual _number_, not a pointer.
+ */
+const char *smbios_get_string(const union smbios_struct *ss, u8 s)
+{
+	const u8 *bp = ((u8 *) ss) + ss->header.length;
+
+	if (s) {
+		s--;
+		while (s > 0 && *bp) {
+			bp += strlen(bp) + 1;
+			s--;
+		}
+
+		if (*bp != 0) {
+			size_t len = strlen(bp)+1;
+			size_t cmp_len = len > 8 ? 8 : len;
+
+			if (!memcmp(bp, smbios_empty_string, cmp_len))
+				return smbios_empty_string;
+			return bp;
+		}
+	}
+
+	return "";
+}
+EXPORT_SYMBOL(smbios_get_string);
+
+#define smbios_find_ptr(_ptr, _struct_name, _type, _field)		 \
+	_struct_name = smbios_find_struct(_type);			 \
+	_ptr = smbios_get_string(_struct_name,				 \
+				 _struct_name->type##_type._field);
+
+static const char *smbios_sysfw_lookup(int field)
+{
+	const union smbios_struct *ss;
+	const u8 *ptr;
+
+	switch (field) {
+	case SYSFW_BIOS_VENDOR:
+		smbios_find_ptr(ptr, ss, 0, vendor);
+		break;
+	case SYSFW_BIOS_VERSION:
+		smbios_find_ptr(ptr, ss, 0, bios_version);
+		break;
+	case SYSFW_BIOS_DATE:
+		smbios_find_ptr(ptr, ss, 0, bios_release_date);
+		break;
+	case SYSFW_SYS_VENDOR:
+		smbios_find_ptr(ptr, ss, 1, manufacturer);
+		break;
+	case SYSFW_PRODUCT_NAME:
+		smbios_find_ptr(ptr, ss, 1, product_name);
+		break;
+	case SYSFW_PRODUCT_VERSION:
+		smbios_find_ptr(ptr, ss, 1, version);
+		break;
+	case SYSFW_PRODUCT_SERIAL:
+		smbios_find_ptr(ptr, ss, 1, serial_number);
+		break;
+	case SYSFW_PRODUCT_UUID:
+		ptr = smbios_type1_uuid;
+		break;
+	case SYSFW_BOARD_VENDOR:
+		smbios_find_ptr(ptr, ss, 2, manufacturer);
+		break;
+	case SYSFW_BOARD_NAME:
+		smbios_find_ptr(ptr, ss, 2, product);
+		break;
+	case SYSFW_BOARD_VERSION:
+		smbios_find_ptr(ptr, ss, 2, version);
+		break;
+	case SYSFW_BOARD_SERIAL:
+		smbios_find_ptr(ptr, ss, 2, serial_number);
+		break;
+	case SYSFW_BOARD_ASSET_TAG:
+		smbios_find_ptr(ptr, ss, 2, asset_tag);
+		break;
+	case SYSFW_CHASSIS_VENDOR:
+		smbios_find_ptr(ptr, ss, 3, manufacturer);
+		break;
+	case SYSFW_CHASSIS_TYPE:
+		ptr = smbios_type3_type;
+		break;
+	case SYSFW_CHASSIS_VERSION:
+		smbios_find_ptr(ptr, ss, 3, version);
+		break;
+	case SYSFW_CHASSIS_SERIAL:
+		smbios_find_ptr(ptr, ss, 3, serial_number);
+		break;
+	case SYSFW_CHASSIS_ASSET_TAG:
+		smbios_find_ptr(ptr, ss, 3, asset_tag_number);
+		break;
+	case SYSFW_STRING_MAX:
+	case SYSFW_NONE:
+	default:
+		ptr = NULL;
+		break;
+	}
+
+	return (const char *)ptr;
+}
+
+/* returns date in formation YYYYMMDD for easy comparisons */
+static int smbios_sysfw_get_date(void)
+{
+	const char *smbios_date;
+	int date, d, m, y;
+
+	/* SMBIOS BIOS DATE is in DD/MM/YYYY format */
+	smbios_date = smbios_sysfw_lookup(SYSFW_BIOS_DATE);
+	if (!smbios_date)
+		return 0;
+
+	sscanf(smbios_date, "%d/%d/%d", &d, &m, &y);
+	date = (y * 10000 + m * 100 + d);
+	return date;
+}
+
+static int __init smbios_sysfw_late(void)
+{
+	if (!smbios_available)
+		return -1;
+
+	/* This looks strange but we're unmapping the BRK space and
+	 * then mapping into memory after the memory subsystem has been
+	 * initialized. */
+	smbios_iounmap(smbios_map, smbios_len);
+	smbios_map = ioremap(smbios_base, smbios_len);
+	if (!smbios_map) {
+		smbios_available = 0;
+		WARN(1, "SMBIOS ioremap failed.");
+		return -ENOMEM;
+	}
+	return 0;
+}
+
+/* print pretty things */
+static void __init print_filtered(const char *info)
+{
+	const char *p;
+
+	if (!info)
+		return;
+
+	for (p = info; *p; p++)
+		if (isprint(*p))
+			printk(KERN_CONT "%c", *p);
+		else
+			printk(KERN_CONT "\\x%02x", *p & 0xff);
+}
+
+/* Dump some basic system information at the beginning of boot */
+static void __init smbios_boot_display(void)
+{
+	const char *board;	/* Board Name is optional */
+
+	if (smbios_available)
+		printk(KERN_DEBUG "SMBIOS: ");
+	else
+		printk(KERN_DEBUG "DMI: ");
+	print_filtered(smbios_sysfw_lookup(SYSFW_SYS_VENDOR));
+	printk(KERN_CONT " ");
+	print_filtered(smbios_sysfw_lookup(SYSFW_PRODUCT_NAME));
+	board = smbios_sysfw_lookup(SYSFW_BOARD_NAME);
+	if (board) {
+		printk(KERN_CONT "/");
+		print_filtered(board);
+	}
+	printk(KERN_CONT ", BIOS ");
+	print_filtered(smbios_sysfw_lookup(SYSFW_BIOS_VERSION));
+	printk(KERN_CONT " ");
+	print_filtered(smbios_sysfw_lookup(SYSFW_BIOS_DATE));
+	printk(KERN_CONT "\n");
+}
+
+static int __init smbios_sysfw_init(void)
+{
+	smbios_boot_display();
+	printk(KERN_INFO "Registered SMBIOS sysfw driver\n");
+	return 0;
+}
+
+static struct sysfw_driver __refdata smbios_sysfw_driver = {
+	.name = "smbios",
+	.init = smbios_sysfw_init,
+	.late = smbios_sysfw_late,
+	.lookup = smbios_sysfw_lookup,
+	.date = smbios_sysfw_get_date,
+};
+
+/*
+ * There are two special "core" values, that require their own strings.
+ * These are SYSFW_CHASSIS_TYPE(ss->type3->type) and
+ * SYSFW_PRODUCT_UUID(ss->type1->uuid).
+ */
+static void smbios_decode_core(void)
+{
+	const union smbios_struct *ss;
+
+	/* SYSFW_CHASSIS_TYPE */
+	ss = smbios_find_struct(3);
+	sprintf(smbios_type3_type, "%u", ss->type3.type & 0x7f);
+	/* SYSFW_PRODUCT_UUID */
+	ss = smbios_find_struct(1);
+	sprintf(smbios_type1_uuid, "%pUB", ss->type1.uuid);
+}
+
+/* This is only useful for legacy DMI table decoding. */
+static int __init dmi_checksum(const u8 *buf)
+{
+	u8 sum = 0;
+	int a;
+
+	for (a = 0; a < 15; a++)
+		sum += buf[a];
+
+	return sum == 0;
+}
+
+/* This is only useful for legacy DMI table decoding. */
+static int __init dmi_present(const char __iomem *p)
+{
+	u8 buf[15];
+
+	memcpy_fromio(buf, p, 15);
+	if ((memcmp(buf, "_DMI_", 5) == 0) && dmi_checksum(buf)) {
+		/* use smbios_ even though it's really dmi_ */
+		smbios_num = (buf[13] << 8) | buf[12];
+		smbios_len = (buf[7] << 8) | buf[6];
+		smbios_base = (buf[11] << 24) | (buf[10] << 16) |
+			(buf[9] << 8) | buf[8];
+
+		printk(KERN_INFO "DMI %d.%d present.\n", buf[14] >> 4,
+		       buf[14] & 0xF);
+
+		smbios_map = smbios_ioremap(smbios_base, smbios_len);
+		if (!smbios_map)
+			return -ENOMEM;
+		smbios_boot_display();
+	}
+	return 1;
+}
+
+/* Check and decode the SMBIOS STEP function */
+static int __init smbios_decode_step(void)
+{
+	u8 chksum1, chksum2, *buf, fp;
+
+	if (!smbios_addr)
+		return -ENODEV;
+
+	buf = smbios_ioremap(smbios_addr, sizeof(struct smbios_step));
+	if (!buf)
+		return -ENODEV;
+
+	memcpy(&smbios_step, buf, sizeof(struct smbios_step));
+
+	/* checksum the entire STEP structure */
+	chksum1 = 0;
+	for (fp = 0; fp < smbios_step.length; fp++)
+		chksum1 += buf[fp];
+	if (chksum1) {
+		smbios_iounmap(buf, sizeof(struct smbios_step));
+		WARN(1, "SMBIOS: Invalid STEP table checksum = %u\n", chksum1);
+		return -EINVAL;
+	}
+
+	/* checksum the Intermediate structure */
+	chksum2 = 0;
+	for (fp = 0x10; fp < smbios_step.length; fp++)
+		chksum2 += buf[fp];
+	if (chksum2) {
+		smbios_iounmap(buf, sizeof(struct smbios_step));
+		WARN(1, "SMBIOS: Invalid Intermediate checksum = %u\n",
+		     chksum2);
+		return -EINVAL;
+	}
+
+	smbios_iounmap(buf, sizeof(struct smbios_step));
+
+	printk(KERN_INFO "SMBIOS: version %u.%u @ 0x%lX | %d structures\n",
+	       smbios_step.major, smbios_step.minor, smbios_addr,
+	       smbios_step.num_structs);
+
+	smbios_num = smbios_step.num_structs;
+	smbios_len = smbios_step.struct_len;
+	smbios_base = smbios_step.struct_addr;
+
+	/*
+	 * Need to map smbios_map for the smbios_walk() and other potential
+	 * early callers.  This is unmapped, and ioremap'ed in the late call.
+	 */
+	smbios_map = smbios_ioremap(smbios_base, smbios_len);
+	if (!smbios_map) {
+		printk(KERN_INFO "SMBIOS tables are invalid.\n");
+		return -ENOMEM;
+	}
+	smbios_available = 1;
+
+	return 0;
+}
+
+/**
+ * smbios_init - Initialize the SMBIOS code and register a sysfw driver
+ *
+ * This function looks for the SMBIOS tables, maps them, and registers a
+ * System Firmware driver.
+ */
+int __init smbios_init(void)
+{
+	u8 *buf;
+	int fp = 0, rc;
+	int ret = 0;
+	int smbios_present = 0;
+
+	if (efi_enabled) {
+		if (efi.smbios == EFI_INVALID_TABLE_ADDR) {
+			ret = -ENODEV;
+			goto error;
+		}
+		smbios_addr = efi.smbios;
+	} else {
+		/*
+		 * Legacy SMBIOS is mapped @ 0xF0000, but may not
+		 * necessarily be _at_ 0xF0000
+		 */
+		smbios_addr = 0xF0000;
+	}
+	buf = smbios_ioremap(smbios_addr, SMBIOS_SIZE);
+	if (!buf) {
+		ret = -ENODEV;
+		goto error;
+	}
+
+	/* Find the SMBIOS entry point */
+	for (fp = 0; fp <= 0xFFF0; fp += 0x10) {
+		if (!memcmp(buf + fp, "_SM_", 4)) {
+			smbios_addr += fp;
+			smbios_present = 1;
+			break;
+		}
+	}
+	smbios_iounmap(buf, SMBIOS_SIZE);
+
+	if (smbios_present) {
+		rc = smbios_decode_step();
+		if (rc)
+			return -ENODEV;
+		rc = sysfw_driver_register(&smbios_sysfw_driver);
+		if (rc)
+			return rc;
+		smbios_decode_core();
+	} else {
+		/*
+		 * SMBIOS has been around since the 1990s.  The likelihood
+		 * of there being a DMI table not embedded in a SMBIOS table
+		 * is extremely unlikely, but the old code did look for this
+		 * and there is at least a possibility of a system out there
+		 * like this ... so check to see if an old legacy _DMI_ table
+		 * is available.
+		 *
+		 * XXX: Hopefully we can get rid of this one day.
+		 */
+		buf = smbios_ioremap(smbios_addr, SMBIOS_SIZE);
+		if (!buf) {
+			ret = -ENODEV;
+			goto error;
+		}
+
+		/* Find the DMI entry point */
+		for (fp = 0; fp <= 0xFFF0; fp += 0x10) {
+			if (dmi_present(buf + fp)) {
+				smbios_addr += fp;
+				break;
+			}
+		}
+		smbios_iounmap(buf, SMBIOS_SIZE);
+	}
+error:
+	if (!smbios_present)
+		printk(KERN_INFO "SMBIOS not present.");
+	return ret;
+
+}
+
+/**
+ * smbios_walk - executes a function for each SMBIOS structure
+ * @decode: Function to execute
+ * private_data: data passed into decode function
+ *
+ * This function walks the SMBIOS structures and executes decode on each
+ * structure.  This should have minimal usage in the kernel.  Unless you have
+ * need to access the raw SMBIOS data, you should use sysfw_lookup() or
+ * sysfw_callback().
+ */
+const union smbios_struct
+*smbios_walk(int (*decode)(const union smbios_struct *, void *),
+			   void *private_data)
+{
+	u8 *data = smbios_map;
+	int size = sizeof(struct smbios_header);
+	int i = 0;
+	int ret = SMBIOS_WALK_CONTINUE;
+	const union smbios_struct *ss = NULL;
+
+	/*
+	 * Stop when we see all the items the table claimed to have
+	 * OR we run off the end of the table (also happens)
+	 */
+	while ((i < smbios_num) &&
+	       (data - smbios_map + size) <= smbios_len) {
+		const struct smbios_header *dm;
+
+		/*
+		 *  We want to know the total length (formatted area and
+		 *  strings) before decoding to make sure we won't run off the
+		 *  table
+		 */
+		dm = (const struct smbios_header *)data;
+		data += dm->length;
+		while ((data - smbios_map < smbios_len - 1) &&
+		       (data[0] || data[1]))
+			data++;
+		if (data - smbios_map < smbios_len - 1) {
+			ret = decode((union smbios_struct *)dm, private_data);
+			if (ret == SMBIOS_WALK_STOP) {
+				ss = (union smbios_struct *)dm;
+				break;
+			}
+		}
+		data += 2;
+		i++;
+	}
+
+	return ss;
+}
+EXPORT_SYMBOL_GPL(smbios_walk);
+
+/*
+ * Helper Functions -- We really don't want a lot of these, but structs like
+ * the OEM Strings have a lot of elements and multiple drivers need to
+ * grep through them for string matches.  Might as well do all of this in
+ * one place.
+ */
+
+/*
+ * This seems really general and currently has only two specific needs
+ * in the kernel (type10 and type11).  But looking at other structs we'll need
+ * this for those as well.
+ */
+struct _smbios_strings {
+	int type;
+	int (*count_fn)(const union smbios_struct *ss);
+	const char *in;
+	const char *out;
+};
+
+/* returns SMBIOS_WALK_STOP & match->out != NULL on string match success */
+static int _match_string(const union smbios_struct *ss, void *_match)
+{
+	int i;
+	const char *str;
+	struct _smbios_strings *match = (struct _smbios_strings *)_match;
+
+	if (ss->header.type != match->type)
+		return SMBIOS_WALK_CONTINUE;
+
+	BUG_ON(!match->count_fn);
+
+	for (i = 1; i <= match->count_fn(ss); i++) {
+		str = smbios_get_string(ss, i);
+		if (!strncmp(match->in, str, strlen(match->in))) {
+			match->out = str;
+			return SMBIOS_WALK_STOP;
+		}
+	}
+
+	return SMBIOS_WALK_CONTINUE;
+}
+
+static int type10_count_fn(const union smbios_struct *ss)
+{
+	/*
+	 * From SMBIOS Specification: The user of this structure determines the
+	 * the number of devices as (Length - 4)/2.
+	 */
+	return (ss->header.length - 4) / 2;
+}
+
+const char *smbios_match_type10_string(const char *match, int check_disabled)
+{
+	struct _smbios_strings _match = {
+		.in = match,
+		.out = NULL,
+		.type = 10,
+		.count_fn = type10_count_fn,
+	};
+	const union smbios_struct *ss;
+
+	ss = smbios_walk(_match_string, (void *)&_match);
+	if ((ss && check_disabled) || (ss && (ss->type10.device_type & 0x80)))
+		return _match.out;
+	return NULL;
+}
+
+/** smbios_is_onboard_device - Determines if a device is on (soldered on)
+ * @match: string to match
+ * @check_disabled_devices: match against devices marked disabled in structure
+ *
+ * This function returns true if the string passed in matches a device
+ * that the SMBIOS recognizes as being on board (soldered on).  The function
+ * also can ignore SMBIOS's information about whether or not a device is
+ * disabled in order to workaround broken BIOSes.
+ *
+ * Note: This currently only looks at the type 10 structure.
+ */
+bool smbios_is_onboard_device(const char *match, int check_disabled_devices)
+{
+	const char *ret;
+
+	ret = smbios_match_type10_string(match, check_disabled_devices);
+	if (ret)
+		return true;
+	return false;
+}
+EXPORT_SYMBOL_GPL(smbios_is_onboard_device);
+
+static int type11_count_fn(const union smbios_struct *ss)
+{
+	return ss->type11.count;
+}
+
+/**
+ * smbios_match_oem_string - match a string with the OEM strings provided by
+ * @match: string to match
+ *
+ * This function returns the matching SMBIOS string if the string passed in
+ * matches the OEM strings provided by the SMBIOS.
+ */
+const char *smbios_match_oem_string(const char *match)
+{
+	struct _smbios_strings _match = {
+		.in = match,
+		.out = NULL,
+		.type = 11,
+		.count_fn = type11_count_fn,
+	};
+	const union smbios_struct *ss;
+
+	ss = smbios_walk(_match_string, (void *)&_match);
+	if (ss)
+		return _match.out;
+	return NULL;
+}
+EXPORT_SYMBOL_GPL(smbios_match_oem_string);
diff --git a/include/linux/smbios.h b/include/linux/smbios.h
new file mode 100644
index 0000000..180a5d8
--- /dev/null
+++ b/include/linux/smbios.h
@@ -0,0 +1,243 @@
+/*
+ * linux/include/smbios.h
+ *
+ * "The SMBIOS Specification addresses how motherboard and system vendors
+ * present management information about their products in a standard format by
+ * extending the BIOS interface on x86 architecture systems. The information is
+ * intended to allow generic instrumentation to deliver this information to
+ * management applications that use DMI, CIM or direct access, eliminating the
+ * need for error prone operations like probing system hardware for presence
+ * detection."
+ *
+ * From http://www.dmtf.org/standards/smbios
+ *
+ * ... Grab the Spec.  It'll help.
+ */
+#ifndef __SMBIOS_H__
+#define __SMBIOS_H__
+
+#include <linux/mod_devicetable.h>
+
+/* struct smbios_step (SMBIOS STEP) is defined in drivers/firmware/smbios.c */
+/* enum sysfw_field (SYSFW_BIOS_VENDOR, etc.) is in mod_devicetable.h */
+
+/* max size of SMBIOS as specified in SMBIOS Specification */
+#define SMBIOS_SIZE 0x10000
+
+struct smbios_header {
+	u8 type;
+	u8 length;
+	u16 handle;
+} __attribute__((__packed__));
+
+/* UNION of SMBIOS types as listed in SMBIOS Specification. */
+union smbios_struct {
+	struct smbios_header header;
+	struct { /* BIOS Information */
+		struct smbios_header header;
+		u8 vendor;
+		u8 bios_version;
+		u16 bios_starting_address_segment;
+		u8 bios_release_date;
+		u8 bios_rom_size;
+		u32 bios_characteristics;
+		u16 bios_characteristics_extension_bytes;
+		u8 system_bios_major_release;
+		u8 system_bios_minor_release;
+		u8 embedded_controller_firmware_major_release;
+		u8 embedded_controller_firmware_minor_release;
+	} __attribute__((__packed__)) type0;
+	struct { /* System Information */
+		struct smbios_header header;
+		u8 manufacturer;
+		u8 product_name;
+		u8 version;
+		u8 serial_number;
+		u8 uuid[16];
+		u8 wake_up_type;
+		u8 sku_number;
+	} __attribute__((__packed__)) type1;
+	struct { /* Baseboard (or Module) Information */
+		struct smbios_header header;
+		u8 manufacturer;
+		u8 product;
+		u8 version;
+		u8 serial_number;
+		u8 asset_tag;
+		u8 feature_flags;
+	} __attribute__((__packed__)) type2;
+	struct { /* System Enclosure of Chassis */
+		struct smbios_header header;
+		u8 manufacturer;
+		u8 type;
+		u8 version;
+		u8 serial_number;
+		u8 asset_tag_number;
+		u8 boot_up_state;
+		u8 power_supply_state;
+		u8 thermal_state;
+		u8 security_status;
+		u8 oem_defined;
+		u8 height;
+		u8 number_of_power_cords;
+		u8 contained_element_count;
+		u8 contained_element_record;
+		/* contained elements = contained_element_count X */
+		/*			contained_element_record  */
+		u8 contained_elements;
+		/* u8 sku_number is allocated after that	  */
+	} __attribute__((__packed__)) type3;
+	struct { /* System Slots */
+		struct smbios_header header;
+		u8 slot_designation;
+		u8 slot_type;
+		u8 slot_data_bus_width;
+		u8 current_usage;
+		u8 slot_length;
+		u16 slot_id;
+		u8 slot_characteristics_1;
+		u8 slot_characteristics_2;
+		u16 segment_group_number;
+		u8 bus_number;
+		u8 device_function_number;
+	} __attribute__((__packed__)) type9;
+	struct { /* On Board Devices Information (Obsolete) */
+		struct smbios_header header;	/* count = (length - 4)/2 */
+		u8 device_type;			/* one for each device */
+		/* strings at end of struct, one per device */
+	} __attribute__((__packed__)) type10;
+	struct { /* OEM Strings */
+		struct smbios_header header;
+		u8 count;
+		u8 start;
+		/* variable number (equal to count) strings listed here */
+	} __attribute__((__packed__)) type11;
+	struct { /* IPMI Device Information - BMC Interface Type */
+		struct smbios_header header;
+		u8 interface_type;
+		u8 ipmi_specification_revision;
+		u8 i2c_slave_address;
+		u8 nv_storage_device_address;
+		u32 base_address;
+		union {
+			u8 base_address_modifier;
+			u8 interrupt_info;
+		};
+		u8 interrupt_number;
+	} __attribute__((__packed__)) type38;
+	struct { /* Onboard Devices Extended Information */
+		struct smbios_header header;
+		u8 reference_designation; /* "silkscreen label */
+		u8 device_type;
+		u8 device_type_instance;
+		u16 segment_group_number;
+		u8 bus_number;
+		u8 device_function_number;
+	} __attribute__((__packed__)) type41;
+};
+
+/* enum used for returns in smbios_walk decode() function */
+enum smbios_walk_value {
+	SMBIOS_WALK_CONTINUE = 0,	/* continue executing in smbios_walk */
+	SMBIOS_WALK_STOP,		/* stop executing and return */
+};
+
+#ifdef CONFIG_SMBIOS
+
+/* is there an SMBIOS on this system? */
+extern int smbios_available;
+
+/**
+ * smbios_get_string -- return a string from an SMBIOS structure
+ * @ss: pointer to structure being examined
+ * @s: number of string being examined
+ *
+ * This function returns a string within the structure ss.  Many SMBIOS
+ * structures have their strings at the end of the structure, and the location
+ * of each string is enumerated throughout the structure.
+ *
+ * For example,  The BIOS Information structure, type0, has the BIOS Version
+ * at offset 0x6, which contains a number enumerating the strings at the end
+ * of the structure.
+ *
+ * ie) s is an actual _number_, not a pointer.
+ */
+extern const char *smbios_get_string(const union smbios_struct *ss, u8 s);
+
+/**
+ * smbios_init - Initialize the SMBIOS code and register a sysfw driver
+ *
+ * This function looks for the SMBIOS tables, maps them, and registers a
+ * System Firmware driver.
+ */
+extern int smbios_init(void);
+
+/**
+ * smbios_walk - executes a function for each SMBIOS structure
+ * @decode: Function to execute
+ * private_data: data passed into decode function
+ *
+ * This function walks the SMBIOS structures and executes decode on each
+ * structure.  If you are looking for a specific unique type of structure,
+ * you should use smbios_find_struct().
+ *
+ * This should have minimal usage in the kernel.  The only reason this should
+ * be used is if you need access the raw SMBIOS data.  Otherwise you should
+ * use sysfw_lookup() or sysfw_callback().
+ */
+extern const union smbios_struct *
+smbios_walk(int (*decode)(const union smbios_struct *, void *),
+	    void *private_data);
+
+/* Helper Functions */
+
+/** smbios_is_onboard_device - Determines if a device is on (soldered on)
+ * @match: string to match
+ * @check_disabled_devices: match against devices marked disabled in structure
+ *
+ * This function returns true if the string passed in matches a device
+ * that the SMBIOS recognizes as being on board (soldered on).  The function
+ * also can ignore SMBIOS's information about whether or not a device is
+ * disabled in order to workaround broken BIOSes.
+ *
+ * XXX: Fix me.  This currently only looks at the type 10 structure.
+ */
+extern bool smbios_is_onboard_device(const char *match,
+				     int check_disabled_devices);
+
+/**
+ * smbios_match_oem_string - match a string with the OEM strings provided by
+ * @match: string to match
+ *
+ * This function returns the matching SMBIOS string if the string passed in
+ * matches the OEM strings provided by the SMBIOS.
+ */
+extern const char *smbios_match_oem_string(const char *match);
+
+#else
+#define smbios_available 0
+static inline const char *smbios_get_string(const union smbios_struct *ss, u8 s)
+{
+	return NULL;
+}
+static inline void smbios_init(void)
+{
+	return;
+}
+static inline const union smbios_struct
+*smbios_walk(int (*decode)(const union smbios_struct *, void *),
+	     void *private_data)
+{
+	return NULL;
+}
+static inline bool smbios_is_onboard_device(const char *match,
+					    int check_disabled_devices)
+{
+	return 0;
+}
+static inline const char *smbios_match_oem_string(const char *match)
+{
+	return NULL;
+}
+#endif
+#endif	/* __SMBIOS_H__ */
-- 
1.6.5.2


^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [PATCH 03/34] arch specific changes for SMBIOS and System Firmware
  2011-07-18 13:08 [PATCH 00/34] System Firmware and SMBIOS Support [v3] Prarit Bhargava
  2011-07-18 13:08 ` [PATCH 01/34] System Firmware Interface Prarit Bhargava
  2011-07-18 13:08 ` [PATCH 02/34] New SMBIOS driver for x86 and ia64 Prarit Bhargava
@ 2011-07-18 13:08 ` Prarit Bhargava
  2011-07-18 13:08 ` [PATCH 04/34] drivers/acpi changes for SMBIOS and System Firmware interface Prarit Bhargava
                   ` (30 subsequent siblings)
  33 siblings, 0 replies; 48+ messages in thread
From: Prarit Bhargava @ 2011-07-18 13:08 UTC (permalink / raw)
  To: linux-kernel; +Cc: Prarit Bhargava, linux-ia64, x86

As part of the new SMBIOS and System Firmware code:

- add in ia64 and x86 calls to initialize SMBIOS
- Replace old dmi* structures and functions with new sysfw* and smbios*
structures and functions in individual drivers
- cleanup sysfw_id lookup tables
- cleanup of includes for dmi.h and mod_devicetable.h which were included in
some files that did not need them

Cc: linux-ia64@vger.kernel.org
Cc: x86@kernel.org
Signed-off-by: Prarit Bhargava <prarit@redhat.com>
---
 arch/ia64/kernel/setup.c           |    8 +-
 arch/x86/include/asm/mmconfig.h    |    4 +-
 arch/x86/include/asm/pci_x86.h     |    6 +-
 arch/x86/kernel/acpi/boot.c        |  177 ++++++++--------
 arch/x86/kernel/acpi/sleep.c       |    1 -
 arch/x86/kernel/apic/apic.c        |   20 +-
 arch/x86/kernel/apic/bigsmp_32.c   |   37 ++--
 arch/x86/kernel/apm_32.c           |  391 ++++++++++++++++++++++--------------
 arch/x86/kernel/cpu/amd.c          |    2 +-
 arch/x86/kernel/cpu/vmware.c       |   17 ++-
 arch/x86/kernel/io_delay.c         |   42 ++--
 arch/x86/kernel/mmconf-fam10h_64.c |   28 ++--
 arch/x86/kernel/probe_roms.c       |    1 -
 arch/x86/kernel/process.c          |    8 +-
 arch/x86/kernel/reboot.c           |  132 +++++++------
 arch/x86/kernel/setup.c            |   14 +-
 arch/x86/kernel/tsc.c              |   16 +-
 arch/x86/pci/acpi.c                |   18 +-
 arch/x86/pci/broadcom_bus.c        |    1 -
 arch/x86/pci/common.c              |  163 ++++++++--------
 arch/x86/pci/direct.c              |    7 +-
 arch/x86/pci/fixup.c               |   33 ++--
 arch/x86/pci/init.c                |    4 +-
 arch/x86/pci/irq.c                 |   26 ++--
 arch/x86/pci/mmconfig-shared.c     |   10 +-
 arch/x86/pci/mrst.c                |    1 -
 drivers/cpufreq/acpi-cpufreq.c     |   16 +-
 drivers/cpufreq/powernow-k7.c      |   14 +-
 28 files changed, 657 insertions(+), 540 deletions(-)

diff --git a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c
index 5e2c724..e170fcc 100644
--- a/arch/ia64/kernel/setup.c
+++ b/arch/ia64/kernel/setup.c
@@ -36,7 +36,7 @@
 #include <linux/string.h>
 #include <linux/threads.h>
 #include <linux/screen_info.h>
-#include <linux/dmi.h>
+#include <linux/smbios.h>
 #include <linux/serial.h>
 #include <linux/serial_core.h>
 #include <linux/efi.h>
@@ -1043,9 +1043,9 @@ check_bugs (void)
 			       (unsigned long) __end___mckinley_e9_bundles);
 }
 
-static int __init run_dmi_scan(void)
+static int __init run_smbios_scan(void)
 {
-	dmi_scan_machine();
+	smbios_init();
 	return 0;
 }
-core_initcall(run_dmi_scan);
+core_initcall(run_smbios_scan);
diff --git a/arch/x86/include/asm/mmconfig.h b/arch/x86/include/asm/mmconfig.h
index 9b119da..1831965 100644
--- a/arch/x86/include/asm/mmconfig.h
+++ b/arch/x86/include/asm/mmconfig.h
@@ -3,10 +3,10 @@
 
 #ifdef CONFIG_PCI_MMCONFIG
 extern void __cpuinit fam10h_check_enable_mmcfg(void);
-extern void __cpuinit check_enable_amd_mmconf_dmi(void);
+extern void __cpuinit check_enable_amd_pci_mmconf(void);
 #else
 static inline void fam10h_check_enable_mmcfg(void) { }
-static inline void check_enable_amd_mmconf_dmi(void) { }
+static inline void check_enable_amd_pci_mmconf(void) { }
 #endif
 
 #endif /* _ASM_X86_MMCONFIG_H */
diff --git a/arch/x86/include/asm/pci_x86.h b/arch/x86/include/asm/pci_x86.h
index 7045267..28e3f3a 100644
--- a/arch/x86/include/asm/pci_x86.h
+++ b/arch/x86/include/asm/pci_x86.h
@@ -39,7 +39,7 @@ enum pci_bf_sort_state {
 	pci_bf_sort_default,
 	pci_force_nobf,
 	pci_force_bf,
-	pci_dmi_bf,
+	pci_smbios_bf,
 };
 
 /* pci-i386.c */
@@ -109,8 +109,8 @@ extern bool port_cf9_safe;
 extern int pci_direct_probe(void);
 extern void pci_direct_init(int type);
 extern void pci_pcbios_init(void);
-extern void __init dmi_check_pciprobe(void);
-extern void __init dmi_check_skip_isa_align(void);
+extern void __init smbios_check_pciprobe(void);
+extern void __init smbios_check_skip_isa_align(void);
 
 /* some common used subsys_initcalls */
 extern int __init pci_acpi_init(void);
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c
index 4558f0d..180d4c7 100644
--- a/arch/x86/kernel/acpi/boot.c
+++ b/arch/x86/kernel/acpi/boot.c
@@ -29,7 +29,7 @@
 #include <linux/efi.h>
 #include <linux/cpumask.h>
 #include <linux/module.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include <linux/irq.h>
 #include <linux/slab.h>
 #include <linux/bootmem.h>
@@ -1294,7 +1294,7 @@ static void __init acpi_process_madt(void)
 	return;
 }
 
-static int __init disable_acpi_irq(const struct dmi_system_id *d)
+static int __init disable_acpi_irq(const struct sysfw_id *d)
 {
 	if (!acpi_force) {
 		printk(KERN_NOTICE "%s detected: force use of acpi=noirq\n",
@@ -1304,7 +1304,7 @@ static int __init disable_acpi_irq(const struct dmi_system_id *d)
 	return 0;
 }
 
-static int __init disable_acpi_pci(const struct dmi_system_id *d)
+static int __init disable_acpi_pci(const struct sysfw_id *d)
 {
 	if (!acpi_force) {
 		printk(KERN_NOTICE "%s detected: force use of pci=noacpi\n",
@@ -1314,14 +1314,14 @@ static int __init disable_acpi_pci(const struct dmi_system_id *d)
 	return 0;
 }
 
-static int __init dmi_disable_acpi(const struct dmi_system_id *d)
+static int __init id_disable_acpi(const struct sysfw_id *d)
 {
 	if (!acpi_force) {
 		printk(KERN_NOTICE "%s detected: acpi off\n", d->ident);
 		disable_acpi();
 	} else {
-		printk(KERN_NOTICE
-		       "Warning: DMI blacklist says broken, but acpi forced\n");
+		printk(KERN_NOTICE "Warning: SMBIOS blacklist says broken, "
+		       "but acpi forced\n");
 	}
 	return 0;
 }
@@ -1329,7 +1329,8 @@ static int __init dmi_disable_acpi(const struct dmi_system_id *d)
 /*
  * Force ignoring BIOS IRQ0 pin2 override
  */
-static int __init dmi_ignore_irq0_timer_override(const struct dmi_system_id *d)
+static int __init
+id_ignore_irq0_timer_override(const struct sysfw_id *d)
 {
 	/*
 	 * The ati_ixp4x0_rev() early PCI quirk should have set
@@ -1348,33 +1349,32 @@ static int __init dmi_ignore_irq0_timer_override(const struct dmi_system_id *d)
  * If your system is blacklisted here, but you find that acpi=force
  * works for you, please contact linux-acpi@vger.kernel.org
  */
-static struct dmi_system_id __initdata acpi_dmi_table[] = {
+static struct sysfw_id __initdata acpi_id_table[] = {
 	/*
 	 * Boxes that need ACPI disabled
 	 */
 	{
-	 .callback = dmi_disable_acpi,
-	 .ident = "IBM Thinkpad",
-	 .matches = {
-		     DMI_MATCH(DMI_BOARD_VENDOR, "IBM"),
-		     DMI_MATCH(DMI_BOARD_NAME, "2629H1G"),
-		     },
+		.callback = id_disable_acpi,
+		.ident = "IBM Thinkpad",
+		.matches = {
+			     SYSFW_MATCH(SYSFW_BOARD_VENDOR, "IBM"),
+			     SYSFW_MATCH(SYSFW_BOARD_NAME, "2629H1G"),
+		},
 	 },
-
 	/*
 	 * Boxes that need ACPI PCI IRQ routing disabled
 	 */
 	{
-	 .callback = disable_acpi_irq,
-	 .ident = "ASUS A7V",
-	 .matches = {
-		     DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC"),
-		     DMI_MATCH(DMI_BOARD_NAME, "<A7V>"),
-		     /* newer BIOS, Revision 1011, does work */
-		     DMI_MATCH(DMI_BIOS_VERSION,
-			       "ASUS A7V ACPI BIOS Revision 1007"),
-		     },
-	 },
+		.callback = disable_acpi_irq,
+		.ident = "ASUS A7V",
+		.matches = {
+			SYSFW_MATCH(SYSFW_BOARD_VENDOR, "ASUSTeK Computer INC"),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "<A7V>"),
+			/* newer BIOS, Revision 1011, does work */
+			SYSFW_MATCH(SYSFW_BIOS_VERSION,
+				    "ASUS A7V ACPI BIOS Revision 1007"),
+			},
+	},
 	{
 		/*
 		 * Latest BIOS for IBM 600E (1.16) has bad pcinum
@@ -1382,48 +1382,49 @@ static struct dmi_system_id __initdata acpi_dmi_table[] = {
 		 * interrupt links to work. DSDT fix is in bug 5966.
 		 * 2645, 2646 model numbers are shared with 600/600E/600X
 		 */
-	 .callback = disable_acpi_irq,
-	 .ident = "IBM Thinkpad 600 Series 2645",
-	 .matches = {
-		     DMI_MATCH(DMI_BOARD_VENDOR, "IBM"),
-		     DMI_MATCH(DMI_BOARD_NAME, "2645"),
-		     },
-	 },
+		.callback = disable_acpi_irq,
+		.ident = "IBM Thinkpad 600 Series 2645",
+		.matches = {
+			SYSFW_MATCH(SYSFW_BOARD_VENDOR, "IBM"),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "2645"),
+		},
+	},
 	{
-	 .callback = disable_acpi_irq,
-	 .ident = "IBM Thinkpad 600 Series 2646",
-	 .matches = {
-		     DMI_MATCH(DMI_BOARD_VENDOR, "IBM"),
-		     DMI_MATCH(DMI_BOARD_NAME, "2646"),
-		     },
-	 },
+		.callback = disable_acpi_irq,
+		.ident = "IBM Thinkpad 600 Series 2646",
+		.matches = {
+			SYSFW_MATCH(SYSFW_BOARD_VENDOR, "IBM"),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "2646"),
+		},
+	},
 	/*
 	 * Boxes that need ACPI PCI IRQ routing and PCI scan disabled
 	 */
 	{			/* _BBN 0 bug */
-	 .callback = disable_acpi_pci,
-	 .ident = "ASUS PR-DLS",
-	 .matches = {
-		     DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."),
-		     DMI_MATCH(DMI_BOARD_NAME, "PR-DLS"),
-		     DMI_MATCH(DMI_BIOS_VERSION,
-			       "ASUS PR-DLS ACPI BIOS Revision 1010"),
-		     DMI_MATCH(DMI_BIOS_DATE, "03/21/2003")
-		     },
-	 },
+		.callback = disable_acpi_pci,
+		.ident = "ASUS PR-DLS",
+		.matches = {
+			SYSFW_MATCH(SYSFW_BOARD_VENDOR,
+				    "ASUSTeK Computer INC."),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "PR-DLS"),
+			SYSFW_MATCH(SYSFW_BIOS_VERSION,
+				    "ASUS PR-DLS ACPI BIOS Revision 1010"),
+			SYSFW_MATCH(SYSFW_BIOS_DATE, "03/21/2003")
+		},
+	},
 	{
-	 .callback = disable_acpi_pci,
-	 .ident = "Acer TravelMate 36x Laptop",
-	 .matches = {
-		     DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
-		     DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 360"),
-		     },
-	 },
+		.callback = disable_acpi_pci,
+		.ident = "Acer TravelMate 36x Laptop",
+		.matches = {
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Acer"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "TravelMate 360"),
+			},
+		},
 	{}
 };
 
-/* second table for DMI checks that should run after early-quirks */
-static struct dmi_system_id __initdata acpi_dmi_table_late[] = {
+/* second table for SMBIOS checks that should run after early-quirks */
+static struct sysfw_id __initdata acpi_id_late[] = {
 	/*
 	 * HP laptops which use a DSDT reporting as HP/SB400/10000,
 	 * which includes some code which overrides all temperature
@@ -1435,37 +1436,37 @@ static struct dmi_system_id __initdata acpi_dmi_table_late[] = {
 	 * override in that cases.
 	 */
 	{
-	 .callback = dmi_ignore_irq0_timer_override,
-	 .ident = "HP nx6115 laptop",
-	 .matches = {
-		     DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
-		     DMI_MATCH(DMI_PRODUCT_NAME, "HP Compaq nx6115"),
-		     },
-	 },
+		.callback = id_ignore_irq0_timer_override,
+		.ident = "HP nx6115 laptop",
+		.matches = {
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Hewlett-Packard"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "HP Compaq nx6115"),
+		},
+	},
 	{
-	 .callback = dmi_ignore_irq0_timer_override,
-	 .ident = "HP NX6125 laptop",
-	 .matches = {
-		     DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
-		     DMI_MATCH(DMI_PRODUCT_NAME, "HP Compaq nx6125"),
-		     },
-	 },
+		.callback = id_ignore_irq0_timer_override,
+		.ident = "HP NX6125 laptop",
+		.matches = {
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Hewlett-Packard"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "HP Compaq nx6125"),
+		},
+	},
 	{
-	 .callback = dmi_ignore_irq0_timer_override,
-	 .ident = "HP NX6325 laptop",
-	 .matches = {
-		     DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
-		     DMI_MATCH(DMI_PRODUCT_NAME, "HP Compaq nx6325"),
-		     },
-	 },
+		.callback = id_ignore_irq0_timer_override,
+		.ident = "HP NX6325 laptop",
+		.matches = {
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Hewlett-Packard"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "HP Compaq nx6325"),
+		},
+	},
 	{
-	 .callback = dmi_ignore_irq0_timer_override,
-	 .ident = "HP 6715b laptop",
-	 .matches = {
-		     DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
-		     DMI_MATCH(DMI_PRODUCT_NAME, "HP Compaq 6715b"),
-		     },
-	 },
+		.callback = id_ignore_irq0_timer_override,
+		.ident = "HP 6715b laptop",
+		.matches = {
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Hewlett-Packard"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "HP Compaq 6715b"),
+		},
+	},
 	{}
 };
 
@@ -1490,7 +1491,7 @@ static struct dmi_system_id __initdata acpi_dmi_table_late[] = {
 
 void __init acpi_boot_table_init(void)
 {
-	dmi_check_system(acpi_dmi_table);
+	sysfw_callback(acpi_id_table);
 
 	/*
 	 * If acpi_disabled, bail out
@@ -1541,7 +1542,7 @@ int __init early_acpi_boot_init(void)
 int __init acpi_boot_init(void)
 {
 	/* those are executed after early-quirks are executed */
-	dmi_check_system(acpi_dmi_table_late);
+	sysfw_callback(acpi_id_late);
 
 	/*
 	 * If acpi_disabled, bail out
diff --git a/arch/x86/kernel/acpi/sleep.c b/arch/x86/kernel/acpi/sleep.c
index 103b6ab..c96b82d 100644
--- a/arch/x86/kernel/acpi/sleep.c
+++ b/arch/x86/kernel/acpi/sleep.c
@@ -8,7 +8,6 @@
 #include <linux/acpi.h>
 #include <linux/bootmem.h>
 #include <linux/memblock.h>
-#include <linux/dmi.h>
 #include <linux/cpumask.h>
 #include <asm/segment.h>
 #include <asm/desc.h>
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index b9338b8..a3a176d 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -30,7 +30,7 @@
 #include <linux/dmar.h>
 #include <linux/init.h>
 #include <linux/cpu.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include <linux/smp.h>
 #include <linux/mm.h>
 
@@ -162,7 +162,7 @@ early_param("nox2apic", setup_nox2apic);
 
 unsigned long mp_lapic_addr;
 int disable_apic;
-/* Disable local APIC timer from the kernel commandline or via dmi quirk */
+/* Disable local APIC timer from the kernel commandline or via smbios quirk */
 static int disable_apic_timer __initdata;
 /* Local APIC timer works in C2 */
 int local_apic_timer_c2_ok;
@@ -2231,7 +2231,7 @@ static int __cpuinit apic_cluster_num(void)
 static int __cpuinitdata multi_checked;
 static int __cpuinitdata multi;
 
-static int __cpuinit set_multi(const struct dmi_system_id *d)
+static int __cpuinit set_multi(const struct sysfw_id *d)
 {
 	if (multi)
 		return 0;
@@ -2240,24 +2240,24 @@ static int __cpuinit set_multi(const struct dmi_system_id *d)
 	return 0;
 }
 
-static const __cpuinitconst struct dmi_system_id multi_dmi_table[] = {
+static const __cpuinitconst struct sysfw_id set_multi_table[] = {
 	{
 		.callback = set_multi,
 		.ident = "IBM System Summit2",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "IBM"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Summit2"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "IBM"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Summit2"),
 		},
 	},
 	{}
 };
 
-static void __cpuinit dmi_check_multi(void)
+static void __cpuinit check_set_multi(void)
 {
 	if (multi_checked)
 		return;
 
-	dmi_check_system(multi_dmi_table);
+	sysfw_callback(set_multi_table);
 	multi_checked = 1;
 }
 
@@ -2267,11 +2267,11 @@ static void __cpuinit dmi_check_multi(void)
  * Thus far, the major user of this is IBM's Summit2 series:
  * Clustered boxes may have unsynced TSC problems if they are
  * multi-chassis.
- * Use DMI to check them
+ * Use SMBIOS to check them
  */
 __cpuinit int apic_is_clustered_box(void)
 {
-	dmi_check_multi();
+	check_set_multi();
 	if (multi)
 		return 1;
 
diff --git a/arch/x86/kernel/apic/bigsmp_32.c b/arch/x86/kernel/apic/bigsmp_32.c
index efd737e..76bee5d 100644
--- a/arch/x86/kernel/apic/bigsmp_32.c
+++ b/arch/x86/kernel/apic/bigsmp_32.c
@@ -7,7 +7,7 @@
 #include <linux/cpumask.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include <linux/smp.h>
 
 #include <asm/apicdef.h>
@@ -151,30 +151,35 @@ static void bigsmp_send_IPI_all(int vector)
 	bigsmp_send_IPI_mask(cpu_online_mask, vector);
 }
 
-static int dmi_bigsmp; /* can be set by dmi scanners */
+static int smbios_bigsmp; /* can be set by smbios scanners */
 
-static int hp_ht_bigsmp(const struct dmi_system_id *d)
+static int hp_ht_bigsmp(const struct sysfw_id *d)
 {
 	printk(KERN_NOTICE "%s detected: force use of apic=bigsmp\n", d->ident);
-	dmi_bigsmp = 1;
+	smbios_bigsmp = 1;
 
 	return 0;
 }
 
 
-static const struct dmi_system_id bigsmp_dmi_table[] = {
-	{ hp_ht_bigsmp, "HP ProLiant DL760 G2",
-		{	DMI_MATCH(DMI_BIOS_VENDOR, "HP"),
-			DMI_MATCH(DMI_BIOS_VERSION, "P44-"),
+static const struct sysfw_id bigsmp_id_table[] = {
+	{
+		.callback = hp_ht_bigsmp,
+		.ident = "HP ProLiant DL760 G2",
+		{
+			SYSFW_MATCH(SYSFW_BIOS_VENDOR, "HP"),
+			SYSFW_MATCH(SYSFW_BIOS_VERSION, "P44-"),
 		}
 	},
-
-	{ hp_ht_bigsmp, "HP ProLiant DL740",
-		{	DMI_MATCH(DMI_BIOS_VENDOR, "HP"),
-			DMI_MATCH(DMI_BIOS_VERSION, "P47-"),
+	{
+		.callback = hp_ht_bigsmp,
+		.ident = "HP ProLiant DL740",
+		{
+			SYSFW_MATCH(SYSFW_BIOS_VENDOR, "HP"),
+			SYSFW_MATCH(SYSFW_BIOS_VERSION, "P47-"),
 		}
 	},
-	{ } /* NULL entry stops DMI scanning */
+	{} /* NULL entry stops SMBIOS scanning */
 };
 
 static void bigsmp_vector_allocation_domain(int cpu, struct cpumask *retmask)
@@ -186,11 +191,11 @@ static void bigsmp_vector_allocation_domain(int cpu, struct cpumask *retmask)
 static int probe_bigsmp(void)
 {
 	if (def_to_bigsmp)
-		dmi_bigsmp = 1;
+		smbios_bigsmp = 1;
 	else
-		dmi_check_system(bigsmp_dmi_table);
+		sysfw_callback(bigsmp_id_table);
 
-	return dmi_bigsmp;
+	return smbios_bigsmp;
 }
 
 static struct apic apic_bigsmp = {
diff --git a/arch/x86/kernel/apm_32.c b/arch/x86/kernel/apm_32.c
index 965a766..dd804ef 100644
--- a/arch/x86/kernel/apm_32.c
+++ b/arch/x86/kernel/apm_32.c
@@ -223,7 +223,7 @@
 #include <linux/kernel.h>
 #include <linux/freezer.h>
 #include <linux/smp.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include <linux/suspend.h>
 #include <linux/kthread.h>
 #include <linux/jiffies.h>
@@ -1931,7 +1931,7 @@ static struct miscdevice apm_device = {
 
 
 /* Simple "print if true" callback */
-static int __init print_if_true(const struct dmi_system_id *d)
+static int __init print_if_true(const struct sysfw_id *d)
 {
 	printk("%s\n", d->ident);
 	return 0;
@@ -1941,7 +1941,7 @@ static int __init print_if_true(const struct dmi_system_id *d)
  * Some Bioses enable the PS/2 mouse (touchpad) at resume, even if it was
  * disabled before the suspend. Linux used to get terribly confused by that.
  */
-static int __init broken_ps2_resume(const struct dmi_system_id *d)
+static int __init broken_ps2_resume(const struct sysfw_id *d)
 {
 	printk(KERN_INFO "%s machine detected. Mousepad Resume Bug "
 	       "workaround hopefully not needed.\n", d->ident);
@@ -1949,7 +1949,7 @@ static int __init broken_ps2_resume(const struct dmi_system_id *d)
 }
 
 /* Some bioses have a broken protected mode poweroff and need to use realmode */
-static int __init set_realmode_power_off(const struct dmi_system_id *d)
+static int __init set_realmode_power_off(const struct sysfw_id *d)
 {
 	if (apm_info.realmode_power_off == 0) {
 		apm_info.realmode_power_off = 1;
@@ -1960,7 +1960,7 @@ static int __init set_realmode_power_off(const struct dmi_system_id *d)
 }
 
 /* Some laptops require interrupts to be enabled during APM calls */
-static int __init set_apm_ints(const struct dmi_system_id *d)
+static int __init set_apm_ints(const struct sysfw_id *d)
 {
 	if (apm_info.allow_ints == 0) {
 		apm_info.allow_ints = 1;
@@ -1971,7 +1971,7 @@ static int __init set_apm_ints(const struct dmi_system_id *d)
 }
 
 /* Some APM bioses corrupt memory or just plain do not work */
-static int __init apm_is_horked(const struct dmi_system_id *d)
+static int __init apm_is_horked(const struct sysfw_id *d)
 {
 	if (apm_info.disabled == 0) {
 		apm_info.disabled = 1;
@@ -1981,7 +1981,7 @@ static int __init apm_is_horked(const struct dmi_system_id *d)
 	return 0;
 }
 
-static int __init apm_is_horked_d850md(const struct dmi_system_id *d)
+static int __init apm_is_horked_d850md(const struct sysfw_id *d)
 {
 	if (apm_info.disabled == 0) {
 		apm_info.disabled = 1;
@@ -1994,7 +1994,7 @@ static int __init apm_is_horked_d850md(const struct dmi_system_id *d)
 }
 
 /* Some APM bioses hang on APM idle calls */
-static int __init apm_likes_to_melt(const struct dmi_system_id *d)
+static int __init apm_likes_to_melt(const struct sysfw_id *d)
 {
 	if (apm_info.forbid_idle == 0) {
 		apm_info.forbid_idle = 1;
@@ -2019,7 +2019,7 @@ static int __init apm_likes_to_melt(const struct dmi_system_id *d)
  *	Phoenix A04  08/24/2000 is known bad (Dell Inspiron 5000e)
  *	Phoenix A07  09/29/2000 is known good (Dell Inspiron 5000)
  */
-static int __init broken_apm_power(const struct dmi_system_id *d)
+static int __init broken_apm_power(const struct sysfw_id *d)
 {
 	apm_info.get_power_status_broken = 1;
 	printk(KERN_WARNING "BIOS strings suggest APM bugs, "
@@ -2031,7 +2031,7 @@ static int __init broken_apm_power(const struct dmi_system_id *d)
  * This bios swaps the APM minute reporting bytes over (Many sony laptops
  * have this problem).
  */
-static int __init swab_apm_power_in_minutes(const struct dmi_system_id *d)
+static int __init swab_apm_power_in_minutes(const struct sysfw_id *d)
 {
 	apm_info.get_power_status_swabinminutes = 1;
 	printk(KERN_WARNING "BIOS strings suggest APM reports battery life "
@@ -2039,215 +2039,314 @@ static int __init swab_apm_power_in_minutes(const struct dmi_system_id *d)
 	return 0;
 }
 
-static struct dmi_system_id __initdata apm_dmi_table[] = {
+static struct sysfw_id __initdata apm_id_table[] = {
 	{
-		print_if_true,
+		.callback = print_if_true,
 		KERN_WARNING "IBM T23 - BIOS 1.03b+ and controller firmware 1.02+ may be needed for Linux APM.",
-		{	DMI_MATCH(DMI_SYS_VENDOR, "IBM"),
-			DMI_MATCH(DMI_BIOS_VERSION, "1AET38WW (1.01b)"), },
+		{	SYSFW_MATCH(SYSFW_SYS_VENDOR, "IBM"),
+			SYSFW_MATCH(SYSFW_BIOS_VERSION, "1AET38WW (1.01b)"),
+		},
 	},
 	{	/* Handle problems with APM on the C600 */
-		broken_ps2_resume, "Dell Latitude C600",
-		{	DMI_MATCH(DMI_SYS_VENDOR, "Dell"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Latitude C600"), },
+		.callback = broken_ps2_resume,
+		.ident = "Dell Latitude C600",
+		{	SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Latitude C600")
+		},
 	},
 	{	/* Allow interrupts during suspend on Dell Latitude laptops*/
-		set_apm_ints, "Dell Latitude",
-		{	DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Latitude C510"), }
+		.callback = set_apm_ints,
+		.ident = "Dell Latitude",
+		{	SYSFW_MATCH(SYSFW_SYS_VENDOR,
+				    "Dell Computer Corporation"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Latitude C510"),
+		},
 	},
 	{	/* APM crashes */
-		apm_is_horked, "Dell Inspiron 2500",
-		{	DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 2500"),
-			DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
-			DMI_MATCH(DMI_BIOS_VERSION, "A11"), },
+		.callback = apm_is_horked,
+		.ident = "Dell Inspiron 2500",
+		{	SYSFW_MATCH(SYSFW_SYS_VENDOR,
+				    "Dell Computer Corporation"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Inspiron 2500"),
+			SYSFW_MATCH(SYSFW_BIOS_VENDOR,
+				    "Phoenix Technologies LTD"),
+			SYSFW_MATCH(SYSFW_BIOS_VERSION, "A11"), },
 	},
 	{	/* Allow interrupts during suspend on Dell Inspiron laptops*/
-		set_apm_ints, "Dell Inspiron", {
-			DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 4000"), },
+		.callback = set_apm_ints,
+		.ident = "Dell Inspiron", {
+			SYSFW_MATCH(SYSFW_SYS_VENDOR,
+				    "Dell Computer Corporation"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Inspiron 4000"),
+		},
 	},
 	{	/* Handle problems with APM on Inspiron 5000e */
-		broken_apm_power, "Dell Inspiron 5000e",
-		{	DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
-			DMI_MATCH(DMI_BIOS_VERSION, "A04"),
-			DMI_MATCH(DMI_BIOS_DATE, "08/24/2000"), },
+		.callback = broken_apm_power,
+		.ident = "Dell Inspiron 5000e",
+		{	SYSFW_MATCH(SYSFW_BIOS_VENDOR,
+				    "Phoenix Technologies LTD"),
+			SYSFW_MATCH(SYSFW_BIOS_VERSION, "A04"),
+			SYSFW_MATCH(SYSFW_BIOS_DATE, "08/24/2000"),
+		},
 	},
 	{	/* Handle problems with APM on Inspiron 2500 */
-		broken_apm_power, "Dell Inspiron 2500",
-		{	DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
-			DMI_MATCH(DMI_BIOS_VERSION, "A12"),
-			DMI_MATCH(DMI_BIOS_DATE, "02/04/2002"), },
+		.callback = broken_apm_power,
+		.ident = "Dell Inspiron 2500",
+		{	SYSFW_MATCH(SYSFW_BIOS_VENDOR,
+				     "Phoenix Technologies LTD"),
+			SYSFW_MATCH(SYSFW_BIOS_VERSION, "A12"),
+			SYSFW_MATCH(SYSFW_BIOS_DATE, "02/04/2002"),
+		},
 	},
 	{	/* APM crashes */
-		apm_is_horked, "Dell Dimension 4100",
-		{	DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "XPS-Z"),
-			DMI_MATCH(DMI_BIOS_VENDOR, "Intel Corp."),
-			DMI_MATCH(DMI_BIOS_VERSION, "A11"), },
+		.callback = apm_is_horked,
+		.ident = "Dell Dimension 4100",
+		{	SYSFW_MATCH(SYSFW_SYS_VENDOR,
+				    "Dell Computer Corporation"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "XPS-Z"),
+			SYSFW_MATCH(SYSFW_BIOS_VENDOR, "Intel Corp."),
+			SYSFW_MATCH(SYSFW_BIOS_VERSION, "A11"),
+		},
 	},
 	{	/* Allow interrupts during suspend on Compaq Laptops*/
-		set_apm_ints, "Compaq 12XL125",
-		{	DMI_MATCH(DMI_SYS_VENDOR, "Compaq"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Compaq PC"),
-			DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
-			DMI_MATCH(DMI_BIOS_VERSION, "4.06"), },
+		.callback = set_apm_ints,
+		.ident = "Compaq 12XL125",
+		{	SYSFW_MATCH(SYSFW_SYS_VENDOR, "Compaq"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Compaq PC"),
+			SYSFW_MATCH(SYSFW_BIOS_VENDOR,
+				    "Phoenix Technologies LTD"),
+			SYSFW_MATCH(SYSFW_BIOS_VERSION, "4.06"),
+		},
 	},
 	{	/* Allow interrupts during APM or the clock goes slow */
-		set_apm_ints, "ASUSTeK",
-		{	DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK Computer Inc."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "L8400K series Notebook PC"), },
+		.callback = set_apm_ints,
+		.ident = "ASUSTeK",
+		{	SYSFW_MATCH(SYSFW_SYS_VENDOR,
+				    "ASUSTeK Computer Inc."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME,
+				    "L8400K series Notebook PC"),
+		},
 	},
 	{	/* APM blows on shutdown */
-		apm_is_horked, "ABIT KX7-333[R]",
-		{	DMI_MATCH(DMI_BOARD_VENDOR, "ABIT"),
-			DMI_MATCH(DMI_BOARD_NAME, "VT8367-8233A (KX7-333[R])"), },
+		.callback = apm_is_horked,
+		.ident = "ABIT KX7-333[R]",
+		{	SYSFW_MATCH(SYSFW_BOARD_VENDOR, "ABIT"),
+			SYSFW_MATCH(SYSFW_BOARD_NAME,
+				    "VT8367-8233A (KX7-333[R])"), },
 	},
 	{	/* APM crashes */
-		apm_is_horked, "Trigem Delhi3",
-		{	DMI_MATCH(DMI_SYS_VENDOR, "TriGem Computer, Inc"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Delhi3"), },
+		.callback = apm_is_horked,
+		.ident = "Trigem Delhi3",
+		{	SYSFW_MATCH(SYSFW_SYS_VENDOR, "TriGem Computer, Inc"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Delhi3"),
+		},
 	},
 	{	/* APM crashes */
-		apm_is_horked, "Fujitsu-Siemens",
-		{	DMI_MATCH(DMI_BIOS_VENDOR, "hoenix/FUJITSU SIEMENS"),
-			DMI_MATCH(DMI_BIOS_VERSION, "Version1.01"), },
+		.callback = apm_is_horked,
+		.ident = "Fujitsu-Siemens",
+		{	SYSFW_MATCH(SYSFW_BIOS_VENDOR,
+				    "hoenix/FUJITSU SIEMENS"),
+			SYSFW_MATCH(SYSFW_BIOS_VERSION, "Version1.01")
+		},
 	},
 	{	/* APM crashes */
-		apm_is_horked_d850md, "Intel D850MD",
-		{	DMI_MATCH(DMI_BIOS_VENDOR, "Intel Corp."),
-			DMI_MATCH(DMI_BIOS_VERSION, "MV85010A.86A.0016.P07.0201251536"), },
+		.callback = apm_is_horked_d850md,
+		.ident = "Intel D850MD",
+		{	SYSFW_MATCH(SYSFW_BIOS_VENDOR, "Intel Corp."),
+			SYSFW_MATCH(SYSFW_BIOS_VERSION,
+				    "MV85010A.86A.0016.P07.0201251536"),
+		},
 	},
 	{	/* APM crashes */
-		apm_is_horked, "Intel D810EMO",
-		{	DMI_MATCH(DMI_BIOS_VENDOR, "Intel Corp."),
-			DMI_MATCH(DMI_BIOS_VERSION, "MO81010A.86A.0008.P04.0004170800"), },
+		.callback = apm_is_horked,
+		.ident = "Intel D810EMO",
+		{	SYSFW_MATCH(SYSFW_BIOS_VENDOR, "Intel Corp."),
+			SYSFW_MATCH(SYSFW_BIOS_VERSION,
+				    "MO81010A.86A.0008.P04.0004170800"),
+		},
 	},
 	{	/* APM crashes */
-		apm_is_horked, "Dell XPS-Z",
-		{	DMI_MATCH(DMI_BIOS_VENDOR, "Intel Corp."),
-			DMI_MATCH(DMI_BIOS_VERSION, "A11"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "XPS-Z"), },
+		.callback = apm_is_horked,
+		.ident = "Dell XPS-Z",
+		{	SYSFW_MATCH(SYSFW_BIOS_VENDOR, "Intel Corp."),
+			SYSFW_MATCH(SYSFW_BIOS_VERSION, "A11"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "XPS-Z"),
+		},
 	},
 	{	/* APM crashes */
-		apm_is_horked, "Sharp PC-PJ/AX",
-		{	DMI_MATCH(DMI_SYS_VENDOR, "SHARP"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "PC-PJ/AX"),
-			DMI_MATCH(DMI_BIOS_VENDOR, "SystemSoft"),
-			DMI_MATCH(DMI_BIOS_VERSION, "Version R2.08"), },
+		.callback = apm_is_horked,
+		.ident = "Sharp PC-PJ/AX",
+		{	SYSFW_MATCH(SYSFW_SYS_VENDOR, "SHARP"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "PC-PJ/AX"),
+			SYSFW_MATCH(SYSFW_BIOS_VENDOR, "SystemSoft"),
+			SYSFW_MATCH(SYSFW_BIOS_VERSION, "Version R2.08"),
+		},
 	},
 	{	/* APM crashes */
-		apm_is_horked, "Dell Inspiron 2500",
-		{	DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 2500"),
-			DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
-			DMI_MATCH(DMI_BIOS_VERSION, "A11"), },
+		.callback = apm_is_horked,
+		.ident = "Dell Inspiron 2500",
+		{	SYSFW_MATCH(SYSFW_SYS_VENDOR,
+				    "Dell Computer Corporation"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Inspiron 2500"),
+			SYSFW_MATCH(SYSFW_BIOS_VENDOR,
+				    "Phoenix Technologies LTD"),
+			SYSFW_MATCH(SYSFW_BIOS_VERSION, "A11"),
+		},
 	},
 	{	/* APM idle hangs */
-		apm_likes_to_melt, "Jabil AMD",
-		{	DMI_MATCH(DMI_BIOS_VENDOR, "American Megatrends Inc."),
-			DMI_MATCH(DMI_BIOS_VERSION, "0AASNP06"), },
+		.callback = apm_likes_to_melt,
+		.ident = "Jabil AMD",
+		{	SYSFW_MATCH(SYSFW_BIOS_VENDOR,
+				    "American Megatrends Inc."),
+			SYSFW_MATCH(SYSFW_BIOS_VERSION, "0AASNP06"),
+		},
 	},
 	{	/* APM idle hangs */
-		apm_likes_to_melt, "AMI Bios",
-		{	DMI_MATCH(DMI_BIOS_VENDOR, "American Megatrends Inc."),
-			DMI_MATCH(DMI_BIOS_VERSION, "0AASNP05"), },
+		.callback = apm_likes_to_melt,
+		.ident = "AMI Bios",
+		{	SYSFW_MATCH(SYSFW_BIOS_VENDOR,
+				    "American Megatrends Inc."),
+			SYSFW_MATCH(SYSFW_BIOS_VERSION, "0AASNP05"),
+		},
 	},
 	{	/* Handle problems with APM on Sony Vaio PCG-N505X(DE) */
-		swab_apm_power_in_minutes, "Sony VAIO",
-		{	DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
-			DMI_MATCH(DMI_BIOS_VERSION, "R0206H"),
-			DMI_MATCH(DMI_BIOS_DATE, "08/23/99"), },
+		.callback = swab_apm_power_in_minutes,
+		.ident = "Sony VAIO",
+		{	SYSFW_MATCH(SYSFW_BIOS_VENDOR,
+				    "Phoenix Technologies LTD"),
+			SYSFW_MATCH(SYSFW_BIOS_VERSION, "R0206H"),
+			SYSFW_MATCH(SYSFW_BIOS_DATE, "08/23/99"),
+		},
 	},
 	{	/* Handle problems with APM on Sony Vaio PCG-N505VX */
-		swab_apm_power_in_minutes, "Sony VAIO",
-		{	DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
-			DMI_MATCH(DMI_BIOS_VERSION, "W2K06H0"),
-			DMI_MATCH(DMI_BIOS_DATE, "02/03/00"), },
+		.callback = swab_apm_power_in_minutes,
+		.ident = "Sony VAIO",
+		{	SYSFW_MATCH(SYSFW_BIOS_VENDOR,
+				    "Phoenix Technologies LTD"),
+			SYSFW_MATCH(SYSFW_BIOS_VERSION, "W2K06H0"),
+			SYSFW_MATCH(SYSFW_BIOS_DATE, "02/03/00"),
+		},
 	},
 	{	/* Handle problems with APM on Sony Vaio PCG-XG29 */
-		swab_apm_power_in_minutes, "Sony VAIO",
-		{	DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
-			DMI_MATCH(DMI_BIOS_VERSION, "R0117A0"),
-			DMI_MATCH(DMI_BIOS_DATE, "04/25/00"), },
+		.callback = swab_apm_power_in_minutes,
+		.ident = "Sony VAIO",
+		{	SYSFW_MATCH(SYSFW_BIOS_VENDOR,
+				    "Phoenix Technologies LTD"),
+			SYSFW_MATCH(SYSFW_BIOS_VERSION, "R0117A0"),
+			SYSFW_MATCH(SYSFW_BIOS_DATE, "04/25/00"),
+		},
 	},
 	{	/* Handle problems with APM on Sony Vaio PCG-Z600NE */
-		swab_apm_power_in_minutes, "Sony VAIO",
-		{	DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
-			DMI_MATCH(DMI_BIOS_VERSION, "R0121Z1"),
-			DMI_MATCH(DMI_BIOS_DATE, "05/11/00"), },
+		.callback = swab_apm_power_in_minutes,
+		.ident = "Sony VAIO",
+		{	SYSFW_MATCH(SYSFW_BIOS_VENDOR,
+				    "Phoenix Technologies LTD"),
+			SYSFW_MATCH(SYSFW_BIOS_VERSION, "R0121Z1"),
+			SYSFW_MATCH(SYSFW_BIOS_DATE, "05/11/00"),
+		},
 	},
 	{	/* Handle problems with APM on Sony Vaio PCG-Z600NE */
-		swab_apm_power_in_minutes, "Sony VAIO",
-		{	DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
-			DMI_MATCH(DMI_BIOS_VERSION, "WME01Z1"),
-			DMI_MATCH(DMI_BIOS_DATE, "08/11/00"), },
+		.callback = swab_apm_power_in_minutes,
+		.ident = "Sony VAIO",
+		{	SYSFW_MATCH(SYSFW_BIOS_VENDOR,
+				    "Phoenix Technologies LTD"),
+			SYSFW_MATCH(SYSFW_BIOS_VERSION, "WME01Z1"),
+			SYSFW_MATCH(SYSFW_BIOS_DATE, "08/11/00"),
+		},
 	},
 	{	/* Handle problems with APM on Sony Vaio PCG-Z600LEK(DE) */
-		swab_apm_power_in_minutes, "Sony VAIO",
-		{	DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
-			DMI_MATCH(DMI_BIOS_VERSION, "R0206Z3"),
-			DMI_MATCH(DMI_BIOS_DATE, "12/25/00"), },
+		.callback = swab_apm_power_in_minutes,
+		.ident = "Sony VAIO",
+		{	SYSFW_MATCH(SYSFW_BIOS_VENDOR,
+				    "Phoenix Technologies LTD"),
+			SYSFW_MATCH(SYSFW_BIOS_VERSION, "R0206Z3"),
+			SYSFW_MATCH(SYSFW_BIOS_DATE, "12/25/00"),
+		},
 	},
 	{	/* Handle problems with APM on Sony Vaio PCG-Z505LS */
-		swab_apm_power_in_minutes, "Sony VAIO",
-		{	DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
-			DMI_MATCH(DMI_BIOS_VERSION, "R0203D0"),
-			DMI_MATCH(DMI_BIOS_DATE, "05/12/00"), },
+		.callback = swab_apm_power_in_minutes,
+		.ident = "Sony VAIO",
+		{	SYSFW_MATCH(SYSFW_BIOS_VENDOR,
+				    "Phoenix Technologies LTD"),
+			SYSFW_MATCH(SYSFW_BIOS_VERSION, "R0203D0"),
+			SYSFW_MATCH(SYSFW_BIOS_DATE, "05/12/00"),
+		},
 	},
 	{	/* Handle problems with APM on Sony Vaio PCG-Z505LS */
-		swab_apm_power_in_minutes, "Sony VAIO",
-		{	DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
-			DMI_MATCH(DMI_BIOS_VERSION, "R0203Z3"),
-			DMI_MATCH(DMI_BIOS_DATE, "08/25/00"), },
+		.callback = swab_apm_power_in_minutes,
+		.ident = "Sony VAIO",
+		{	SYSFW_MATCH(SYSFW_BIOS_VENDOR,
+				    "Phoenix Technologies LTD"),
+			SYSFW_MATCH(SYSFW_BIOS_VERSION, "R0203Z3"),
+			SYSFW_MATCH(SYSFW_BIOS_DATE, "08/25/00"),
+		},
 	},
 	{	/* Handle problems with APM on Sony Vaio PCG-Z505LS (with updated BIOS) */
-		swab_apm_power_in_minutes, "Sony VAIO",
-		{	DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
-			DMI_MATCH(DMI_BIOS_VERSION, "R0209Z3"),
-			DMI_MATCH(DMI_BIOS_DATE, "05/12/01"), },
+		.callback = swab_apm_power_in_minutes,
+		.ident = "Sony VAIO",
+		{	SYSFW_MATCH(SYSFW_BIOS_VENDOR,
+				    "Phoenix Technologies LTD"),
+			SYSFW_MATCH(SYSFW_BIOS_VERSION, "R0209Z3"),
+			SYSFW_MATCH(SYSFW_BIOS_DATE, "05/12/01"),
+		},
 	},
 	{	/* Handle problems with APM on Sony Vaio PCG-F104K */
-		swab_apm_power_in_minutes, "Sony VAIO",
-		{	DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
-			DMI_MATCH(DMI_BIOS_VERSION, "R0204K2"),
-			DMI_MATCH(DMI_BIOS_DATE, "08/28/00"), },
+		.callback = swab_apm_power_in_minutes,
+		.ident = "Sony VAIO",
+		{	SYSFW_MATCH(SYSFW_BIOS_VENDOR,
+				    "Phoenix Technologies LTD"),
+			SYSFW_MATCH(SYSFW_BIOS_VERSION, "R0204K2"),
+			SYSFW_MATCH(SYSFW_BIOS_DATE, "08/28/00"),
+		},
 	},
 
 	{	/* Handle problems with APM on Sony Vaio PCG-C1VN/C1VE */
-		swab_apm_power_in_minutes, "Sony VAIO",
-		{	DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
-			DMI_MATCH(DMI_BIOS_VERSION, "R0208P1"),
-			DMI_MATCH(DMI_BIOS_DATE, "11/09/00"), },
+		.callback = swab_apm_power_in_minutes,
+		.ident = "Sony VAIO",
+		{	SYSFW_MATCH(SYSFW_BIOS_VENDOR,
+				    "Phoenix Technologies LTD"),
+			SYSFW_MATCH(SYSFW_BIOS_VERSION, "R0208P1"),
+			SYSFW_MATCH(SYSFW_BIOS_DATE, "11/09/00"),
+		},
 	},
 	{	/* Handle problems with APM on Sony Vaio PCG-C1VE */
-		swab_apm_power_in_minutes, "Sony VAIO",
-		{	DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
-			DMI_MATCH(DMI_BIOS_VERSION, "R0204P1"),
-			DMI_MATCH(DMI_BIOS_DATE, "09/12/00"), },
+		.callback = swab_apm_power_in_minutes,
+		.ident = "Sony VAIO",
+		{	SYSFW_MATCH(SYSFW_BIOS_VENDOR,
+				    "Phoenix Technologies LTD"),
+			SYSFW_MATCH(SYSFW_BIOS_VERSION, "R0204P1"),
+			SYSFW_MATCH(SYSFW_BIOS_DATE, "09/12/00"),
+		},
 	},
 	{	/* Handle problems with APM on Sony Vaio PCG-C1VE */
-		swab_apm_power_in_minutes, "Sony VAIO",
-		{	DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
-			DMI_MATCH(DMI_BIOS_VERSION, "WXPO1Z3"),
-			DMI_MATCH(DMI_BIOS_DATE, "10/26/01"), },
+		.callback = swab_apm_power_in_minutes,
+		.ident = "Sony VAIO",
+		{	SYSFW_MATCH(SYSFW_BIOS_VENDOR,
+				    "Phoenix Technologies LTD"),
+			SYSFW_MATCH(SYSFW_BIOS_VERSION, "WXPO1Z3"),
+			SYSFW_MATCH(SYSFW_BIOS_DATE, "10/26/01"),
+		},
 	},
 	{	/* broken PM poweroff bios */
-		set_realmode_power_off, "Award Software v4.60 PGMA",
-		{	DMI_MATCH(DMI_BIOS_VENDOR, "Award Software International, Inc."),
-			DMI_MATCH(DMI_BIOS_VERSION, "4.60 PGMA"),
-			DMI_MATCH(DMI_BIOS_DATE, "134526184"), },
+		.callback = set_realmode_power_off,
+		.ident = "Award Software v4.60 PGMA",
+		{	SYSFW_MATCH(SYSFW_BIOS_VENDOR,
+				    "Award Software International, Inc."),
+			SYSFW_MATCH(SYSFW_BIOS_VERSION, "4.60 PGMA"),
+			SYSFW_MATCH(SYSFW_BIOS_DATE, "134526184"),
+		},
 	},
 
 	/* Generic per vendor APM settings  */
 
 	{	/* Allow interrupts during suspend on IBM laptops */
-		set_apm_ints, "IBM",
-		{	DMI_MATCH(DMI_SYS_VENDOR, "IBM"), },
+		.callback = set_apm_ints,
+		.ident = "IBM",
+		{
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "IBM"),
+		},
 	},
-
-	{ }
+	{}
 };
 
 /*
@@ -2265,7 +2364,7 @@ static int __init apm_init(void)
 	struct desc_struct *gdt;
 	int err;
 
-	dmi_check_system(apm_dmi_table);
+	sysfw_callback(apm_id_table);
 
 	if (apm_info.bios.version == 0 || paravirt_enabled() || machine_is_olpc()) {
 		printk(KERN_INFO "apm: BIOS not found.\n");
@@ -2288,7 +2387,7 @@ static int __init apm_init(void)
 		apm_info.get_power_status_broken = 1;
 	if (realmode_power_off)
 		apm_info.realmode_power_off = 1;
-	/* User can override, but default is to trust DMI */
+	/* User can override, but default is to trust SMBIOS */
 	if (apm_disabled != -1)
 		apm_info.disabled = apm_disabled;
 
diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
index b13ed39..79fd786 100644
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
@@ -587,7 +587,7 @@ static void __cpuinit init_amd(struct cpuinfo_x86 *c)
 	if (c->x86 == 0x10) {
 		/* do this for boot cpu */
 		if (c == &boot_cpu_data)
-			check_enable_amd_mmconf_dmi();
+			check_enable_amd_pci_mmconf();
 
 		fam10h_check_enable_mmcfg();
 	}
diff --git a/arch/x86/kernel/cpu/vmware.c b/arch/x86/kernel/cpu/vmware.c
index d22d0c4..e427451 100644
--- a/arch/x86/kernel/cpu/vmware.c
+++ b/arch/x86/kernel/cpu/vmware.c
@@ -21,7 +21,7 @@
  *
  */
 
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include <linux/module.h>
 #include <asm/div64.h>
 #include <asm/x86_init.h>
@@ -85,8 +85,18 @@ static void __init vmware_platform_setup(void)
 		       "Failed to get TSC freq from the hypervisor\n");
 }
 
+static struct sysfw_id vmware_id_table[] = {
+	{
+		 .ident = "VMware",
+		.matches = {
+			SYSFW_MATCH(SYSFW_PRODUCT_SERIAL, "VMWare"),
+		},
+	},
+	{},
+};
+
 /*
- * While checking the dmi string information, just checking the product
+ * While checking the smbios string information, just checking the product
  * serial key should be enough, as this will always have a VMware
  * specific string when running under VMware hypervisor.
  */
@@ -100,8 +110,7 @@ static bool __init vmware_platform(void)
 		      &hyper_vendor_id[1], &hyper_vendor_id[2]);
 		if (!memcmp(hyper_vendor_id, "VMwareVMware", 12))
 			return true;
-	} else if (dmi_available && dmi_name_in_serial("VMware") &&
-		   __vmware_platform())
+	} else if (sysfw_callback(vmware_id_table) && __vmware_platform())
 		return true;
 
 	return false;
diff --git a/arch/x86/kernel/io_delay.c b/arch/x86/kernel/io_delay.c
index a979b5b..27c0390 100644
--- a/arch/x86/kernel/io_delay.c
+++ b/arch/x86/kernel/io_delay.c
@@ -1,7 +1,7 @@
 /*
  * I/O delay strategies for inb_p/outb_p
  *
- * Allow for a DMI based override of port 0x80, needed for certain HP laptops
+ * Allow for a SMBIOS based override of port 0x80, needed for certain HP laptops
  * and possibly other systems. Also allow for the gradual elimination of
  * outb_p/inb_p API uses.
  */
@@ -9,7 +9,7 @@
 #include <linux/module.h>
 #include <linux/delay.h>
 #include <linux/init.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include <linux/io.h>
 
 int io_delay_type __read_mostly = CONFIG_DEFAULT_IO_DELAY_TYPE;
@@ -44,7 +44,7 @@ void native_io_delay(void)
 }
 EXPORT_SYMBOL(native_io_delay);
 
-static int __init dmi_io_delay_0xed_port(const struct dmi_system_id *id)
+static int __init io_delay_0xed_port(const struct sysfw_id *id)
 {
 	if (io_delay_type == CONFIG_IO_DELAY_TYPE_0X80) {
 		pr_notice("%s: using 0xed I/O delay port\n", id->ident);
@@ -58,54 +58,54 @@ static int __init dmi_io_delay_0xed_port(const struct dmi_system_id *id)
  * Quirk table for systems that misbehave (lock up, etc.) if port
  * 0x80 is used:
  */
-static struct dmi_system_id __initdata io_delay_0xed_port_dmi_table[] = {
+static struct sysfw_id __initdata io_delay_0xed_port_table[] = {
 	{
-		.callback	= dmi_io_delay_0xed_port,
+		.callback	= io_delay_0xed_port,
 		.ident		= "Compaq Presario V6000",
 		.matches	= {
-			DMI_MATCH(DMI_BOARD_VENDOR,	"Quanta"),
-			DMI_MATCH(DMI_BOARD_NAME,	"30B7")
+			SYSFW_MATCH(SYSFW_BOARD_VENDOR,	"Quanta"),
+			SYSFW_MATCH(SYSFW_BOARD_NAME,	"30B7")
 		}
 	},
 	{
-		.callback	= dmi_io_delay_0xed_port,
+		.callback	= io_delay_0xed_port,
 		.ident		= "HP Pavilion dv9000z",
 		.matches	= {
-			DMI_MATCH(DMI_BOARD_VENDOR,	"Quanta"),
-			DMI_MATCH(DMI_BOARD_NAME,	"30B9")
+			SYSFW_MATCH(SYSFW_BOARD_VENDOR,	"Quanta"),
+			SYSFW_MATCH(SYSFW_BOARD_NAME,	"30B9")
 		}
 	},
 	{
-		.callback	= dmi_io_delay_0xed_port,
+		.callback	= io_delay_0xed_port,
 		.ident		= "HP Pavilion dv6000",
 		.matches	= {
-			DMI_MATCH(DMI_BOARD_VENDOR,	"Quanta"),
-			DMI_MATCH(DMI_BOARD_NAME,	"30B8")
+			SYSFW_MATCH(SYSFW_BOARD_VENDOR,	"Quanta"),
+			SYSFW_MATCH(SYSFW_BOARD_NAME,	"30B8")
 		}
 	},
 	{
-		.callback	= dmi_io_delay_0xed_port,
+		.callback	= io_delay_0xed_port,
 		.ident		= "HP Pavilion tx1000",
 		.matches	= {
-			DMI_MATCH(DMI_BOARD_VENDOR,	"Quanta"),
-			DMI_MATCH(DMI_BOARD_NAME,	"30BF")
+			SYSFW_MATCH(SYSFW_BOARD_VENDOR,	"Quanta"),
+			SYSFW_MATCH(SYSFW_BOARD_NAME,	"30BF")
 		}
 	},
 	{
-		.callback	= dmi_io_delay_0xed_port,
+		.callback	= io_delay_0xed_port,
 		.ident		= "Presario F700",
 		.matches	= {
-			DMI_MATCH(DMI_BOARD_VENDOR,	"Quanta"),
-			DMI_MATCH(DMI_BOARD_NAME,	"30D3")
+			SYSFW_MATCH(SYSFW_BOARD_VENDOR,	"Quanta"),
+			SYSFW_MATCH(SYSFW_BOARD_NAME,	"30D3")
 		}
 	},
-	{ }
+	{}
 };
 
 void __init io_delay_init(void)
 {
 	if (!io_delay_override)
-		dmi_check_system(io_delay_0xed_port_dmi_table);
+		sysfw_callback(io_delay_0xed_port_table);
 }
 
 static int __init io_delay_param(char *s)
diff --git a/arch/x86/kernel/mmconf-fam10h_64.c b/arch/x86/kernel/mmconf-fam10h_64.c
index ac861b8..f24400a 100644
--- a/arch/x86/kernel/mmconf-fam10h_64.c
+++ b/arch/x86/kernel/mmconf-fam10h_64.c
@@ -6,7 +6,7 @@
 #include <linux/mm.h>
 #include <linux/string.h>
 #include <linux/pci.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include <linux/range.h>
 
 #include <asm/pci-direct.h>
@@ -213,25 +213,25 @@ void __cpuinit fam10h_check_enable_mmcfg(void)
 	wrmsrl(address, val);
 }
 
-static int __init set_check_enable_amd_mmconf(const struct dmi_system_id *d)
+static int __init set_check_enable_amd_mmconf(const struct sysfw_id *d)
 {
-        pci_probe |= PCI_CHECK_ENABLE_AMD_MMCONF;
-        return 0;
+	pci_probe |= PCI_CHECK_ENABLE_AMD_MMCONF;
+	return 0;
 }
 
-static const struct dmi_system_id __initconst mmconf_dmi_table[] = {
-        {
-                .callback = set_check_enable_amd_mmconf,
-                .ident = "Sun Microsystems Machine",
-                .matches = {
-                        DMI_MATCH(DMI_SYS_VENDOR, "Sun Microsystems"),
-                },
-        },
+static const struct sysfw_id __initconst mmconf_id_table[] = {
+	{
+		.callback = set_check_enable_amd_mmconf,
+		.ident = "Sun Microsystems Machine",
+		.matches = {
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Sun Microsystems"),
+		},
+	},
 	{}
 };
 
 /* Called from a __cpuinit function, but only on the BSP. */
-void __ref check_enable_amd_mmconf_dmi(void)
+void __ref check_enable_amd_pci_mmconf(void)
 {
-	dmi_check_system(mmconf_dmi_table);
+	sysfw_callback(mmconf_id_table);
 }
diff --git a/arch/x86/kernel/probe_roms.c b/arch/x86/kernel/probe_roms.c
index ba0a4cc..e36d641 100644
--- a/arch/x86/kernel/probe_roms.c
+++ b/arch/x86/kernel/probe_roms.c
@@ -7,7 +7,6 @@
 #include <linux/console.h>
 #include <linux/init.h>
 #include <linux/edd.h>
-#include <linux/dmi.h>
 #include <linux/pfn.h>
 #include <linux/pci.h>
 #include <asm/pci-direct.h>
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c
index e1ba8cb..c1d7c54 100644
--- a/arch/x86/kernel/process.c
+++ b/arch/x86/kernel/process.c
@@ -10,7 +10,7 @@
 #include <linux/clockchips.h>
 #include <linux/random.h>
 #include <linux/user-return-notifier.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include <linux/utsname.h>
 #include <trace/events/power.h>
 #include <linux/hw_breakpoint.h>
@@ -94,15 +94,15 @@ void show_regs_common(void)
 {
 	const char *vendor, *product, *board;
 
-	vendor = dmi_get_system_info(DMI_SYS_VENDOR);
+	vendor = sysfw_lookup(SYSFW_SYS_VENDOR);
 	if (!vendor)
 		vendor = "";
-	product = dmi_get_system_info(DMI_PRODUCT_NAME);
+	product = sysfw_lookup(SYSFW_PRODUCT_NAME);
 	if (!product)
 		product = "";
 
 	/* Board Name is optional */
-	board = dmi_get_system_info(DMI_BOARD_NAME);
+	board = sysfw_lookup(SYSFW_BOARD_NAME);
 
 	printk(KERN_CONT "\n");
 	printk(KERN_DEFAULT "Pid: %d, comm: %.20s %s %s %.*s",
diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c
index 4f0d46f..b3837c5 100644
--- a/arch/x86/kernel/reboot.c
+++ b/arch/x86/kernel/reboot.c
@@ -3,7 +3,7 @@
 #include <linux/init.h>
 #include <linux/pm.h>
 #include <linux/efi.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include <linux/sched.h>
 #include <linux/tboot.h>
 #include <linux/delay.h>
@@ -127,7 +127,7 @@ __setup("reboot=", reboot_setup);
  * Some machines require the "reboot=b"  commandline option,
  * this quirk makes that automatic.
  */
-static int __init set_bios_reboot(const struct dmi_system_id *d)
+static int __init set_bios_reboot(const struct sysfw_id *d)
 {
 	if (reboot_type != BOOT_BIOS) {
 		reboot_type = BOOT_BIOS;
@@ -136,178 +136,186 @@ static int __init set_bios_reboot(const struct dmi_system_id *d)
 	return 0;
 }
 
-static struct dmi_system_id __initdata reboot_dmi_table[] = {
+static struct sysfw_id __initdata reboot_id_table[] = {
 	{	/* Handle problems with rebooting on Dell E520's */
 		.callback = set_bios_reboot,
 		.ident = "Dell E520",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Dell DM061"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell Inc."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Dell DM061"),
 		},
 	},
 	{	/* Handle problems with rebooting on Dell 1300's */
 		.callback = set_bios_reboot,
 		.ident = "Dell PowerEdge 1300",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 1300/"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR,
+				    "Dell Computer Corporation"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "PowerEdge 1300/"),
 		},
 	},
 	{	/* Handle problems with rebooting on Dell 300's */
 		.callback = set_bios_reboot,
 		.ident = "Dell PowerEdge 300",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 300/"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR,
+				    "Dell Computer Corporation"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "PowerEdge 300/"),
 		},
 	},
 	{       /* Handle problems with rebooting on Dell Optiplex 745's SFF*/
 		.callback = set_bios_reboot,
 		.ident = "Dell OptiPlex 745",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 745"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell Inc."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "OptiPlex 745"),
 		},
 	},
 	{       /* Handle problems with rebooting on Dell Optiplex 745's DFF*/
 		.callback = set_bios_reboot,
 		.ident = "Dell OptiPlex 745",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 745"),
-			DMI_MATCH(DMI_BOARD_NAME, "0MM599"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell Inc."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "OptiPlex 745"),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "0MM599"),
 		},
 	},
 	{       /* Handle problems with rebooting on Dell Optiplex 745 with 0KW626 */
 		.callback = set_bios_reboot,
 		.ident = "Dell OptiPlex 745",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 745"),
-			DMI_MATCH(DMI_BOARD_NAME, "0KW626"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell Inc."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "OptiPlex 745"),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "0KW626"),
 		},
 	},
 	{   /* Handle problems with rebooting on Dell Optiplex 330 with 0KP561 */
 		.callback = set_bios_reboot,
 		.ident = "Dell OptiPlex 330",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 330"),
-			DMI_MATCH(DMI_BOARD_NAME, "0KP561"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell Inc."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "OptiPlex 330"),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "0KP561"),
 		},
 	},
 	{   /* Handle problems with rebooting on Dell Optiplex 360 with 0T656F */
 		.callback = set_bios_reboot,
 		.ident = "Dell OptiPlex 360",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 360"),
-			DMI_MATCH(DMI_BOARD_NAME, "0T656F"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell Inc."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "OptiPlex 360"),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "0T656F"),
 		},
 	},
 	{	/* Handle problems with rebooting on Dell OptiPlex 760 with 0G919G*/
 		.callback = set_bios_reboot,
 		.ident = "Dell OptiPlex 760",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 760"),
-			DMI_MATCH(DMI_BOARD_NAME, "0G919G"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell Inc."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "OptiPlex 760"),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "0G919G"),
 		},
 	},
 	{	/* Handle problems with rebooting on Dell 2400's */
 		.callback = set_bios_reboot,
 		.ident = "Dell PowerEdge 2400",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 2400"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR,
+				    "Dell Computer Corporation"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "PowerEdge 2400"),
 		},
 	},
 	{	/* Handle problems with rebooting on Dell T5400's */
 		.callback = set_bios_reboot,
 		.ident = "Dell Precision T5400",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Precision WorkStation T5400"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell Inc."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME,
+				    "Precision WorkStation T5400"),
 		},
 	},
 	{	/* Handle problems with rebooting on Dell T7400's */
 		.callback = set_bios_reboot,
 		.ident = "Dell Precision T7400",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Precision WorkStation T7400"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell Inc."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME,
+				    "Precision WorkStation T7400"),
 		},
 	},
 	{	/* Handle problems with rebooting on HP laptops */
 		.callback = set_bios_reboot,
 		.ident = "HP Compaq Laptop",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "HP Compaq"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Hewlett-Packard"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "HP Compaq"),
 		},
 	},
 	{	/* Handle problems with rebooting on Dell XPS710 */
 		.callback = set_bios_reboot,
 		.ident = "Dell XPS710",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Dell XPS710"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell Inc."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Dell XPS710"),
 		},
 	},
 	{	/* Handle problems with rebooting on Dell DXP061 */
 		.callback = set_bios_reboot,
 		.ident = "Dell DXP061",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Dell DXP061"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell Inc."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Dell DXP061"),
 		},
 	},
 	{	/* Handle problems with rebooting on Sony VGN-Z540N */
 		.callback = set_bios_reboot,
 		.ident = "Sony VGN-Z540N",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "VGN-Z540N"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Sony Corporation"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "VGN-Z540N"),
 		},
 	},
 	{	/* Handle problems with rebooting on CompuLab SBC-FITPC2 */
 		.callback = set_bios_reboot,
 		.ident = "CompuLab SBC-FITPC2",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "CompuLab"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "SBC-FITPC2"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "CompuLab"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "SBC-FITPC2"),
 		},
 	},
 	{       /* Handle problems with rebooting on ASUS P4S800 */
 		.callback = set_bios_reboot,
 		.ident = "ASUS P4S800",
 		.matches = {
-			DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."),
-			DMI_MATCH(DMI_BOARD_NAME, "P4S800"),
+			SYSFW_MATCH(SYSFW_BOARD_VENDOR,
+				    "ASUSTeK Computer INC."),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "P4S800"),
 		},
 	},
 	{	/* Handle problems with rebooting on VersaLogic Menlow boards */
 		.callback = set_bios_reboot,
 		.ident = "VersaLogic Menlow based board",
 		.matches = {
-			DMI_MATCH(DMI_BOARD_VENDOR, "VersaLogic Corporation"),
-			DMI_MATCH(DMI_BOARD_NAME, "VersaLogic Menlow board"),
+			SYSFW_MATCH(SYSFW_BOARD_VENDOR,
+				    "VersaLogic Corporation"),
+			SYSFW_MATCH(SYSFW_BOARD_NAME,
+				    "VersaLogic Menlow board"),
 		},
 	},
 	{ /* Handle reboot issue on Acer Aspire one */
 		.callback = set_bios_reboot,
 		.ident = "Acer Aspire One A110",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "AOA110"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Acer"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "AOA110"),
 		},
 	},
-	{ }
+	{}
 };
 
 static int __init reboot_init(void)
 {
-	dmi_check_system(reboot_dmi_table);
+	sysfw_callback(reboot_id_table);
 	return 0;
 }
 core_initcall(reboot_init);
@@ -376,7 +384,7 @@ EXPORT_SYMBOL(machine_real_restart);
 /*
  * Some Apple MacBook and MacBookPro's needs reboot=p to be able to reboot
  */
-static int __init set_pci_reboot(const struct dmi_system_id *d)
+static int __init set_pci_reboot(const struct sysfw_id *d)
 {
 	if (reboot_type != BOOT_CF9) {
 		reboot_type = BOOT_CF9;
@@ -386,45 +394,45 @@ static int __init set_pci_reboot(const struct dmi_system_id *d)
 	return 0;
 }
 
-static struct dmi_system_id __initdata pci_reboot_dmi_table[] = {
+static struct sysfw_id __initdata pci_reboot_id_table[] = {
 	{	/* Handle problems with rebooting on Apple MacBook5 */
 		.callback = set_pci_reboot,
 		.ident = "Apple MacBook5",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "MacBook5"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Apple Inc."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "MacBook5"),
 		},
 	},
 	{	/* Handle problems with rebooting on Apple MacBookPro5 */
 		.callback = set_pci_reboot,
 		.ident = "Apple MacBookPro5",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro5"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Apple Inc."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "MacBookPro5"),
 		},
 	},
 	{	/* Handle problems with rebooting on Apple Macmini3,1 */
 		.callback = set_pci_reboot,
 		.ident = "Apple Macmini3,1",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Macmini3,1"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Apple Inc."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Macmini3,1"),
 		},
 	},
 	{	/* Handle problems with rebooting on the iMac9,1. */
 		.callback = set_pci_reboot,
 		.ident = "Apple iMac9,1",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "iMac9,1"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Apple Inc."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "iMac9,1"),
 		},
 	},
-	{ }
+	{}
 };
 
 static int __init pci_reboot_init(void)
 {
-	dmi_check_system(pci_reboot_dmi_table);
+	sysfw_callback(pci_reboot_id_table);
 	return 0;
 }
 core_initcall(pci_reboot_init);
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index afaf384..8b74838 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -44,7 +44,7 @@
 #include <linux/iscsi_ibft.h>
 #include <linux/nodemask.h>
 #include <linux/kexec.h>
-#include <linux/dmi.h>
+#include <linux/smbios.h>
 #include <linux/pfn.h>
 #include <linux/pci.h>
 #include <asm/pci-direct.h>
@@ -81,7 +81,7 @@
 #include <asm/timer.h>
 #include <asm/i8259.h>
 #include <asm/sections.h>
-#include <asm/dmi.h>
+#include <asm/smbios.h>
 #include <asm/io_apic.h>
 #include <asm/ist.h>
 #include <asm/setup_arch.h>
@@ -123,8 +123,8 @@
 unsigned long max_low_pfn_mapped;
 unsigned long max_pfn_mapped;
 
-#ifdef CONFIG_DMI
-RESERVE_BRK(dmi_alloc, 65536);
+#ifdef CONFIG_SMBIOS
+RESERVE_BRK(smbios_alloc, SMBIOS_SIZE);
 #endif
 
 
@@ -834,11 +834,11 @@ void __init setup_arch(char **cmdline_p)
 	if (efi_enabled)
 		efi_init();
 
-	dmi_scan_machine();
+	smbios_init();
 
 	/*
-	 * VMware detection requires dmi to be available, so this
-	 * needs to be done after dmi_scan_machine, for the BP.
+	 * VMware detection requires smbios to be available, so this
+	 * needs to be done after smbios_init(), for the BP.
 	 */
 	init_hypervisor_platform();
 
diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
index 6cc6922..36c4160 100644
--- a/arch/x86/kernel/tsc.c
+++ b/arch/x86/kernel/tsc.c
@@ -5,7 +5,7 @@
 #include <linux/timer.h>
 #include <linux/acpi_pmtmr.h>
 #include <linux/cpufreq.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include <linux/delay.h>
 #include <linux/clocksource.h>
 #include <linux/percpu.h>
@@ -800,22 +800,22 @@ void mark_tsc_unstable(char *reason)
 
 EXPORT_SYMBOL_GPL(mark_tsc_unstable);
 
-static int __init dmi_mark_tsc_unstable(const struct dmi_system_id *d)
+static int __init quirk_mark_tsc_unstable(const struct sysfw_id *d)
 {
 	printk(KERN_NOTICE "%s detected: marking TSC unstable.\n",
-			d->ident);
+	       d->ident);
 	tsc_unstable = 1;
 	return 0;
 }
 
 /* List of systems that have known TSC problems */
-static struct dmi_system_id __initdata bad_tsc_dmi_table[] = {
+static struct sysfw_id __initdata bad_tsc_table[] = {
 	{
-		.callback = dmi_mark_tsc_unstable,
+		.callback = quirk_mark_tsc_unstable,
 		.ident = "IBM Thinkpad 380XD",
 		.matches = {
-			DMI_MATCH(DMI_BOARD_VENDOR, "IBM"),
-			DMI_MATCH(DMI_BOARD_NAME, "2635FA0"),
+			SYSFW_MATCH(SYSFW_BOARD_VENDOR, "IBM"),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "2635FA0"),
 		},
 	},
 	{}
@@ -1011,7 +1011,7 @@ void __init tsc_init(void)
 
 	use_tsc_delay();
 	/* Check and install the TSC clocksource */
-	dmi_check_system(bad_tsc_dmi_table);
+	sysfw_callback(bad_tsc_table);
 
 	if (unsynchronized_tsc())
 		mark_tsc_unstable("TSCs unsynchronized");
diff --git a/arch/x86/pci/acpi.c b/arch/x86/pci/acpi.c
index 68c3c13..51517a1 100644
--- a/arch/x86/pci/acpi.c
+++ b/arch/x86/pci/acpi.c
@@ -2,7 +2,7 @@
 #include <linux/acpi.h>
 #include <linux/init.h>
 #include <linux/irq.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include <linux/slab.h>
 #include <asm/numa.h>
 #include <asm/pci_x86.h>
@@ -18,20 +18,20 @@ struct pci_root_info {
 
 static bool pci_use_crs = true;
 
-static int __init set_use_crs(const struct dmi_system_id *id)
+static int __init set_use_crs(const struct sysfw_id *id)
 {
 	pci_use_crs = true;
 	return 0;
 }
 
-static const struct dmi_system_id pci_use_crs_table[] __initconst = {
+static const struct sysfw_id pci_use_crs_table[] __initconst = {
 	/* http://bugzilla.kernel.org/show_bug.cgi?id=14183 */
 	{
 		.callback = set_use_crs,
 		.ident = "IBM System x3800",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "IBM"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "x3800"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "IBM"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "x3800"),
 		},
 	},
 	/* https://bugzilla.kernel.org/show_bug.cgi?id=16007 */
@@ -40,7 +40,7 @@ static const struct dmi_system_id pci_use_crs_table[] __initconst = {
 		.callback = set_use_crs,
 		.ident = "ASRock ALiveSATA2-GLAN",
 		.matches = {
-			DMI_MATCH(DMI_PRODUCT_NAME, "ALiveSATA2-GLAN"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "ALiveSATA2-GLAN"),
                 },
         },
 	{}
@@ -48,12 +48,10 @@ static const struct dmi_system_id pci_use_crs_table[] __initconst = {
 
 void __init pci_acpi_crs_quirks(void)
 {
-	int year;
-
-	if (dmi_get_date(DMI_BIOS_DATE, &year, NULL, NULL) && year < 2008)
+	if (!(sysfw_get_date() >= 20080000))
 		pci_use_crs = false;
 
-	dmi_check_system(pci_use_crs_table);
+	sysfw_callback(pci_use_crs_table);
 
 	/*
 	 * If the user specifies "pci=use_crs" or "pci=nocrs" explicitly, that
diff --git a/arch/x86/pci/broadcom_bus.c b/arch/x86/pci/broadcom_bus.c
index ab8269b..c332b7b 100644
--- a/arch/x86/pci/broadcom_bus.c
+++ b/arch/x86/pci/broadcom_bus.c
@@ -11,7 +11,6 @@
 
 #include <linux/acpi.h>
 #include <linux/delay.h>
-#include <linux/dmi.h>
 #include <linux/pci.h>
 #include <linux/init.h>
 #include <asm/pci_x86.h>
diff --git a/arch/x86/pci/common.c b/arch/x86/pci/common.c
index 5fe7502..ee193bd 100644
--- a/arch/x86/pci/common.c
+++ b/arch/x86/pci/common.c
@@ -8,7 +8,8 @@
 #include <linux/pci.h>
 #include <linux/ioport.h>
 #include <linux/init.h>
-#include <linux/dmi.h>
+#include <linux/smbios.h>
+#include <linux/sysfw.h>
 #include <linux/slab.h>
 
 #include <asm/acpi.h>
@@ -79,14 +80,15 @@ struct pci_ops pci_root_ops = {
  */
 DEFINE_RAW_SPINLOCK(pci_config_lock);
 
-static int __devinit can_skip_ioresource_align(const struct dmi_system_id *d)
+static int __devinit can_skip_ioresource_align(const struct sysfw_id *d)
 {
 	pci_probe |= PCI_CAN_SKIP_ISA_ALIGN;
 	printk(KERN_INFO "PCI: %s detected, can skip ISA alignment\n", d->ident);
 	return 0;
 }
 
-static const struct dmi_system_id can_skip_pciprobe_dmi_table[] __devinitconst = {
+static const struct sysfw_id
+can_skip_pciprobe_smbios_table[] __devinitconst = {
 /*
  * Systems where PCI IO resource ISA alignment can be skipped
  * when the ISA enable bit in the bridge control is not set
@@ -95,32 +97,32 @@ static const struct dmi_system_id can_skip_pciprobe_dmi_table[] __devinitconst =
 		.callback = can_skip_ioresource_align,
 		.ident = "IBM System x3800",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "IBM"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "x3800"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "IBM"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "x3800"),
 		},
 	},
 	{
 		.callback = can_skip_ioresource_align,
 		.ident = "IBM System x3850",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "IBM"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "x3850"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "IBM"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "x3850"),
 		},
 	},
 	{
 		.callback = can_skip_ioresource_align,
 		.ident = "IBM System x3950",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "IBM"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "x3950"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "IBM"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "x3950"),
 		},
 	},
 	{}
 };
 
-void __init dmi_check_skip_isa_align(void)
+void __init smbios_check_skip_isa_align(void)
 {
-	dmi_check_system(can_skip_pciprobe_dmi_table);
+	sysfw_callback(can_skip_pciprobe_smbios_table);
 }
 
 static void __devinit pcibios_fixup_device_resources(struct pci_dev *dev)
@@ -173,32 +175,37 @@ void __devinit pcibios_fixup_bus(struct pci_bus *b)
 }
 
 /*
- * Only use DMI information to set this if nothing was passed
+ * Only use SMBIOS information to set this if nothing was passed
  * on the kernel command line (which was parsed earlier).
  */
 
-static int __devinit set_bf_sort(const struct dmi_system_id *d)
+static int __devinit set_bf_sort(const struct sysfw_id *d)
 {
 	if (pci_bf_sort == pci_bf_sort_default) {
-		pci_bf_sort = pci_dmi_bf;
+		pci_bf_sort = pci_smbios_bf;
 		printk(KERN_INFO "PCI: %s detected, enabling pci=bfsort.\n", d->ident);
 	}
 	return 0;
 }
 
-static void __devinit read_dmi_type_b1(const struct dmi_header *dm,
-				       void *private_data)
+static int __devinit dell_sort_method_decode(const union smbios_struct *ss,
+					     void *data)
 {
-	u8 *d = (u8 *)dm + 4;
+	u8 *p;
+	const struct sysfw_id *d = (const struct sysfw_id *)data;
 
-	if (dm->type != 0xB1)
-		return;
-	switch (((*(u32 *)d) >> 9) & 0x03) {
+	if ((ss->header.type) != 0xb1)
+		return SMBIOS_WALK_CONTINUE;
+
+	p = (u8 *)ss + 4;
+	switch (((*(u32 *)p) >> 9) & 0x03) {
 	case 0x00:
-		printk(KERN_INFO "dmi type 0xB1 record - unknown flag\n");
+		printk(KERN_INFO "smbios type 0xB1 record - unknown flag\n");
 		break;
 	case 0x01: /* set pci=bfsort */
 		smbios_type_b1_flag = 1;
+		set_bf_sort(d);
+		return SMBIOS_WALK_STOP;
 		break;
 	case 0x02: /* do not set pci=bfsort */
 		smbios_type_b1_flag = 2;
@@ -206,24 +213,22 @@ static void __devinit read_dmi_type_b1(const struct dmi_header *dm,
 	default:
 		break;
 	}
-}
 
-static int __devinit find_sort_method(const struct dmi_system_id *d)
-{
-	dmi_walk(read_dmi_type_b1, NULL);
+	return SMBIOS_WALK_STOP;
 
-	if (smbios_type_b1_flag == 1) {
-		set_bf_sort(d);
-		return 0;
-	}
-	return -1;
+}
+static int __devinit find_sort_method(const struct sysfw_id *d)
+{
+	if (smbios_walk(dell_sort_method_decode, (void *)d))
+		return 1;
+	return 0;
 }
 
 /*
  * Enable renumbering of PCI bus# ranges to reach all PCI busses (Cardbus)
  */
 #ifdef __i386__
-static int __devinit assign_all_busses(const struct dmi_system_id *d)
+static int __devinit assign_all_busses(const struct sysfw_id *d)
 {
 	pci_probe |= PCI_ASSIGN_ALL_BUSSES;
 	printk(KERN_INFO "%s detected: enabling PCI bus# renumbering"
@@ -232,7 +237,7 @@ static int __devinit assign_all_busses(const struct dmi_system_id *d)
 }
 #endif
 
-static const struct dmi_system_id __devinitconst pciprobe_dmi_table[] = {
+static const struct sysfw_id __devinitconst pciprobe_smbios_table[] = {
 #ifdef __i386__
 /*
  * Laptops which need pci=assign-busses to see Cardbus cards
@@ -241,8 +246,8 @@ static const struct dmi_system_id __devinitconst pciprobe_dmi_table[] = {
 		.callback = assign_all_busses,
 		.ident = "Samsung X20 Laptop",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Samsung Electronics"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "SX20S"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Samsung Electronics"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "SX20S"),
 		},
 	},
 #endif		/* __i386__ */
@@ -250,151 +255,151 @@ static const struct dmi_system_id __devinitconst pciprobe_dmi_table[] = {
 		.callback = find_sort_method,
 		.ident = "Dell System",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell Inc"),
 		},
 	},
 	{
 		.callback = set_bf_sort,
 		.ident = "Dell PowerEdge 1950",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Dell"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 1950"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "PowerEdge 1950"),
 		},
 	},
 	{
 		.callback = set_bf_sort,
 		.ident = "Dell PowerEdge 1955",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Dell"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 1955"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "PowerEdge 1955"),
 		},
 	},
 	{
 		.callback = set_bf_sort,
 		.ident = "Dell PowerEdge 2900",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Dell"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 2900"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "PowerEdge 2900"),
 		},
 	},
 	{
 		.callback = set_bf_sort,
 		.ident = "Dell PowerEdge 2950",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Dell"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 2950"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "PowerEdge 2950"),
 		},
 	},
 	{
 		.callback = set_bf_sort,
 		.ident = "Dell PowerEdge R900",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Dell"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge R900"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "PowerEdge R900"),
 		},
 	},
 	{
 		.callback = set_bf_sort,
 		.ident = "HP ProLiant BL20p G3",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "HP"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant BL20p G3"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "HP"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "ProLiant BL20p G3"),
 		},
 	},
 	{
 		.callback = set_bf_sort,
 		.ident = "HP ProLiant BL20p G4",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "HP"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant BL20p G4"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "HP"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "ProLiant BL20p G4"),
 		},
 	},
 	{
 		.callback = set_bf_sort,
 		.ident = "HP ProLiant BL30p G1",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "HP"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant BL30p G1"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "HP"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "ProLiant BL30p G1"),
 		},
 	},
 	{
 		.callback = set_bf_sort,
 		.ident = "HP ProLiant BL25p G1",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "HP"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant BL25p G1"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "HP"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "ProLiant BL25p G1"),
 		},
 	},
 	{
 		.callback = set_bf_sort,
 		.ident = "HP ProLiant BL35p G1",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "HP"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant BL35p G1"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "HP"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "ProLiant BL35p G1"),
 		},
 	},
 	{
 		.callback = set_bf_sort,
 		.ident = "HP ProLiant BL45p G1",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "HP"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant BL45p G1"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "HP"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "ProLiant BL45p G1"),
 		},
 	},
 	{
 		.callback = set_bf_sort,
 		.ident = "HP ProLiant BL45p G2",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "HP"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant BL45p G2"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "HP"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "ProLiant BL45p G2"),
 		},
 	},
 	{
 		.callback = set_bf_sort,
 		.ident = "HP ProLiant BL460c G1",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "HP"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant BL460c G1"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "HP"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "ProLiant BL460c G1"),
 		},
 	},
 	{
 		.callback = set_bf_sort,
 		.ident = "HP ProLiant BL465c G1",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "HP"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant BL465c G1"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "HP"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "ProLiant BL465c G1"),
 		},
 	},
 	{
 		.callback = set_bf_sort,
 		.ident = "HP ProLiant BL480c G1",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "HP"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant BL480c G1"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "HP"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "ProLiant BL480c G1"),
 		},
 	},
 	{
 		.callback = set_bf_sort,
 		.ident = "HP ProLiant BL685c G1",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "HP"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant BL685c G1"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "HP"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "ProLiant BL685c G1"),
 		},
 	},
 	{
 		.callback = set_bf_sort,
 		.ident = "HP ProLiant DL360",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "HP"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant DL360"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "HP"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "ProLiant DL360"),
 		},
 	},
 	{
 		.callback = set_bf_sort,
 		.ident = "HP ProLiant DL380",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "HP"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant DL380"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "HP"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "ProLiant DL380"),
 		},
 	},
 #ifdef __i386__
@@ -402,8 +407,8 @@ static const struct dmi_system_id __devinitconst pciprobe_dmi_table[] = {
 		.callback = assign_all_busses,
 		.ident = "Compaq EVO N800c",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Compaq"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "EVO N800c"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Compaq"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "EVO N800c"),
 		},
 	},
 #endif
@@ -411,24 +416,24 @@ static const struct dmi_system_id __devinitconst pciprobe_dmi_table[] = {
 		.callback = set_bf_sort,
 		.ident = "HP ProLiant DL385 G2",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "HP"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant DL385 G2"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "HP"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "ProLiant DL385 G2"),
 		},
 	},
 	{
 		.callback = set_bf_sort,
 		.ident = "HP ProLiant DL585 G2",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "HP"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant DL585 G2"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "HP"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "ProLiant DL585 G2"),
 		},
 	},
 	{}
 };
 
-void __init dmi_check_pciprobe(void)
+void __init smbios_check_pciprobe(void)
 {
-	dmi_check_system(pciprobe_dmi_table);
+	sysfw_callback(pciprobe_smbios_table);
 }
 
 struct pci_bus * __devinit pcibios_scan_root(int busnum)
diff --git a/arch/x86/pci/direct.c b/arch/x86/pci/direct.c
index e6fd847..217d788 100644
--- a/arch/x86/pci/direct.c
+++ b/arch/x86/pci/direct.c
@@ -4,7 +4,7 @@
 
 #include <linux/pci.h>
 #include <linux/init.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include <asm/pci_x86.h>
 
 /*
@@ -192,14 +192,13 @@ struct pci_raw_ops pci_direct_conf2 = {
 static int __init pci_sanity_check(struct pci_raw_ops *o)
 {
 	u32 x = 0;
-	int year, devfn;
+	int devfn;
 
 	if (pci_probe & PCI_NO_CHECKS)
 		return 1;
 	/* Assume Type 1 works for newer systems.
 	   This handles machines that don't have anything on PCI Bus 0. */
-	dmi_get_date(DMI_BIOS_DATE, &year, NULL, NULL);
-	if (year >= 2001)
+	if (sysfw_get_date() >= 20010000)
 		return 1;
 
 	for (devfn = 0; devfn < 0x100; devfn++) {
diff --git a/arch/x86/pci/fixup.c b/arch/x86/pci/fixup.c
index 6dd8955..381c136 100644
--- a/arch/x86/pci/fixup.c
+++ b/arch/x86/pci/fixup.c
@@ -3,7 +3,7 @@
  */
 
 #include <linux/delay.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include <linux/pci.h>
 #include <linux/init.h>
 #include <asm/pci_x86.h>
@@ -356,12 +356,12 @@ static void __devinit pci_fixup_video(struct pci_dev *pdev)
 DECLARE_PCI_FIXUP_FINAL(PCI_ANY_ID, PCI_ANY_ID, pci_fixup_video);
 
 
-static const struct dmi_system_id __devinitconst msi_k8t_dmi_table[] = {
+static const struct sysfw_id __devinitconst msi_k8t_quirk_table[] = {
 	{
 		.ident = "MSI-K8T-Neo2Fir",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "MSI"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "MS-6702E"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "MSI"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "MS-6702E"),
 		},
 	},
 	{}
@@ -375,12 +375,12 @@ static const struct dmi_system_id __devinitconst msi_k8t_dmi_table[] = {
  * the corresponding register-value to enable the soundcard.
  *
  * The soundcard is only enabled, if the mainborad is identified
- * via DMI-tables and the soundcard is detected to be off.
+ * via SMBIOS tables and the soundcard is detected to be off.
  */
 static void __devinit pci_fixup_msi_k8t_onboard_sound(struct pci_dev *dev)
 {
 	unsigned char val;
-	if (!dmi_check_system(msi_k8t_dmi_table))
+	if (!sysfw_callback(msi_k8t_quirk_table))
 		return; /* only applies to MSI K8T Neo2-FIR */
 
 	pci_read_config_byte(dev, 0x50, &val);
@@ -413,34 +413,35 @@ DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8237,
  */
 static u16 toshiba_line_size;
 
-static const struct dmi_system_id __devinitconst toshiba_ohci1394_dmi_table[] = {
+static const struct sysfw_id __devinitconst
+toshiba_ohci1394_quirk_table[] = {
 	{
 		.ident = "Toshiba PS5 based laptop",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
-			DMI_MATCH(DMI_PRODUCT_VERSION, "PS5"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "TOSHIBA"),
+			SYSFW_MATCH(SYSFW_PRODUCT_VERSION, "PS5"),
 		},
 	},
 	{
 		.ident = "Toshiba PSM4 based laptop",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
-			DMI_MATCH(DMI_PRODUCT_VERSION, "PSM4"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "TOSHIBA"),
+			SYSFW_MATCH(SYSFW_PRODUCT_VERSION, "PSM4"),
 		},
 	},
 	{
 		.ident = "Toshiba A40 based laptop",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
-			DMI_MATCH(DMI_PRODUCT_VERSION, "PSA40U"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "TOSHIBA"),
+			SYSFW_MATCH(SYSFW_PRODUCT_VERSION, "PSA40U"),
 		},
 	},
-	{ }
+	{}
 };
 
 static void __devinit pci_pre_fixup_toshiba_ohci1394(struct pci_dev *dev)
 {
-	if (!dmi_check_system(toshiba_ohci1394_dmi_table))
+	if (!sysfw_callback(toshiba_ohci1394_quirk_table))
 		return; /* only applies to certain Toshibas (so far) */
 
 	dev->current_state = PCI_D3cold;
@@ -451,7 +452,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_TI, 0x8032,
 
 static void __devinit pci_post_fixup_toshiba_ohci1394(struct pci_dev *dev)
 {
-	if (!dmi_check_system(toshiba_ohci1394_dmi_table))
+	if (!sysfw_callback(toshiba_ohci1394_quirk_table))
 		return; /* only applies to certain Toshibas (so far) */
 
 	/* Restore config space on Toshiba laptops */
diff --git a/arch/x86/pci/init.c b/arch/x86/pci/init.c
index adb62aa..9afdbc3 100644
--- a/arch/x86/pci/init.c
+++ b/arch/x86/pci/init.c
@@ -35,9 +35,9 @@ static __init int pci_arch_init(void)
 		printk(KERN_ERR
 		"PCI: Fatal: No config space access function found\n");
 
-	dmi_check_pciprobe();
+	smbios_check_pciprobe();
 
-	dmi_check_skip_isa_align();
+	smbios_check_skip_isa_align();
 
 	return 0;
 }
diff --git a/arch/x86/pci/irq.c b/arch/x86/pci/irq.c
index 372e9b8..3e2ac8f 100644
--- a/arch/x86/pci/irq.c
+++ b/arch/x86/pci/irq.c
@@ -9,7 +9,7 @@
 #include <linux/pci.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include <linux/io.h>
 #include <linux/smp.h>
 #include <asm/io_apic.h>
@@ -1070,7 +1070,7 @@ void __init pcibios_fixup_irqs(void)
  * Work around broken HP Pavilion Notebooks which assign USB to
  * IRQ 9 even though it is actually wired to IRQ 11
  */
-static int __init fix_broken_hp_bios_irq9(const struct dmi_system_id *d)
+static int __init fix_broken_hp_bios_irq9(const struct sysfw_id *d)
 {
 	if (!broken_hp_bios_irq9) {
 		broken_hp_bios_irq9 = 1;
@@ -1084,7 +1084,7 @@ static int __init fix_broken_hp_bios_irq9(const struct dmi_system_id *d)
  * Work around broken Acer TravelMate 360 Notebooks which assign
  * Cardbus to IRQ 11 even though it is actually wired to IRQ 10
  */
-static int __init fix_acer_tm360_irqrouting(const struct dmi_system_id *d)
+static int __init fix_acer_tm360_irqrouting(const struct sysfw_id *d)
 {
 	if (!acer_tm360_irqrouting) {
 		acer_tm360_irqrouting = 1;
@@ -1094,27 +1094,27 @@ static int __init fix_acer_tm360_irqrouting(const struct dmi_system_id *d)
 	return 0;
 }
 
-static struct dmi_system_id __initdata pciirq_dmi_table[] = {
+static struct sysfw_id __initdata pciirq_quirk_table[] = {
 	{
 		.callback = fix_broken_hp_bios_irq9,
 		.ident = "HP Pavilion N5400 Series Laptop",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
-			DMI_MATCH(DMI_BIOS_VERSION, "GE.M1.03"),
-			DMI_MATCH(DMI_PRODUCT_VERSION,
-				"HP Pavilion Notebook Model GE"),
-			DMI_MATCH(DMI_BOARD_VERSION, "OmniBook N32N-736"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Hewlett-Packard"),
+			SYSFW_MATCH(SYSFW_BIOS_VERSION, "GE.M1.03"),
+			SYSFW_MATCH(SYSFW_PRODUCT_VERSION,
+				    "HP Pavilion Notebook Model GE"),
+			SYSFW_MATCH(SYSFW_BOARD_VERSION, "OmniBook N32N-736"),
 		},
 	},
 	{
 		.callback = fix_acer_tm360_irqrouting,
 		.ident = "Acer TravelMate 36x Laptop",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 360"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Acer"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "TravelMate 360"),
 		},
 	},
-	{ }
+	{}
 };
 
 void __init pcibios_irq_init(void)
@@ -1124,7 +1124,7 @@ void __init pcibios_irq_init(void)
 	if (raw_pci_ops == NULL)
 		return;
 
-	dmi_check_system(pciirq_dmi_table);
+	sysfw_callback(pciirq_quirk_table);
 
 	pirq_table = pirq_find_routing_table();
 
diff --git a/arch/x86/pci/mmconfig-shared.c b/arch/x86/pci/mmconfig-shared.c
index 750c346..730b36b 100644
--- a/arch/x86/pci/mmconfig-shared.c
+++ b/arch/x86/pci/mmconfig-shared.c
@@ -15,7 +15,7 @@
 #include <linux/acpi.h>
 #include <linux/sfi_acpi.h>
 #include <linux/bitmap.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include <linux/slab.h>
 #include <asm/e820.h>
 #include <asm/pci_x86.h>
@@ -514,19 +514,15 @@ static int __initdata known_bridge;
 static int __init acpi_mcfg_check_entry(struct acpi_table_mcfg *mcfg,
 					struct acpi_mcfg_allocation *cfg)
 {
-	int year;
-
 	if (cfg->address < 0xFFFFFFFF)
 		return 0;
 
 	if (!strcmp(mcfg->header.oem_id, "SGI"))
 		return 0;
 
-	if (mcfg->header.revision >= 1) {
-		if (dmi_get_date(DMI_BIOS_DATE, &year, NULL, NULL) &&
-		    year >= 2010)
+	if (mcfg->header.revision >= 1)
+		if (sysfw_get_date() >= 20100000)
 			return 0;
-	}
 
 	printk(KERN_ERR PREFIX "MCFG region for %04x [bus %02x-%02x] at %#llx "
 	       "is above 4GB, ignored\n", cfg->pci_segment,
diff --git a/arch/x86/pci/mrst.c b/arch/x86/pci/mrst.c
index cb29191..741dbb0 100644
--- a/arch/x86/pci/mrst.c
+++ b/arch/x86/pci/mrst.c
@@ -22,7 +22,6 @@
 #include <linux/pci.h>
 #include <linux/ioport.h>
 #include <linux/init.h>
-#include <linux/dmi.h>
 
 #include <asm/acpi.h>
 #include <asm/segment.h>
diff --git a/drivers/cpufreq/acpi-cpufreq.c b/drivers/cpufreq/acpi-cpufreq.c
index 596d5dd..6880c41 100644
--- a/drivers/cpufreq/acpi-cpufreq.c
+++ b/drivers/cpufreq/acpi-cpufreq.c
@@ -32,7 +32,7 @@
 #include <linux/sched.h>
 #include <linux/cpufreq.h>
 #include <linux/compiler.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include <linux/slab.h>
 
 #include <linux/acpi.h>
@@ -462,23 +462,23 @@ static int __init acpi_cpufreq_early_init(void)
  */
 static int bios_with_sw_any_bug;
 
-static int sw_any_bug_found(const struct dmi_system_id *d)
+static int sw_any_bug_found(const struct sysfw_id *d)
 {
 	bios_with_sw_any_bug = 1;
 	return 0;
 }
 
-static const struct dmi_system_id sw_any_bug_dmi_table[] = {
+static const struct sysfw_id sw_any_bug_table[] = {
 	{
 		.callback = sw_any_bug_found,
 		.ident = "Supermicro Server X6DLP",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Supermicro"),
-			DMI_MATCH(DMI_BIOS_VERSION, "080010"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "X6DLP"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Supermicro"),
+			SYSFW_MATCH(SYSFW_BIOS_VERSION, "080010"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "X6DLP"),
 		},
 	},
-	{ }
+	{}
 };
 
 static int acpi_cpufreq_blacklist(struct cpuinfo_x86 *c)
@@ -554,7 +554,7 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)
 	cpumask_copy(policy->related_cpus, perf->shared_cpu_map);
 
 #ifdef CONFIG_SMP
-	dmi_check_system(sw_any_bug_dmi_table);
+	sysfw_callback(sw_any_bug_table);
 	if (bios_with_sw_any_bug && cpumask_weight(policy->cpus) == 1) {
 		policy->shared_type = CPUFREQ_SHARED_TYPE_ALL;
 		cpumask_copy(policy->cpus, cpu_core_mask(cpu));
diff --git a/drivers/cpufreq/powernow-k7.c b/drivers/cpufreq/powernow-k7.c
index d71d9f3..ce33c9f 100644
--- a/drivers/cpufreq/powernow-k7.c
+++ b/drivers/cpufreq/powernow-k7.c
@@ -21,7 +21,7 @@
 #include <linux/cpufreq.h>
 #include <linux/slab.h>
 #include <linux/string.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include <linux/timex.h>
 #include <linux/io.h>
 
@@ -598,7 +598,7 @@ static unsigned int powernow_get(unsigned int cpu)
 }
 
 
-static int __cpuinit acer_cpufreq_pst(const struct dmi_system_id *d)
+static int __cpuinit acer_cpufreq_pst(const struct sysfw_id *d)
 {
 	printk(KERN_WARNING PFX
 		"%s laptop with broken PST tables in BIOS detected.\n",
@@ -616,16 +616,16 @@ static int __cpuinit acer_cpufreq_pst(const struct dmi_system_id *d)
  * A BIOS update is all that can save them.
  * Mention this, and disable cpufreq.
  */
-static struct dmi_system_id __cpuinitdata powernow_dmi_table[] = {
+static struct sysfw_id __cpuinitdata powernow_id_table[] = {
 	{
 		.callback = acer_cpufreq_pst,
 		.ident = "Acer Aspire",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Insyde Software"),
-			DMI_MATCH(DMI_BIOS_VERSION, "3A71"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Insyde Software"),
+			SYSFW_MATCH(SYSFW_BIOS_VERSION, "3A71"),
 		},
 	},
-	{ }
+	{}
 };
 
 static int __cpuinit powernow_cpu_init(struct cpufreq_policy *policy)
@@ -647,7 +647,7 @@ static int __cpuinit powernow_cpu_init(struct cpufreq_policy *policy)
 	}
 	pr_debug("FSB: %3dMHz\n", fsb/1000);
 
-	if (dmi_check_system(powernow_dmi_table) || acpi_force) {
+	if (sysfw_callback(powernow_id_table) || acpi_force) {
 		printk(KERN_INFO PFX "PSB/PST known to be broken.  "
 				"Trying ACPI instead\n");
 		result = powernow_acpi_init();
-- 
1.6.5.2


^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [PATCH 04/34] drivers/acpi changes for SMBIOS and System Firmware interface
  2011-07-18 13:08 [PATCH 00/34] System Firmware and SMBIOS Support [v3] Prarit Bhargava
                   ` (2 preceding siblings ...)
  2011-07-18 13:08 ` [PATCH 03/34] arch specific changes for SMBIOS and System Firmware Prarit Bhargava
@ 2011-07-18 13:08 ` Prarit Bhargava
  2011-07-18 13:08 ` [PATCH 05/34] drivers/ata changes for SMBIOS and System Firmware Prarit Bhargava
                   ` (29 subsequent siblings)
  33 siblings, 0 replies; 48+ messages in thread
From: Prarit Bhargava @ 2011-07-18 13:08 UTC (permalink / raw)
  To: linux-kernel; +Cc: Prarit Bhargava, linux-acpi

As part of the new SMBIOS and System Firmware code:

- Replace old dmi* structures and functions with new sysfw* and smbios*
structures and functions in individual drivers
- cleanup sysfw_id lookup tables
- cleanup of includes for dmi.h and mod_devicetable.h which were included in
some files that did not need them

Cc: linux-acpi@vger.kernel.org
Signed-off-by: Prarit Bhargava <prarit@redhat.com>
---
 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           |   33 +++++-----
 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, 295 insertions(+), 229 deletions(-)

diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
index fcc13ac..cf4faba 100644
--- a/drivers/acpi/battery.c
+++ b/drivers/acpi/battery.c
@@ -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);
-	}
 }
 
 /*
diff --git a/drivers/acpi/blacklist.c b/drivers/acpi/blacklist.c
index af308d0..4e44fbe 100644
--- a/drivers/acpi/blacklist.c
+++ b/drivers/acpi/blacklist.c
@@ -3,7 +3,7 @@
  *
  *  Check to see if the given machine has a known bad ACPI BIOS
  *  or if the BIOS is too old.
- *  Check given machine against acpi_osi_dmi_table[].
+ *  Check given machine against acpi_osi_smbios_table[].
  *
  *  Copyright (C) 2004 Len Brown <len.brown@intel.com>
  *  Copyright (C) 2002 Andy Grover <andrew.grover@intel.com>
@@ -32,7 +32,7 @@
 #include <linux/init.h>
 #include <linux/acpi.h>
 #include <acpi/acpi_bus.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 
 #include "internal.h"
 
@@ -53,7 +53,7 @@ struct acpi_blacklist_item {
 	u32 is_critical_error;
 };
 
-static struct dmi_system_id acpi_osi_dmi_table[] __initdata;
+static struct sysfw_id acpi_osi_table[] __initdata;
 
 /*
  * POLICY: If *anything* doesn't work, put it on the blacklist.
@@ -83,18 +83,18 @@ static int __init blacklist_by_year(void)
 	int year;
 
 	/* Doesn't exist? Likely an old system */
-	if (!dmi_get_date(DMI_BIOS_DATE, &year, NULL, NULL)) {
-		printk(KERN_ERR PREFIX "no DMI BIOS year, "
+	if (!sysfw_lookup(SYSFW_BIOS_DATE)) {
+		printk(KERN_ERR PREFIX "no SMBIOS year, "
 			"acpi=force is required to enable ACPI\n" );
 		return 1;
 	}
 	/* 0? Likely a buggy new BIOS */
-	if (year == 0) {
-		printk(KERN_ERR PREFIX "DMI BIOS year==0, "
+	if (!sysfw_get_date()) {
+		printk(KERN_ERR PREFIX "SMBIOS date = 0, "
 			"assuming ACPI-capable machine\n" );
 		return 0;
 	}
-	if (year < CONFIG_ACPI_BLACKLIST_YEAR) {
+	if (sysfw_get_date() < (CONFIG_ACPI_BLACKLIST_YEAR * 10000)) {
 		printk(KERN_ERR PREFIX "BIOS age (%d) fails cutoff (%d), "
 		       "acpi=force is required to enable ACPI\n",
 		       year, CONFIG_ACPI_BLACKLIST_YEAR);
@@ -169,38 +169,37 @@ int __init acpi_blacklisted(void)
 
 	blacklisted += blacklist_by_year();
 
-	dmi_check_system(acpi_osi_dmi_table);
+	sysfw_callback(acpi_osi_table);
 
 	return blacklisted;
 }
-#ifdef CONFIG_DMI
-static int __init dmi_enable_osi_linux(const struct dmi_system_id *d)
+static int __init enable_osi_linux(const struct sysfw_id *d)
 {
-	acpi_dmi_osi_linux(1, d);	/* enable */
+	acpi_smbios_osi_linux(1, d);	/* enable */
 	return 0;
 }
-static int __init dmi_disable_osi_vista(const struct dmi_system_id *d)
+static int __init disable_osi_vista(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);
 	acpi_osi_setup("!Windows 2006");
 	acpi_osi_setup("!Windows 2006 SP1");
 	acpi_osi_setup("!Windows 2006 SP2");
 	return 0;
 }
-static int __init dmi_disable_osi_win7(const struct dmi_system_id *d)
+static int __init disable_osi_win7(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);
 	acpi_osi_setup("!Windows 2009");
 	return 0;
 }
 
-static struct dmi_system_id acpi_osi_dmi_table[] __initdata = {
+static struct sysfw_id acpi_osi_table[] __initdata = {
 	{
-	.callback = dmi_disable_osi_vista,
+	.callback = disable_osi_vista,
 	.ident = "Fujitsu Siemens",
 	.matches = {
-		     DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
-		     DMI_MATCH(DMI_PRODUCT_NAME, "ESPRIMO Mobile V5505"),
+		     SYSFW_MATCH(SYSFW_SYS_VENDOR, "FUJITSU SIEMENS"),
+		     SYSFW_MATCH(SYSFW_PRODUCT_NAME, "ESPRIMO Mobile V5505"),
 		},
 	},
 	{
@@ -209,63 +208,63 @@ static struct dmi_system_id acpi_osi_dmi_table[] __initdata = {
 	 * driver (e.g. nouveau) when user press brightness hotkey.
 	 * Currently, nouveau driver didn't do the job and it causes there
 	 * have a infinite while loop in DSDT when user press hotkey.
-	 * We add MSI GX723's dmi information to this table for workaround
+	 * We add MSI GX723's smbios information to this table for workaround
 	 * this issue.
 	 * Will remove MSI GX723 from the table after nouveau grows support.
 	 */
-	.callback = dmi_disable_osi_vista,
+	.callback = disable_osi_vista,
 	.ident = "MSI GX723",
 	.matches = {
-		     DMI_MATCH(DMI_SYS_VENDOR, "Micro-Star International"),
-		     DMI_MATCH(DMI_PRODUCT_NAME, "GX723"),
+		     SYSFW_MATCH(SYSFW_SYS_VENDOR, "Micro-Star International"),
+		     SYSFW_MATCH(SYSFW_PRODUCT_NAME, "GX723"),
 		},
 	},
 	{
-	.callback = dmi_disable_osi_vista,
+	.callback = disable_osi_vista,
 	.ident = "Sony VGN-NS10J_S",
 	.matches = {
-		     DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
-		     DMI_MATCH(DMI_PRODUCT_NAME, "VGN-NS10J_S"),
+		     SYSFW_MATCH(SYSFW_SYS_VENDOR, "Sony Corporation"),
+		     SYSFW_MATCH(SYSFW_PRODUCT_NAME, "VGN-NS10J_S"),
 		},
 	},
 	{
-	.callback = dmi_disable_osi_vista,
+	.callback = disable_osi_vista,
 	.ident = "Sony VGN-SR290J",
 	.matches = {
-		     DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
-		     DMI_MATCH(DMI_PRODUCT_NAME, "VGN-SR290J"),
+		     SYSFW_MATCH(SYSFW_SYS_VENDOR, "Sony Corporation"),
+		     SYSFW_MATCH(SYSFW_PRODUCT_NAME, "VGN-SR290J"),
 		},
 	},
 	{
-	.callback = dmi_disable_osi_vista,
+	.callback = disable_osi_vista,
 	.ident = "VGN-NS50B_L",
 	.matches = {
-		     DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
-		     DMI_MATCH(DMI_PRODUCT_NAME, "VGN-NS50B_L"),
+		     SYSFW_MATCH(SYSFW_SYS_VENDOR, "Sony Corporation"),
+		     SYSFW_MATCH(SYSFW_PRODUCT_NAME, "VGN-NS50B_L"),
 		},
 	},
 	{
-	.callback = dmi_disable_osi_vista,
+	.callback = disable_osi_vista,
 	.ident = "Toshiba Satellite L355",
 	.matches = {
-		     DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
-		     DMI_MATCH(DMI_PRODUCT_VERSION, "Satellite L355"),
+		     SYSFW_MATCH(SYSFW_SYS_VENDOR, "TOSHIBA"),
+		     SYSFW_MATCH(SYSFW_PRODUCT_VERSION, "Satellite L355"),
 		},
 	},
 	{
-	.callback = dmi_disable_osi_win7,
+	.callback = disable_osi_win7,
 	.ident = "ASUS K50IJ",
 	.matches = {
-		     DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK Computer Inc."),
-		     DMI_MATCH(DMI_PRODUCT_NAME, "K50IJ"),
+		     SYSFW_MATCH(SYSFW_SYS_VENDOR, "ASUSTeK Computer Inc."),
+		     SYSFW_MATCH(SYSFW_PRODUCT_NAME, "K50IJ"),
 		},
 	},
 	{
-	.callback = dmi_disable_osi_vista,
+	.callback = disable_osi_vista,
 	.ident = "Toshiba P305D",
 	.matches = {
-		     DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
-		     DMI_MATCH(DMI_PRODUCT_NAME, "Satellite P305D"),
+		     SYSFW_MATCH(SYSFW_SYS_VENDOR, "TOSHIBA"),
+		     SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Satellite P305D"),
 		},
 	},
 
@@ -279,56 +278,54 @@ static struct dmi_system_id acpi_osi_dmi_table[] __initdata = {
 	 * and thus we can not wildcard the vendor.
 	 *
 	 * _OSI(Linux) helps sound
-	 * DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad R61"),
-	 * DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T61"),
+	 * SYSFW_MATCH(SYSFW_PRODUCT_VERSION, "ThinkPad R61"),
+	 * SYSFW_MATCH(SYSFW_PRODUCT_VERSION, "ThinkPad T61"),
 	 * T400, T500
 	 * _OSI(Linux) has Linux specific hooks
-	 * DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X61"),
+	 * SYSFW_MATCH(SYSFW_PRODUCT_VERSION, "ThinkPad X61"),
 	 * _OSI(Linux) is a NOP:
-	 * DMI_MATCH(DMI_PRODUCT_VERSION, "3000 N100"),
-	 * DMI_MATCH(DMI_PRODUCT_VERSION, "LENOVO3000 V100"),
+	 * SYSFW_MATCH(SYSFW_PRODUCT_VERSION, "3000 N100"),
+	 * SYSFW_MATCH(SYSFW_PRODUCT_VERSION, "LENOVO3000 V100"),
 	 */
 	{
-	.callback = dmi_enable_osi_linux,
+	.callback = enable_osi_linux,
 	.ident = "Lenovo ThinkPad R61",
 	.matches = {
-		     DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
-		     DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad R61"),
+		     SYSFW_MATCH(SYSFW_SYS_VENDOR, "LENOVO"),
+		     SYSFW_MATCH(SYSFW_PRODUCT_VERSION, "ThinkPad R61"),
 		},
 	},
 	{
-	.callback = dmi_enable_osi_linux,
+	.callback = enable_osi_linux,
 	.ident = "Lenovo ThinkPad T61",
 	.matches = {
-		     DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
-		     DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T61"),
+		     SYSFW_MATCH(SYSFW_SYS_VENDOR, "LENOVO"),
+		     SYSFW_MATCH(SYSFW_PRODUCT_VERSION, "ThinkPad T61"),
 		},
 	},
 	{
-	.callback = dmi_enable_osi_linux,
+	.callback = enable_osi_linux,
 	.ident = "Lenovo ThinkPad X61",
 	.matches = {
-		     DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
-		     DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X61"),
+		     SYSFW_MATCH(SYSFW_SYS_VENDOR, "LENOVO"),
+		     SYSFW_MATCH(SYSFW_PRODUCT_VERSION, "ThinkPad X61"),
 		},
 	},
 	{
-	.callback = dmi_enable_osi_linux,
+	.callback = enable_osi_linux,
 	.ident = "Lenovo ThinkPad T400",
 	.matches = {
-		     DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
-		     DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T400"),
+		     SYSFW_MATCH(SYSFW_SYS_VENDOR, "LENOVO"),
+		     SYSFW_MATCH(SYSFW_PRODUCT_VERSION, "ThinkPad T400"),
 		},
 	},
 	{
-	.callback = dmi_enable_osi_linux,
+	.callback = enable_osi_linux,
 	.ident = "Lenovo ThinkPad T500",
 	.matches = {
-		     DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
-		     DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T500"),
+		     SYSFW_MATCH(SYSFW_SYS_VENDOR, "LENOVO"),
+		     SYSFW_MATCH(SYSFW_PRODUCT_VERSION, "ThinkPad T500"),
 		},
 	},
 	{}
 };
-
-#endif /* CONFIG_DMI */
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
index d1e06c1..09ad035 100644
--- a/drivers/acpi/bus.c
+++ b/drivers/acpi/bus.c
@@ -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)) {
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index b19a18d..f0febee 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -41,7 +41,7 @@
 #include <asm/io.h>
 #include <acpi/acpi_bus.h>
 #include <acpi/acpi_drivers.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 
 #include "internal.h"
 
@@ -892,21 +892,21 @@ static const struct acpi_device_id ec_device_ids[] = {
 };
 
 /* Some BIOS do not survive early DSDT scan, skip it */
-static int ec_skip_dsdt_scan(const struct dmi_system_id *id)
+static int ec_skip_dsdt_scan(const struct sysfw_id *id)
 {
 	EC_FLAGS_SKIP_DSDT_SCAN = 1;
 	return 0;
 }
 
 /* ASUStek often supplies us with broken ECDT, validate it */
-static int ec_validate_ecdt(const struct dmi_system_id *id)
+static int ec_validate_ecdt(const struct sysfw_id *id)
 {
 	EC_FLAGS_VALIDATE_ECDT = 1;
 	return 0;
 }
 
 /* MSI EC needs special treatment, enable it */
-static int ec_flag_msi(const struct dmi_system_id *id)
+static int ec_flag_msi(const struct sysfw_id *id)
 {
 	printk(KERN_DEBUG PREFIX "Detected MSI hardware, enabling workarounds.\n");
 	EC_FLAGS_MSI = 1;
@@ -914,41 +914,84 @@ static int ec_flag_msi(const struct dmi_system_id *id)
 	return 0;
 }
 
-static struct dmi_system_id __initdata ec_dmi_table[] = {
+static struct sysfw_id __initdata ec_smbios_table[] = {
 	{
-	ec_skip_dsdt_scan, "Compal JFL92", {
-	DMI_MATCH(DMI_BIOS_VENDOR, "COMPAL"),
-	DMI_MATCH(DMI_BOARD_NAME, "JFL92") }, NULL},
+		.callback = ec_skip_dsdt_scan,
+		.ident = "Compal JFL92",
+		.matches = {
+			SYSFW_MATCH(SYSFW_BIOS_VENDOR, "COMPAL"),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "JFL92")
+		},
+	},
+	{
+		.callback = ec_flag_msi,
+		.ident = "MSI hardware",
+		.matches = {
+			SYSFW_MATCH(SYSFW_BIOS_VENDOR, "Micro-Star")
+		},
+	},
 	{
-	ec_flag_msi, "MSI hardware", {
-	DMI_MATCH(DMI_BIOS_VENDOR, "Micro-Star")}, NULL},
+		.callback = ec_flag_msi,
+		.ident = "MSI hardware",
+		.matches = {
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Micro-Star")
+		},
+	},
 	{
-	ec_flag_msi, "MSI hardware", {
-	DMI_MATCH(DMI_SYS_VENDOR, "Micro-Star")}, NULL},
+		.callback = ec_flag_msi,
+		.ident = "MSI hardware",
+		.matches = {
+			SYSFW_MATCH(SYSFW_CHASSIS_VENDOR, "MICRO-Star")
+		},
+	},
 	{
-	ec_flag_msi, "MSI hardware", {
-	DMI_MATCH(DMI_CHASSIS_VENDOR, "MICRO-Star")}, NULL},
+		.callback = ec_flag_msi,
+		.ident = "MSI hardware",
+		.matches = {
+			SYSFW_MATCH(SYSFW_CHASSIS_VENDOR, "MICRO-STAR")
+		},
+	},
 	{
-	ec_flag_msi, "MSI hardware", {
-	DMI_MATCH(DMI_CHASSIS_VENDOR, "MICRO-STAR")}, NULL},
+		.callback = ec_flag_msi,
+		.ident = "Quanta hardware",
+		.matches = {
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Quanta"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "TW8/SW8/DW8")
+		},
+	},
 	{
-	ec_flag_msi, "Quanta hardware", {
-	DMI_MATCH(DMI_SYS_VENDOR, "Quanta"),
-	DMI_MATCH(DMI_PRODUCT_NAME, "TW8/SW8/DW8"),}, NULL},
+		.callback = ec_flag_msi,
+		.ident = "Quanta hardware",
+		.matches = {
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Quanta"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "TW9/SW9")
+		},
+	},
 	{
-	ec_flag_msi, "Quanta hardware", {
-	DMI_MATCH(DMI_SYS_VENDOR, "Quanta"),
-	DMI_MATCH(DMI_PRODUCT_NAME, "TW9/SW9"),}, NULL},
+		.callback = ec_validate_ecdt,
+		.ident = "ASUS hardware",
+		.matches = {
+			SYSFW_MATCH(SYSFW_BIOS_VENDOR, "ASUS")
+		},
+	},
 	{
-	ec_validate_ecdt, "ASUS hardware", {
-	DMI_MATCH(DMI_BIOS_VENDOR, "ASUS") }, NULL},
+		.callback = ec_validate_ecdt,
+		.ident = "ASUS hardware",
+		.matches = {
+			SYSFW_MATCH(SYSFW_BOARD_VENDOR,
+				    "ASUSTeK Computer Inc.")
+		},
+	},
 	{
-	ec_validate_ecdt, "ASUS hardware", {
-	DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer Inc.") }, NULL},
+		.callback = ec_validate_ecdt,
+		.ident = "ASUS hardware",
+		.matches = {
+			SYSFW_MATCH(SYSFW_BIOS_VENDOR, "ASUS")
+		},
+	},
 	{},
 };
 
-
 int __init acpi_ec_ecdt_probe(void)
 {
 	acpi_status status;
@@ -961,7 +1004,7 @@ int __init acpi_ec_ecdt_probe(void)
 	/*
 	 * Generate a boot ec context
 	 */
-	dmi_check_system(ec_dmi_table);
+	sysfw_callback(ec_smbios_table);
 	status = acpi_get_table(ACPI_SIG_ECDT, 1,
 				(struct acpi_table_header **)&ecdt_ptr);
 	if (ACPI_SUCCESS(status)) {
@@ -1009,7 +1052,7 @@ int __init acpi_ec_ecdt_probe(void)
 		* Keep boot_ec struct as it will be needed soon.
 		*/
 		acpi_handle dummy;
-		if (!dmi_name_in_vendors("ASUS") ||
+		if (!sysfw_vendor_is("ASUS") ||
 		    ACPI_FAILURE(acpi_get_handle(boot_ec->handle, "_INI",
 							&dummy)))
 			return -ENODEV;
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
index 52ca964..bbf1c68 100644
--- a/drivers/acpi/osl.c
+++ b/drivers/acpi/osl.c
@@ -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;
diff --git a/drivers/acpi/pci_irq.c b/drivers/acpi/pci_irq.c
index f907cfb..ffc7af3 100644
--- a/drivers/acpi/pci_irq.c
+++ b/drivers/acpi/pci_irq.c
@@ -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 &&
diff --git a/drivers/acpi/pci_slot.c b/drivers/acpi/pci_slot.c
index 07f7fea..1db7f02 100644
--- a/drivers/acpi/pci_slot.c
+++ b/drivers/acpi/pci_slot.c
@@ -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;
 }
diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c
index 02d2a4c..ab3955a 100644
--- a/drivers/acpi/processor_core.c
+++ b/drivers/acpi/processor_core.c
@@ -7,7 +7,7 @@
  *	Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
  *	- 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,
diff --git a/drivers/acpi/processor_driver.c b/drivers/acpi/processor_driver.c
index a4e0f1b..a78045e 100644
--- a/drivers/acpi/processor_driver.c
+++ b/drivers/acpi/processor_driver.c
@@ -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>
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
index 431ab11..7fe9632 100644
--- a/drivers/acpi/processor_idle.c
+++ b/drivers/acpi/processor_idle.c
@@ -34,7 +34,7 @@
 #include <linux/cpufreq.h>
 #include <linux/slab.h>
 #include <linux/acpi.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include <linux/moduleparam.h>
 #include <linux/sched.h>	/* need_resched() */
 #include <linux/pm_qos_params.h>
@@ -92,7 +92,7 @@ static int disabled_by_idle_boot_param(void)
  *
  * To skip this limit, boot/load with a large max_cstate limit.
  */
-static int set_max_cstate(const struct dmi_system_id *id)
+static int set_max_cstate(const struct sysfw_id *id)
 {
 	if (max_cstate > ACPI_PROCESSOR_MAX_POWER)
 		return 0;
@@ -108,19 +108,38 @@ static int set_max_cstate(const struct dmi_system_id *id)
 
 /* Actually this shouldn't be __cpuinitdata, would be better to fix the
    callers to only run once -AK */
-static struct dmi_system_id __cpuinitdata processor_power_dmi_table[] = {
-	{ set_max_cstate, "Clevo 5600D", {
-	  DMI_MATCH(DMI_BIOS_VENDOR,"Phoenix Technologies LTD"),
-	  DMI_MATCH(DMI_BIOS_VERSION,"SHE845M0.86C.0013.D.0302131307")},
-	 (void *)2},
-	{ set_max_cstate, "Pavilion zv5000", {
-	  DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
-	  DMI_MATCH(DMI_PRODUCT_NAME,"Pavilion zv5000 (DS502A#ABA)")},
-	 (void *)1},
-	{ set_max_cstate, "Asus L8400B", {
-	  DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK Computer Inc."),
-	  DMI_MATCH(DMI_PRODUCT_NAME,"L8400B series Notebook PC")},
-	 (void *)1},
+static struct sysfw_id __cpuinitdata processor_power_id_table[] = {
+	{
+		.callback = set_max_cstate,
+		.ident = "Clevo 5600D",
+		.matches = {
+			SYSFW_MATCH(SYSFW_BIOS_VENDOR,
+				    "Phoenix Technologies LTD"),
+			SYSFW_MATCH(SYSFW_BIOS_VERSION,
+				    "SHE845M0.86C.0013.D.0302131307")
+		},
+		.driver_data = (void *)2
+	},
+	{
+		.callback = set_max_cstate,
+		.ident = "Pavilion zv5000",
+		.matches = {
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Hewlett-Packard"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME,
+				    "Pavilion zv5000 (DS502A#ABA)")
+		},
+		.driver_data = (void *)1
+	},
+	{
+		.callback = set_max_cstate,
+		.ident = "Asus L8400B",
+		.matches = {
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "ASUSTeK Computer Inc."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME,
+				    "L8400B series Notebook PC")
+		},
+		.driver_data = (void *)1
+	},
 	{},
 };
 
@@ -1096,7 +1115,7 @@ int __cpuinit acpi_processor_power_init(struct acpi_processor *pr,
 		return 0;
 
 	if (!first_run) {
-		dmi_check_system(processor_power_dmi_table);
+		sysfw_callback(processor_power_id_table);
 		max_cstate = acpi_processor_cstate_check(max_cstate);
 		if (max_cstate < ACPI_C_STATES_MAX)
 			printk(KERN_NOTICE
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index 449c556..ff94b79 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -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 */
diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c
index 6c94960..2fe5d12 100644
--- a/drivers/acpi/sleep.c
+++ b/drivers/acpi/sleep.c
@@ -12,7 +12,7 @@
 
 #include <linux/delay.h>
 #include <linux/irq.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include <linux/device.h>
 #include <linux/suspend.h>
 #include <linux/reboot.h>
@@ -342,90 +342,90 @@ static const struct platform_suspend_ops acpi_suspend_ops_old = {
 	.recover = acpi_pm_finish,
 };
 
-static int __init init_old_suspend_ordering(const struct dmi_system_id *d)
+static int __init init_old_suspend_ordering(const struct sysfw_id *d)
 {
 	old_suspend_ordering = true;
 	return 0;
 }
 
-static int __init init_nvs_nosave(const struct dmi_system_id *d)
+static int __init init_nvs_nosave(const struct sysfw_id *d)
 {
 	acpi_nvs_nosave();
 	return 0;
 }
 
-static struct dmi_system_id __initdata acpisleep_dmi_table[] = {
+static struct sysfw_id __initdata acpisleep_table[] = {
 	{
 	.callback = init_old_suspend_ordering,
 	.ident = "Abit KN9 (nForce4 variant)",
 	.matches = {
-		DMI_MATCH(DMI_BOARD_VENDOR, "http://www.abit.com.tw/"),
-		DMI_MATCH(DMI_BOARD_NAME, "KN9 Series(NF-CK804)"),
+		SYSFW_MATCH(SYSFW_BOARD_VENDOR, "http://www.abit.com.tw/"),
+		SYSFW_MATCH(SYSFW_BOARD_NAME, "KN9 Series(NF-CK804)"),
 		},
 	},
 	{
 	.callback = init_old_suspend_ordering,
 	.ident = "HP xw4600 Workstation",
 	.matches = {
-		DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
-		DMI_MATCH(DMI_PRODUCT_NAME, "HP xw4600 Workstation"),
+		SYSFW_MATCH(SYSFW_SYS_VENDOR, "Hewlett-Packard"),
+		SYSFW_MATCH(SYSFW_PRODUCT_NAME, "HP xw4600 Workstation"),
 		},
 	},
 	{
 	.callback = init_old_suspend_ordering,
 	.ident = "Asus Pundit P1-AH2 (M2N8L motherboard)",
 	.matches = {
-		DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTek Computer INC."),
-		DMI_MATCH(DMI_BOARD_NAME, "M2N8L"),
+		SYSFW_MATCH(SYSFW_BOARD_VENDOR, "ASUSTek Computer INC."),
+		SYSFW_MATCH(SYSFW_BOARD_NAME, "M2N8L"),
 		},
 	},
 	{
 	.callback = init_old_suspend_ordering,
 	.ident = "Panasonic CF51-2L",
 	.matches = {
-		DMI_MATCH(DMI_BOARD_VENDOR,
+		SYSFW_MATCH(SYSFW_BOARD_VENDOR,
 				"Matsushita Electric Industrial Co.,Ltd."),
-		DMI_MATCH(DMI_BOARD_NAME, "CF51-2L"),
+		SYSFW_MATCH(SYSFW_BOARD_NAME, "CF51-2L"),
 		},
 	},
 	{
 	.callback = init_nvs_nosave,
 	.ident = "Sony Vaio VGN-SR11M",
 	.matches = {
-		DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
-		DMI_MATCH(DMI_PRODUCT_NAME, "VGN-SR11M"),
+		SYSFW_MATCH(SYSFW_SYS_VENDOR, "Sony Corporation"),
+		SYSFW_MATCH(SYSFW_PRODUCT_NAME, "VGN-SR11M"),
 		},
 	},
 	{
 	.callback = init_nvs_nosave,
 	.ident = "Everex StepNote Series",
 	.matches = {
-		DMI_MATCH(DMI_SYS_VENDOR, "Everex Systems, Inc."),
-		DMI_MATCH(DMI_PRODUCT_NAME, "Everex StepNote Series"),
+		SYSFW_MATCH(SYSFW_SYS_VENDOR, "Everex Systems, Inc."),
+		SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Everex StepNote Series"),
 		},
 	},
 	{
 	.callback = init_nvs_nosave,
 	.ident = "Sony Vaio VPCEB1Z1E",
 	.matches = {
-		DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
-		DMI_MATCH(DMI_PRODUCT_NAME, "VPCEB1Z1E"),
+		SYSFW_MATCH(SYSFW_SYS_VENDOR, "Sony Corporation"),
+		SYSFW_MATCH(SYSFW_PRODUCT_NAME, "VPCEB1Z1E"),
 		},
 	},
 	{
 	.callback = init_nvs_nosave,
 	.ident = "Sony Vaio VGN-NW130D",
 	.matches = {
-		DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
-		DMI_MATCH(DMI_PRODUCT_NAME, "VGN-NW130D"),
+		SYSFW_MATCH(SYSFW_SYS_VENDOR, "Sony Corporation"),
+		SYSFW_MATCH(SYSFW_PRODUCT_NAME, "VGN-NW130D"),
 		},
 	},
 	{
 	.callback = init_nvs_nosave,
 	.ident = "Averatec AV1020-ED2",
 	.matches = {
-		DMI_MATCH(DMI_SYS_VENDOR, "AVERATEC"),
-		DMI_MATCH(DMI_PRODUCT_NAME, "1000 Series"),
+		SYSFW_MATCH(SYSFW_SYS_VENDOR, "AVERATEC"),
+		SYSFW_MATCH(SYSFW_PRODUCT_NAME, "1000 Series"),
 		},
 	},
 	{},
@@ -737,7 +737,7 @@ int __init acpi_sleep_init(void)
 #ifdef CONFIG_SUSPEND
 	int i = 0;
 
-	dmi_check_system(acpisleep_dmi_table);
+	sysfw_callback(acpisleep_table);
 #endif
 
 	if (acpi_disabled)
diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
index 2607e17..7005de5 100644
--- a/drivers/acpi/thermal.c
+++ b/drivers/acpi/thermal.c
@@ -33,7 +33,7 @@
 
 #include <linux/kernel.h>
 #include <linux/module.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include <linux/init.h>
 #include <linux/slab.h>
 #include <linux/types.h>
@@ -1075,8 +1075,8 @@ static int acpi_thermal_resume(struct acpi_device *device)
 	return AE_OK;
 }
 
-static int thermal_act(const struct dmi_system_id *d) {
-
+static int thermal_act(const struct sysfw_id *d)
+{
 	if (act == 0) {
 		printk(KERN_NOTICE "ACPI: %s detected: "
 			"disabling all active thermal trip points\n", d->ident);
@@ -1084,15 +1084,16 @@ static int thermal_act(const struct dmi_system_id *d) {
 	}
 	return 0;
 }
-static int thermal_nocrt(const struct dmi_system_id *d) {
-
+static int thermal_nocrt(const struct sysfw_id *d)
+{
 	printk(KERN_NOTICE "ACPI: %s detected: "
-		"disabling all critical thermal trip point actions.\n", d->ident);
+	       "disabling all critical thermal trip point actions.\n",
+	       d->ident);
 	nocrt = 1;
 	return 0;
 }
-static int thermal_tzp(const struct dmi_system_id *d) {
-
+static int thermal_tzp(const struct sysfw_id *d)
+{
 	if (tzp == 0) {
 		printk(KERN_NOTICE "ACPI: %s detected: "
 			"enabling thermal zone polling\n", d->ident);
@@ -1100,8 +1101,8 @@ static int thermal_tzp(const struct dmi_system_id *d) {
 	}
 	return 0;
 }
-static int thermal_psv(const struct dmi_system_id *d) {
-
+static int thermal_psv(const struct sysfw_id *d)
+{
 	if (psv == 0) {
 		printk(KERN_NOTICE "ACPI: %s detected: "
 			"disabling all passive thermal trip points\n", d->ident);
@@ -1110,7 +1111,7 @@ static int thermal_psv(const struct dmi_system_id *d) {
 	return 0;
 }
 
-static struct dmi_system_id thermal_dmi_table[] __initdata = {
+static struct sysfw_id thermal_id_table[] __initdata = {
 	/*
 	 * Award BIOS on this AOpen makes thermal control almost worthless.
 	 * http://bugzilla.kernel.org/show_bug.cgi?id=8842
@@ -1119,32 +1120,33 @@ static struct dmi_system_id thermal_dmi_table[] __initdata = {
 	 .callback = thermal_act,
 	 .ident = "AOpen i915GMm-HFS",
 	 .matches = {
-		DMI_MATCH(DMI_BOARD_VENDOR, "AOpen"),
-		DMI_MATCH(DMI_BOARD_NAME, "i915GMm-HFS"),
+		SYSFW_MATCH(SYSFW_BOARD_VENDOR, "AOpen"),
+		SYSFW_MATCH(SYSFW_BOARD_NAME, "i915GMm-HFS"),
 		},
 	},
 	{
 	 .callback = thermal_psv,
 	 .ident = "AOpen i915GMm-HFS",
 	 .matches = {
-		DMI_MATCH(DMI_BOARD_VENDOR, "AOpen"),
-		DMI_MATCH(DMI_BOARD_NAME, "i915GMm-HFS"),
+		SYSFW_MATCH(SYSFW_BOARD_VENDOR, "AOpen"),
+		SYSFW_MATCH(SYSFW_BOARD_NAME, "i915GMm-HFS"),
 		},
 	},
 	{
 	 .callback = thermal_tzp,
 	 .ident = "AOpen i915GMm-HFS",
 	 .matches = {
-		DMI_MATCH(DMI_BOARD_VENDOR, "AOpen"),
-		DMI_MATCH(DMI_BOARD_NAME, "i915GMm-HFS"),
+		SYSFW_MATCH(SYSFW_BOARD_VENDOR, "AOpen"),
+		SYSFW_MATCH(SYSFW_BOARD_NAME, "i915GMm-HFS"),
 		},
 	},
 	{
 	 .callback = thermal_nocrt,
 	 .ident = "Gigabyte GA-7ZX",
 	 .matches = {
-		DMI_MATCH(DMI_BOARD_VENDOR, "Gigabyte Technology Co., Ltd."),
-		DMI_MATCH(DMI_BOARD_NAME, "7ZX"),
+		SYSFW_MATCH(SYSFW_BOARD_VENDOR,
+			    "Gigabyte Technology Co., Ltd."),
+		SYSFW_MATCH(SYSFW_BOARD_NAME, "7ZX"),
 		},
 	},
 	{}
@@ -1154,7 +1156,7 @@ static int __init acpi_thermal_init(void)
 {
 	int result = 0;
 
-	dmi_check_system(thermal_dmi_table);
+	sysfw_callback(thermal_id_table);
 
 	if (off) {
 		printk(KERN_NOTICE "ACPI: thermal control disabled\n");
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
index db39e9e..b28912b 100644
--- a/drivers/acpi/video.c
+++ b/drivers/acpi/video.c
@@ -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;
diff --git a/drivers/acpi/video_detect.c b/drivers/acpi/video_detect.c
index 5af3479..41f0d10 100644
--- a/drivers/acpi/video_detect.c
+++ b/drivers/acpi/video_detect.c
@@ -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;
 		 *}
diff --git a/drivers/hwmon/acpi_power_meter.c b/drivers/hwmon/acpi_power_meter.c
index 66f6729..47175c6 100644
--- a/drivers/hwmon/acpi_power_meter.c
+++ b/drivers/hwmon/acpi_power_meter.c
@@ -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)
-- 
1.6.5.2


^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [PATCH 05/34] drivers/ata changes for SMBIOS and System Firmware
  2011-07-18 13:08 [PATCH 00/34] System Firmware and SMBIOS Support [v3] Prarit Bhargava
                   ` (3 preceding siblings ...)
  2011-07-18 13:08 ` [PATCH 04/34] drivers/acpi changes for SMBIOS and System Firmware interface Prarit Bhargava
@ 2011-07-18 13:08 ` Prarit Bhargava
  2011-07-18 13:08 ` [PATCH 06/34] drivers/floppy " Prarit Bhargava
                   ` (28 subsequent siblings)
  33 siblings, 0 replies; 48+ messages in thread
From: Prarit Bhargava @ 2011-07-18 13:08 UTC (permalink / raw)
  To: linux-kernel; +Cc: Prarit Bhargava, linux-ide

As part of the new SMBIOS and System Firmware code:

- Replace old dmi* structures and functions with new sysfw* and smbios*
structures and functions in individual drivers
- cleanup sysfw_id lookup tables
- cleanup of includes for dmi.h and mod_devicetable.h which were included in
some files that did not need them

[v2]: removed sysfw_match() from ata_piix.c code.  The matching code is limited
to four matches, and this manual comparison was required.  The sysfw_id struct
now has been modified to allow up to 8 matches instead so the need for
sysfw_match() has been eliminated.

Cc: linux-ide@vger.kernel.org
Acked-by: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: Prarit Bhargava <prarit@redhat.com>
---
 drivers/ata/acard-ahci.c  |    1 -
 drivers/ata/ahci.c        |  177 +++++++++++++++++++++++----------------------
 drivers/ata/ata_piix.c    |  154 +++++++++++++++++++++------------------
 drivers/ata/pata_ali.c    |   18 +++---
 drivers/ata/pata_cs5530.c |   12 ++--
 drivers/ata/pata_rdc.c    |    1 -
 drivers/ata/pata_sch.c    |    1 -
 drivers/ata/pata_via.c    |   14 ++--
 drivers/ata/sata_sil.c    |   19 +++---
 9 files changed, 203 insertions(+), 194 deletions(-)

diff --git a/drivers/ata/acard-ahci.c b/drivers/ata/acard-ahci.c
index ae22be4..d16b700 100644
--- a/drivers/ata/acard-ahci.c
+++ b/drivers/ata/acard-ahci.c
@@ -42,7 +42,6 @@
 #include <linux/interrupt.h>
 #include <linux/dma-mapping.h>
 #include <linux/device.h>
-#include <linux/dmi.h>
 #include <linux/gfp.h>
 #include <scsi/scsi_host.h>
 #include <scsi/scsi_cmnd.h>
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 71afe03..90100c4 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -41,7 +41,7 @@
 #include <linux/interrupt.h>
 #include <linux/dma-mapping.h>
 #include <linux/device.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include <linux/gfp.h>
 #include <scsi/scsi_host.h>
 #include <scsi/scsi_cmnd.h>
@@ -742,21 +742,22 @@ static void ahci_pci_print_info(struct ata_host *host)
  */
 static void ahci_p5wdh_workaround(struct ata_host *host)
 {
-	static struct dmi_system_id sysids[] = {
+	static struct sysfw_id sysids[] = {
 		{
 			.ident = "P5W DH Deluxe",
 			.matches = {
-				DMI_MATCH(DMI_SYS_VENDOR,
-					  "ASUSTEK COMPUTER INC"),
-				DMI_MATCH(DMI_PRODUCT_NAME, "P5W DH Deluxe"),
+				SYSFW_MATCH(SYSFW_SYS_VENDOR,
+					    "ASUSTEK COMPUTER INC"),
+				SYSFW_MATCH(SYSFW_PRODUCT_NAME,
+					    "P5W DH Deluxe"),
 			},
 		},
-		{ }
+		{}
 	};
 	struct pci_dev *pdev = to_pci_dev(host->dev);
 
 	if (pdev->bus->number == 0 && pdev->devfn == PCI_DEVFN(0x1f, 2) &&
-	    dmi_check_system(sysids)) {
+	    sysfw_callback(sysids)) {
 		struct ata_port *ap = host->ports[1];
 
 		dev_printk(KERN_INFO, &pdev->dev, "enabling ASUS P5W DH "
@@ -770,7 +771,7 @@ static void ahci_p5wdh_workaround(struct ata_host *host)
 /* only some SB600 ahci controllers can do 64bit DMA */
 static bool ahci_sb600_enable_64bit(struct pci_dev *pdev)
 {
-	static const struct dmi_system_id sysids[] = {
+	static const struct sysfw_id sysids[] = {
 		/*
 		 * The oldest version known to be broken is 0901 and
 		 * working is 1501 which was released on 2007-10-26.
@@ -781,43 +782,41 @@ static bool ahci_sb600_enable_64bit(struct pci_dev *pdev)
 		{
 			.ident = "ASUS M2A-VM",
 			.matches = {
-				DMI_MATCH(DMI_BOARD_VENDOR,
-					  "ASUSTeK Computer INC."),
-				DMI_MATCH(DMI_BOARD_NAME, "M2A-VM"),
+				SYSFW_MATCH(SYSFW_BOARD_VENDOR,
+					    "ASUSTeK Computer INC."),
+				SYSFW_MATCH(SYSFW_BOARD_NAME, "M2A-VM"),
 			},
-			.driver_data = "20071026",	/* yyyymmdd */
+			.driver_data = (void *)20071026, /* yyyymmdd */
 		},
 		/*
 		 * All BIOS versions for the MSI K9A2 Platinum (MS-7376)
 		 * support 64bit DMA.
 		 *
-		 * BIOS versions earlier than 1.5 had the Manufacturer DMI
+		 * BIOS versions earlier than 1.5 had the Manufacturer SMBIOS
 		 * fields as "MICRO-STAR INTERANTIONAL CO.,LTD".
 		 * This spelling mistake was fixed in BIOS version 1.5, so
 		 * 1.5 and later have the Manufacturer as
 		 * "MICRO-STAR INTERNATIONAL CO.,LTD".
-		 * So try to match on DMI_BOARD_VENDOR of "MICRO-STAR INTER".
+		 * So try to match on SYSFW_BOARD_VENDOR of "MICRO-STAR INTER".
 		 *
 		 * BIOS versions earlier than 1.9 had a Board Product Name
-		 * DMI field of "MS-7376". This was changed to be
+		 * SMBIOS field of "MS-7376". This was changed to be
 		 * "K9A2 Platinum (MS-7376)" in version 1.9, but we can still
-		 * match on DMI_BOARD_NAME of "MS-7376".
+		 * match on SYSFW_BOARD_NAME of "MS-7376".
 		 */
 		{
 			.ident = "MSI K9A2 Platinum",
 			.matches = {
-				DMI_MATCH(DMI_BOARD_VENDOR,
-					  "MICRO-STAR INTER"),
-				DMI_MATCH(DMI_BOARD_NAME, "MS-7376"),
+				SYSFW_MATCH(SYSFW_BOARD_VENDOR,
+					    "MICRO-STAR INTER"),
+				SYSFW_MATCH(SYSFW_BOARD_NAME, "MS-7376"),
 			},
 		},
-		{ }
+		{}
 	};
-	const struct dmi_system_id *match;
-	int year, month, date;
-	char buf[9];
+	const struct sysfw_id *match;
 
-	match = dmi_first_match(sysids);
+	match = sysfw_callback(sysids);
 	if (pdev->bus->number != 0 || pdev->devfn != PCI_DEVFN(0x12, 0) ||
 	    !match)
 		return false;
@@ -825,14 +824,12 @@ static bool ahci_sb600_enable_64bit(struct pci_dev *pdev)
 	if (!match->driver_data)
 		goto enable_64bit;
 
-	dmi_get_date(DMI_BIOS_DATE, &year, &month, &date);
-	snprintf(buf, sizeof(buf), "%04d%02d%02d", year, month, date);
-
-	if (strcmp(buf, match->driver_data) >= 0)
+	if (sysfw_get_date() >= (unsigned long)match->driver_data)
 		goto enable_64bit;
 	else {
-		dev_printk(KERN_WARNING, &pdev->dev, "%s: BIOS too old, "
-			   "forcing 32bit DMA, update BIOS\n", match->ident);
+		dev_printk(KERN_WARNING, &pdev->dev, "%s: BIOS too old, %s "
+			   "forcing 32bit DMA, update BIOS\n", match->ident,
+			   sysfw_lookup(SYSFW_BIOS_DATE));
 		return false;
 	}
 
@@ -844,12 +841,14 @@ enable_64bit:
 
 static bool ahci_broken_system_poweroff(struct pci_dev *pdev)
 {
-	static const struct dmi_system_id broken_systems[] = {
+	static const struct sysfw_id broken_systems[] = {
 		{
 			.ident = "HP Compaq nx6310",
 			.matches = {
-				DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
-				DMI_MATCH(DMI_PRODUCT_NAME, "HP Compaq nx6310"),
+				SYSFW_MATCH(SYSFW_SYS_VENDOR,
+					    "Hewlett-Packard"),
+				SYSFW_MATCH(SYSFW_PRODUCT_NAME,
+					    "HP Compaq nx6310"),
 			},
 			/* PCI slot number of the controller */
 			.driver_data = (void *)0x1FUL,
@@ -857,19 +856,20 @@ static bool ahci_broken_system_poweroff(struct pci_dev *pdev)
 		{
 			.ident = "HP Compaq 6720s",
 			.matches = {
-				DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
-				DMI_MATCH(DMI_PRODUCT_NAME, "HP Compaq 6720s"),
+				SYSFW_MATCH(SYSFW_SYS_VENDOR,
+					    "Hewlett-Packard"),
+				SYSFW_MATCH(SYSFW_PRODUCT_NAME,
+					    "HP Compaq 6720s"),
 			},
 			/* PCI slot number of the controller */
 			.driver_data = (void *)0x1FUL,
 		},
-
-		{ }	/* terminate list */
+		{}
 	};
-	const struct dmi_system_id *dmi = dmi_first_match(broken_systems);
+	const struct sysfw_id *id = sysfw_callback(broken_systems);
 
-	if (dmi) {
-		unsigned long slot = (unsigned long)dmi->driver_data;
+	if (id) {
+		unsigned long slot = (unsigned long)id->driver_data;
 		/* apply the quirk only to on-board controllers */
 		return slot == PCI_SLOT(pdev->devfn);
 	}
@@ -879,7 +879,7 @@ static bool ahci_broken_system_poweroff(struct pci_dev *pdev)
 
 static bool ahci_broken_suspend(struct pci_dev *pdev)
 {
-	static const struct dmi_system_id sysids[] = {
+	static const struct sysfw_id sysids[] = {
 		/*
 		 * On HP dv[4-6] and HDX18 with earlier BIOSen, link
 		 * to the harddisk doesn't become online after
@@ -896,38 +896,42 @@ static bool ahci_broken_suspend(struct pci_dev *pdev)
 		{
 			.ident = "dv4",
 			.matches = {
-				DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
-				DMI_MATCH(DMI_PRODUCT_NAME,
-					  "HP Pavilion dv4 Notebook PC"),
+				SYSFW_MATCH(SYSFW_SYS_VENDOR,
+					    "Hewlett-Packard"),
+				SYSFW_MATCH(SYSFW_PRODUCT_NAME,
+					    "HP Pavilion dv4 Notebook PC"),
 			},
-			.driver_data = "20090105",	/* F.30 */
+			.driver_data = (void *)20090105, /* F.30 */
 		},
 		{
 			.ident = "dv5",
 			.matches = {
-				DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
-				DMI_MATCH(DMI_PRODUCT_NAME,
-					  "HP Pavilion dv5 Notebook PC"),
+				SYSFW_MATCH(SYSFW_SYS_VENDOR,
+					    "Hewlett-Packard"),
+				SYSFW_MATCH(SYSFW_PRODUCT_NAME,
+					    "HP Pavilion dv5 Notebook PC"),
 			},
-			.driver_data = "20090506",	/* F.16 */
+			.driver_data = (void *)20090506, /* F.16 */
 		},
 		{
 			.ident = "dv6",
 			.matches = {
-				DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
-				DMI_MATCH(DMI_PRODUCT_NAME,
-					  "HP Pavilion dv6 Notebook PC"),
+				SYSFW_MATCH(SYSFW_SYS_VENDOR,
+					    "Hewlett-Packard"),
+				SYSFW_MATCH(SYSFW_PRODUCT_NAME,
+					    "HP Pavilion dv6 Notebook PC"),
 			},
-			.driver_data = "20090423",	/* F.21 */
+			.driver_data = (void *)20090423, /* F.21 */
 		},
 		{
 			.ident = "HDX18",
 			.matches = {
-				DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
-				DMI_MATCH(DMI_PRODUCT_NAME,
-					  "HP HDX18 Notebook PC"),
+				SYSFW_MATCH(SYSFW_SYS_VENDOR,
+					    "Hewlett-Packard"),
+				SYSFW_MATCH(SYSFW_PRODUCT_NAME,
+					    "HP HDX18 Notebook PC"),
 			},
-			.driver_data = "20090430",	/* F.23 */
+			.driver_data = (void *)20090430, /* F.23 */
 		},
 		/*
 		 * Acer eMachines G725 has the same problem.  BIOS
@@ -941,31 +945,27 @@ static bool ahci_broken_suspend(struct pci_dev *pdev)
 		{
 			.ident = "G725",
 			.matches = {
-				DMI_MATCH(DMI_SYS_VENDOR, "eMachines"),
-				DMI_MATCH(DMI_PRODUCT_NAME, "eMachines G725"),
+				SYSFW_MATCH(SYSFW_SYS_VENDOR, "eMachines"),
+				SYSFW_MATCH(SYSFW_PRODUCT_NAME,
+					    "eMachines G725"),
 			},
-			.driver_data = "20091216",	/* V3.04 */
+			.driver_data = (void *)20091216, /* V3.04 */
 		},
-		{ }	/* terminate list */
+		{}
 	};
-	const struct dmi_system_id *dmi = dmi_first_match(sysids);
-	int year, month, date;
-	char buf[9];
+	const struct sysfw_id *id = sysfw_callback(sysids);
 
-	if (!dmi || pdev->bus->number || pdev->devfn != PCI_DEVFN(0x1f, 2))
+	if (!id || pdev->bus->number || pdev->devfn != PCI_DEVFN(0x1f, 2))
 		return false;
 
-	dmi_get_date(DMI_BIOS_DATE, &year, &month, &date);
-	snprintf(buf, sizeof(buf), "%04d%02d%02d", year, month, date);
-
-	return strcmp(buf, dmi->driver_data) < 0;
+	return (sysfw_get_date() < (unsigned long)id->driver_data);
 }
 
 static bool ahci_broken_online(struct pci_dev *pdev)
 {
 #define ENCODE_BUSDEVFN(bus, slot, func)			\
 	(void *)(unsigned long)(((bus) << 8) | PCI_DEVFN((slot), (func)))
-	static const struct dmi_system_id sysids[] = {
+	static const struct sysfw_id sysids[] = {
 		/*
 		 * There are several gigabyte boards which use
 		 * SIMG5723s configured as hardware RAID.  Certain
@@ -982,31 +982,31 @@ static bool ahci_broken_online(struct pci_dev *pdev)
 		{
 			.ident = "EP45-DQ6",
 			.matches = {
-				DMI_MATCH(DMI_BOARD_VENDOR,
-					  "Gigabyte Technology Co., Ltd."),
-				DMI_MATCH(DMI_BOARD_NAME, "EP45-DQ6"),
+				SYSFW_MATCH(SYSFW_BOARD_VENDOR,
+					    "Gigabyte Technology Co., Ltd."),
+				SYSFW_MATCH(SYSFW_BOARD_NAME, "EP45-DQ6"),
 			},
 			.driver_data = ENCODE_BUSDEVFN(0x0a, 0x00, 0),
 		},
 		{
 			.ident = "EP45-DS5",
 			.matches = {
-				DMI_MATCH(DMI_BOARD_VENDOR,
-					  "Gigabyte Technology Co., Ltd."),
-				DMI_MATCH(DMI_BOARD_NAME, "EP45-DS5"),
+				SYSFW_MATCH(SYSFW_BOARD_VENDOR,
+					    "Gigabyte Technology Co., Ltd."),
+				SYSFW_MATCH(SYSFW_BOARD_NAME, "EP45-DS5"),
 			},
 			.driver_data = ENCODE_BUSDEVFN(0x03, 0x00, 0),
 		},
-		{ }	/* terminate list */
+		{}
 	};
 #undef ENCODE_BUSDEVFN
-	const struct dmi_system_id *dmi = dmi_first_match(sysids);
+	const struct sysfw_id *id = sysfw_callback(sysids);
 	unsigned int val;
 
-	if (!dmi)
+	if (!id)
 		return false;
 
-	val = (unsigned long)dmi->driver_data;
+	val = (unsigned long)id->driver_data;
 
 	return pdev->bus->number == (val >> 8) && pdev->devfn == (val & 0xff);
 }
@@ -1014,7 +1014,7 @@ static bool ahci_broken_online(struct pci_dev *pdev)
 #ifdef CONFIG_ATA_ACPI
 static void ahci_gtf_filter_workaround(struct ata_host *host)
 {
-	static const struct dmi_system_id sysids[] = {
+	static const struct sysfw_id sysids[] = {
 		/*
 		 * Aspire 3810T issues a bunch of SATA enable commands
 		 * via _GTF including an invalid one and one which is
@@ -1026,24 +1026,25 @@ static void ahci_gtf_filter_workaround(struct ata_host *host)
 		{
 			.ident = "Aspire 3810T",
 			.matches = {
-				DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
-				DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 3810T"),
+				SYSFW_MATCH(SYSFW_SYS_VENDOR, "Acer"),
+				SYSFW_MATCH(SYSFW_PRODUCT_NAME,
+					    "Aspire 3810T"),
 			},
 			.driver_data = (void *)ATA_ACPI_FILTER_FPDMA_OFFSET,
 		},
-		{ }
+		{}
 	};
-	const struct dmi_system_id *dmi = dmi_first_match(sysids);
+	const struct sysfw_id *id = sysfw_callback(sysids);
 	unsigned int filter;
 	int i;
 
-	if (!dmi)
+	if (!id)
 		return;
 
-	filter = (unsigned long)dmi->driver_data;
+	filter = (unsigned long)id->driver_data;
 	dev_printk(KERN_INFO, host->dev,
 		   "applying extra ACPI _GTF filter 0x%x for %s\n",
-		   filter, dmi->ident);
+		   filter, id->ident);
 
 	for (i = 0; i < host->n_ports; i++) {
 		struct ata_port *ap = host->ports[i];
diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c
index 6f6e771..cc8b62e 100644
--- a/drivers/ata/ata_piix.c
+++ b/drivers/ata/ata_piix.c
@@ -93,7 +93,8 @@
 #include <linux/gfp.h>
 #include <scsi/scsi_host.h>
 #include <linux/libata.h>
-#include <linux/dmi.h>
+#include <linux/smbios.h>
+#include <linux/sysfw.h>
 
 #define DRV_NAME	"ata_piix"
 #define DRV_VERSION	"2.13"
@@ -1017,156 +1018,163 @@ static bool piix_irq_check(struct ata_port *ap)
 #ifdef CONFIG_PM
 static int piix_broken_suspend(void)
 {
-	static const struct dmi_system_id sysids[] = {
+	static const struct sysfw_id sysids[] = {
 		{
 			.ident = "TECRA M3",
 			.matches = {
-				DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
-				DMI_MATCH(DMI_PRODUCT_NAME, "TECRA M3"),
+				SYSFW_MATCH(SYSFW_SYS_VENDOR, "TOSHIBA"),
+				SYSFW_MATCH(SYSFW_PRODUCT_NAME, "TECRA M3"),
 			},
 		},
 		{
 			.ident = "TECRA M3",
 			.matches = {
-				DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
-				DMI_MATCH(DMI_PRODUCT_NAME, "Tecra M3"),
+				SYSFW_MATCH(SYSFW_SYS_VENDOR, "TOSHIBA"),
+				SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Tecra M3"),
 			},
 		},
 		{
 			.ident = "TECRA M4",
 			.matches = {
-				DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
-				DMI_MATCH(DMI_PRODUCT_NAME, "Tecra M4"),
+				SYSFW_MATCH(SYSFW_SYS_VENDOR, "TOSHIBA"),
+				SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Tecra M4"),
 			},
 		},
 		{
 			.ident = "TECRA M4",
 			.matches = {
-				DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
-				DMI_MATCH(DMI_PRODUCT_NAME, "TECRA M4"),
+				SYSFW_MATCH(SYSFW_SYS_VENDOR, "TOSHIBA"),
+				SYSFW_MATCH(SYSFW_PRODUCT_NAME, "TECRA M4"),
 			},
 		},
 		{
 			.ident = "TECRA M5",
 			.matches = {
-				DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
-				DMI_MATCH(DMI_PRODUCT_NAME, "TECRA M5"),
+				SYSFW_MATCH(SYSFW_SYS_VENDOR, "TOSHIBA"),
+				SYSFW_MATCH(SYSFW_PRODUCT_NAME, "TECRA M5"),
 			},
 		},
 		{
 			.ident = "TECRA M6",
 			.matches = {
-				DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
-				DMI_MATCH(DMI_PRODUCT_NAME, "TECRA M6"),
+				SYSFW_MATCH(SYSFW_SYS_VENDOR, "TOSHIBA"),
+				SYSFW_MATCH(SYSFW_PRODUCT_NAME, "TECRA M6"),
 			},
 		},
 		{
 			.ident = "TECRA M7",
 			.matches = {
-				DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
-				DMI_MATCH(DMI_PRODUCT_NAME, "TECRA M7"),
+				SYSFW_MATCH(SYSFW_SYS_VENDOR, "TOSHIBA"),
+				SYSFW_MATCH(SYSFW_PRODUCT_NAME, "TECRA M7"),
 			},
 		},
 		{
 			.ident = "TECRA A8",
 			.matches = {
-				DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
-				DMI_MATCH(DMI_PRODUCT_NAME, "TECRA A8"),
+				SYSFW_MATCH(SYSFW_SYS_VENDOR, "TOSHIBA"),
+				SYSFW_MATCH(SYSFW_PRODUCT_NAME, "TECRA A8"),
 			},
 		},
 		{
 			.ident = "Satellite R20",
 			.matches = {
-				DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
-				DMI_MATCH(DMI_PRODUCT_NAME, "Satellite R20"),
+				SYSFW_MATCH(SYSFW_SYS_VENDOR, "TOSHIBA"),
+				SYSFW_MATCH(SYSFW_PRODUCT_NAME,
+					    "Satellite R20"),
 			},
 		},
 		{
 			.ident = "Satellite R25",
 			.matches = {
-				DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
-				DMI_MATCH(DMI_PRODUCT_NAME, "Satellite R25"),
+				SYSFW_MATCH(SYSFW_SYS_VENDOR, "TOSHIBA"),
+				SYSFW_MATCH(SYSFW_PRODUCT_NAME,
+					    "Satellite R25"),
 			},
 		},
 		{
 			.ident = "Satellite U200",
 			.matches = {
-				DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
-				DMI_MATCH(DMI_PRODUCT_NAME, "Satellite U200"),
+				SYSFW_MATCH(SYSFW_SYS_VENDOR, "TOSHIBA"),
+				SYSFW_MATCH(SYSFW_PRODUCT_NAME,
+					    "Satellite U200"),
 			},
 		},
 		{
 			.ident = "Satellite U200",
 			.matches = {
-				DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
-				DMI_MATCH(DMI_PRODUCT_NAME, "SATELLITE U200"),
+				SYSFW_MATCH(SYSFW_SYS_VENDOR, "TOSHIBA"),
+				SYSFW_MATCH(SYSFW_PRODUCT_NAME,
+					    "SATELLITE U200"),
 			},
 		},
 		{
 			.ident = "Satellite Pro U200",
 			.matches = {
-				DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
-				DMI_MATCH(DMI_PRODUCT_NAME, "SATELLITE PRO U200"),
+				SYSFW_MATCH(SYSFW_SYS_VENDOR, "TOSHIBA"),
+				SYSFW_MATCH(SYSFW_PRODUCT_NAME,
+					    "SATELLITE PRO U200"),
 			},
 		},
 		{
 			.ident = "Satellite U205",
 			.matches = {
-				DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
-				DMI_MATCH(DMI_PRODUCT_NAME, "Satellite U205"),
+				SYSFW_MATCH(SYSFW_SYS_VENDOR, "TOSHIBA"),
+				SYSFW_MATCH(SYSFW_PRODUCT_NAME,
+					    "Satellite U205"),
 			},
 		},
 		{
 			.ident = "SATELLITE U205",
 			.matches = {
-				DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
-				DMI_MATCH(DMI_PRODUCT_NAME, "SATELLITE U205"),
+				SYSFW_MATCH(SYSFW_SYS_VENDOR, "TOSHIBA"),
+				SYSFW_MATCH(SYSFW_PRODUCT_NAME,
+					    "SATELLITE U205"),
 			},
 		},
 		{
 			.ident = "Portege M500",
 			.matches = {
-				DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
-				DMI_MATCH(DMI_PRODUCT_NAME, "PORTEGE M500"),
+				SYSFW_MATCH(SYSFW_SYS_VENDOR, "TOSHIBA"),
+				SYSFW_MATCH(SYSFW_PRODUCT_NAME,
+					    "PORTEGE M500"),
 			},
 		},
 		{
 			.ident = "VGN-BX297XP",
 			.matches = {
-				DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
-				DMI_MATCH(DMI_PRODUCT_NAME, "VGN-BX297XP"),
+				SYSFW_MATCH(SYSFW_SYS_VENDOR,
+					    "Sony Corporation"),
+				SYSFW_MATCH(SYSFW_PRODUCT_NAME,
+					    "VGN-BX297XP"),
 			},
 		},
-
-		{ }	/* terminate list */
+		{
+			.ident = "TECRA M4",
+			.matches = {
+				SYSFW_MATCH(SYSFW_SYS_VENDOR, "TOSHIBA"),
+				SYSFW_MATCH(SYSFW_PRODUCT_NAME, "000000"),
+				SYSFW_MATCH(SYSFW_PRODUCT_VERSION, "000000"),
+				SYSFW_MATCH(SYSFW_PRODUCT_SERIAL, "000000"),
+				SYSFW_MATCH(SYSFW_BOARD_VENDOR, "TOSHIBA"),
+				SYSFW_MATCH(SYSFW_BOARD_NAME, "Portable PC"),
+				SYSFW_MATCH(SYSFW_BOARD_VERSION, "Version A0"),
+			},
+			.exactmatch = 1,
+		},
+		{}
 	};
 	static const char *oemstrs[] = {
 		"Tecra M3,",
 	};
 	int i;
 
-	if (dmi_check_system(sysids))
+	if (sysfw_callback(sysids))
 		return 1;
 
 	for (i = 0; i < ARRAY_SIZE(oemstrs); i++)
-		if (dmi_find_device(DMI_DEV_TYPE_OEM_STRING, oemstrs[i], NULL))
+		if (smbios_match_oem_string(oemstrs[i]))
 			return 1;
 
-	/* TECRA M4 sometimes forgets its identify and reports bogus
-	 * DMI information.  As the bogus information is a bit
-	 * generic, match as many entries as possible.  This manual
-	 * matching is necessary because dmi_system_id.matches is
-	 * limited to four entries.
-	 */
-	if (dmi_match(DMI_SYS_VENDOR, "TOSHIBA") &&
-	    dmi_match(DMI_PRODUCT_NAME, "000000") &&
-	    dmi_match(DMI_PRODUCT_VERSION, "000000") &&
-	    dmi_match(DMI_PRODUCT_SERIAL, "000000") &&
-	    dmi_match(DMI_BOARD_VENDOR, "TOSHIBA") &&
-	    dmi_match(DMI_BOARD_NAME, "Portable PC") &&
-	    dmi_match(DMI_BOARD_VERSION, "Version A0"))
-		return 1;
-
 	return 0;
 }
 
@@ -1383,7 +1391,7 @@ static bool piix_no_sidpr(struct ata_host *host)
 	 * while not responding to SRST protocol causing excessive
 	 * detection delay.
 	 *
-	 * Unfortunately, the system doesn't carry enough DMI
+	 * Unfortunately, the system doesn't carry enough SMBIOS
 	 * information to identify the machine but does have subsystem
 	 * vendor and device set.  As it's unclear whether the
 	 * subsystem vendor/device is used only for this specific
@@ -1475,7 +1483,7 @@ static int __devinit piix_init_sidpr(struct ata_host *host)
 
 static void piix_iocfg_bit18_quirk(struct ata_host *host)
 {
-	static const struct dmi_system_id sysids[] = {
+	static const struct sysfw_id sysids[] = {
 		{
 			/* Clevo M570U sets IOCFG bit 18 if the cdrom
 			 * isn't used to boot the system which
@@ -1483,17 +1491,16 @@ static void piix_iocfg_bit18_quirk(struct ata_host *host)
 			 */
 			.ident = "M570U",
 			.matches = {
-				DMI_MATCH(DMI_SYS_VENDOR, "Clevo Co."),
-				DMI_MATCH(DMI_PRODUCT_NAME, "M570U"),
+				SYSFW_MATCH(SYSFW_SYS_VENDOR, "Clevo Co."),
+				SYSFW_MATCH(SYSFW_PRODUCT_NAME, "M570U"),
 			},
 		},
-
-		{ }	/* terminate list */
+		{}
 	};
 	struct pci_dev *pdev = to_pci_dev(host->dev);
 	struct piix_host_priv *hpriv = host->private_data;
 
-	if (!dmi_check_system(sysids))
+	if (!sysfw_callback(sysids))
 		return;
 
 	/* The datasheet says that bit 18 is NOOP but certain systems
@@ -1510,12 +1517,14 @@ static void piix_iocfg_bit18_quirk(struct ata_host *host)
 
 static bool piix_broken_system_poweroff(struct pci_dev *pdev)
 {
-	static const struct dmi_system_id broken_systems[] = {
+	static const struct sysfw_id broken_systems[] = {
 		{
 			.ident = "HP Compaq 2510p",
 			.matches = {
-				DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
-				DMI_MATCH(DMI_PRODUCT_NAME, "HP Compaq 2510p"),
+				SYSFW_MATCH(SYSFW_SYS_VENDOR,
+					    "Hewlett-Packard"),
+				SYSFW_MATCH(SYSFW_PRODUCT_NAME,
+					    "HP Compaq 2510p"),
 			},
 			/* PCI slot number of the controller */
 			.driver_data = (void *)0x1FUL,
@@ -1523,19 +1532,20 @@ static bool piix_broken_system_poweroff(struct pci_dev *pdev)
 		{
 			.ident = "HP Compaq nc6000",
 			.matches = {
-				DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
-				DMI_MATCH(DMI_PRODUCT_NAME, "HP Compaq nc6000"),
+				SYSFW_MATCH(SYSFW_SYS_VENDOR,
+					    "Hewlett-Packard"),
+				SYSFW_MATCH(SYSFW_PRODUCT_NAME,
+					    "HP Compaq nc6000"),
 			},
 			/* PCI slot number of the controller */
 			.driver_data = (void *)0x1FUL,
 		},
-
-		{ }	/* terminate list */
+		{}
 	};
-	const struct dmi_system_id *dmi = dmi_first_match(broken_systems);
+	const struct sysfw_id *id = sysfw_callback(broken_systems);
 
-	if (dmi) {
-		unsigned long slot = (unsigned long)dmi->driver_data;
+	if (id) {
+		unsigned long slot = (unsigned long)id->driver_data;
 		/* apply the quirk only to on-board controllers */
 		return slot == PCI_SLOT(pdev->devfn);
 	}
diff --git a/drivers/ata/pata_ali.c b/drivers/ata/pata_ali.c
index 794ec6e..d6e158b 100644
--- a/drivers/ata/pata_ali.c
+++ b/drivers/ata/pata_ali.c
@@ -32,7 +32,7 @@
 #include <linux/delay.h>
 #include <scsi/scsi_host.h>
 #include <linux/libata.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 
 #define DRV_NAME "pata_ali"
 #define DRV_VERSION "0.7.8"
@@ -47,22 +47,22 @@ static struct pci_dev *ali_isa_bridge;
  *	Cable special cases
  */
 
-static const struct dmi_system_id cable_dmi_table[] = {
+static const struct sysfw_id cable_override_table[] = {
 	{
 		.ident = "HP Pavilion N5430",
 		.matches = {
-			DMI_MATCH(DMI_BOARD_VENDOR, "Hewlett-Packard"),
-			DMI_MATCH(DMI_BOARD_VERSION, "OmniBook N32N-736"),
+			SYSFW_MATCH(SYSFW_BOARD_VENDOR, "Hewlett-Packard"),
+			SYSFW_MATCH(SYSFW_BOARD_VERSION, "OmniBook N32N-736"),
 		},
 	},
 	{
 		.ident = "Toshiba Satelite S1800-814",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "S1800-814"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "TOSHIBA"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "S1800-814"),
 		},
 	},
-	{ }
+	{}
 };
 
 static int ali_cable_override(struct pci_dev *pdev)
@@ -73,8 +73,8 @@ static int ali_cable_override(struct pci_dev *pdev)
 	/* Mitac 8317 (Winbook-A) and relatives */
 	if (pdev->subsystem_vendor == 0x1071 && pdev->subsystem_device == 0x8317)
 		return 1;
-	/* Systems by DMI */
-	if (dmi_check_system(cable_dmi_table))
+	/* Systems by SMBIOS */
+	if (sysfw_callback(cable_override_table))
 		return 1;
 	return 0;
 }
diff --git a/drivers/ata/pata_cs5530.c b/drivers/ata/pata_cs5530.c
index f792330..085820a 100644
--- a/drivers/ata/pata_cs5530.c
+++ b/drivers/ata/pata_cs5530.c
@@ -31,7 +31,7 @@
 #include <linux/delay.h>
 #include <scsi/scsi_host.h>
 #include <linux/libata.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 
 #define DRV_NAME	"pata_cs5530"
 #define DRV_VERSION	"0.7.4"
@@ -175,20 +175,20 @@ static struct ata_port_operations cs5530_port_ops = {
 	.set_dmamode	= cs5530_set_dmamode,
 };
 
-static const struct dmi_system_id palmax_dmi_table[] = {
+static const struct sysfw_id palmax_id_table[] = {
 	{
 		.ident = "Palmax PD1100",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Cyrix"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Caddis"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Cyrix"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Caddis"),
 		},
 	},
-	{ }
+	{}
 };
 
 static int cs5530_is_palmax(void)
 {
-	if (dmi_check_system(palmax_dmi_table)) {
+	if (sysfw_callback(palmax_id_table)) {
 		printk(KERN_INFO "Palmax PD1100: Disabling DMA on docking port.\n");
 		return 1;
 	}
diff --git a/drivers/ata/pata_rdc.c b/drivers/ata/pata_rdc.c
index 5fbe9b1..497f514 100644
--- a/drivers/ata/pata_rdc.c
+++ b/drivers/ata/pata_rdc.c
@@ -31,7 +31,6 @@
 #include <linux/gfp.h>
 #include <scsi/scsi_host.h>
 #include <linux/libata.h>
-#include <linux/dmi.h>
 
 #define DRV_NAME	"pata_rdc"
 #define DRV_VERSION	"0.01"
diff --git a/drivers/ata/pata_sch.c b/drivers/ata/pata_sch.c
index e97b32f..8b95c13 100644
--- a/drivers/ata/pata_sch.c
+++ b/drivers/ata/pata_sch.c
@@ -33,7 +33,6 @@
 #include <linux/device.h>
 #include <scsi/scsi_host.h>
 #include <linux/libata.h>
-#include <linux/dmi.h>
 
 #define DRV_NAME	"pata_sch"
 #define DRV_VERSION	"0.2"
diff --git a/drivers/ata/pata_via.c b/drivers/ata/pata_via.c
index ac8d7d9..2175119 100644
--- a/drivers/ata/pata_via.c
+++ b/drivers/ata/pata_via.c
@@ -61,7 +61,7 @@
 #include <linux/gfp.h>
 #include <scsi/scsi_host.h>
 #include <linux/libata.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 
 #define DRV_NAME "pata_via"
 #define DRV_VERSION "0.3.4"
@@ -132,21 +132,21 @@ struct via_port {
  *	Cable special cases
  */
 
-static const struct dmi_system_id cable_dmi_table[] = {
+static const struct sysfw_id cable_override_table[] = {
 	{
 		.ident = "Acer Ferrari 3400",
 		.matches = {
-			DMI_MATCH(DMI_BOARD_VENDOR, "Acer,Inc."),
-			DMI_MATCH(DMI_BOARD_NAME, "Ferrari 3400"),
+			SYSFW_MATCH(SYSFW_BOARD_VENDOR, "Acer,Inc."),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "Ferrari 3400"),
 		},
 	},
-	{ }
+	{}
 };
 
 static int via_cable_override(struct pci_dev *pdev)
 {
-	/* Systems by DMI */
-	if (dmi_check_system(cable_dmi_table))
+	/* Systems by SMBIOS */
+	if (sysfw_callback(cable_override_table))
 		return 1;
 	/* Arima W730-K8/Targa Visionary 811/... */
 	if (pdev->subsystem_vendor == 0x161F && pdev->subsystem_device == 0x2032)
diff --git a/drivers/ata/sata_sil.c b/drivers/ata/sata_sil.c
index b42edaa..fff0e2b 100644
--- a/drivers/ata/sata_sil.c
+++ b/drivers/ata/sata_sil.c
@@ -44,7 +44,7 @@
 #include <linux/device.h>
 #include <scsi/scsi_host.h>
 #include <linux/libata.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 
 #define DRV_NAME	"sata_sil"
 #define DRV_VERSION	"2.4"
@@ -707,23 +707,24 @@ static void sil_init_controller(struct ata_host *host)
 
 static bool sil_broken_system_poweroff(struct pci_dev *pdev)
 {
-	static const struct dmi_system_id broken_systems[] = {
+	static const struct sysfw_id broken_systems[] = {
 		{
 			.ident = "HP Compaq nx6325",
 			.matches = {
-				DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
-				DMI_MATCH(DMI_PRODUCT_NAME, "HP Compaq nx6325"),
+				SYSFW_MATCH(SYSFW_SYS_VENDOR,
+					    "Hewlett-Packard"),
+				SYSFW_MATCH(SYSFW_PRODUCT_NAME,
+					    "HP Compaq nx6325"),
 			},
 			/* PCI slot number of the controller */
 			.driver_data = (void *)0x12UL,
 		},
-
-		{ }	/* terminate list */
+		{}	/* terminate list */
 	};
-	const struct dmi_system_id *dmi = dmi_first_match(broken_systems);
+	const struct sysfw_id *id = sysfw_callback(broken_systems);
 
-	if (dmi) {
-		unsigned long slot = (unsigned long)dmi->driver_data;
+	if (id) {
+		unsigned long slot = (unsigned long)id->driver_data;
 		/* apply the quirk only to on-board controllers */
 		return slot == PCI_SLOT(pdev->devfn);
 	}
-- 
1.6.5.2


^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [PATCH 06/34] drivers/floppy changes for SMBIOS and System Firmware
  2011-07-18 13:08 [PATCH 00/34] System Firmware and SMBIOS Support [v3] Prarit Bhargava
                   ` (4 preceding siblings ...)
  2011-07-18 13:08 ` [PATCH 05/34] drivers/ata changes for SMBIOS and System Firmware Prarit Bhargava
@ 2011-07-18 13:08 ` Prarit Bhargava
  2011-07-18 13:08 ` [PATCH 07/34] drivers/char " Prarit Bhargava
                   ` (27 subsequent siblings)
  33 siblings, 0 replies; 48+ messages in thread
From: Prarit Bhargava @ 2011-07-18 13:08 UTC (permalink / raw)
  To: linux-kernel; +Cc: Prarit Bhargava

As part of the new SMBIOS and System Firmware code:

- cleanup of includes for dmi.h and mod_devicetable.h which were included in
some files that did not need them

Signed-off-by: Prarit Bhargava <prarit@redhat.com>
---
 drivers/block/floppy.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
index 98de8f4..a12f8e1 100644
--- a/drivers/block/floppy.c
+++ b/drivers/block/floppy.c
@@ -187,7 +187,6 @@ static int print_unex = 1;
 #include <linux/interrupt.h>
 #include <linux/init.h>
 #include <linux/platform_device.h>
-#include <linux/mod_devicetable.h>
 #include <linux/buffer_head.h>	/* for invalidate_buffers() */
 #include <linux/mutex.h>
 #include <linux/io.h>
-- 
1.6.5.2


^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [PATCH 07/34] drivers/char changes for SMBIOS and System Firmware
  2011-07-18 13:08 [PATCH 00/34] System Firmware and SMBIOS Support [v3] Prarit Bhargava
                   ` (5 preceding siblings ...)
  2011-07-18 13:08 ` [PATCH 06/34] drivers/floppy " Prarit Bhargava
@ 2011-07-18 13:08 ` Prarit Bhargava
  2011-07-18 13:08 ` [PATCH 08/34] drivers/crypto " Prarit Bhargava
                   ` (26 subsequent siblings)
  33 siblings, 0 replies; 48+ messages in thread
From: Prarit Bhargava @ 2011-07-18 13:08 UTC (permalink / raw)
  To: linux-kernel; +Cc: Prarit Bhargava, openipmi-developer, dz, platform-driver-x86

As part of the new SMBIOS and System Firmware code:

- Replace old dmi* structures and functions with new sysfw* and smbios*
structures and functions in individual drivers
- cleanup sysfw_id lookup tables

Cc: openipmi-developer@lists.sourceforge.net
Cc: dz@debian.org
Cc: platform-driver-x86@vger.kernel.org
Signed-off-by: Prarit Bhargava <prarit@redhat.com>
---
 drivers/char/i8k.c               |   75 +++++++++---------
 drivers/char/ipmi/ipmi_si_intf.c |  159 +++++++++++++++++++-------------------
 drivers/char/sonypi.c            |   16 ++--
 3 files changed, 125 insertions(+), 125 deletions(-)

diff --git a/drivers/char/i8k.c b/drivers/char/i8k.c
index 6e40072..f198fac 100644
--- a/drivers/char/i8k.c
+++ b/drivers/char/i8k.c
@@ -24,7 +24,7 @@
 #include <linux/init.h>
 #include <linux/proc_fs.h>
 #include <linux/seq_file.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include <linux/capability.h>
 #include <linux/mutex.h>
 #include <linux/hwmon.h>
@@ -73,9 +73,10 @@ static int force;
 module_param(force, bool, 0);
 MODULE_PARM_DESC(force, "Force loading without checking for supported models");
 
-static int ignore_dmi;
-module_param(ignore_dmi, bool, 0);
-MODULE_PARM_DESC(ignore_dmi, "Continue probing hardware even if DMI data does not match");
+static int ignore_smbios;
+module_param(ignore_smbios, bool, 0);
+MODULE_PARM_DESC(ignore_smbios,
+		"Continue probing hardware even if SMBIOS data does not match");
 
 static int restricted;
 module_param(restricted, bool, 0);
@@ -110,11 +111,11 @@ struct smm_regs {
 	unsigned int edi __attribute__ ((packed));
 };
 
-static inline const char *i8k_get_dmi_data(int field)
+static inline const char *i8k_get_smbios_data(int field)
 {
-	const char *dmi_data = dmi_get_system_info(field);
+	const char *smbios_data = sysfw_lookup(field);
 
-	return dmi_data && *dmi_data ? dmi_data : "?";
+	return smbios_data && *smbios_data ? smbios_data : "?";
 }
 
 /*
@@ -333,7 +334,8 @@ i8k_ioctl_unlocked(struct file *fp, unsigned int cmd, unsigned long arg)
 
 	case I8K_MACHINE_ID:
 		memset(buff, 0, 16);
-		strlcpy(buff, i8k_get_dmi_data(DMI_PRODUCT_SERIAL), sizeof(buff));
+		strlcpy(buff, i8k_get_smbios_data(SYSFW_PRODUCT_SERIAL),
+			sizeof(buff));
 		break;
 
 	case I8K_FN_STATUS:
@@ -450,7 +452,7 @@ static int i8k_proc_show(struct seq_file *seq, void *offset)
 	return seq_printf(seq, "%s %s %s %d %d %d %d %d %d %d\n",
 			  I8K_PROC_FMT,
 			  bios_version,
-			  i8k_get_dmi_data(DMI_PRODUCT_SERIAL),
+			  i8k_get_smbios_data(SYSFW_PRODUCT_SERIAL),
 			  cpu_temp,
 			  left_fan, right_fan, left_speed, right_speed,
 			  ac_power, fn_key);
@@ -607,64 +609,64 @@ static void __exit i8k_exit_hwmon(void)
 	hwmon_device_unregister(i8k_hwmon_dev);
 }
 
-static struct dmi_system_id __initdata i8k_dmi_table[] = {
+static struct sysfw_id __initdata i8k_smbios_table[] = {
 	{
 		.ident = "Dell Inspiron",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell Computer"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Inspiron"),
 		},
 	},
 	{
 		.ident = "Dell Latitude",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Latitude"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell Computer"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Latitude"),
 		},
 	},
 	{
 		.ident = "Dell Inspiron 2",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell Inc."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Inspiron"),
 		},
 	},
 	{
 		.ident = "Dell Latitude 2",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Latitude"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell Inc."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Latitude"),
 		},
 	},
 	{	/* UK Inspiron 6400  */
 		.ident = "Dell Inspiron 3",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "MM061"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell Inc."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "MM061"),
 		},
 	},
 	{
 		.ident = "Dell Inspiron 3",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "MP061"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell Inc."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "MP061"),
 		},
 	},
 	{
 		.ident = "Dell Precision",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Precision"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell Inc."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Precision"),
 		},
 	},
 	{
 		.ident = "Dell Vostro",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Vostro"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell Inc."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Vostro"),
 		},
 	},
-        { }
+	{}
 };
 
 /*
@@ -676,20 +678,21 @@ static int __init i8k_probe(void)
 	int version;
 
 	/*
-	 * Get DMI information
+	 * Get SMBIOS information
 	 */
-	if (!dmi_check_system(i8k_dmi_table)) {
-		if (!ignore_dmi && !force)
+	if (!sysfw_callback(i8k_smbios_table)) {
+		if (!ignore_smbios && !force)
 			return -ENODEV;
 
 		printk(KERN_INFO "i8k: not running on a supported Dell system.\n");
 		printk(KERN_INFO "i8k: vendor=%s, model=%s, version=%s\n",
-			i8k_get_dmi_data(DMI_SYS_VENDOR),
-			i8k_get_dmi_data(DMI_PRODUCT_NAME),
-			i8k_get_dmi_data(DMI_BIOS_VERSION));
+			i8k_get_smbios_data(SYSFW_SYS_VENDOR),
+			i8k_get_smbios_data(SYSFW_PRODUCT_NAME),
+			i8k_get_smbios_data(SYSFW_BIOS_VERSION));
 	}
 
-	strlcpy(bios_version, i8k_get_dmi_data(DMI_BIOS_VERSION), sizeof(bios_version));
+	strlcpy(bios_version, i8k_get_smbios_data(SYSFW_BIOS_VERSION),
+		sizeof(bios_version));
 
 	/*
 	 * Get SMM Dell signature
@@ -713,9 +716,9 @@ static int __init i8k_probe(void)
 		buff[2] = (version) & 0xff;
 		buff[3] = '\0';
 		/*
-		 * If DMI BIOS version is unknown use SMM BIOS version.
+		 * If SMBIOS version is unknown use SMM BIOS version.
 		 */
-		if (!dmi_get_system_info(DMI_BIOS_VERSION))
+		if (!sysfw_lookup(SYSFW_BIOS_VERSION))
 			strlcpy(bios_version, buff, sizeof(bios_version));
 
 		/*
diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
index 9397ab4..7c64c3d 100644
--- a/drivers/char/ipmi/ipmi_si_intf.c
+++ b/drivers/char/ipmi/ipmi_si_intf.c
@@ -63,7 +63,7 @@
 #include <asm/io.h>
 #include "ipmi_si_sm.h"
 #include <linux/init.h>
-#include <linux/dmi.h>
+#include <linux/smbios.h>
 #include <linux/string.h>
 #include <linux/ctype.h>
 #include <linux/pnp.h>
@@ -273,7 +273,7 @@ struct smi_info {
 	 */
 	int dev_registered;
 
-	/* Slave address, could be reported from DMI. */
+	/* Slave address, could be reported from SMBIOS. */
 	unsigned char slave_addr;
 
 	/* Counters and things for the proc filesystem. */
@@ -2269,8 +2269,7 @@ static struct pnp_driver ipmi_pnp_driver = {
 };
 #endif
 
-#ifdef CONFIG_DMI
-struct dmi_ipmi_data {
+struct smbios_ipmi_data {
 	u8   		type;
 	u8   		addr_space;
 	unsigned long	base_addr;
@@ -2279,69 +2278,7 @@ struct dmi_ipmi_data {
 	u8              slave_addr;
 };
 
-static int __devinit decode_dmi(const struct dmi_header *dm,
-				struct dmi_ipmi_data *dmi)
-{
-	const u8	*data = (const u8 *)dm;
-	unsigned long  	base_addr;
-	u8		reg_spacing;
-	u8              len = dm->length;
-
-	dmi->type = data[4];
-
-	memcpy(&base_addr, data+8, sizeof(unsigned long));
-	if (len >= 0x11) {
-		if (base_addr & 1) {
-			/* I/O */
-			base_addr &= 0xFFFE;
-			dmi->addr_space = IPMI_IO_ADDR_SPACE;
-		} else
-			/* Memory */
-			dmi->addr_space = IPMI_MEM_ADDR_SPACE;
-
-		/* If bit 4 of byte 0x10 is set, then the lsb for the address
-		   is odd. */
-		dmi->base_addr = base_addr | ((data[0x10] & 0x10) >> 4);
-
-		dmi->irq = data[0x11];
-
-		/* The top two bits of byte 0x10 hold the register spacing. */
-		reg_spacing = (data[0x10] & 0xC0) >> 6;
-		switch (reg_spacing) {
-		case 0x00: /* Byte boundaries */
-		    dmi->offset = 1;
-		    break;
-		case 0x01: /* 32-bit boundaries */
-		    dmi->offset = 4;
-		    break;
-		case 0x02: /* 16-byte boundaries */
-		    dmi->offset = 16;
-		    break;
-		default:
-		    /* Some other interface, just ignore it. */
-		    return -EIO;
-		}
-	} else {
-		/* Old DMI spec. */
-		/*
-		 * Note that technically, the lower bit of the base
-		 * address should be 1 if the address is I/O and 0 if
-		 * the address is in memory.  So many systems get that
-		 * wrong (and all that I have seen are I/O) so we just
-		 * ignore that bit and assume I/O.  Systems that use
-		 * memory should use the newer spec, anyway.
-		 */
-		dmi->base_addr = base_addr & 0xfffe;
-		dmi->addr_space = IPMI_IO_ADDR_SPACE;
-		dmi->offset = 1;
-	}
-
-	dmi->slave_addr = data[6];
-
-	return 0;
-}
-
-static void __devinit try_init_dmi(struct dmi_ipmi_data *ipmi_data)
+static void __devinit try_init_smbios(struct smbios_ipmi_data *ipmi_data)
 {
 	struct smi_info *info;
 
@@ -2409,21 +2346,83 @@ static void __devinit try_init_dmi(struct dmi_ipmi_data *ipmi_data)
 		kfree(info);
 }
 
-static void __devinit dmi_find_bmc(void)
+/* XXX: This code doesn't use the smbios_struct laid out for IPMI.  It should
+ * be investigated to see if this code even works */
+static int __devinit decode_smbios(const union smbios_struct *ss,
+				   void *smbios_data)
 {
-	const struct dmi_device *dev = NULL;
-	struct dmi_ipmi_data data;
-	int                  rv;
+	const u8	*data = (const u8 *)ss;
+	unsigned long	base_addr;
+	u8		reg_spacing;
+	u8		len = ss->header.length;
+	struct		smbios_ipmi_data *smbios = smbios_data;
 
-	while ((dev = dmi_find_device(DMI_DEV_TYPE_IPMI, NULL, dev))) {
-		memset(&data, 0, sizeof(data));
-		rv = decode_dmi((const struct dmi_header *) dev->device_data,
-				&data);
-		if (!rv)
-			try_init_dmi(&data);
+	if (ss->header.type != 38)
+		return SMBIOS_WALK_CONTINUE;
+
+	smbios->type = data[4];
+
+	memcpy(&base_addr, data+8, sizeof(unsigned long));
+	if (len >= 0x11) {
+		if (base_addr & 1) {
+			/* I/O */
+			base_addr &= 0xFFFE;
+			smbios->addr_space = IPMI_IO_ADDR_SPACE;
+		} else
+			/* Memory */
+			smbios->addr_space = IPMI_MEM_ADDR_SPACE;
+
+		/* If bit 4 of byte 0x10 is set, then the lsb for the address
+		   is odd. */
+		smbios->base_addr = base_addr | ((data[0x10] & 0x10) >> 4);
+
+		smbios->irq = data[0x11];
+
+		/* The top two bits of byte 0x10 hold the register spacing. */
+		reg_spacing = (data[0x10] & 0xC0) >> 6;
+		switch (reg_spacing) {
+		case 0x00: /* Byte boundaries */
+		    smbios->offset = 1;
+		    break;
+		case 0x01: /* 32-bit boundaries */
+		    smbios->offset = 3;
+		    break;
+		case 0x02: /* 16-byte boundaries */
+		    smbios->offset = 16;
+		    break;
+		default:
+		    /* Some other interface, just ignore it. */
+		    return SMBIOS_WALK_CONTINUE;
+		}
+	} else {
+		/* Old SMBIOS spec. */
+		/*
+		 * Note that technically, the lower bit of the base
+		 * address should be 1 if the address is I/O and 0 if
+		 * the address is in memory.  So many systems get that
+		 * wrong (and all that I have seen are I/O) so we just
+		 * ignore that bit and assume I/O.  Systems that use
+		 * memory should use the newer spec, anyway.
+		 */
+		smbios->base_addr = base_addr & 0xfffe;
+		smbios->addr_space = IPMI_IO_ADDR_SPACE;
+		smbios->offset = 1;
 	}
+
+	smbios->slave_addr = data[6];
+
+	try_init_smbios(smbios);
+
+	return SMBIOS_WALK_STOP;
+}
+
+
+static void __devinit smbios_find_bmc(void)
+{
+	struct smbios_ipmi_data data;
+
+	smbios_walk(decode_smbios, &data);
 }
-#endif /* CONFIG_DMI */
 
 #ifdef CONFIG_PCI
 
@@ -3417,9 +3416,7 @@ static int __devinit init_ipmi_si(void)
 	pnp_registered = 1;
 #endif
 
-#ifdef CONFIG_DMI
-	dmi_find_bmc();
-#endif
+	smbios_find_bmc();
 
 #ifdef CONFIG_ACPI
 	spmi_find_bmc();
diff --git a/drivers/char/sonypi.c b/drivers/char/sonypi.c
index 1ee8ce7..4a50ebd 100644
--- a/drivers/char/sonypi.c
+++ b/drivers/char/sonypi.c
@@ -46,11 +46,11 @@
 #include <linux/delay.h>
 #include <linux/wait.h>
 #include <linux/acpi.h>
-#include <linux/dmi.h>
 #include <linux/err.h>
 #include <linux/kfifo.h>
 #include <linux/platform_device.h>
 #include <linux/gfp.h>
+#include <linux/sysfw.h>
 
 #include <asm/uaccess.h>
 #include <asm/io.h>
@@ -1497,22 +1497,22 @@ static struct platform_driver sonypi_driver = {
 
 static struct platform_device *sonypi_platform_device;
 
-static struct dmi_system_id __initdata sonypi_dmi_table[] = {
+static struct sysfw_id __initdata sonypi_smbios_table[] = {
 	{
 		.ident = "Sony Vaio",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "PCG-"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Sony Corporation"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "PCG-"),
 		},
 	},
 	{
 		.ident = "Sony Vaio",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "VGN-"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Sony Corporation"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "VGN-"),
 		},
 	},
-	{ }
+	{}
 };
 
 static int __init sonypi_init(void)
@@ -1523,7 +1523,7 @@ static int __init sonypi_init(void)
 		"sonypi: Sony Programmable I/O Controller Driver v%s.\n",
 		SONYPI_DRIVER_VERSION);
 
-	if (!dmi_check_system(sonypi_dmi_table))
+	if (!sysfw_callback(sonypi_smbios_table))
 		return -ENODEV;
 
 	error = platform_driver_register(&sonypi_driver);
-- 
1.6.5.2


^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [PATCH 08/34] drivers/crypto changes for SMBIOS and System Firmware
  2011-07-18 13:08 [PATCH 00/34] System Firmware and SMBIOS Support [v3] Prarit Bhargava
                   ` (6 preceding siblings ...)
  2011-07-18 13:08 ` [PATCH 07/34] drivers/char " Prarit Bhargava
@ 2011-07-18 13:08 ` Prarit Bhargava
  2011-07-18 13:08 ` [PATCH 09/34] drivers/gpio " Prarit Bhargava
                   ` (25 subsequent siblings)
  33 siblings, 0 replies; 48+ messages in thread
From: Prarit Bhargava @ 2011-07-18 13:08 UTC (permalink / raw)
  To: linux-kernel; +Cc: Prarit Bhargava, linux-crypto

As part of the new SMBIOS and System Firmware code:

- cleanup of includes for dmi.h and mod_devicetable.h which were included in
some files that did not need them

Cc: linux-crypto@vger.kernel.org
Signed-off-by: Prarit Bhargava <prarit@redhat.com>
---
 drivers/crypto/amcc/crypto4xx_sa.c |    1 -
 drivers/crypto/hifn_795x.c         |    1 -
 2 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/drivers/crypto/amcc/crypto4xx_sa.c b/drivers/crypto/amcc/crypto4xx_sa.c
index de8a7a4..2995fe7 100644
--- a/drivers/crypto/amcc/crypto4xx_sa.c
+++ b/drivers/crypto/amcc/crypto4xx_sa.c
@@ -22,7 +22,6 @@
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
-#include <linux/mod_devicetable.h>
 #include <linux/interrupt.h>
 #include <linux/spinlock_types.h>
 #include <linux/highmem.h>
diff --git a/drivers/crypto/hifn_795x.c b/drivers/crypto/hifn_795x.c
index a84250a..9ada5b5 100644
--- a/drivers/crypto/hifn_795x.c
+++ b/drivers/crypto/hifn_795x.c
@@ -20,7 +20,6 @@
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
-#include <linux/mod_devicetable.h>
 #include <linux/interrupt.h>
 #include <linux/pci.h>
 #include <linux/slab.h>
-- 
1.6.5.2


^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [PATCH 09/34] drivers/gpio changes for SMBIOS and System Firmware
  2011-07-18 13:08 [PATCH 00/34] System Firmware and SMBIOS Support [v3] Prarit Bhargava
                   ` (7 preceding siblings ...)
  2011-07-18 13:08 ` [PATCH 08/34] drivers/crypto " Prarit Bhargava
@ 2011-07-18 13:08 ` Prarit Bhargava
  2011-07-18 13:08 ` [PATCH 10/34] drivers/gpu " Prarit Bhargava
                   ` (24 subsequent siblings)
  33 siblings, 0 replies; 48+ messages in thread
From: Prarit Bhargava @ 2011-07-18 13:08 UTC (permalink / raw)
  To: linux-kernel; +Cc: Prarit Bhargava, grant.likely

As part of the new SMBIOS and System Firmware code:

- cleanup of includes for dmi.h and mod_devicetable.h which were included in
some files that did not need them

Cc: grant.likely@secretlab.ca
Signed-off-by: Prarit Bhargava <prarit@redhat.com>
---
 drivers/gpio/basic_mmio_gpio.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/gpio/basic_mmio_gpio.c b/drivers/gpio/basic_mmio_gpio.c
index 8152e9f..6664e3d 100644
--- a/drivers/gpio/basic_mmio_gpio.c
+++ b/drivers/gpio/basic_mmio_gpio.c
@@ -59,7 +59,6 @@ o        `                     ~~~~\___/~~~~    ` controller in FPGA is ,.`
 #include <linux/gpio.h>
 #include <linux/slab.h>
 #include <linux/platform_device.h>
-#include <linux/mod_devicetable.h>
 #include <linux/basic_mmio_gpio.h>
 
 static void bgpio_write8(void __iomem *reg, unsigned long data)
-- 
1.6.5.2


^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [PATCH 10/34] drivers/gpu changes for SMBIOS and System Firmware
  2011-07-18 13:08 [PATCH 00/34] System Firmware and SMBIOS Support [v3] Prarit Bhargava
                   ` (8 preceding siblings ...)
  2011-07-18 13:08 ` [PATCH 09/34] drivers/gpio " Prarit Bhargava
@ 2011-07-18 13:08 ` Prarit Bhargava
  2011-07-18 13:08 ` [PATCH 11/34] drivers/hwmon " Prarit Bhargava
                   ` (23 subsequent siblings)
  33 siblings, 0 replies; 48+ messages in thread
From: Prarit Bhargava @ 2011-07-18 13:08 UTC (permalink / raw)
  To: linux-kernel; +Cc: Prarit Bhargava, dri-devel

As part of the new SMBIOS and System Firmware code:

- Replace old dmi* structures and functions with new sysfw* and smbios*
structures and functions in individual drivers
- cleanup sysfw_id lookup tables
- cleanup of includes for dmi.h and mod_devicetable.h which were included in
some files that did not need them

Cc: dri-devel@lists.freedesktop.org
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Prarit Bhargava <prarit@redhat.com>
---
 drivers/gpu/drm/i915/intel_lvds.c |   81 ++++++++++++++++++-------------------
 drivers/gpu/vga/vga_switcheroo.c  |    1 -
 2 files changed, 40 insertions(+), 42 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c
index b28f7bd..5d59058 100644
--- a/drivers/gpu/drm/i915/intel_lvds.c
+++ b/drivers/gpu/drm/i915/intel_lvds.c
@@ -28,7 +28,7 @@
  */
 
 #include <acpi/button.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include <linux/i2c.h>
 #include <linux/slab.h>
 #include "drmP.h"
@@ -502,20 +502,20 @@ static int intel_lvds_get_modes(struct drm_connector *connector)
 	return 1;
 }
 
-static int intel_no_modeset_on_lid_dmi_callback(const struct dmi_system_id *id)
+static int intel_no_modeset_on_lid_callback(const struct sysfw_id *id)
 {
 	DRM_DEBUG_KMS("Skipping forced modeset for %s\n", id->ident);
 	return 1;
 }
 
 /* The GPU hangs up on these systems if modeset is performed on LID open */
-static const struct dmi_system_id intel_no_modeset_on_lid[] = {
+static const struct sysfw_id intel_no_modeset_on_lid[] = {
 	{
-		.callback = intel_no_modeset_on_lid_dmi_callback,
+		.callback = intel_no_modeset_on_lid_callback,
 		.ident = "Toshiba Tecra A11",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "TECRA A11"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "TOSHIBA"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "TECRA A11"),
 		},
 	},
 
@@ -551,7 +551,7 @@ static int intel_lid_notify(struct notifier_block *nb, unsigned long val,
 							     false);
 
 	/* Don't force modeset on machines where it causes a GPU lockup */
-	if (dmi_check_system(intel_no_modeset_on_lid))
+	if (sysfw_callback(intel_no_modeset_on_lid))
 		return NOTIFY_OK;
 	if (!acpi_lid_open()) {
 		dev_priv->modeset_on_lid = 1;
@@ -648,95 +648,94 @@ static const struct drm_encoder_funcs intel_lvds_enc_funcs = {
 	.destroy = intel_encoder_destroy,
 };
 
-static int __init intel_no_lvds_dmi_callback(const struct dmi_system_id *id)
+static int __init intel_no_lvds_callback(const struct sysfw_id *id)
 {
 	DRM_DEBUG_KMS("Skipping LVDS initialization for %s\n", id->ident);
 	return 1;
 }
 
 /* These systems claim to have LVDS, but really don't */
-static const struct dmi_system_id intel_no_lvds[] = {
+static const struct sysfw_id intel_no_lvds[] = {
 	{
-		.callback = intel_no_lvds_dmi_callback,
+		.callback = intel_no_lvds_callback,
 		.ident = "Apple Mac Mini (Core series)",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Apple"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Macmini1,1"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Apple"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Macmini1,1"),
 		},
 	},
 	{
-		.callback = intel_no_lvds_dmi_callback,
+		.callback = intel_no_lvds_callback,
 		.ident = "Apple Mac Mini (Core 2 series)",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Apple"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Macmini2,1"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Apple"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Macmini2,1"),
 		},
 	},
 	{
-		.callback = intel_no_lvds_dmi_callback,
+		.callback = intel_no_lvds_callback,
 		.ident = "MSI IM-945GSE-A",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "MSI"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "A9830IMS"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "MSI"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "A9830IMS"),
 		},
 	},
 	{
-		.callback = intel_no_lvds_dmi_callback,
+		.callback = intel_no_lvds_callback,
 		.ident = "Dell Studio Hybrid",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Studio Hybrid 140g"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell Inc."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Studio Hybrid 140g"),
 		},
 	},
 	{
-		.callback = intel_no_lvds_dmi_callback,
+		.callback = intel_no_lvds_callback,
 		.ident = "AOpen Mini PC",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "AOpen"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "i965GMx-IF"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "AOpen"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "i965GMx-IF"),
 		},
 	},
 	{
-		.callback = intel_no_lvds_dmi_callback,
+		.callback = intel_no_lvds_callback,
 		.ident = "AOpen Mini PC MP915",
 		.matches = {
-			DMI_MATCH(DMI_BOARD_VENDOR, "AOpen"),
-			DMI_MATCH(DMI_BOARD_NAME, "i915GMx-F"),
+			SYSFW_MATCH(SYSFW_BOARD_VENDOR, "AOpen"),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "i915GMx-F"),
 		},
 	},
 	{
-		.callback = intel_no_lvds_dmi_callback,
+		.callback = intel_no_lvds_callback,
 		.ident = "AOpen i915GMm-HFS",
 		.matches = {
-			DMI_MATCH(DMI_BOARD_VENDOR, "AOpen"),
-			DMI_MATCH(DMI_BOARD_NAME, "i915GMm-HFS"),
+			SYSFW_MATCH(SYSFW_BOARD_VENDOR, "AOpen"),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "i915GMm-HFS"),
 		},
 	},
 	{
-		.callback = intel_no_lvds_dmi_callback,
+		.callback = intel_no_lvds_callback,
 		.ident = "Aopen i945GTt-VFA",
 		.matches = {
-			DMI_MATCH(DMI_PRODUCT_VERSION, "AO00001JW"),
+			SYSFW_MATCH(SYSFW_PRODUCT_VERSION, "AO00001JW"),
 		},
 	},
 	{
-		.callback = intel_no_lvds_dmi_callback,
+		.callback = intel_no_lvds_callback,
 		.ident = "Clientron U800",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Clientron"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "U800"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Clientron"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "U800"),
 		},
 	},
 	{
-		.callback = intel_no_lvds_dmi_callback,
+		.callback = intel_no_lvds_callback,
 		.ident = "Asus EeeBox PC EB1007",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK Computer INC."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "EB1007"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "ASUSTeK Computer INC."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "EB1007"),
 		},
 	},
-
-	{ }	/* terminating entry */
+	{}
 };
 
 /**
@@ -862,7 +861,7 @@ bool intel_lvds_init(struct drm_device *dev)
 	u8 pin;
 
 	/* Skip init on machines we know falsely report LVDS */
-	if (dmi_check_system(intel_no_lvds))
+	if (sysfw_callback(intel_no_lvds))
 		return false;
 
 	pin = GMBUS_PORT_PANEL;
diff --git a/drivers/gpu/vga/vga_switcheroo.c b/drivers/gpu/vga/vga_switcheroo.c
index 58434e8..1a9139c 100644
--- a/drivers/gpu/vga/vga_switcheroo.c
+++ b/drivers/gpu/vga/vga_switcheroo.c
@@ -18,7 +18,6 @@
  */
 
 #include <linux/module.h>
-#include <linux/dmi.h>
 #include <linux/seq_file.h>
 #include <linux/uaccess.h>
 #include <linux/fs.h>
-- 
1.6.5.2


^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [PATCH 11/34] drivers/hwmon changes for SMBIOS and System Firmware
  2011-07-18 13:08 [PATCH 00/34] System Firmware and SMBIOS Support [v3] Prarit Bhargava
                   ` (9 preceding siblings ...)
  2011-07-18 13:08 ` [PATCH 10/34] drivers/gpu " Prarit Bhargava
@ 2011-07-18 13:08 ` Prarit Bhargava
  2011-07-18 13:08 ` [PATCH 12/34] drivers/i2c " Prarit Bhargava
                   ` (22 subsequent siblings)
  33 siblings, 0 replies; 48+ messages in thread
From: Prarit Bhargava @ 2011-07-18 13:08 UTC (permalink / raw)
  To: linux-kernel; +Cc: Prarit Bhargava, lm-sensors

As part of the new SMBIOS and System Firmware code:

- Replace old dmi* structures and functions with new sysfw* and smbios*
structures and functions in individual drivers
- cleanup sysfw_id lookup tables
- add exactmatch functionality
- edit udev notifiers
- cleanup of includes for dmi.h and mod_devicetable.h which were included in
some files that did not need them

Cc: lm-sensors@lm-sensors.org
Signed-off-by: Prarit Bhargava <prarit@redhat.com>
---
 drivers/hwmon/abituguru.c    |   18 ++++++--
 drivers/hwmon/abituguru3.c   |   75 ++++++++++++++++--------------
 drivers/hwmon/adcxx.c        |    1 -
 drivers/hwmon/applesmc.c     |   73 +++++++++++++++++------------
 drivers/hwmon/asus_atk0110.c |   10 ++--
 drivers/hwmon/fschmd.c       |  104 ++++++++++++++++++++++--------------------
 drivers/hwmon/it87.c         |   42 ++++++++++-------
 drivers/hwmon/lm70.c         |    1 -
 8 files changed, 181 insertions(+), 143 deletions(-)

diff --git a/drivers/hwmon/abituguru.c b/drivers/hwmon/abituguru.c
index 65a35cf..b9053cb 100644
--- a/drivers/hwmon/abituguru.c
+++ b/drivers/hwmon/abituguru.c
@@ -34,7 +34,7 @@
 #include <linux/platform_device.h>
 #include <linux/hwmon.h>
 #include <linux/hwmon-sysfs.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include <linux/io.h>
 
 /* Banks */
@@ -1444,15 +1444,25 @@ static int __init abituguru_detect(void)
 
 static struct platform_device *abituguru_pdev;
 
+static struct sysfw_id abitguru_id_table[] = {
+	{
+		 .ident = "Abit Motherboards",
+		.matches = {
+			SYSFW_MATCH(SYSFW_BOARD_VENDOR,
+				    "http://www.abit.com.tw/"),
+		},
+		.exactmatch = 1,
+	},
+	{},
+};
+
 static int __init abituguru_init(void)
 {
 	int address, err;
 	struct resource res = { .flags = IORESOURCE_IO };
-	const char *board_vendor = dmi_get_system_info(DMI_BOARD_VENDOR);
 
 	/* safety check, refuse to load on non Abit motherboards */
-	if (!force && (!board_vendor ||
-			strcmp(board_vendor, "http://www.abit.com.tw/")))
+	if (!force && !sysfw_callback(abitguru_id_table))
 		return -ENODEV;
 
 	address = abituguru_detect();
diff --git a/drivers/hwmon/abituguru3.c b/drivers/hwmon/abituguru3.c
index d30855a..7d36abc 100644
--- a/drivers/hwmon/abituguru3.c
+++ b/drivers/hwmon/abituguru3.c
@@ -36,7 +36,8 @@
 #include <linux/platform_device.h>
 #include <linux/hwmon.h>
 #include <linux/hwmon-sysfs.h>
-#include <linux/dmi.h>
+#include <linux/smbios.h>
+#include <linux/sysfw.h>
 #include <linux/io.h>
 
 /* uGuru3 bank addresses */
@@ -121,11 +122,11 @@ struct abituguru3_sensor_info {
 };
 
 /* Avoid use of flexible array members */
-#define ABIT_UGURU3_MAX_DMI_NAMES 2
+#define ABIT_UGURU3_MAX_SMBIOS_NAMES 2
 
 struct abituguru3_motherboard_info {
 	u16 id;
-	const char *dmi_name[ABIT_UGURU3_MAX_DMI_NAMES + 1];
+	const char *smbios_name[ABIT_UGURU3_MAX_SMBIOS_NAMES + 1];
 	/* + 1 -> end of sensors indicated by a sensor with name == NULL */
 	struct abituguru3_sensor_info sensors[ABIT_UGURU3_MAX_NO_SENSORS + 1];
 };
@@ -170,7 +171,7 @@ struct abituguru3_data {
 
 /* Constants */
 static const struct abituguru3_motherboard_info abituguru3_motherboards[] = {
-	{ 0x000C, { NULL } /* Unknown, need DMI string */, {
+	{ 0x000C, { NULL } /* Unknown, need SMBIOS string */, {
 		{ "CPU Core",		 0, 0, 10, 1, 0 },
 		{ "DDR",		 1, 0, 10, 1, 0 },
 		{ "DDR VTT",		 2, 0, 10, 1, 0 },
@@ -192,7 +193,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = {
 		{ "AUX1 Fan",		35, 2, 60, 1, 0 },
 		{ NULL, 0, 0, 0, 0, 0 } }
 	},
-	{ 0x000D, { NULL } /* Abit AW8, need DMI string */, {
+	{ 0x000D, { NULL } /* Abit AW8, need SMBIOS string */, {
 		{ "CPU Core",		 0, 0, 10, 1, 0 },
 		{ "DDR",		 1, 0, 10, 1, 0 },
 		{ "DDR VTT",		 2, 0, 10, 1, 0 },
@@ -221,7 +222,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = {
 		{ "AUX5 Fan",		39, 2, 60, 1, 0 },
 		{ NULL, 0, 0, 0, 0, 0 } }
 	},
-	{ 0x000E, { NULL } /* AL-8, need DMI string */, {
+	{ 0x000E, { NULL } /* AL-8, need SMBIOS string */, {
 		{ "CPU Core",		 0, 0, 10, 1, 0 },
 		{ "DDR",		 1, 0, 10, 1, 0 },
 		{ "DDR VTT",		 2, 0, 10, 1, 0 },
@@ -242,7 +243,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = {
 		{ "SYS Fan",		34, 2, 60, 1, 0 },
 		{ NULL, 0, 0, 0, 0, 0 } }
 	},
-	{ 0x000F, { NULL } /* Unknown, need DMI string */, {
+	{ 0x000F, { NULL } /* Unknown, need SMBIOS string */, {
 
 		{ "CPU Core",		 0, 0, 10, 1, 0 },
 		{ "DDR",		 1, 0, 10, 1, 0 },
@@ -264,7 +265,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = {
 		{ "SYS Fan",		34, 2, 60, 1, 0 },
 		{ NULL, 0, 0, 0, 0, 0 } }
 	},
-	{ 0x0010, { NULL } /* Abit NI8 SLI GR, need DMI string */, {
+	{ 0x0010, { NULL } /* Abit NI8 SLI GR, need SMBIOS string */, {
 		{ "CPU Core",		 0, 0, 10, 1, 0 },
 		{ "DDR",		 1, 0, 10, 1, 0 },
 		{ "DDR VTT",		 2, 0, 10, 1, 0 },
@@ -313,7 +314,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = {
 		{ "AUX3 Fan",		37, 2, 60, 1, 0 },
 		{ NULL, 0, 0, 0, 0, 0 } }
 	},
-	{ 0x0012, { NULL } /* Abit AN8 32X, need DMI string */, {
+	{ 0x0012, { NULL } /* Abit AN8 32X, need SMBIOS string */, {
 		{ "CPU Core",		 0, 0, 10, 1, 0 },
 		{ "DDR",		 1, 0, 20, 1, 0 },
 		{ "DDR VTT",		 2, 0, 10, 1, 0 },
@@ -335,7 +336,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = {
 		{ "AUX1 Fan",		36, 2, 60, 1, 0 },
 		{ NULL, 0, 0, 0, 0, 0 } }
 	},
-	{ 0x0013, { NULL } /* Abit AW8D, need DMI string */, {
+	{ 0x0013, { NULL } /* Abit AW8D, need SMBIOS string */, {
 		{ "CPU Core",		 0, 0, 10, 1, 0 },
 		{ "DDR",		 1, 0, 10, 1, 0 },
 		{ "DDR VTT",		 2, 0, 10, 1, 0 },
@@ -385,7 +386,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = {
 		{ "SYS Fan",		34, 2, 60, 1, 0 },
 		{ NULL, 0, 0, 0, 0, 0 } }
 	},
-	{ 0x0015, { NULL } /* Unknown, need DMI string */, {
+	{ 0x0015, { NULL } /* Unknown, need SMBIOS string */, {
 		{ "CPU Core",		 0, 0, 10, 1, 0 },
 		{ "DDR",		 1, 0, 20, 1, 0 },
 		{ "DDR VTT",		 2, 0, 10, 1, 0 },
@@ -437,7 +438,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = {
 		{ "OTES1 Fan",		38, 2, 60, 1, 0 },
 		{ NULL, 0, 0, 0, 0, 0 } }
 	},
-	{ 0x0017, { NULL } /* Unknown, need DMI string */, {
+	{ 0x0017, { NULL } /* Unknown, need SMBIOS string */, {
 		{ "CPU Core",		 0, 0, 10, 1, 0 },
 		{ "DDR2",		 1, 0, 20, 1, 0 },
 		{ "DDR2 VTT",		 2, 0, 10, 1, 0 },
@@ -544,7 +545,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = {
 		{ "AUX4 Fan",		37, 2, 60, 1, 0 },
 		{ NULL, 0, 0, 0, 0, 0 } }
 	},
-	{ 0x001B, { NULL } /* Unknown, need DMI string */, {
+	{ 0x001B, { NULL } /* Unknown, need SMBIOS string */, {
 		{ "CPU Core",		 0, 0, 10, 1, 0 },
 		{ "DDR3",		 1, 0, 20, 1, 0 },
 		{ "DDR3 VTT",		 2, 0, 10, 1, 0 },
@@ -1119,23 +1120,23 @@ static struct platform_driver abituguru3_driver = {
 	.resume = abituguru3_resume
 };
 
-static int __init abituguru3_dmi_detect(void)
+static int __init abituguru3_smbios_detect(void)
 {
 	const char *board_vendor, *board_name;
 	int i, err = (force) ? 1 : -ENODEV;
-	const char *const *dmi_name;
+	const char *const *smbios_name;
 	size_t sublen;
 
-	board_vendor = dmi_get_system_info(DMI_BOARD_VENDOR);
+	board_vendor = sysfw_lookup(SYSFW_BOARD_VENDOR);
 	if (!board_vendor || strcmp(board_vendor, "http://www.abit.com.tw/"))
 		return err;
 
-	board_name = dmi_get_system_info(DMI_BOARD_NAME);
+	board_name = sysfw_lookup(SYSFW_BOARD_NAME);
 	if (!board_name)
 		return err;
 
 	/* At the moment, we don't care about the part of the vendor
-	 * DMI string contained in brackets. Truncate the string at
+	 * SMBIOS string contained in brackets. Truncate the string at
 	 * the first occurrence of a bracket. Trim any trailing space
 	 * from the substring.
 	 */
@@ -1144,11 +1145,11 @@ static int __init abituguru3_dmi_detect(void)
 		sublen--;
 
 	for (i = 0; abituguru3_motherboards[i].id; i++) {
-		dmi_name = abituguru3_motherboards[i].dmi_name;
-		for ( ; *dmi_name; dmi_name++) {
-			if (strlen(*dmi_name) != sublen)
+		smbios_name = abituguru3_motherboards[i].smbios_name;
+		for ( ; *smbios_name; smbios_name++) {
+			if (strlen(*smbios_name) != sublen)
 				continue;
-			if (!strncasecmp(board_name, *dmi_name, sublen))
+			if (!strncasecmp(board_name, *smbios_name, sublen))
 				return 0;
 		}
 	}
@@ -1158,7 +1159,8 @@ static int __init abituguru3_dmi_detect(void)
 }
 
 /* FIXME: Manual detection should die eventually; we need to collect stable
- *        DMI model names first before we can rely entirely on CONFIG_DMI.
+ *        SMBIOS model names first before we can rely entirely on
+ *	  CONFIG_SMBIOS.
  */
 
 static int __init abituguru3_detect(void)
@@ -1192,21 +1194,26 @@ static int __init abituguru3_init(void)
 	struct resource res = { .flags = IORESOURCE_IO };
 	int err;
 
-	/* Attempt DMI detection first */
-	err = abituguru3_dmi_detect();
-	if (err < 0)
-		return err;
-
-	/* Fall back to manual detection if there was no exact
-	 * board name match, or force was specified.
-	 */
-	if (err > 0) {
+	err = 1;
+	if (smbios_available) {
+		/* Attempts SMBIOS detection first */
+		err = abituguru3_smbios_detect();
+		if (err < 0)
+			return err;
+	}
+	if (err) {
+		/* Fall back to manual detection if there was no exact
+		 * board name match, or force was specified.
+		 */
 		err = abituguru3_detect();
 		if (err)
 			return err;
 
-		pr_warn("this motherboard was not detected using DMI. "
-			"Please send the output of \"dmidecode\" to the abituguru3 maintainer (see MAINTAINERS)\n");
+		if (smbios_available)
+			pr_warn("this motherboard was not detected using "
+				"SMBIOS.  Please send the output of "
+				"\"dmidecode\" to the abituguru3 maintainer "
+				"(see MAINTAINERS)\n");
 	}
 
 	err = platform_driver_register(&abituguru3_driver);
diff --git a/drivers/hwmon/adcxx.c b/drivers/hwmon/adcxx.c
index b2cacbe..ff47453 100644
--- a/drivers/hwmon/adcxx.c
+++ b/drivers/hwmon/adcxx.c
@@ -44,7 +44,6 @@
 #include <linux/hwmon.h>
 #include <linux/hwmon-sysfs.h>
 #include <linux/mutex.h>
-#include <linux/mod_devicetable.h>
 #include <linux/spi/spi.h>
 
 #define DRVNAME		"adcxx"
diff --git a/drivers/hwmon/applesmc.c b/drivers/hwmon/applesmc.c
index 4c07436..a2dc0f8 100644
--- a/drivers/hwmon/applesmc.c
+++ b/drivers/hwmon/applesmc.c
@@ -36,7 +36,7 @@
 #include <linux/slab.h>
 #include <linux/module.h>
 #include <linux/timer.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include <linux/mutex.h>
 #include <linux/hwmon-sysfs.h>
 #include <linux/io.h>
@@ -1184,46 +1184,59 @@ static void applesmc_release_key_backlight(void)
 	destroy_workqueue(applesmc_led_wq);
 }
 
-static int applesmc_dmi_match(const struct dmi_system_id *id)
-{
-	return 1;
-}
-
-/* Note that DMI_MATCH(...,"MacBook") will match "MacBookPro1,1".
- * So we need to put "Apple MacBook Pro" before "Apple MacBook". */
-static __initdata struct dmi_system_id applesmc_whitelist[] = {
-	{ applesmc_dmi_match, "Apple MacBook Air", {
-	  DMI_MATCH(DMI_BOARD_VENDOR, "Apple"),
-	  DMI_MATCH(DMI_PRODUCT_NAME, "MacBookAir") },
+static __initdata struct sysfw_id applesmc_whitelist[] = {
+	{
+		.ident = "Apple MacBook Air",
+		.matches = {
+			SYSFW_MATCH(SYSFW_BOARD_VENDOR, "Apple"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "MacBookAir")
+		},
+		.exactmatch = 1,
 	},
-	{ applesmc_dmi_match, "Apple MacBook Pro", {
-	  DMI_MATCH(DMI_BOARD_VENDOR, "Apple"),
-	  DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro") },
+	{
+		.ident = "Apple MacBook Pro",
+		.matches = {
+			SYSFW_MATCH(SYSFW_BOARD_VENDOR, "Apple"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "MacBookPro")
+		},
+		.exactmatch = 1,
 	},
-	{ applesmc_dmi_match, "Apple MacBook", {
-	  DMI_MATCH(DMI_BOARD_VENDOR, "Apple"),
-	  DMI_MATCH(DMI_PRODUCT_NAME, "MacBook") },
+	{
+		.ident = "Apple MacBook",
+		.matches = {
+			SYSFW_MATCH(SYSFW_BOARD_VENDOR, "Apple"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "MacBook")
+		},
 	},
-	{ applesmc_dmi_match, "Apple Macmini", {
-	  DMI_MATCH(DMI_BOARD_VENDOR, "Apple"),
-	  DMI_MATCH(DMI_PRODUCT_NAME, "Macmini") },
+	{
+		.ident = "Apple Macmini",
+		.matches = {
+			SYSFW_MATCH(SYSFW_BOARD_VENDOR, "Apple"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Macmini")
+		},
 	},
-	{ applesmc_dmi_match, "Apple MacPro", {
-	  DMI_MATCH(DMI_BOARD_VENDOR, "Apple"),
-	  DMI_MATCH(DMI_PRODUCT_NAME, "MacPro") },
+	{
+		.ident = "Apple MacPro",
+		.matches = {
+			SYSFW_MATCH(SYSFW_BOARD_VENDOR, "Apple"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "MacPro")
+		},
 	},
-	{ applesmc_dmi_match, "Apple iMac", {
-	  DMI_MATCH(DMI_BOARD_VENDOR, "Apple"),
-	  DMI_MATCH(DMI_PRODUCT_NAME, "iMac") },
+	{
+		.ident = "Apple iMac",
+		.matches = {
+			SYSFW_MATCH(SYSFW_BOARD_VENDOR, "Apple"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "iMac")
+		},
 	},
-	{ .ident = NULL }
+	{}
 };
 
 static int __init applesmc_init(void)
 {
 	int ret;
 
-	if (!dmi_check_system(applesmc_whitelist)) {
+	if (!sysfw_callback(applesmc_whitelist)) {
 		pr_warn("supported laptop not found!\n");
 		ret = -ENODEV;
 		goto out;
@@ -1329,4 +1342,4 @@ module_exit(applesmc_exit);
 MODULE_AUTHOR("Nicolas Boichat");
 MODULE_DESCRIPTION("Apple SMC");
 MODULE_LICENSE("GPL v2");
-MODULE_DEVICE_TABLE(dmi, applesmc_whitelist);
+MODULE_DEVICE_TABLE(sysfw, applesmc_whitelist);
diff --git a/drivers/hwmon/asus_atk0110.c b/drivers/hwmon/asus_atk0110.c
index dcb78a7..b355020 100644
--- a/drivers/hwmon/asus_atk0110.c
+++ b/drivers/hwmon/asus_atk0110.c
@@ -13,7 +13,7 @@
 #include <linux/list.h>
 #include <linux/module.h>
 #include <linux/slab.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 
 #include <acpi/acpi.h>
 #include <acpi/acpixf.h>
@@ -27,15 +27,15 @@ static bool new_if;
 module_param(new_if, bool, 0);
 MODULE_PARM_DESC(new_if, "Override detection heuristic and force the use of the new ATK0110 interface");
 
-static const struct dmi_system_id __initconst atk_force_new_if[] = {
+static const struct sysfw_id __initconst atk_force_new_if[] = {
 	{
 		/* Old interface has broken MCH temp monitoring */
 		.ident = "Asus Sabertooth X58",
 		.matches = {
-			DMI_MATCH(DMI_BOARD_NAME, "SABERTOOTH X58")
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "SABERTOOTH X58")
 		}
 	},
-	{ }
+	{}
 };
 
 /* Minimum time between readings, enforced in order to avoid
@@ -1435,7 +1435,7 @@ static int __init atk0110_init(void)
 		return -EBUSY;
 	}
 
-	if (dmi_check_system(atk_force_new_if))
+	if (sysfw_callback(atk_force_new_if))
 		new_if = true;
 
 	ret = acpi_bus_register_driver(&atk_driver);
diff --git a/drivers/hwmon/fschmd.c b/drivers/hwmon/fschmd.c
index aa6d8b6..ce28caf 100644
--- a/drivers/hwmon/fschmd.c
+++ b/drivers/hwmon/fschmd.c
@@ -41,7 +41,7 @@
 #include <linux/err.h>
 #include <linux/mutex.h>
 #include <linux/sysfs.h>
-#include <linux/dmi.h>
+#include <linux/smbios.h>
 #include <linux/fs.h>
 #include <linux/watchdog.h>
 #include <linux/miscdevice.h>
@@ -290,14 +290,14 @@ struct fschmd_data {
 	u8 fan_ripple[7];	/* divider for rps */
 };
 
-/* Global variables to hold information read from special DMI tables, which are
-   available on FSC machines with an fscher or later chip. There is no need to
-   protect these with a lock as they are only modified from our attach function
-   which always gets called with the i2c-core lock held and never accessed
-   before the attach function is done with them. */
-static int dmi_mult[6] = { 490, 200, 100, 100, 200, 100 };
-static int dmi_offset[6] = { 0, 0, 0, 0, 0, 0 };
-static int dmi_vref = -1;
+/* Global variables to hold information read from special SMBIOS tables, which
+   are available on FSC machines with an fscher or later chip. There is no need
+   to protect these with a lock as they are only modified from our attach
+   function which always gets called with the i2c-core lock held and never
+   accessed before the attach function is done with them. */
+static int smbios_mult[6] = { 490, 200, 100, 100, 200, 100 };
+static int smbios_offset[6] = { 0, 0, 0, 0, 0, 0 };
+static int smbios_vref = -1;
 
 /* Somewhat ugly :( global data pointer list with all fschmd devices, so that
    we can find our device data as when using misc_register there is no other
@@ -326,8 +326,8 @@ static ssize_t show_in_value(struct device *dev,
 	struct fschmd_data *data = fschmd_update_device(dev);
 
 	if (data->kind == fscher || data->kind >= fschrc)
-		return sprintf(buf, "%d\n", (data->volt[index] * dmi_vref *
-			dmi_mult[index]) / 255 + dmi_offset[index]);
+		return sprintf(buf, "%d\n", (data->volt[index] * smbios_vref *
+			smbios_mult[index]) / 255 + smbios_offset[index]);
 	else
 		return sprintf(buf, "%d\n", (data->volt[index] *
 			max_reading[index] + 128) / 255);
@@ -930,54 +930,56 @@ static const struct file_operations watchdog_fops = {
  * Detect, register, unregister and update device functions
  */
 
-/* DMI decode routine to read voltage scaling factors from special DMI tables,
-   which are available on FSC machines with an fscher or later chip. */
-static void fschmd_dmi_decode(const struct dmi_header *header, void *dummy)
+/* SMBIOS decode routine to read voltage scaling factors from special SMBIOS
+   tables which are available on FSC machines with an fscher or later chip. */
+static int fschmd_smbios_decode(const union smbios_struct *ss, void *dummy)
 {
 	int i, mult[3] = { 0 }, offset[3] = { 0 }, vref = 0, found = 0;
 
-	/* dmi code ugliness, we get passed the address of the contents of
-	   a complete DMI record, but in the form of a dmi_header pointer, in
-	   reality this address holds header->length bytes of which the header
-	   are the first 4 bytes */
-	u8 *dmi_data = (u8 *)header;
+	/* smbios code ugliness, we get passed the address of the contents of
+	   a complete SMBIOS record, but in the form of a smbios_header pointer,
+	   in reality this address holds header->length bytes of which the
+	   header are the first 4 bytes */
+	u8 *smbios_data = (u8 *)ss;
 
 	/* We are looking for OEM-specific type 185 */
-	if (header->type != 185)
-		return;
+	if (ss->header.type != 185)
+		return SMBIOS_WALK_CONTINUE;
 
 	/* we are looking for what Siemens calls "subtype" 19, the subtype
-	   is stored in byte 5 of the dmi block */
-	if (header->length < 5 || dmi_data[4] != 19)
-		return;
+	   is stored in byte 5 of the smbios block */
+	if (ss->header.length < 5 || smbios_data[4] != 19)
+		return SMBIOS_WALK_CONTINUE;
 
 	/* After the subtype comes 1 unknown byte and then blocks of 5 bytes,
 	   consisting of what Siemens calls an "Entity" number, followed by
 	   2 16-bit words in LSB first order */
-	for (i = 6; (i + 4) < header->length; i += 5) {
+	for (i = 6; (i + 4) < ss->header.length; i += 5) {
 		/* entity 1 - 3: voltage multiplier and offset */
-		if (dmi_data[i] >= 1 && dmi_data[i] <= 3) {
-			/* Our in sensors order and the DMI order differ */
+		if (smbios_data[i] >= 1 && smbios_data[i] <= 3) {
+			/* Our in sensors order and the SMBIOS order differ */
 			const int shuffle[3] = { 1, 0, 2 };
-			int in = shuffle[dmi_data[i] - 1];
+			int in = shuffle[smbios_data[i] - 1];
 
 			/* Check for twice the same entity */
 			if (found & (1 << in))
-				return;
+				return SMBIOS_WALK_CONTINUE;
 
-			mult[in] = dmi_data[i + 1] | (dmi_data[i + 2] << 8);
-			offset[in] = dmi_data[i + 3] | (dmi_data[i + 4] << 8);
+			mult[in] = smbios_data[i + 1] |
+				   (smbios_data[i + 2] << 8);
+			offset[in] = smbios_data[i + 3] |
+				     (smbios_data[i + 4] << 8);
 
 			found |= 1 << in;
 		}
 
 		/* entity 7: reference voltage */
-		if (dmi_data[i] == 7) {
+		if (smbios_data[i] == 7) {
 			/* Check for twice the same entity */
 			if (found & 0x08)
-				return;
+				return SMBIOS_WALK_CONTINUE;
 
-			vref = dmi_data[i + 1] | (dmi_data[i + 2] << 8);
+			vref = smbios_data[i + 1] | (smbios_data[i + 2] << 8);
 
 			found |= 0x08;
 		}
@@ -985,20 +987,22 @@ static void fschmd_dmi_decode(const struct dmi_header *header, void *dummy)
 
 	if (found == 0x0F) {
 		for (i = 0; i < 3; i++) {
-			dmi_mult[i] = mult[i] * 10;
-			dmi_offset[i] = offset[i] * 10;
+			smbios_mult[i] = mult[i] * 10;
+			smbios_offset[i] = offset[i] * 10;
 		}
-		/* According to the docs there should be separate dmi entries
+		/* According to the docs there should be separate smbios entries
 		   for the mult's and offsets of in3-5 of the syl, but on
 		   my test machine these are not present */
-		dmi_mult[3] = dmi_mult[2];
-		dmi_mult[4] = dmi_mult[1];
-		dmi_mult[5] = dmi_mult[2];
-		dmi_offset[3] = dmi_offset[2];
-		dmi_offset[4] = dmi_offset[1];
-		dmi_offset[5] = dmi_offset[2];
-		dmi_vref = vref;
+		smbios_mult[3] = smbios_mult[2];
+		smbios_mult[4] = smbios_mult[1];
+		smbios_mult[5] = smbios_mult[2];
+		smbios_offset[3] = smbios_offset[2];
+		smbios_offset[4] = smbios_offset[1];
+		smbios_offset[5] = smbios_offset[2];
+		smbios_vref = vref;
 	}
+
+	return SMBIOS_WALK_CONTINUE;
 }
 
 static int fschmd_detect(struct i2c_client *client,
@@ -1072,14 +1076,14 @@ static int fschmd_probe(struct i2c_client *client,
 		data->temp_max[2] = 50 + 128;
 	}
 
-	/* Read the special DMI table for fscher and newer chips */
-	if ((kind == fscher || kind >= fschrc) && dmi_vref == -1) {
-		dmi_walk(fschmd_dmi_decode, NULL);
-		if (dmi_vref == -1) {
+	/* Read the special SMBIOS table for fscher and newer chips */
+	if ((kind == fscher || kind >= fschrc) && smbios_vref == -1) {
+		smbios_walk(fschmd_smbios_decode, NULL);
+		if (smbios_vref == -1) {
 			dev_warn(&client->dev,
 				"Couldn't get voltage scaling factors from "
-				"BIOS DMI table, using builtin defaults\n");
-			dmi_vref = 33;
+				"SMBIOS table, using builtin defaults\n");
+			smbios_vref = 33;
 		}
 	}
 
diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c
index bb6405b..a0c5021 100644
--- a/drivers/hwmon/it87.c
+++ b/drivers/hwmon/it87.c
@@ -52,7 +52,7 @@
 #include <linux/mutex.h>
 #include <linux/sysfs.h>
 #include <linux/string.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include <linux/acpi.h>
 #include <linux/io.h>
 
@@ -219,7 +219,7 @@ struct it87_sio_data {
 	u8 vid_value;
 	u8 beep_pin;
 	u8 internal;	/* Internal sensors can be labeled */
-	/* Features skipped based on config or DMI */
+	/* Features skipped based on config or SMBIOS */
 	u8 skip_vid;
 	u8 skip_fan;
 	u8 skip_pwm;
@@ -1541,13 +1541,24 @@ static const struct attribute_group it87_group_label = {
 	.attrs = it87_attributes_vid,
 };
 
+static struct sysfw_id __initdata it87_id_table[] = {
+	{
+		 .ident = "nVIDIA FN68PT",
+		.matches = {
+			SYSFW_MATCH(SYSFW_BOARD_VENDOR, "nVIDIA"),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "FN68PT"),
+		},
+		.exactmatch = 1,
+	},
+	{},
+};
+
 /* SuperIO detection - will change isa_address if a chip is found */
 static int __init it87_find(unsigned short *address,
 	struct it87_sio_data *sio_data)
 {
 	int err;
 	u16 chip_type;
-	const char *board_vendor, *board_name;
 
 	err = superio_enter();
 	if (err)
@@ -1671,21 +1682,16 @@ static int __init it87_find(unsigned short *address,
 	if (sio_data->beep_pin)
 		pr_info("Beeping is supported\n");
 
-	/* Disable specific features based on DMI strings */
-	board_vendor = dmi_get_system_info(DMI_BOARD_VENDOR);
-	board_name = dmi_get_system_info(DMI_BOARD_NAME);
-	if (board_vendor && board_name) {
-		if (strcmp(board_vendor, "nVIDIA") == 0
-		 && strcmp(board_name, "FN68PT") == 0) {
-			/* On the Shuttle SN68PT, FAN_CTL2 is apparently not
-			   connected to a fan, but to something else. One user
-			   has reported instant system power-off when changing
-			   the PWM2 duty cycle, so we disable it.
-			   I use the board name string as the trigger in case
-			   the same board is ever used in other systems. */
-			pr_info("Disabling pwm2 due to hardware constraints\n");
-			sio_data->skip_pwm = (1 << 1);
-		}
+	/* Disable specific features based on system firmware strings */
+	if (sysfw_callback(it87_id_table)) {
+		/* On the Shuttle SN68PT, FAN_CTL2 is apparently not
+		   connected to a fan, but to something else. One user
+		   has reported instant system power-off when changing
+		   the PWM2 duty cycle, so we disable it.
+		   I use the board name string as the trigger in case
+		   the same board is ever used in other systems. */
+		pr_info("Disabling pwm2 due to hardware constraints\n");
+		sio_data->skip_pwm = (1 << 1);
 	}
 
 exit:
diff --git a/drivers/hwmon/lm70.c b/drivers/hwmon/lm70.c
index c274ea2..bdb34f8 100644
--- a/drivers/hwmon/lm70.c
+++ b/drivers/hwmon/lm70.c
@@ -34,7 +34,6 @@
 #include <linux/sysfs.h>
 #include <linux/hwmon.h>
 #include <linux/mutex.h>
-#include <linux/mod_devicetable.h>
 #include <linux/spi/spi.h>
 #include <linux/slab.h>
 
-- 
1.6.5.2


^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [PATCH 12/34] drivers/i2c changes for SMBIOS and System Firmware
  2011-07-18 13:08 [PATCH 00/34] System Firmware and SMBIOS Support [v3] Prarit Bhargava
                   ` (10 preceding siblings ...)
  2011-07-18 13:08 ` [PATCH 11/34] drivers/hwmon " Prarit Bhargava
@ 2011-07-18 13:08 ` Prarit Bhargava
  2011-07-18 13:08 ` [PATCH 13/34] drivers/ide " Prarit Bhargava
                   ` (21 subsequent siblings)
  33 siblings, 0 replies; 48+ messages in thread
From: Prarit Bhargava @ 2011-07-18 13:08 UTC (permalink / raw)
  To: linux-kernel; +Cc: Prarit Bhargava, linux-i2c

As part of the new SMBIOS and System Firmware code:

- Replace old dmi* structures and functions with new sysfw* and smbios*
structures and functions in individual drivers
- cleanup sysfw_id lookup tables

Cc: linux-i2c@vger.kernel.org
Signed-off-by: Prarit Bhargava <prarit@redhat.com>
---
 drivers/i2c/busses/i2c-i801.c    |   76 ++++++++++---------------------------
 drivers/i2c/busses/i2c-nforce2.c |   12 +++---
 drivers/i2c/busses/i2c-piix4.c   |   24 ++++++------
 3 files changed, 39 insertions(+), 73 deletions(-)

diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c
index ab26840..7e19ea2 100644
--- a/drivers/i2c/busses/i2c-i801.c
+++ b/drivers/i2c/busses/i2c-i801.c
@@ -73,7 +73,8 @@
 #include <linux/i2c.h>
 #include <linux/acpi.h>
 #include <linux/io.h>
-#include <linux/dmi.h>
+#include <linux/smbios.h>
+#include <linux/sysfw.h>
 #include <linux/slab.h>
 
 /* I801 SMBus address offsets */
@@ -669,69 +670,34 @@ static void __init input_apanel_init(void)
 	iounmap(bios);
 }
 
-struct dmi_onboard_device_info {
+struct smbios_onboard_device_info {
 	const char *name;
-	u8 type;
 	unsigned short i2c_addr;
 	const char *i2c_type;
 };
 
-static struct dmi_onboard_device_info __devinitdata dmi_devices[] = {
-	{ "Syleus", DMI_DEV_TYPE_OTHER, 0x73, "fscsyl" },
-	{ "Hermes", DMI_DEV_TYPE_OTHER, 0x73, "fscher" },
-	{ "Hades",  DMI_DEV_TYPE_OTHER, 0x73, "fschds" },
+static struct smbios_onboard_device_info __devinitdata smbios_devices[] = {
+	{ "Syleus", 0x73, "fscsyl" },
+	{ "SYLEUS", 0x73, "fscsyl" },
+	{ "Hermes", 0x73, "fscher" },
+	{ "HERMES", 0x73, "fscher" },
+	{ "Hades", 0x73, "fschds" },
+	{ "HADES", 0x73, "fschds" },
 };
 
-static void __devinit dmi_check_onboard_device(u8 type, const char *name,
-					       struct i2c_adapter *adap)
+static void __devinit smbios_check_fschmd(struct i2c_adapter *adap)
 {
 	int i;
 	struct i2c_board_info info;
 
-	for (i = 0; i < ARRAY_SIZE(dmi_devices); i++) {
-		/* & ~0x80, ignore enabled/disabled bit */
-		if ((type & ~0x80) != dmi_devices[i].type)
-			continue;
-		if (strcasecmp(name, dmi_devices[i].name))
-			continue;
-
-		memset(&info, 0, sizeof(struct i2c_board_info));
-		info.addr = dmi_devices[i].i2c_addr;
-		strlcpy(info.type, dmi_devices[i].i2c_type, I2C_NAME_SIZE);
-		i2c_new_device(adap, &info);
-		break;
-	}
-}
-
-/* We use our own function to check for onboard devices instead of
-   dmi_find_device() as some buggy BIOS's have the devices we are interested
-   in marked as disabled */
-static void __devinit dmi_check_onboard_devices(const struct dmi_header *dm,
-						void *adap)
-{
-	int i, count;
-
-	if (dm->type != 10)
-		return;
-
-	count = (dm->length - sizeof(struct dmi_header)) / 2;
-	for (i = 0; i < count; i++) {
-		const u8 *d = (char *)(dm + 1) + (i * 2);
-		const char *name = ((char *) dm) + dm->length;
-		u8 type = d[0];
-		u8 s = d[1];
-
-		if (!s)
-			continue;
-		s--;
-		while (s > 0 && name[0]) {
-			name += strlen(name) + 1;
-			s--;
+	for (i = 0; i < ARRAY_SIZE(onboard); i++) {
+		/* some buggy BIOSes have the devices disabled */
+		if (smbios_is_onboard_device(onboard[i].name, 1)) {
+			memset(&info, 0, sizeof(struct i2c_board_info));
+			info.addr = onboard[i].i2c_addr;
+			strlcpy(info.type, onboard[i].i2c_type,	I2C_NAME_SIZE);
+			i2c_new_device(adap, &info);
 		}
-		if (name[0] == 0) /* Bogus string reference */
-			continue;
-
-		dmi_check_onboard_device(type, name, adap);
 	}
 }
 
@@ -751,8 +717,8 @@ static void __devinit i801_probe_optional_slaves(struct i801_priv *priv)
 		i2c_new_device(&priv->adapter, &info);
 	}
 
-	if (dmi_name_in_vendors("FUJITSU"))
-		dmi_walk(dmi_check_onboard_devices, &priv->adapter);
+	if (sysfw_vendor_is("FUJITSU"))
+		smbios_check_fschmd(&priv->adapter);
 }
 #else
 static void __init input_apanel_init(void) {}
@@ -927,7 +893,7 @@ static struct pci_driver i801_driver = {
 
 static int __init i2c_i801_init(void)
 {
-	if (dmi_name_in_vendors("FUJITSU"))
+	if (sysfw_vendor_is("FUJITSU"))
 		input_apanel_init();
 	return pci_register_driver(&i801_driver);
 }
diff --git a/drivers/i2c/busses/i2c-nforce2.c b/drivers/i2c/busses/i2c-nforce2.c
index ff1e127..458623e 100644
--- a/drivers/i2c/busses/i2c-nforce2.c
+++ b/drivers/i2c/busses/i2c-nforce2.c
@@ -54,7 +54,7 @@
 #include <linux/init.h>
 #include <linux/i2c.h>
 #include <linux/delay.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include <linux/acpi.h>
 #include <linux/slab.h>
 #include <linux/io.h>
@@ -117,15 +117,15 @@ struct nforce2_smbus {
 #define MAX_TIMEOUT	100
 
 /* We disable the second SMBus channel on these boards */
-static struct dmi_system_id __devinitdata nforce2_dmi_blacklist2[] = {
+static struct sysfw_id __devinitdata nforce2_id_blacklist2[] = {
 	{
 		.ident = "DFI Lanparty NF4 Expert",
 		.matches = {
-			DMI_MATCH(DMI_BOARD_VENDOR, "DFI Corp,LTD"),
-			DMI_MATCH(DMI_BOARD_NAME, "LP UT NF4 Expert"),
+			SYSFW_MATCH(SYSFW_BOARD_VENDOR, "DFI Corp,LTD"),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "LP UT NF4 Expert"),
 		},
 	},
-	{ }
+	{}
 };
 
 static struct pci_driver nforce2_driver;
@@ -408,7 +408,7 @@ static int __devinit nforce2_probe(struct pci_dev *dev, const struct pci_device_
 		smbuses[0].base = 0;	/* to have a check value */
 
 	/* SMBus adapter 2 */
-	if (dmi_check_system(nforce2_dmi_blacklist2)) {
+	if (sysfw_callback(nforce2_id_blacklist2)) {
 		dev_err(&dev->dev, "Disabling SMB2 for safety reasons.\n");
 		res2 = -EPERM;
 		smbuses[1].base = 0;
diff --git a/drivers/i2c/busses/i2c-piix4.c b/drivers/i2c/busses/i2c-piix4.c
index 6d14ac2..12b4019 100644
--- a/drivers/i2c/busses/i2c-piix4.c
+++ b/drivers/i2c/busses/i2c-piix4.c
@@ -37,7 +37,7 @@
 #include <linux/ioport.h>
 #include <linux/i2c.h>
 #include <linux/init.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include <linux/acpi.h>
 #include <linux/io.h>
 
@@ -99,32 +99,32 @@ static int srvrworks_csb5_delay;
 static struct pci_driver piix4_driver;
 static struct i2c_adapter piix4_adapter;
 
-static struct dmi_system_id __devinitdata piix4_dmi_blacklist[] = {
+static struct sysfw_id __devinitdata piix4_id_blacklist[] = {
 	{
 		.ident = "Sapphire AM2RD790",
 		.matches = {
-			DMI_MATCH(DMI_BOARD_VENDOR, "SAPPHIRE Inc."),
-			DMI_MATCH(DMI_BOARD_NAME, "PC-AM2RD790"),
+			SYSFW_MATCH(SYSFW_BOARD_VENDOR, "SAPPHIRE Inc."),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "PC-AM2RD790"),
 		},
 	},
 	{
 		.ident = "DFI Lanparty UT 790FX",
 		.matches = {
-			DMI_MATCH(DMI_BOARD_VENDOR, "DFI Inc."),
-			DMI_MATCH(DMI_BOARD_NAME, "LP UT 790FX"),
+			SYSFW_MATCH(SYSFW_BOARD_VENDOR, "DFI Inc."),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "LP UT 790FX"),
 		},
 	},
-	{ }
+	{}
 };
 
 /* The IBM entry is in a separate table because we only check it
    on Intel-based systems */
-static struct dmi_system_id __devinitdata piix4_dmi_ibm[] = {
+static struct sysfw_id __devinitdata piix4_id_ibm[] = {
 	{
 		.ident = "IBM",
-		.matches = { DMI_MATCH(DMI_SYS_VENDOR, "IBM"), },
+		.matches = { SYSFW_MATCH(SYSFW_SYS_VENDOR, "IBM"), },
 	},
-	{ },
+	{},
 };
 
 static int __devinit piix4_setup(struct pci_dev *PIIX4_dev,
@@ -138,14 +138,14 @@ static int __devinit piix4_setup(struct pci_dev *PIIX4_dev,
 
 	/* On some motherboards, it was reported that accessing the SMBus
 	   caused severe hardware problems */
-	if (dmi_check_system(piix4_dmi_blacklist)) {
+	if (sysfw_callback(piix4_id_blacklist)) {
 		dev_err(&PIIX4_dev->dev,
 			"Accessing the SMBus on this system is unsafe!\n");
 		return -EPERM;
 	}
 
 	/* Don't access SMBus on IBM systems which get corrupted eeproms */
-	if (dmi_check_system(piix4_dmi_ibm) &&
+	if (sysfw_callback(piix4_id_ibm) &&
 			PIIX4_dev->vendor == PCI_VENDOR_ID_INTEL) {
 		dev_err(&PIIX4_dev->dev, "IBM system detected; this module "
 			"may corrupt your serial eeprom! Refusing to load "
-- 
1.6.5.2


^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [PATCH 13/34] drivers/ide changes for SMBIOS and System Firmware
  2011-07-18 13:08 [PATCH 00/34] System Firmware and SMBIOS Support [v3] Prarit Bhargava
                   ` (11 preceding siblings ...)
  2011-07-18 13:08 ` [PATCH 12/34] drivers/i2c " Prarit Bhargava
@ 2011-07-18 13:08 ` Prarit Bhargava
  2011-07-18 13:08 ` [PATCH 14/34] drivers/input " Prarit Bhargava
                   ` (20 subsequent siblings)
  33 siblings, 0 replies; 48+ messages in thread
From: Prarit Bhargava @ 2011-07-18 13:08 UTC (permalink / raw)
  To: linux-kernel; +Cc: Prarit Bhargava, linux-ide

As part of the new SMBIOS and System Firmware code:

- Replace old dmi* structures and functions with new sysfw* and smbios*
structures and functions in individual drivers
- cleanup sysfw_id lookup tables

Cc: linux-ide@vger.kernel.org
Signed-off-by: Prarit Bhargava <prarit@redhat.com>
---
 drivers/ide/alim15x3.c  |   18 +++++++++---------
 drivers/ide/ide-acpi.c  |   16 ++++++++--------
 drivers/ide/ide-gd.c    |   10 +++++-----
 drivers/ide/via82cxxx.c |   14 +++++++-------
 4 files changed, 29 insertions(+), 29 deletions(-)

diff --git a/drivers/ide/alim15x3.c b/drivers/ide/alim15x3.c
index 2c8016a..d5194e1 100644
--- a/drivers/ide/alim15x3.c
+++ b/drivers/ide/alim15x3.c
@@ -33,7 +33,7 @@
 #include <linux/pci.h>
 #include <linux/ide.h>
 #include <linux/init.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 
 #include <asm/io.h>
 
@@ -333,22 +333,22 @@ out:
  *	Cable special cases
  */
 
-static const struct dmi_system_id cable_dmi_table[] = {
+static const struct sysfw_id cable_smbios_table[] = {
 	{
 		.ident = "HP Pavilion N5430",
 		.matches = {
-			DMI_MATCH(DMI_BOARD_VENDOR, "Hewlett-Packard"),
-			DMI_MATCH(DMI_BOARD_VERSION, "OmniBook N32N-736"),
+			SYSFW_MATCH(SYSFW_BOARD_VENDOR, "Hewlett-Packard"),
+			SYSFW_MATCH(SYSFW_BOARD_VERSION, "OmniBook N32N-736"),
 		},
 	},
 	{
 		.ident = "Toshiba Satellite S1800-814",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "S1800-814"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "TOSHIBA"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "S1800-814"),
 		},
 	},
-	{ }
+	{}
 };
 
 static int ali_cable_override(struct pci_dev *pdev)
@@ -363,8 +363,8 @@ static int ali_cable_override(struct pci_dev *pdev)
 	    pdev->subsystem_device == 0x8317)
 		return 1;
 
-	/* Systems by DMI */
-	if (dmi_check_system(cable_dmi_table))
+	/* Systems by SMBIOS */
+	if (sysfw_callback(cable_smbios_table))
 		return 1;
 
 	return 0;
diff --git a/drivers/ide/ide-acpi.c b/drivers/ide/ide-acpi.c
index 2af8cb4..dfcff27 100644
--- a/drivers/ide/ide-acpi.c
+++ b/drivers/ide/ide-acpi.c
@@ -16,7 +16,7 @@
 #include <acpi/acpi.h>
 #include <linux/ide.h>
 #include <linux/pci.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 
 #include <acpi/acpi_bus.h>
 
@@ -65,31 +65,31 @@ module_param_named(acpionboot, ide_acpionboot, bool, 0);
 MODULE_PARM_DESC(acpionboot, "call IDE ACPI methods on boot");
 
 static bool ide_noacpi_psx;
-static int no_acpi_psx(const struct dmi_system_id *id)
+static int no_acpi_psx(const struct sysfw_id *id)
 {
 	ide_noacpi_psx = true;
 	printk(KERN_NOTICE"%s detected - disable ACPI _PSx.\n", id->ident);
 	return 0;
 }
 
-static const struct dmi_system_id ide_acpi_dmi_table[] = {
+static const struct sysfw_id ide_acpi_smbios_table[] = {
 	/* Bug 9673. */
 	/* We should check if this is because ACPI NVS isn't save/restored. */
 	{
 		.callback = no_acpi_psx,
 		.ident    = "HP nx9005",
 		.matches  = {
-			DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies Ltd."),
-			DMI_MATCH(DMI_BIOS_VERSION, "KAM1.60")
+			SYSFW_MATCH(SYSFW_BIOS_VENDOR,
+				    "Phoenix Technologies Ltd."),
+			SYSFW_MATCH(SYSFW_BIOS_VERSION, "KAM1.60")
 		},
 	},
-
-	{ }	/* terminate list */
+	{}
 };
 
 int ide_acpi_init(void)
 {
-	dmi_check_system(ide_acpi_dmi_table);
+	sysfw_callback(ide_acpi_smbios_table);
 	return 0;
 }
 
diff --git a/drivers/ide/ide-gd.c b/drivers/ide/ide-gd.c
index 70ea876..3801f49 100644
--- a/drivers/ide/ide-gd.c
+++ b/drivers/ide/ide-gd.c
@@ -7,8 +7,8 @@
 #include <linux/mutex.h>
 #include <linux/ide.h>
 #include <linux/hdreg.h>
-#include <linux/dmi.h>
 #include <linux/slab.h>
+#include <linux/sysfw.h>
 
 #if !defined(CONFIG_DEBUG_BLOCK_EXT_DEVT)
 #define IDE_DISK_MINORS		(1 << PARTN_BITS)
@@ -102,13 +102,13 @@ static void ide_gd_resume(ide_drive_t *drive)
 		(void)drive->disk_ops->get_capacity(drive);
 }
 
-static const struct dmi_system_id ide_coldreboot_table[] = {
+static const struct sysfw_id ide_coldreboot_table[] = {
 	{
 		/* Acer TravelMate 66x cuts power during reboot */
 		.ident   = "Acer TravelMate 660",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 660"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Acer"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "TravelMate 660"),
 		},
 	},
 
@@ -132,7 +132,7 @@ static void ide_gd_shutdown(ide_drive_t *drive)
 	if (system_state != SYSTEM_POWER_OFF) {
 #else
 	if (system_state == SYSTEM_RESTART &&
-		!dmi_check_system(ide_coldreboot_table)) {
+	    !sysfw_callback(ide_coldreboot_table)) {
 #endif
 		drive->disk_ops->flush(drive);
 		return;
diff --git a/drivers/ide/via82cxxx.c b/drivers/ide/via82cxxx.c
index f46f49c..a51eb2b 100644
--- a/drivers/ide/via82cxxx.c
+++ b/drivers/ide/via82cxxx.c
@@ -30,7 +30,7 @@
 #include <linux/pci.h>
 #include <linux/init.h>
 #include <linux/ide.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 
 #ifdef CONFIG_PPC_CHRP
 #include <asm/processor.h>
@@ -354,21 +354,21 @@ static int init_chipset_via82cxxx(struct pci_dev *dev)
  *	Cable special cases
  */
 
-static const struct dmi_system_id cable_dmi_table[] = {
+static const struct sysfw_id cable_smbios_table[] = {
 	{
 		.ident = "Acer Ferrari 3400",
 		.matches = {
-			DMI_MATCH(DMI_BOARD_VENDOR, "Acer,Inc."),
-			DMI_MATCH(DMI_BOARD_NAME, "Ferrari 3400"),
+			SYSFW_MATCH(SYSFW_BOARD_VENDOR, "Acer,Inc."),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "Ferrari 3400"),
 		},
 	},
-	{ }
+	{}
 };
 
 static int via_cable_override(struct pci_dev *pdev)
 {
-	/* Systems by DMI */
-	if (dmi_check_system(cable_dmi_table))
+	/* Systems by SMBIOS */
+	if (sysfw_callback(cable_smbios_table))
 		return 1;
 
 	/* Arima W730-K8/Targa Visionary 811/... */
-- 
1.6.5.2


^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [PATCH 14/34] drivers/input changes for SMBIOS and System Firmware
  2011-07-18 13:08 [PATCH 00/34] System Firmware and SMBIOS Support [v3] Prarit Bhargava
                   ` (12 preceding siblings ...)
  2011-07-18 13:08 ` [PATCH 13/34] drivers/ide " Prarit Bhargava
@ 2011-07-18 13:08 ` Prarit Bhargava
  2011-07-18 13:08 ` [PATCH 15/34] drivers/leds " Prarit Bhargava
                   ` (19 subsequent siblings)
  33 siblings, 0 replies; 48+ messages in thread
From: Prarit Bhargava @ 2011-07-18 13:08 UTC (permalink / raw)
  To: linux-kernel; +Cc: Prarit Bhargava, linux-input

As part of the new SMBIOS and System Firmware code:

- Replace old dmi* structures and functions with new sysfw* and smbios*
structures and functions in individual drivers
- cleanup sysfw_id lookup tables
- cleanup of includes for dmi.h and mod_devicetable.h which were included in
some files that did not need them

Cc: linux-input@vger.kernel.org
Signed-off-by: Prarit Bhargava <prarit@redhat.com>
---
 drivers/input/keyboard/atkbd.c        |   80 ++++----
 drivers/input/misc/wistron_btns.c     |  239 +++++++++++-----------
 drivers/input/mouse/lifebook.c        |   42 ++--
 drivers/input/mouse/synaptics.c       |   44 ++--
 drivers/input/serio/i8042-x86ia64io.h |  367 +++++++++++++++++----------------
 drivers/input/tablet/wacom.h          |    1 -
 drivers/input/touchscreen/htcpen.c    |   13 +-
 7 files changed, 405 insertions(+), 381 deletions(-)

diff --git a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c
index 11478eb..b66c8dd 100644
--- a/drivers/input/keyboard/atkbd.c
+++ b/drivers/input/keyboard/atkbd.c
@@ -27,7 +27,7 @@
 #include <linux/workqueue.h>
 #include <linux/libps2.h>
 #include <linux/mutex.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 
 #define DRIVER_DESC	"AT and PS/2 keyboard driver"
 
@@ -1573,7 +1573,7 @@ static ssize_t atkbd_show_err_count(struct atkbd *atkbd, char *buf)
 	return sprintf(buf, "%lu\n", atkbd->err_count);
 }
 
-static int __init atkbd_setup_forced_release(const struct dmi_system_id *id)
+static int __init atkbd_setup_forced_release(const struct sysfw_id *id)
 {
 	atkbd_platform_fixup = atkbd_apply_forced_release_keylist;
 	atkbd_platform_fixup_data = id->driver_data;
@@ -1581,66 +1581,67 @@ static int __init atkbd_setup_forced_release(const struct dmi_system_id *id)
 	return 0;
 }
 
-static int __init atkbd_setup_scancode_fixup(const struct dmi_system_id *id)
+static int __init atkbd_setup_scancode_fixup(const struct sysfw_id *id)
 {
 	atkbd_platform_scancode_fixup = id->driver_data;
 
 	return 0;
 }
 
-static const struct dmi_system_id atkbd_dmi_quirk_table[] __initconst = {
+static const struct sysfw_id atkbd_id_quirk_table[] __initconst = {
 	{
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-			DMI_MATCH(DMI_CHASSIS_TYPE, "8"), /* Portable */
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell Inc."),
+			SYSFW_MATCH(SYSFW_CHASSIS_TYPE, "8"), /* Portable */
 		},
 		.callback = atkbd_setup_forced_release,
 		.driver_data = atkbd_dell_laptop_forced_release_keys,
 	},
 	{
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
-			DMI_MATCH(DMI_CHASSIS_TYPE, "8"), /* Portable */
+			SYSFW_MATCH(SYSFW_SYS_VENDOR,
+				    "Dell Computer Corporation"),
+			SYSFW_MATCH(SYSFW_CHASSIS_TYPE, "8"), /* Portable */
 		},
 		.callback = atkbd_setup_forced_release,
 		.driver_data = atkbd_dell_laptop_forced_release_keys,
 	},
 	{
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "HP 2133"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Hewlett-Packard"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "HP 2133"),
 		},
 		.callback = atkbd_setup_forced_release,
 		.driver_data = atkbd_hp_forced_release_keys,
 	},
 	{
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Pavilion ZV6100"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Hewlett-Packard"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Pavilion ZV6100"),
 		},
 		.callback = atkbd_setup_forced_release,
 		.driver_data = atkbd_volume_forced_release_keys,
 	},
 	{
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Presario R4000"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Hewlett-Packard"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Presario R4000"),
 		},
 		.callback = atkbd_setup_forced_release,
 		.driver_data = atkbd_volume_forced_release_keys,
 	},
 	{
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Presario R4100"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Hewlett-Packard"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Presario R4100"),
 		},
 		.callback = atkbd_setup_forced_release,
 		.driver_data = atkbd_volume_forced_release_keys,
 	},
 	{
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Presario R4200"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Hewlett-Packard"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Presario R4200"),
 		},
 		.callback = atkbd_setup_forced_release,
 		.driver_data = atkbd_volume_forced_release_keys,
@@ -1648,8 +1649,8 @@ static const struct dmi_system_id atkbd_dmi_quirk_table[] __initconst = {
 	{
 		/* Inventec Symphony */
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "INVENTEC"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "SYMPHONY 6.0/7.0"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "INVENTEC"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "SYMPHONY 6.0/7.0"),
 		},
 		.callback = atkbd_setup_forced_release,
 		.driver_data = atkbd_volume_forced_release_keys,
@@ -1657,8 +1658,9 @@ static const struct dmi_system_id atkbd_dmi_quirk_table[] __initconst = {
 	{
 		/* Samsung NC10 */
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "NC10"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR,
+				    "SAMSUNG ELECTRONICS CO., LTD."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "NC10"),
 		},
 		.callback = atkbd_setup_forced_release,
 		.driver_data = atkbd_samsung_forced_release_keys,
@@ -1666,8 +1668,9 @@ static const struct dmi_system_id atkbd_dmi_quirk_table[] __initconst = {
 	{
 		/* Samsung NC20 */
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "NC20"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR,
+				    "SAMSUNG ELECTRONICS CO., LTD."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "NC20"),
 		},
 		.callback = atkbd_setup_forced_release,
 		.driver_data = atkbd_samsung_forced_release_keys,
@@ -1675,8 +1678,9 @@ static const struct dmi_system_id atkbd_dmi_quirk_table[] __initconst = {
 	{
 		/* Samsung SQ45S70S */
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "SQ45S70S"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR,
+				    "SAMSUNG ELECTRONICS CO., LTD."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "SQ45S70S"),
 		},
 		.callback = atkbd_setup_forced_release,
 		.driver_data = atkbd_samsung_forced_release_keys,
@@ -1684,8 +1688,8 @@ static const struct dmi_system_id atkbd_dmi_quirk_table[] __initconst = {
 	{
 		/* Fujitsu Amilo PA 1510 */
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "AMILO Pa 1510"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "FUJITSU SIEMENS"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "AMILO Pa 1510"),
 		},
 		.callback = atkbd_setup_forced_release,
 		.driver_data = atkbd_volume_forced_release_keys,
@@ -1693,8 +1697,8 @@ static const struct dmi_system_id atkbd_dmi_quirk_table[] __initconst = {
 	{
 		/* Fujitsu Amilo Pi 3525 */
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "AMILO Pi 3525"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "FUJITSU SIEMENS"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "AMILO Pi 3525"),
 		},
 		.callback = atkbd_setup_forced_release,
 		.driver_data = atkbd_amilo_pi3525_forced_release_keys,
@@ -1702,16 +1706,16 @@ static const struct dmi_system_id atkbd_dmi_quirk_table[] __initconst = {
 	{
 		/* Fujitsu Amilo Xi 3650 */
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "AMILO Xi 3650"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "FUJITSU SIEMENS"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "AMILO Xi 3650"),
 		},
 		.callback = atkbd_setup_forced_release,
 		.driver_data = atkbd_amilo_xi3650_forced_release_keys,
 	},
 	{
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Soltech Corporation"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "TA12"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Soltech Corporation"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "TA12"),
 		},
 		.callback = atkbd_setup_forced_release,
 		.driver_data = atkdb_soltech_ta12_forced_release_keys,
@@ -1719,18 +1723,18 @@ static const struct dmi_system_id atkbd_dmi_quirk_table[] __initconst = {
 	{
 		/* OQO Model 01+ */
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "OQO"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "ZEPTO"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "OQO"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "ZEPTO"),
 		},
 		.callback = atkbd_setup_scancode_fixup,
 		.driver_data = atkbd_oqo_01plus_scancode_fixup,
 	},
-	{ }
+	{}
 };
 
 static int __init atkbd_init(void)
 {
-	dmi_check_system(atkbd_dmi_quirk_table);
+	sysfw_callback(atkbd_id_quirk_table);
 
 	return serio_register_driver(&atkbd_drv);
 }
diff --git a/drivers/input/misc/wistron_btns.c b/drivers/input/misc/wistron_btns.c
index 52b4193..f4aabda 100644
--- a/drivers/input/misc/wistron_btns.c
+++ b/drivers/input/misc/wistron_btns.c
@@ -18,7 +18,7 @@
  * 59 Temple Place Suite 330, Boston, MA 02111-1307, USA.
  */
 #include <linux/io.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include <linux/init.h>
 #include <linux/input-polldev.h>
 #include <linux/input/sparse-keymap.h>
@@ -238,11 +238,11 @@ static bool have_wifi;
 static bool have_bluetooth;
 static int leds_present;	/* bitmask of leds present */
 
-static int __init dmi_matched(const struct dmi_system_id *dmi)
+static int __init sysfw_matched(const struct sysfw_id *id)
 {
 	const struct key_entry *key;
 
-	keymap = dmi->driver_data;
+	keymap = id->driver_data;
 	for (key = keymap; key->type != KE_END; key++) {
 		if (key->type == KE_WIFI)
 			have_wifi = true;
@@ -635,342 +635,345 @@ static struct key_entry keymap_prestigio[] __initdata = {
  * a list of buttons and their key codes (reported when loading this module
  * with force=1) and the output of dmidecode to $MODULE_AUTHOR.
  */
-static const struct dmi_system_id __initconst dmi_ids[] = {
+static const struct sysfw_id __initconst sysfw_ids[] = {
 	{
 		/* Fujitsu-Siemens Amilo Pro V2000 */
-		.callback = dmi_matched,
+		.callback = sysfw_matched,
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "AMILO Pro V2000"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "FUJITSU SIEMENS"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "AMILO Pro V2000"),
 		},
 		.driver_data = keymap_fs_amilo_pro_v2000
 	},
 	{
 		/* Fujitsu-Siemens Amilo Pro Edition V3505 */
-		.callback = dmi_matched,
+		.callback = sysfw_matched,
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "AMILO Pro Edition V3505"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "FUJITSU SIEMENS"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME,
+				    "AMILO Pro Edition V3505"),
 		},
 		.driver_data = keymap_fs_amilo_pro_v3505
 	},
 	{
 		/* Fujitsu-Siemens Amilo M7400 */
-		.callback = dmi_matched,
+		.callback = sysfw_matched,
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "AMILO M        "),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "FUJITSU SIEMENS"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "AMILO M        "),
 		},
 		.driver_data = keymap_fs_amilo_pro_v2000
 	},
 	{
 		/* Maxdata Pro 7000 DX */
-		.callback = dmi_matched,
+		.callback = sysfw_matched,
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "MAXDATA"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Pro 7000"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "MAXDATA"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Pro 7000"),
 		},
 		.driver_data = keymap_fs_amilo_pro_v2000
 	},
 	{
 		/* Fujitsu N3510 */
-		.callback = dmi_matched,
+		.callback = sysfw_matched,
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "N3510"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "FUJITSU"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "N3510"),
 		},
 		.driver_data = keymap_fujitsu_n3510
 	},
 	{
 		/* Acer Aspire 1500 */
-		.callback = dmi_matched,
+		.callback = sysfw_matched,
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 1500"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Acer"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Aspire 1500"),
 		},
 		.driver_data = keymap_acer_aspire_1500
 	},
 	{
 		/* Acer Aspire 1600 */
-		.callback = dmi_matched,
+		.callback = sysfw_matched,
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 1600"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Acer"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Aspire 1600"),
 		},
 		.driver_data = keymap_acer_aspire_1600
 	},
 	{
 		/* Acer Aspire 3020 */
-		.callback = dmi_matched,
+		.callback = sysfw_matched,
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 3020"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Acer"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Aspire 3020"),
 		},
 		.driver_data = keymap_acer_aspire_5020
 	},
 	{
 		/* Acer Aspire 5020 */
-		.callback = dmi_matched,
+		.callback = sysfw_matched,
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5020"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Acer"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Aspire 5020"),
 		},
 		.driver_data = keymap_acer_aspire_5020
 	},
 	{
 		/* Acer TravelMate 2100 */
-		.callback = dmi_matched,
+		.callback = sysfw_matched,
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 2100"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Acer"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "TravelMate 2100"),
 		},
 		.driver_data = keymap_acer_aspire_5020
 	},
 	{
 		/* Acer TravelMate 2410 */
-		.callback = dmi_matched,
+		.callback = sysfw_matched,
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 2410"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Acer"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "TravelMate 2410"),
 		},
 		.driver_data = keymap_acer_travelmate_2410
 	},
 	{
 		/* Acer TravelMate C300 */
-		.callback = dmi_matched,
+		.callback = sysfw_matched,
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate C300"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Acer"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "TravelMate C300"),
 		},
 		.driver_data = keymap_acer_travelmate_300
 	},
 	{
 		/* Acer TravelMate C100 */
-		.callback = dmi_matched,
+		.callback = sysfw_matched,
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate C100"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Acer"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "TravelMate C100"),
 		},
 		.driver_data = keymap_acer_travelmate_300
 	},
 	{
 		/* Acer TravelMate C110 */
-		.callback = dmi_matched,
+		.callback = sysfw_matched,
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate C110"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Acer"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "TravelMate C110"),
 		},
 		.driver_data = keymap_acer_travelmate_110
 	},
 	{
 		/* Acer TravelMate 380 */
-		.callback = dmi_matched,
+		.callback = sysfw_matched,
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 380"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Acer"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "TravelMate 380"),
 		},
 		.driver_data = keymap_acer_travelmate_380
 	},
 	{
 		/* Acer TravelMate 370 */
-		.callback = dmi_matched,
+		.callback = sysfw_matched,
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 370"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Acer"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "TravelMate 370"),
 		},
-		.driver_data = keymap_acer_travelmate_380 /* keyboard minus 1 key */
+		/* keyboard minus 1 key */
+		.driver_data = keymap_acer_travelmate_380
 	},
 	{
 		/* Acer TravelMate 220 */
-		.callback = dmi_matched,
+		.callback = sysfw_matched,
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 220"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Acer"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "TravelMate 220"),
 		},
 		.driver_data = keymap_acer_travelmate_220
 	},
 	{
 		/* Acer TravelMate 260 */
-		.callback = dmi_matched,
+		.callback = sysfw_matched,
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 260"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Acer"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "TravelMate 260"),
 		},
 		.driver_data = keymap_acer_travelmate_220
 	},
 	{
 		/* Acer TravelMate 230 */
-		.callback = dmi_matched,
+		.callback = sysfw_matched,
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 230"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Acer"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "TravelMate 230"),
 			/* acerhk looks for "TravelMate F4..." ?! */
 		},
 		.driver_data = keymap_acer_travelmate_230
 	},
 	{
 		/* Acer TravelMate 280 */
-		.callback = dmi_matched,
+		.callback = sysfw_matched,
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 280"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Acer"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "TravelMate 280"),
 		},
 		.driver_data = keymap_acer_travelmate_230
 	},
 	{
 		/* Acer TravelMate 240 */
-		.callback = dmi_matched,
+		.callback = sysfw_matched,
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 240"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Acer"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "TravelMate 240"),
 		},
 		.driver_data = keymap_acer_travelmate_240
 	},
 	{
 		/* Acer TravelMate 250 */
-		.callback = dmi_matched,
+		.callback = sysfw_matched,
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 250"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Acer"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "TravelMate 250"),
 		},
 		.driver_data = keymap_acer_travelmate_240
 	},
 	{
 		/* Acer TravelMate 2424NWXCi */
-		.callback = dmi_matched,
+		.callback = sysfw_matched,
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 2420"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Acer"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "TravelMate 2420"),
 		},
 		.driver_data = keymap_acer_travelmate_240
 	},
 	{
 		/* Acer TravelMate 350 */
-		.callback = dmi_matched,
+		.callback = sysfw_matched,
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 350"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Acer"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "TravelMate 350"),
 		},
 		.driver_data = keymap_acer_travelmate_350
 	},
 	{
 		/* Acer TravelMate 360 */
-		.callback = dmi_matched,
+		.callback = sysfw_matched,
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 360"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Acer"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "TravelMate 360"),
 		},
 		.driver_data = keymap_acer_travelmate_360
 	},
 	{
 		/* Acer TravelMate 610 */
-		.callback = dmi_matched,
+		.callback = sysfw_matched,
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "ACER"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 610"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "ACER"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "TravelMate 610"),
 		},
 		.driver_data = keymap_acer_travelmate_610
 	},
 	{
 		/* Acer TravelMate 620 */
-		.callback = dmi_matched,
+		.callback = sysfw_matched,
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 620"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Acer"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "TravelMate 620"),
 		},
 		.driver_data = keymap_acer_travelmate_630
 	},
 	{
 		/* Acer TravelMate 630 */
-		.callback = dmi_matched,
+		.callback = sysfw_matched,
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 630"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Acer"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "TravelMate 630"),
 		},
 		.driver_data = keymap_acer_travelmate_630
 	},
 	{
 		/* AOpen 1559AS */
-		.callback = dmi_matched,
+		.callback = sysfw_matched,
 		.matches = {
-			DMI_MATCH(DMI_PRODUCT_NAME, "E2U"),
-			DMI_MATCH(DMI_BOARD_NAME, "E2U"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "E2U"),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "E2U"),
 		},
 		.driver_data = keymap_aopen_1559as
 	},
 	{
 		/* Medion MD 9783 */
-		.callback = dmi_matched,
+		.callback = sysfw_matched,
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "MEDIONNB"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "MD 9783"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "MEDIONNB"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "MD 9783"),
 		},
 		.driver_data = keymap_wistron_ms2111
 	},
 	{
 		/* Medion MD 40100 */
-		.callback = dmi_matched,
+		.callback = sysfw_matched,
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "MEDIONNB"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "WID2000"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "MEDIONNB"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "WID2000"),
 		},
 		.driver_data = keymap_wistron_md40100
 	},
 	{
 		/* Medion MD 2900 */
-		.callback = dmi_matched,
+		.callback = sysfw_matched,
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "MEDIONNB"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "WIM 2000"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "MEDIONNB"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "WIM 2000"),
 		},
 		.driver_data = keymap_wistron_md2900
 	},
 	{
 		/* Medion MD 42200 */
-		.callback = dmi_matched,
+		.callback = sysfw_matched,
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Medion"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "WIM 2030"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Medion"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "WIM 2030"),
 		},
 		.driver_data = keymap_fs_amilo_pro_v2000
 	},
 	{
 		/* Medion MD 96500 */
-		.callback = dmi_matched,
+		.callback = sysfw_matched,
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "MEDIONPC"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "WIM 2040"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "MEDIONPC"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "WIM 2040"),
 		},
 		.driver_data = keymap_wistron_md96500
 	},
 	{
 		/* Medion MD 95400 */
-		.callback = dmi_matched,
+		.callback = sysfw_matched,
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "MEDIONPC"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "WIM 2050"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "MEDIONPC"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "WIM 2050"),
 		},
 		.driver_data = keymap_wistron_md96500
 	},
 	{
 		/* Fujitsu Siemens Amilo D7820 */
-		.callback = dmi_matched,
+		.callback = sysfw_matched,
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"), /* not sure */
-			DMI_MATCH(DMI_PRODUCT_NAME, "Amilo D"),
+			/* not sure */
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "FUJITSU SIEMENS"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Amilo D"),
 		},
 		.driver_data = keymap_fs_amilo_d88x0
 	},
 	{
 		/* Fujitsu Siemens Amilo D88x0 */
-		.callback = dmi_matched,
+		.callback = sysfw_matched,
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "AMILO D"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "FUJITSU SIEMENS"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "AMILO D"),
 		},
 		.driver_data = keymap_fs_amilo_d88x0
 	},
-	{ NULL, }
+	{}
 };
 
 /* Copy the good keymap, as the original ones are free'd */
@@ -995,7 +998,7 @@ static int __init copy_keymap(void)
 
 static int __init select_keymap(void)
 {
-	dmi_check_system(dmi_ids);
+	sysfw_callback(sysfw_ids);
 	if (keymap_name != NULL) {
 		if (strcmp (keymap_name, "1557/MS2141") == 0)
 			keymap = keymap_wistron_ms2141;
diff --git a/drivers/input/mouse/lifebook.c b/drivers/input/mouse/lifebook.c
index c31ad11..37af398 100644
--- a/drivers/input/mouse/lifebook.c
+++ b/drivers/input/mouse/lifebook.c
@@ -15,8 +15,8 @@
 #include <linux/input.h>
 #include <linux/serio.h>
 #include <linux/libps2.h>
-#include <linux/dmi.h>
 #include <linux/slab.h>
+#include <linux/sysfw.h>
 
 #include "psmouse.h"
 #include "lifebook.h"
@@ -30,7 +30,7 @@ static bool lifebook_present;
 
 static const char *desired_serio_phys;
 
-static int lifebook_limit_serio3(const struct dmi_system_id *d)
+static int lifebook_limit_serio3(const struct sysfw_id *d)
 {
 	desired_serio_phys = "isa0060/serio3";
 	return 0;
@@ -38,97 +38,99 @@ static int lifebook_limit_serio3(const struct dmi_system_id *d)
 
 static bool lifebook_use_6byte_proto;
 
-static int lifebook_set_6byte_proto(const struct dmi_system_id *d)
+static int lifebook_set_6byte_proto(const struct sysfw_id *d)
 {
 	lifebook_use_6byte_proto = true;
 	return 0;
 }
 
-static const struct dmi_system_id __initconst lifebook_dmi_table[] = {
+static const struct sysfw_id __initconst lifebook_smbios_table[] = {
 	{
 		/* FLORA-ie 55mi */
 		.matches = {
-			DMI_MATCH(DMI_PRODUCT_NAME, "FLORA-ie 55mi"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "FLORA-ie 55mi"),
 		},
 	},
 	{
 		/* LifeBook B */
 		.matches = {
-			DMI_MATCH(DMI_PRODUCT_NAME, "Lifebook B Series"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Lifebook B Series"),
 		},
 	},
 	{
 		/* LifeBook B */
 		.matches = {
-			DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook B Series"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "LifeBook B Series"),
 		},
 	},
 	{
 		/* Lifebook B */
 		.matches = {
-			DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK B Series"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "LIFEBOOK B Series"),
 		},
 	},
 	{
 		/* Lifebook B-2130 */
 		.matches = {
-			DMI_MATCH(DMI_BOARD_NAME, "ZEPHYR"),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "ZEPHYR"),
 		},
 	},
 	{
 		/* Lifebook B213x/B2150 */
 		.matches = {
-			DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook B2131/B2133/B2150"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME,
+				    "LifeBook B2131/B2133/B2150"),
 		},
 	},
 	{
 		/* Zephyr */
 		.matches = {
-			DMI_MATCH(DMI_PRODUCT_NAME, "ZEPHYR"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "ZEPHYR"),
 		},
 	},
 	{
 		/* Panasonic CF-18 */
 		.matches = {
-			DMI_MATCH(DMI_PRODUCT_NAME, "CF-18"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "CF-18"),
 		},
 		.callback = lifebook_limit_serio3,
 	},
 	{
 		/* Panasonic CF-28 */
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Matsushita"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "CF-28"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Matsushita"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "CF-28"),
 		},
 		.callback = lifebook_set_6byte_proto,
 	},
 	{
 		/* Panasonic CF-29 */
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Matsushita"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "CF-29"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Matsushita"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "CF-29"),
 		},
 		.callback = lifebook_set_6byte_proto,
 	},
 	{
 		/* Panasonic CF-72 */
 		.matches = {
-			DMI_MATCH(DMI_PRODUCT_NAME, "CF-72"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "CF-72"),
 		},
 		.callback = lifebook_set_6byte_proto,
 	},
 	{
 		/* Lifebook B142 */
 		.matches = {
-			DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook B142"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "LifeBook B142"),
 		},
 	},
-	{ }
+	{}
 };
 
 void __init lifebook_module_init(void)
 {
-	lifebook_present = dmi_check_system(lifebook_dmi_table);
+	if (sysfw_callback(lifebook_smbios_table))
+		lifebook_present = 1;
 }
 
 static psmouse_ret_t lifebook_process_byte(struct psmouse *psmouse)
diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
index e06e045..ac7fc41 100644
--- a/drivers/input/mouse/synaptics.c
+++ b/drivers/input/mouse/synaptics.c
@@ -24,7 +24,7 @@
  */
 
 #include <linux/module.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include <linux/input/mt.h>
 #include <linux/serio.h>
 #include <linux/libps2.h>
@@ -803,62 +803,64 @@ static int synaptics_reconnect(struct psmouse *psmouse)
 
 static bool impaired_toshiba_kbc;
 
-static const struct dmi_system_id __initconst toshiba_dmi_table[] = {
-#if defined(CONFIG_DMI) && defined(CONFIG_X86)
+static const struct sysfw_id __initconst toshiba_smbios_table[] = {
+#ifdef CONFIG_X86
 	{
 		/* 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"),
 		},
 	},
 	{
 		/* Toshiba Dynabook */
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "dynabook"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "TOSHIBA"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "dynabook"),
 		},
 	},
 	{
 		/* Toshiba Portege M300 */
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "PORTEGE M300"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "TOSHIBA"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "PORTEGE M300"),
 		},
 
 	},
 	{
 		/* Toshiba Portege M300 */
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Portable PC"),
-			DMI_MATCH(DMI_PRODUCT_VERSION, "Version 1.0"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "TOSHIBA"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Portable PC"),
+			SYSFW_MATCH(SYSFW_PRODUCT_VERSION, "Version 1.0"),
 		},
 
 	},
 #endif
-	{ }
+	{}
 };
 
 static bool broken_olpc_ec;
 
-static const struct dmi_system_id __initconst olpc_dmi_table[] = {
-#if defined(CONFIG_DMI) && defined(CONFIG_OLPC)
+static const struct sysfw_id __initconst olpc_smbios_table[] = {
+#ifdef CONFIG_OLPC
 	{
 		/* OLPC XO-1 or XO-1.5 */
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "OLPC"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "XO"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "OLPC"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "XO"),
 		},
 	},
 #endif
-	{ }
+	{}
 };
 
 void __init synaptics_module_init(void)
 {
-	impaired_toshiba_kbc = dmi_check_system(toshiba_dmi_table);
-	broken_olpc_ec = dmi_check_system(olpc_dmi_table);
+	if (sysfw_callback(toshiba_smbios_table))
+		impaired_toshiba_kbc = 1;
+	if (sysfw_callback(olpc_smbios_table))
+		broken_olpc_ec = 1;
 }
 
 int synaptics_init(struct psmouse *psmouse)
@@ -938,7 +940,7 @@ int synaptics_init(struct psmouse *psmouse)
 	 */
 	if (psmouse->rate >= 80 && impaired_toshiba_kbc) {
 		printk(KERN_INFO "synaptics: Toshiba %s detected, limiting rate to 40pps.\n",
-			dmi_get_system_info(DMI_PRODUCT_NAME));
+			sysfw_lookup(SYSFW_PRODUCT_NAME));
 		psmouse->rate = 40;
 	}
 
diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h
index bb9f5d3..8a8e2d2 100644
--- a/drivers/input/serio/i8042-x86ia64io.h
+++ b/drivers/input/serio/i8042-x86ia64io.h
@@ -69,121 +69,125 @@ static inline void i8042_write_command(int val)
 
 #ifdef CONFIG_X86
 
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 
-static const struct dmi_system_id __initconst i8042_dmi_noloop_table[] = {
+static const struct sysfw_id __initconst i8042_id_noloop_table[] = {
 	{
 		/*
 		 * Arima-Rioworks HDAMB -
 		 * AUX LOOP command does not raise AUX IRQ
 		 */
 		.matches = {
-			DMI_MATCH(DMI_BOARD_VENDOR, "RIOWORKS"),
-			DMI_MATCH(DMI_BOARD_NAME, "HDAMB"),
-			DMI_MATCH(DMI_BOARD_VERSION, "Rev E"),
+			SYSFW_MATCH(SYSFW_BOARD_VENDOR, "RIOWORKS"),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "HDAMB"),
+			SYSFW_MATCH(SYSFW_BOARD_VERSION, "Rev E"),
 		},
 	},
 	{
 		/* ASUS G1S */
 		.matches = {
-			DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer Inc."),
-			DMI_MATCH(DMI_BOARD_NAME, "G1S"),
-			DMI_MATCH(DMI_BOARD_VERSION, "1.0"),
+			SYSFW_MATCH(SYSFW_BOARD_VENDOR,
+				    "ASUSTeK Computer Inc."),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "G1S"),
+			SYSFW_MATCH(SYSFW_BOARD_VERSION, "1.0"),
 		},
 	},
 	{
 		/* ASUS P65UP5 - AUX LOOP command does not raise AUX IRQ */
 		.matches = {
-			DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."),
-			DMI_MATCH(DMI_BOARD_NAME, "P/I-P65UP5"),
-			DMI_MATCH(DMI_BOARD_VERSION, "REV 2.X"),
+			SYSFW_MATCH(SYSFW_BOARD_VENDOR,
+				    "ASUSTeK Computer INC."),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "P/I-P65UP5"),
+			SYSFW_MATCH(SYSFW_BOARD_VERSION, "REV 2.X"),
 		},
 	},
 	{
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Compaq"),
-			DMI_MATCH(DMI_PRODUCT_NAME , "ProLiant"),
-			DMI_MATCH(DMI_PRODUCT_VERSION, "8500"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Compaq"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME , "ProLiant"),
+			SYSFW_MATCH(SYSFW_PRODUCT_VERSION, "8500"),
 		},
 	},
 	{
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Compaq"),
-			DMI_MATCH(DMI_PRODUCT_NAME , "ProLiant"),
-			DMI_MATCH(DMI_PRODUCT_VERSION, "DL760"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Compaq"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME , "ProLiant"),
+			SYSFW_MATCH(SYSFW_PRODUCT_VERSION, "DL760"),
 		},
 	},
 	{
 		/* OQO Model 01 */
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "OQO"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "ZEPTO"),
-			DMI_MATCH(DMI_PRODUCT_VERSION, "00"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "OQO"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "ZEPTO"),
+			SYSFW_MATCH(SYSFW_PRODUCT_VERSION, "00"),
 		},
 	},
 	{
 		/* ULI EV4873 - AUX LOOP does not work properly */
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "ULI"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "EV4873"),
-			DMI_MATCH(DMI_PRODUCT_VERSION, "5a"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "ULI"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "EV4873"),
+			SYSFW_MATCH(SYSFW_PRODUCT_VERSION, "5a"),
 		},
 	},
 	{
 		/* Microsoft Virtual Machine */
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Virtual Machine"),
-			DMI_MATCH(DMI_PRODUCT_VERSION, "VS2005R2"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR,
+				    "Microsoft Corporation"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Virtual Machine"),
+			SYSFW_MATCH(SYSFW_PRODUCT_VERSION, "VS2005R2"),
 		},
 	},
 	{
 		/* Medion MAM 2070 */
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Notebook"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "MAM 2070"),
-			DMI_MATCH(DMI_PRODUCT_VERSION, "5a"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Notebook"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "MAM 2070"),
+			SYSFW_MATCH(SYSFW_PRODUCT_VERSION, "5a"),
 		},
 	},
 	{
 		/* Blue FB5601 */
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "blue"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "FB5601"),
-			DMI_MATCH(DMI_PRODUCT_VERSION, "M606"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "blue"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "FB5601"),
+			SYSFW_MATCH(SYSFW_PRODUCT_VERSION, "M606"),
 		},
 	},
 	{
 		/* Gigabyte M912 */
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "M912"),
-			DMI_MATCH(DMI_PRODUCT_VERSION, "01"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "GIGABYTE"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "M912"),
+			SYSFW_MATCH(SYSFW_PRODUCT_VERSION, "01"),
 		},
 	},
 	{
 		/* Gigabyte M1022M netbook */
 		.matches = {
-			DMI_MATCH(DMI_BOARD_VENDOR, "Gigabyte Technology Co.,Ltd."),
-			DMI_MATCH(DMI_BOARD_NAME, "M1022E"),
-			DMI_MATCH(DMI_BOARD_VERSION, "1.02"),
+			SYSFW_MATCH(SYSFW_BOARD_VENDOR,
+				    "Gigabyte Technology Co.,Ltd."),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "M1022E"),
+			SYSFW_MATCH(SYSFW_BOARD_VERSION, "1.02"),
 		},
 	},
 	{
 		/* Gigabyte Spring Peak - defines wrong chassis type */
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Spring Peak"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "GIGABYTE"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Spring Peak"),
 		},
 	},
 	{
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv9700"),
-			DMI_MATCH(DMI_PRODUCT_VERSION, "Rev 1"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Hewlett-Packard"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "HP Pavilion dv9700"),
+			SYSFW_MATCH(SYSFW_PRODUCT_VERSION, "Rev 1"),
 		},
 	},
-	{ }
+	{}
 };
 
 /*
@@ -193,75 +197,75 @@ static const struct dmi_system_id __initconst i8042_dmi_noloop_table[] = {
  * ... apparently some Toshibas don't like MUX mode either and
  * die horrible death on reboot.
  */
-static const struct dmi_system_id __initconst i8042_dmi_nomux_table[] = {
+static const struct sysfw_id __initconst i8042_id_nomux_table[] = {
 	{
 		/* Fujitsu Lifebook P7010/P7010D */
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "P7010"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "FUJITSU"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "P7010"),
 		},
 	},
 	{
 		/* Fujitsu Lifebook P7010 */
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "0000000000"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "FUJITSU SIEMENS"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "0000000000"),
 		},
 	},
 	{
 		/* Fujitsu Lifebook P5020D */
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook P Series"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "FUJITSU"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "LifeBook P Series"),
 		},
 	},
 	{
 		/* Fujitsu Lifebook S2000 */
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook S Series"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "FUJITSU"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "LifeBook S Series"),
 		},
 	},
 	{
 		/* Fujitsu Lifebook S6230 */
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook S6230"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "FUJITSU"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "LifeBook S6230"),
 		},
 	},
 	{
 		/* Fujitsu T70H */
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "FMVLT70H"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "FUJITSU"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "FMVLT70H"),
 		},
 	},
 	{
 		/* Fujitsu-Siemens Lifebook T3010 */
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK T3010"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "FUJITSU SIEMENS"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "LIFEBOOK T3010"),
 		},
 	},
 	{
 		/* Fujitsu-Siemens Lifebook E4010 */
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK E4010"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "FUJITSU SIEMENS"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "LIFEBOOK E4010"),
 		},
 	},
 	{
 		/* Fujitsu-Siemens Amilo Pro 2010 */
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "AMILO Pro V2010"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "FUJITSU SIEMENS"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "AMILO Pro V2010"),
 		},
 	},
 	{
 		/* Fujitsu-Siemens Amilo Pro 2030 */
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "AMILO PRO V2030"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "FUJITSU SIEMENS"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "AMILO PRO V2030"),
 		},
 	},
 	{
@@ -271,8 +275,8 @@ static const struct dmi_system_id __initconst i8042_dmi_nomux_table[] = {
 		 */
 		/* Panasonic CF-29 */
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Matsushita"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "CF-29"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Matsushita"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "CF-29"),
 		},
 	},
 	{
@@ -282,8 +286,9 @@ static const struct dmi_system_id __initconst i8042_dmi_nomux_table[] = {
 		 * causing "spurious NAK" messages.
 		 */
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Pavilion dv4000 (EA032EA#ABF)"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Hewlett-Packard"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME,
+				    "Pavilion dv4000 (EA032EA#ABF)"),
 		},
 	},
 	{
@@ -292,9 +297,11 @@ static const struct dmi_system_id __initconst i8042_dmi_nomux_table[] = {
 		 * like DV4017EA does not raise AUXERR for errors on MUX ports.
 		 */
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion Notebook PC"),
-			DMI_MATCH(DMI_PRODUCT_VERSION, "HP Pavilion Notebook ZT1000"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Hewlett-Packard"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME,
+				    "HP Pavilion Notebook PC"),
+			SYSFW_MATCH(SYSFW_PRODUCT_VERSION,
+				    "HP Pavilion Notebook ZT1000"),
 		},
 	},
 	{
@@ -303,40 +310,41 @@ static const struct dmi_system_id __initconst i8042_dmi_nomux_table[] = {
 		 * like DV4017EA does not raise AUXERR for errors on MUX ports.
 		 */
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Pavilion dv4000 (EH476UA#ABL)"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Hewlett-Packard"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME,
+				    "Pavilion dv4000 (EH476UA#ABL)"),
 		},
 	},
 	{
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Satellite P10"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "TOSHIBA"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Satellite P10"),
 		},
 	},
 	{
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "EQUIUM A110"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "TOSHIBA"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "EQUIUM A110"),
 		},
 	},
 	{
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "ALIENWARE"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Sentia"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "ALIENWARE"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Sentia"),
 		},
 	},
 	{
 		/* Sharp Actius MM20 */
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "SHARP"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "PC-MM20 Series"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "SHARP"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "PC-MM20 Series"),
 		},
 	},
 	{
 		/* Sony Vaio FS-115b */
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "VGN-FS115B"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Sony Corporation"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "VGN-FS115B"),
 		},
 	},
 	{
@@ -346,8 +354,8 @@ static const struct dmi_system_id __initconst i8042_dmi_nomux_table[] = {
 		 * sometimes being delivered to AUX3.
 		 */
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "VGN-FZ240E"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Sony Corporation"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "VGN-FZ240E"),
 		},
 	},
 	{
@@ -357,210 +365,215 @@ static const struct dmi_system_id __initconst i8042_dmi_nomux_table[] = {
 		 * MUX discovery usually messes up keyboard/touchpad.
 		 */
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
-			DMI_MATCH(DMI_BOARD_NAME, "VAIO"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Sony Corporation"),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "VAIO"),
 		},
 	},
 	{
 		/* Amoi M636/A737 */
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Amoi Electronics CO.,LTD."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "M636/A737 platform"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR,
+				     "Amoi Electronics CO.,LTD."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "M636/A737 platform"),
 		},
 	},
 	{
 		/* Lenovo 3000 n100 */
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "076804U"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "LENOVO"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "076804U"),
 		},
 	},
 	{
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 1360"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Acer"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Aspire 1360"),
 		},
 	},
 	{
 		/* Gericom Bellagio */
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Gericom"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "N34AS6"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Gericom"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "N34AS6"),
 		},
 	},
 	{
 		/* IBM 2656 */
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "IBM"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "2656"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "IBM"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "2656"),
 		},
 	},
 	{
 		/* Dell XPS M1530 */
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "XPS M1530"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell Inc."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "XPS M1530"),
 		},
 	},
 	{
 		/* Compal HEL80I */
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "COMPAL"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "HEL80I"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "COMPAL"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "HEL80I"),
 		},
 	},
 	{
 		/* Dell Vostro 1510 */
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Vostro1510"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell Inc."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Vostro1510"),
 		},
 	},
 	{
 		/* Acer Aspire 5536 */
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5536"),
-			DMI_MATCH(DMI_PRODUCT_VERSION, "0100"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Acer"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Aspire 5536"),
+			SYSFW_MATCH(SYSFW_PRODUCT_VERSION, "0100"),
 		},
 	},
 	{
 		/* Dell Vostro V13 */
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Vostro V13"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell Inc."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Vostro V13"),
 		},
 	},
-	{ }
+	{}
 };
 
-static const struct dmi_system_id __initconst i8042_dmi_reset_table[] = {
+static const struct sysfw_id __initconst i8042_id_reset_table[] = {
 	{
 		/* MSI Wind U-100 */
 		.matches = {
-			DMI_MATCH(DMI_BOARD_NAME, "U-100"),
-			DMI_MATCH(DMI_BOARD_VENDOR, "MICRO-STAR INTERNATIONAL CO., LTD"),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "U-100"),
+			SYSFW_MATCH(SYSFW_BOARD_VENDOR,
+				    "MICRO-STAR INTERNATIONAL CO., LTD"),
 		},
 	},
 	{
 		/* LG Electronics X110 */
 		.matches = {
-			DMI_MATCH(DMI_BOARD_NAME, "X110"),
-			DMI_MATCH(DMI_BOARD_VENDOR, "LG Electronics Inc."),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "X110"),
+			SYSFW_MATCH(SYSFW_BOARD_VENDOR,
+				     "LG Electronics Inc."),
 		},
 	},
 	{
 		/* Acer Aspire One 150 */
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "AOA150"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Acer"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "AOA150"),
 		},
 	},
 	{
 		/* Advent 4211 */
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "DIXONSXP"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Advent 4211"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "DIXONSXP"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Advent 4211"),
 		},
 	},
 	{
 		/* Medion Akoya Mini E1210 */
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "MEDION"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "E1210"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "MEDION"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "E1210"),
 		},
 	},
 	{
 		/* Medion Akoya E1222 */
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "MEDION"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "E122X"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "MEDION"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "E122X"),
 		},
 	},
 	{
 		/* Mivvy M310 */
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "VIOOO"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "N10"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "VIOOO"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "N10"),
 		},
 	},
 	{
 		/* Dell Vostro 1320 */
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Vostro 1320"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell Inc."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Vostro 1320"),
 		},
 	},
 	{
 		/* Dell Vostro 1520 */
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Vostro 1520"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell Inc."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Vostro 1520"),
 		},
 	},
 	{
 		/* Dell Vostro 1720 */
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Vostro 1720"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell Inc."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Vostro 1720"),
 		},
 	},
-	{ }
+	{}
 };
 
 #ifdef CONFIG_PNP
-static const struct dmi_system_id __initconst i8042_dmi_nopnp_table[] = {
+static const struct sysfw_id __initconst i8042_id_nopnp_table[] = {
 	{
 		/* Intel MBO Desktop D845PESV */
 		.matches = {
-			DMI_MATCH(DMI_BOARD_NAME, "D845PESV"),
-			DMI_MATCH(DMI_BOARD_VENDOR, "Intel Corporation"),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "D845PESV"),
+			SYSFW_MATCH(SYSFW_BOARD_VENDOR, "Intel Corporation"),
 		},
 	},
 	{
 		/* MSI Wind U-100 */
 		.matches = {
-			DMI_MATCH(DMI_BOARD_NAME, "U-100"),
-			DMI_MATCH(DMI_BOARD_VENDOR, "MICRO-STAR INTERNATIONAL CO., LTD"),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "U-100"),
+			SYSFW_MATCH(SYSFW_BOARD_VENDOR,
+				     "MICRO-STAR INTERNATIONAL CO., LTD"),
 		},
 	},
-	{ }
+	{}
 };
 
-static const struct dmi_system_id __initconst i8042_dmi_laptop_table[] = {
+static const struct sysfw_id __initconst i8042_id_laptop_table[] = {
 	{
 		.matches = {
-			DMI_MATCH(DMI_CHASSIS_TYPE, "8"), /* Portable */
+			SYSFW_MATCH(SYSFW_CHASSIS_TYPE, "8"), /* Portable */
 		},
 	},
 	{
 		.matches = {
-			DMI_MATCH(DMI_CHASSIS_TYPE, "9"), /* Laptop */
+			SYSFW_MATCH(SYSFW_CHASSIS_TYPE, "9"), /* Laptop */
 		},
 	},
 	{
 		.matches = {
-			DMI_MATCH(DMI_CHASSIS_TYPE, "10"), /* Notebook */
+			SYSFW_MATCH(SYSFW_CHASSIS_TYPE, "10"), /* Notebook */
 		},
 	},
 	{
 		.matches = {
-			DMI_MATCH(DMI_CHASSIS_TYPE, "14"), /* Sub-Notebook */
+			/* Sub-Notebook */
+			SYSFW_MATCH(SYSFW_CHASSIS_TYPE, "14"),
 		},
 	},
-	{ }
+	{}
 };
 #endif
 
-static const struct dmi_system_id __initconst i8042_dmi_notimeout_table[] = {
+static const struct sysfw_id __initconst i8042_id_notimeout_table[] = {
 	{
 		/* Dell Vostro V13 */
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Vostro V13"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell Inc."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Vostro V13"),
 		},
 	},
-	{ }
+	{}
 };
 
 /*
@@ -569,78 +582,78 @@ static const struct dmi_system_id __initconst i8042_dmi_notimeout_table[] = {
  * Originally, this was just confined to older laptops, but a few Acer laptops
  * have turned up in 2007 that also need this again.
  */
-static const struct dmi_system_id __initconst i8042_dmi_dritek_table[] = {
+static const struct sysfw_id __initconst i8042_id_dritek_table[] = {
 	{
 		/* Acer Aspire 5100 */
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5100"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Acer"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Aspire 5100"),
 		},
 	},
 	{
 		/* Acer Aspire 5610 */
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5610"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Acer"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Aspire 5610"),
 		},
 	},
 	{
 		/* Acer Aspire 5630 */
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5630"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Acer"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Aspire 5630"),
 		},
 	},
 	{
 		/* Acer Aspire 5650 */
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5650"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Acer"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Aspire 5650"),
 		},
 	},
 	{
 		/* Acer Aspire 5680 */
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5680"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Acer"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Aspire 5680"),
 		},
 	},
 	{
 		/* Acer Aspire 5720 */
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5720"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Acer"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Aspire 5720"),
 		},
 	},
 	{
 		/* Acer Aspire 9110 */
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 9110"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Acer"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Aspire 9110"),
 		},
 	},
 	{
 		/* Acer TravelMate 660 */
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 660"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Acer"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "TravelMate 660"),
 		},
 	},
 	{
 		/* Acer TravelMate 2490 */
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 2490"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Acer"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "TravelMate 2490"),
 		},
 	},
 	{
 		/* Acer TravelMate 4280 */
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 4280"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Acer"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "TravelMate 4280"),
 		},
 	},
-	{ }
+	{}
 };
 
 #endif /* CONFIG_X86 */
@@ -772,7 +785,7 @@ static int __init i8042_pnp_init(void)
 	int err;
 
 #ifdef CONFIG_X86
-	if (dmi_check_system(i8042_dmi_nopnp_table))
+	if (sysfw_callback(i8042_id_nopnp_table))
 		i8042_nopnp = true;
 #endif
 
@@ -864,7 +877,7 @@ static int __init i8042_pnp_init(void)
 
 #ifdef CONFIG_X86
 	i8042_bypass_aux_irq_test = !pnp_data_busted &&
-				    dmi_check_system(i8042_dmi_laptop_table);
+				    sysfw_callback(i8042_id_laptop_table);
 #endif
 
 	return 0;
@@ -905,19 +918,19 @@ static int __init i8042_platform_init(void)
 #endif
 
 #ifdef CONFIG_X86
-	if (dmi_check_system(i8042_dmi_reset_table))
+	if (sysfw_callback(i8042_id_reset_table))
 		i8042_reset = true;
 
-	if (dmi_check_system(i8042_dmi_noloop_table))
+	if (sysfw_callback(i8042_id_noloop_table))
 		i8042_noloop = true;
 
-	if (dmi_check_system(i8042_dmi_nomux_table))
+	if (sysfw_callback(i8042_id_nomux_table))
 		i8042_nomux = true;
 
-	if (dmi_check_system(i8042_dmi_notimeout_table))
+	if (sysfw_callback(i8042_id_notimeout_table))
 		i8042_notimeout = true;
 
-	if (dmi_check_system(i8042_dmi_dritek_table))
+	if (sysfw_callback(i8042_id_dritek_table))
 		i8042_dritek = true;
 #endif /* CONFIG_X86 */
 
diff --git a/drivers/input/tablet/wacom.h b/drivers/input/tablet/wacom.h
index 23317bd..1b43e02 100644
--- a/drivers/input/tablet/wacom.h
+++ b/drivers/input/tablet/wacom.h
@@ -85,7 +85,6 @@
 #include <linux/kernel.h>
 #include <linux/slab.h>
 #include <linux/module.h>
-#include <linux/mod_devicetable.h>
 #include <linux/init.h>
 #include <linux/usb/input.h>
 #include <asm/unaligned.h>
diff --git a/drivers/input/touchscreen/htcpen.c b/drivers/input/touchscreen/htcpen.c
index 62811de..8375462 100644
--- a/drivers/input/touchscreen/htcpen.c
+++ b/drivers/input/touchscreen/htcpen.c
@@ -18,7 +18,7 @@
 #include <linux/irq.h>
 #include <linux/isa.h>
 #include <linux/ioport.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 
 MODULE_AUTHOR("Pau Oliva Fora <pau@eslack.org>");
 MODULE_DESCRIPTION("HTC Shift touchscreen driver");
@@ -227,20 +227,21 @@ static struct isa_driver htcpen_isa_driver = {
 	}
 };
 
-static struct dmi_system_id __initdata htcshift_dmi_table[] = {
+static struct sysfw_id __initdata htcshift_smbios_table[] = {
 	{
 		.ident = "Shift",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "High Tech Computer Corp"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Shift"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR,
+				    "High Tech Computer Corp"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Shift"),
 		},
 	},
-	{ }
+	{}
 };
 
 static int __init htcpen_isa_init(void)
 {
-	if (!dmi_check_system(htcshift_dmi_table))
+	if (!sysfw_callback(htcshift_smbios_table))
 		return -ENODEV;
 
 	return isa_register_driver(&htcpen_isa_driver, 1);
-- 
1.6.5.2


^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [PATCH 15/34] drivers/leds changes for SMBIOS and System Firmware
  2011-07-18 13:08 [PATCH 00/34] System Firmware and SMBIOS Support [v3] Prarit Bhargava
                   ` (13 preceding siblings ...)
  2011-07-18 13:08 ` [PATCH 14/34] drivers/input " Prarit Bhargava
@ 2011-07-18 13:08 ` Prarit Bhargava
  2011-07-18 13:08 ` [PATCH 16/34] drivers/media " Prarit Bhargava
                   ` (18 subsequent siblings)
  33 siblings, 0 replies; 48+ messages in thread
From: Prarit Bhargava @ 2011-07-18 13:08 UTC (permalink / raw)
  To: linux-kernel; +Cc: Prarit Bhargava, rpurdie

As part of the new SMBIOS and System Firmware code:

- Replace old dmi* structures and functions with new sysfw* and smbios*
structures and functions in individual drivers
- cleanup sysfw_id lookup tables

Cc: rpurdie@rpsys.net
Signed-off-by: Prarit Bhargava <prarit@redhat.com>
---
 drivers/leds/leds-clevo-mail.c |   78 ++++++++++++++++++----------------------
 drivers/leds/leds-ss4200.c     |   23 +++++-------
 2 files changed, 44 insertions(+), 57 deletions(-)

diff --git a/drivers/leds/leds-clevo-mail.c b/drivers/leds/leds-clevo-mail.c
index a498135..63047de 100644
--- a/drivers/leds/leds-clevo-mail.c
+++ b/drivers/leds/leds-clevo-mail.c
@@ -1,14 +1,10 @@
-
-#include <linux/module.h>
-
-#include <linux/platform_device.h>
 #include <linux/err.h>
-#include <linux/leds.h>
-
-#include <linux/io.h>
-#include <linux/dmi.h>
-
 #include <linux/i8042.h>
+#include <linux/io.h>
+#include <linux/leds.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
+#include <linux/sysfw.h>
 
 #define CLEVO_MAIL_LED_OFF		0x0084
 #define CLEVO_MAIL_LED_BLINK_1HZ	0x008A
@@ -20,11 +16,12 @@ MODULE_LICENSE("GPL");
 
 static unsigned int __initdata nodetect;
 module_param_named(nodetect, nodetect, bool, 0);
-MODULE_PARM_DESC(nodetect, "Skip DMI hardware detection");
+MODULE_PARM_DESC(nodetect, "Skip SMBIOS hardware detection");
 
 static struct platform_device *pdev;
 
-static int __init clevo_mail_led_dmi_callback(const struct dmi_system_id *id)
+static int __init
+clevo_mail_led_smbios_callback(const struct sysfw_id *id)
 {
 	printk(KERN_INFO KBUILD_MODNAME ": '%s' found\n", id->ident);
 	return 1;
@@ -39,55 +36,55 @@ static int __init clevo_mail_led_dmi_callback(const struct dmi_system_id *id)
  * detected as working, but in reality it is not) as low as
  * possible.
  */
-static struct dmi_system_id __initdata mail_led_whitelist[] = {
+static struct sysfw_id __initdata mail_led_whitelist[] = {
 	{
-		.callback = clevo_mail_led_dmi_callback,
+		.callback = clevo_mail_led_smbios_callback,
 		.ident = "Clevo D410J",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "VIA"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "K8N800"),
-			DMI_MATCH(DMI_PRODUCT_VERSION, "VT8204B")
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "VIA"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "K8N800"),
+			SYSFW_MATCH(SYSFW_PRODUCT_VERSION, "VT8204B")
 		}
 	},
 	{
-		.callback = clevo_mail_led_dmi_callback,
+		.callback = clevo_mail_led_smbios_callback,
 		.ident = "Clevo M5x0N",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "CLEVO Co."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "M5x0N")
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "CLEVO Co."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "M5x0N")
 		}
 	},
 	{
-		.callback = clevo_mail_led_dmi_callback,
+		.callback = clevo_mail_led_smbios_callback,
 		.ident = "Positivo Mobile",
 		.matches = {
-			DMI_MATCH(DMI_BOARD_VENDOR, "CLEVO Co. "),
-			DMI_MATCH(DMI_BOARD_NAME, "M5X0V "),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Positivo Mobile"),
-			DMI_MATCH(DMI_PRODUCT_VERSION, "VT6198")
+			SYSFW_MATCH(SYSFW_BOARD_VENDOR, "CLEVO Co. "),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "M5X0V "),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Positivo Mobile"),
+			SYSFW_MATCH(SYSFW_PRODUCT_VERSION, "VT6198")
 		}
 	},
 	{
-		.callback = clevo_mail_led_dmi_callback,
+		.callback = clevo_mail_led_smbios_callback,
 		.ident = "Clevo D400P",
 		.matches = {
-			DMI_MATCH(DMI_BOARD_VENDOR, "Clevo"),
-			DMI_MATCH(DMI_BOARD_NAME, "D400P"),
-			DMI_MATCH(DMI_BOARD_VERSION, "Rev.A"),
-			DMI_MATCH(DMI_PRODUCT_VERSION, "0106")
+			SYSFW_MATCH(SYSFW_BOARD_VENDOR, "Clevo"),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "D400P"),
+			SYSFW_MATCH(SYSFW_BOARD_VERSION, "Rev.A"),
+			SYSFW_MATCH(SYSFW_PRODUCT_VERSION, "0106")
 		}
 	},
 	{
-		.callback = clevo_mail_led_dmi_callback,
+		.callback = clevo_mail_led_smbios_callback,
 		.ident = "Clevo D410V",
 		.matches = {
-			DMI_MATCH(DMI_BOARD_VENDOR, "Clevo, Co."),
-			DMI_MATCH(DMI_BOARD_NAME, "D400V/D470V"),
-			DMI_MATCH(DMI_BOARD_VERSION, "SS78B"),
-			DMI_MATCH(DMI_PRODUCT_VERSION, "Rev. A1")
+			SYSFW_MATCH(SYSFW_BOARD_VENDOR, "Clevo, Co."),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "D400V/D470V"),
+			SYSFW_MATCH(SYSFW_BOARD_VERSION, "SS78B"),
+			SYSFW_MATCH(SYSFW_PRODUCT_VERSION, "Rev. A1")
 		}
 	},
-	{ }
+	{}
 };
 
 static void clevo_mail_led_set(struct led_classdev *led_cdev,
@@ -176,21 +173,16 @@ static struct platform_driver clevo_mail_led_driver = {
 static int __init clevo_mail_led_init(void)
 {
 	int error = 0;
-	int count = 0;
 
 	/* Check with the help of DMI if we are running on supported hardware */
-	if (!nodetect) {
-		count = dmi_check_system(mail_led_whitelist);
-	} else {
-		count = 1;
+	if (nodetect) {
 		printk(KERN_ERR KBUILD_MODNAME ": Skipping DMI detection. "
 		       "If the driver works on your hardware please "
 		       "report model and the output of dmidecode in tracker "
 		       "at http://sourceforge.net/projects/clevo-mailled/\n");
-	}
-
-	if (!count)
+	} else if (!sysfw_callback(mail_led_whitelist)) {
 		return -ENODEV;
+	}
 
 	pdev = platform_device_register_simple(KBUILD_MODNAME, -1, NULL, 0);
 	if (!IS_ERR(pdev)) {
diff --git a/drivers/leds/leds-ss4200.c b/drivers/leds/leds-ss4200.c
index 614ebeb..0b6b6fa 100644
--- a/drivers/leds/leds-ss4200.c
+++ b/drivers/leds/leds-ss4200.c
@@ -21,13 +21,13 @@
 
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
-#include <linux/dmi.h>
 #include <linux/init.h>
 #include <linux/ioport.h>
 #include <linux/kernel.h>
 #include <linux/leds.h>
 #include <linux/module.h>
 #include <linux/pci.h>
+#include <linux/sysfw.h>
 #include <linux/types.h>
 #include <linux/uaccess.h>
 
@@ -73,7 +73,7 @@ static const struct pci_device_id ich7_lpc_pci_id[] =
 
 MODULE_DEVICE_TABLE(pci, ich7_lpc_pci_id);
 
-static int __init ss4200_led_dmi_callback(const struct dmi_system_id *id)
+static int __init ss4200_led_smbios_callback(const struct sysfw_id *id)
 {
 	pr_info("detected '%s'\n", id->ident);
 	return 1;
@@ -81,7 +81,7 @@ static int __init ss4200_led_dmi_callback(const struct dmi_system_id *id)
 
 static unsigned int __initdata nodetect;
 module_param_named(nodetect, nodetect, bool, 0);
-MODULE_PARM_DESC(nodetect, "Skip DMI-based hardware detection");
+MODULE_PARM_DESC(nodetect, "Skip SMBIOS-based hardware detection");
 
 /*
  * struct nas_led_whitelist - List of known good models
@@ -92,14 +92,14 @@ MODULE_PARM_DESC(nodetect, "Skip DMI-based hardware detection");
  * detected as working, but in reality it is not) as low as
  * possible.
  */
-static struct dmi_system_id __initdata nas_led_whitelist[] = {
+static struct sysfw_id __initdata nas_led_whitelist[] = {
 	{
-		.callback = ss4200_led_dmi_callback,
+		.callback = ss4200_led_smbios_callback,
 		.ident = "Intel SS4200-E",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Intel"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "SS4200-E"),
-			DMI_MATCH(DMI_PRODUCT_VERSION, "1.00.00")
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Intel"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "SS4200-E"),
+			SYSFW_MATCH(SYSFW_PRODUCT_VERSION, "1.00.00")
 		}
 	},
 	{}
@@ -504,16 +504,11 @@ static int __init nas_gpio_init(void)
 {
 	int i;
 	int ret = 0;
-	int nr_devices = 0;
 
-	nr_devices = dmi_check_system(nas_led_whitelist);
 	if (nodetect) {
 		pr_info("skipping hardware autodetection\n");
 		pr_info("Please send 'dmidecode' output to dave@sr71.net\n");
-		nr_devices++;
-	}
-
-	if (nr_devices <= 0) {
+	} else if (!sysfw_callback(nas_led_whitelist)) {
 		pr_info("no LED devices found\n");
 		return -ENODEV;
 	}
-- 
1.6.5.2


^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [PATCH 16/34] drivers/media changes for SMBIOS and System Firmware
  2011-07-18 13:08 [PATCH 00/34] System Firmware and SMBIOS Support [v3] Prarit Bhargava
                   ` (14 preceding siblings ...)
  2011-07-18 13:08 ` [PATCH 15/34] drivers/leds " Prarit Bhargava
@ 2011-07-18 13:08 ` Prarit Bhargava
  2011-07-18 13:08 ` [PATCH 17/34] drivers/misc " Prarit Bhargava
                   ` (17 subsequent siblings)
  33 siblings, 0 replies; 48+ messages in thread
From: Prarit Bhargava @ 2011-07-18 13:08 UTC (permalink / raw)
  To: linux-kernel; +Cc: Prarit Bhargava, linux-media

As part of the new SMBIOS and System Firmware code:

- Replace old dmi* structures and functions with new sysfw* and smbios*
structures and functions in individual drivers
- cleanup sysfw_id lookup tables
- cleanup of includes for dmi.h and mod_devicetable.h which were included in
some files that did not need them

Cc: linux-media@vger.kernel.org
Signed-off-by: Prarit Bhargava <prarit@redhat.com>
---
 drivers/media/dvb/firewire/firedtv-fw.c        |    1 -
 drivers/media/dvb/firewire/firedtv.h           |    1 -
 drivers/media/video/cafe_ccic.c                |   14 ++--
 drivers/media/video/gspca/m5602/m5602_ov9650.c |   46 ++++++------
 drivers/media/video/gspca/m5602/m5602_ov9650.h |    2 +-
 drivers/media/video/gspca/m5602/m5602_s5k4aa.c |  102 ++++++++++++++----------
 drivers/media/video/gspca/m5602/m5602_s5k4aa.h |    2 +-
 drivers/media/video/gspca/sn9c20x.c            |   30 ++++---
 drivers/media/video/pvrusb2/pvrusb2-devattr.h  |    1 -
 9 files changed, 107 insertions(+), 92 deletions(-)

diff --git a/drivers/media/dvb/firewire/firedtv-fw.c b/drivers/media/dvb/firewire/firedtv-fw.c
index 864b627..5f808c1 100644
--- a/drivers/media/dvb/firewire/firedtv-fw.c
+++ b/drivers/media/dvb/firewire/firedtv-fw.c
@@ -9,7 +9,6 @@
 #include <linux/kernel.h>
 #include <linux/list.h>
 #include <linux/mm.h>
-#include <linux/mod_devicetable.h>
 #include <linux/module.h>
 #include <linux/mutex.h>
 #include <linux/slab.h>
diff --git a/drivers/media/dvb/firewire/firedtv.h b/drivers/media/dvb/firewire/firedtv.h
index bd00b04..409b892 100644
--- a/drivers/media/dvb/firewire/firedtv.h
+++ b/drivers/media/dvb/firewire/firedtv.h
@@ -16,7 +16,6 @@
 #include <linux/dvb/dmx.h>
 #include <linux/dvb/frontend.h>
 #include <linux/list.h>
-#include <linux/mod_devicetable.h>
 #include <linux/mutex.h>
 #include <linux/spinlock_types.h>
 #include <linux/types.h>
diff --git a/drivers/media/video/cafe_ccic.c b/drivers/media/video/cafe_ccic.c
index 6647033..831d11d 100644
--- a/drivers/media/video/cafe_ccic.c
+++ b/drivers/media/video/cafe_ccic.c
@@ -25,7 +25,7 @@
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/fs.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include <linux/mm.h>
 #include <linux/pci.h>
 #include <linux/i2c.h>
@@ -1974,15 +1974,15 @@ static irqreturn_t cafe_irq(int irq, void *data)
  * PCI interface stuff.
  */
 
-static const struct dmi_system_id olpc_xo1_dmi[] = {
+static const struct sysfw_id olpc_xo1_id[] = {
 	{
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "OLPC"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "XO"),
-			DMI_MATCH(DMI_PRODUCT_VERSION, "1"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "OLPC"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "XO"),
+			SYSFW_MATCH(SYSFW_PRODUCT_VERSION, "1"),
 		},
 	},
-	{ }
+	{}
 };
 
 static int cafe_pci_probe(struct pci_dev *pdev,
@@ -2064,7 +2064,7 @@ static int cafe_pci_probe(struct pci_dev *pdev,
 		goto out_freeirq;
 
 	/* Apply XO-1 clock speed */
-	if (dmi_check_system(olpc_xo1_dmi))
+	if (sysfw_callback(olpc_xo1_id))
 		sensor_cfg.clock_speed = 45;
 
 	cam->sensor_addr = ov7670_info.addr;
diff --git a/drivers/media/video/gspca/m5602/m5602_ov9650.c b/drivers/media/video/gspca/m5602/m5602_ov9650.c
index 703d486..d73eed0 100644
--- a/drivers/media/video/gspca/m5602/m5602_ov9650.c
+++ b/drivers/media/video/gspca/m5602/m5602_ov9650.c
@@ -43,69 +43,69 @@ static int ov9650_set_auto_exposure(struct gspca_dev *gspca_dev, __s32 val);
    where the sensor is mounted upside down */
 static
     const
-	struct dmi_system_id ov9650_flip_dmi_table[] = {
+	struct sysfw_id ov9650_flip_id_table[] = {
 	{
 		.ident = "ASUS A6Ja",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK Computer Inc."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "A6J")
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "ASUSTeK Computer Inc."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "A6J")
 		}
 	},
 	{
 		.ident = "ASUS A6JC",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK Computer Inc."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "A6JC")
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "ASUSTeK Computer Inc."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "A6JC")
 		}
 	},
 	{
 		.ident = "ASUS A6K",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK Computer Inc."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "A6K")
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "ASUSTeK Computer Inc."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "A6K")
 		}
 	},
 	{
 		.ident = "ASUS A6Kt",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK Computer Inc."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "A6Kt")
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "ASUSTeK Computer Inc."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "A6Kt")
 		}
 	},
 	{
 		.ident = "ASUS A6VA",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK Computer Inc."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "A6VA")
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "ASUSTeK Computer Inc."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "A6VA")
 		}
 	},
 	{
 
 		.ident = "ASUS A6VC",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK Computer Inc."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "A6VC")
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "ASUSTeK Computer Inc."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "A6VC")
 		}
 	},
 	{
 		.ident = "ASUS A6VM",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK Computer Inc."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "A6VM")
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "ASUSTeK Computer Inc."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "A6VM")
 		}
 	},
 	{
 		.ident = "ASUS A7V",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK Computer Inc."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "A7V")
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "ASUSTeK Computer Inc."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "A7V")
 		}
 	},
 	{
 		.ident = "Alienware Aurora m9700",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "alienware"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Aurora m9700")
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "alienware"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Aurora m9700")
 		}
 	},
 	{}
@@ -424,9 +424,9 @@ int ov9650_start(struct sd *sd)
 	int ver_offs = cam->cam_mode[sd->gspca_dev.curr_mode].priv;
 	int hor_offs = OV9650_LEFT_OFFSET;
 
-	if ((!dmi_check_system(ov9650_flip_dmi_table) &&
+	if ((!sysfw_callback(ov9650_flip_id_table) &&
 		sensor_settings[VFLIP_IDX]) ||
-		(dmi_check_system(ov9650_flip_dmi_table) &&
+		(sysfw_callback(ov9650_flip_id_table) &&
 		!sensor_settings[VFLIP_IDX]))
 		ver_offs--;
 
@@ -709,7 +709,7 @@ static int ov9650_set_hflip(struct gspca_dev *gspca_dev, __s32 val)
 
 	sensor_settings[HFLIP_IDX] = val;
 
-	if (!dmi_check_system(ov9650_flip_dmi_table))
+	if (!sysfw_callback(ov9650_flip_id_table))
 		i2c_data = ((val & 0x01) << 5) |
 				(sensor_settings[VFLIP_IDX] << 4);
 	else
@@ -742,7 +742,7 @@ static int ov9650_set_vflip(struct gspca_dev *gspca_dev, __s32 val)
 	PDEBUG(D_V4L2, "Set vertical flip to %d", val);
 	sensor_settings[VFLIP_IDX] = val;
 
-	if (dmi_check_system(ov9650_flip_dmi_table))
+	if (sysfw_callback(ov9650_flip_id_table))
 		val = !val;
 
 	i2c_data = ((val & 0x01) << 4) | (sensor_settings[VFLIP_IDX] << 5);
diff --git a/drivers/media/video/gspca/m5602/m5602_ov9650.h b/drivers/media/video/gspca/m5602/m5602_ov9650.h
index da9a129..394042f 100644
--- a/drivers/media/video/gspca/m5602/m5602_ov9650.h
+++ b/drivers/media/video/gspca/m5602/m5602_ov9650.h
@@ -19,7 +19,7 @@
 #ifndef M5602_OV9650_H_
 #define M5602_OV9650_H_
 
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include "m5602_sensor.h"
 
 /*****************************************************************************/
diff --git a/drivers/media/video/gspca/m5602/m5602_s5k4aa.c b/drivers/media/video/gspca/m5602/m5602_s5k4aa.c
index d27280b..c6860e9 100644
--- a/drivers/media/video/gspca/m5602/m5602_s5k4aa.c
+++ b/drivers/media/video/gspca/m5602/m5602_s5k4aa.c
@@ -33,85 +33,101 @@ static int s5k4aa_set_brightness(struct gspca_dev *gspca_dev, __s32 val);
 
 static
     const
-	struct dmi_system_id s5k4aa_vflip_dmi_table[] = {
+	struct sysfw_id s5k4aa_vflip_id_table[] = {
 	{
 		.ident = "BRUNEINIT",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "BRUNENIT"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "BRUNENIT"),
-			DMI_MATCH(DMI_BOARD_VERSION, "00030D0000000001")
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "BRUNENIT"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "BRUNENIT"),
+			SYSFW_MATCH(SYSFW_BOARD_VERSION, "00030D0000000001")
 		}
-	}, {
+	},
+	{
 		.ident = "Fujitsu-Siemens Amilo Xa 2528",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "AMILO Xa 2528")
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "FUJITSU SIEMENS"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "AMILO Xa 2528")
 		}
-	}, {
+	},
+	{
 		.ident = "Fujitsu-Siemens Amilo Xi 2428",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "AMILO Xi 2428")
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "FUJITSU SIEMENS"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "AMILO Xi 2428")
 		}
-	}, {
+	},
+	{
 		.ident = "Fujitsu-Siemens Amilo Xi 2528",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "AMILO Xi 2528")
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "FUJITSU SIEMENS"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "AMILO Xi 2528")
 		}
-	}, {
+	},
+	{
 		.ident = "Fujitsu-Siemens Amilo Xi 2550",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "AMILO Xi 2550")
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "FUJITSU SIEMENS"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "AMILO Xi 2550")
 		}
-	}, {
+	},
+	{
 		.ident = "Fujitsu-Siemens Amilo Pa 2548",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "AMILO Pa 2548")
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "FUJITSU SIEMENS"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "AMILO Pa 2548")
 		}
-	}, {
+	},
+	{
 		.ident = "MSI GX700",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Micro-Star International"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "GX700"),
-			DMI_MATCH(DMI_BIOS_DATE, "12/02/2008")
+			SYSFW_MATCH(SYSFW_SYS_VENDOR,
+				    "Micro-Star International"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "GX700"),
+			SYSFW_MATCH(SYSFW_BIOS_DATE, "12/02/2008")
 		}
-	}, {
+	},
+	{
 		.ident = "MSI GX700",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Micro-Star International"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "GX700"),
-			DMI_MATCH(DMI_BIOS_DATE, "07/26/2007")
+			SYSFW_MATCH(SYSFW_SYS_VENDOR,
+				    "Micro-Star International"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "GX700"),
+			SYSFW_MATCH(SYSFW_BIOS_DATE, "07/26/2007")
 		}
-	}, {
+	},
+	{
 		.ident = "MSI GX700",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Micro-Star International"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "GX700"),
-			DMI_MATCH(DMI_BIOS_DATE, "07/19/2007")
+			SYSFW_MATCH(SYSFW_SYS_VENDOR,
+				    "Micro-Star International"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "GX700"),
+			SYSFW_MATCH(SYSFW_BIOS_DATE, "07/19/2007")
 		}
-	}, {
+	},
+	{
 		.ident = "MSI GX700/GX705/EX700",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Micro-Star International"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "GX700/GX705/EX700")
+			SYSFW_MATCH(SYSFW_SYS_VENDOR,
+				    "Micro-Star International"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "GX700/GX705/EX700")
 		}
-	}, {
+	},
+	{
 		.ident = "MSI L735",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Micro-Star International"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "MS-1717X")
+			SYSFW_MATCH(SYSFW_SYS_VENDOR,
+				    "Micro-Star International"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "MS-1717X")
 		}
-	}, {
+	},
+	{
 		.ident = "Lenovo Y300",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "L3000 Y300"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Y300")
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "L3000 Y300"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Y300")
 		}
 	},
-	{ }
+	{}
 };
 
 static struct v4l2_pix_format s5k4aa_modes[] = {
@@ -520,7 +536,7 @@ static int s5k4aa_set_vflip(struct gspca_dev *gspca_dev, __s32 val)
 	if (err < 0)
 		return err;
 
-	if (dmi_check_system(s5k4aa_vflip_dmi_table))
+	if (sysfw_callback(s5k4aa_vflip_id_table))
 		val = !val;
 
 	data = ((data & ~S5K4AA_RM_V_FLIP) | ((val & 0x01) << 7));
@@ -568,7 +584,7 @@ static int s5k4aa_set_hflip(struct gspca_dev *gspca_dev, __s32 val)
 	if (err < 0)
 		return err;
 
-	if (dmi_check_system(s5k4aa_vflip_dmi_table))
+	if (sysfw_callback(s5k4aa_vflip_id_table))
 		val = !val;
 
 	data = ((data & ~S5K4AA_RM_H_FLIP) | ((val & 0x01) << 6));
diff --git a/drivers/media/video/gspca/m5602/m5602_s5k4aa.h b/drivers/media/video/gspca/m5602/m5602_s5k4aa.h
index 8cc7a3f..d6d1338 100644
--- a/drivers/media/video/gspca/m5602/m5602_s5k4aa.h
+++ b/drivers/media/video/gspca/m5602/m5602_s5k4aa.h
@@ -19,7 +19,7 @@
 #ifndef M5602_S5K4AA_H_
 #define M5602_S5K4AA_H_
 
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 
 #include "m5602_sensor.h"
 
diff --git a/drivers/media/video/gspca/sn9c20x.c b/drivers/media/video/gspca/sn9c20x.c
index c431900..90f919a 100644
--- a/drivers/media/video/gspca/sn9c20x.c
+++ b/drivers/media/video/gspca/sn9c20x.c
@@ -24,7 +24,7 @@
 #include "jpeg.h"
 
 #include <media/v4l2-chip-ident.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 
 MODULE_AUTHOR("Brian Johnson <brijohn@gmail.com>, "
 		"microdia project <microdia@googlegroups.com>");
@@ -135,41 +135,43 @@ static int sd_getexposure(struct gspca_dev *gspca_dev, s32 *val);
 static int sd_setautoexposure(struct gspca_dev *gspca_dev, s32 val);
 static int sd_getautoexposure(struct gspca_dev *gspca_dev, s32 *val);
 
-static const struct dmi_system_id flip_dmi_table[] = {
+static const struct sysfw_id flip_id_table[] = {
 	{
 		.ident = "MSI MS-1034",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "MICRO-STAR INT'L CO.,LTD."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "MS-1034"),
-			DMI_MATCH(DMI_PRODUCT_VERSION, "0341")
+			SYSFW_MATCH(SYSFW_SYS_VENDOR,
+				    "MICRO-STAR INT'L CO.,LTD."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "MS-1034"),
+			SYSFW_MATCH(SYSFW_PRODUCT_VERSION, "0341")
 		}
 	},
 	{
 		.ident = "MSI MS-1632",
 		.matches = {
-			DMI_MATCH(DMI_BOARD_VENDOR, "MSI"),
-			DMI_MATCH(DMI_BOARD_NAME, "MS-1632")
+			SYSFW_MATCH(SYSFW_BOARD_VENDOR, "MSI"),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "MS-1632")
 		}
 	},
 	{
 		.ident = "MSI MS-1633X",
 		.matches = {
-			DMI_MATCH(DMI_BOARD_VENDOR, "MSI"),
-			DMI_MATCH(DMI_BOARD_NAME, "MS-1633X")
+			SYSFW_MATCH(SYSFW_BOARD_VENDOR, "MSI"),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "MS-1633X")
 		}
 	},
 	{
 		.ident = "MSI MS-1635X",
 		.matches = {
-			DMI_MATCH(DMI_BOARD_VENDOR, "MSI"),
-			DMI_MATCH(DMI_BOARD_NAME, "MS-1635X")
+			SYSFW_MATCH(SYSFW_BOARD_VENDOR, "MSI"),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "MS-1635X")
 		}
 	},
 	{
 		.ident = "ASUSTeK W7J",
 		.matches = {
-			DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer Inc."),
-			DMI_MATCH(DMI_BOARD_NAME, "W7J       ")
+			SYSFW_MATCH(SYSFW_BOARD_VENDOR,
+				    "ASUSTeK Computer Inc."),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "W7J       ")
 		}
 	},
 	{}
@@ -1607,7 +1609,7 @@ static int set_hvflip(struct gspca_dev *gspca_dev)
 	u16 value2;
 	struct sd *sd = (struct sd *) gspca_dev;
 
-	if ((sd->flags & FLIP_DETECT) && dmi_check_system(flip_dmi_table)) {
+	if ((sd->flags & FLIP_DETECT) && sysfw_callback(flip_id_table)) {
 		hflip = !sd->hflip;
 		vflip = !sd->vflip;
 	} else {
diff --git a/drivers/media/video/pvrusb2/pvrusb2-devattr.h b/drivers/media/video/pvrusb2/pvrusb2-devattr.h
index 273c8d4..68b8073 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-devattr.h
+++ b/drivers/media/video/pvrusb2/pvrusb2-devattr.h
@@ -20,7 +20,6 @@
 #ifndef __PVRUSB2_DEVATTR_H
 #define __PVRUSB2_DEVATTR_H
 
-#include <linux/mod_devicetable.h>
 #include <linux/videodev2.h>
 #ifdef CONFIG_VIDEO_PVRUSB2_DVB
 #include "pvrusb2-dvb.h"
-- 
1.6.5.2


^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [PATCH 17/34] drivers/misc changes for SMBIOS and System Firmware
  2011-07-18 13:08 [PATCH 00/34] System Firmware and SMBIOS Support [v3] Prarit Bhargava
                   ` (15 preceding siblings ...)
  2011-07-18 13:08 ` [PATCH 16/34] drivers/media " Prarit Bhargava
@ 2011-07-18 13:08 ` Prarit Bhargava
  2011-07-18 13:08 ` [PATCH 18/34] drivers/mtd " Prarit Bhargava
                   ` (16 subsequent siblings)
  33 siblings, 0 replies; 48+ messages in thread
From: Prarit Bhargava @ 2011-07-18 13:08 UTC (permalink / raw)
  To: linux-kernel; +Cc: Prarit Bhargava, eric.piel

 part of the new SMBIOS and System Firmware code:

- Replace old dmi* structures and functions with new sysfw* and smbios*
structures and functions in individual drivers
- cleanup of includes for dmi.h and mod_devicetable.h which were included in
some files that did not need them

Cc: eric.piel@tremplin-utc.net
Signed-off-by: Prarit Bhargava <prarit@redhat.com>
---
 drivers/misc/eeprom/at24.c         |    1 -
 drivers/misc/lis3lv02d/lis3lv02d.c |    1 -
 drivers/misc/pch_phub.c            |   14 ++++++++++++--
 3 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/drivers/misc/eeprom/at24.c b/drivers/misc/eeprom/at24.c
index ab1ad41..1e73630 100644
--- a/drivers/misc/eeprom/at24.c
+++ b/drivers/misc/eeprom/at24.c
@@ -16,7 +16,6 @@
 #include <linux/delay.h>
 #include <linux/mutex.h>
 #include <linux/sysfs.h>
-#include <linux/mod_devicetable.h>
 #include <linux/log2.h>
 #include <linux/bitops.h>
 #include <linux/jiffies.h>
diff --git a/drivers/misc/lis3lv02d/lis3lv02d.c b/drivers/misc/lis3lv02d/lis3lv02d.c
index b928bc1..c48b955 100644
--- a/drivers/misc/lis3lv02d/lis3lv02d.c
+++ b/drivers/misc/lis3lv02d/lis3lv02d.c
@@ -24,7 +24,6 @@
 
 #include <linux/kernel.h>
 #include <linux/init.h>
-#include <linux/dmi.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/platform_device.h>
diff --git a/drivers/misc/pch_phub.c b/drivers/misc/pch_phub.c
index 5fe79df..ecd2cb2 100644
--- a/drivers/misc/pch_phub.c
+++ b/drivers/misc/pch_phub.c
@@ -27,7 +27,7 @@
 #include <linux/mutex.h>
 #include <linux/if_ether.h>
 #include <linux/ctype.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 
 #define PHUB_STATUS 0x00		/* Status Register offset */
 #define PHUB_CONTROL 0x04		/* Control Register offset */
@@ -598,6 +598,16 @@ static ssize_t show_pch_mac(struct device *dev, struct device_attribute *attr,
 				mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
 }
 
+static struct sysfw_id pcih_phub_quirk_id[] = {
+	{
+		 .ident = "CM-iTC",
+		.matches = {
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "CM-iTC"),
+		},
+	},
+	{},
+};
+
 static ssize_t store_pch_mac(struct device *dev, struct device_attribute *attr,
 			     const char *buf, size_t count)
 {
@@ -701,7 +711,7 @@ static int __devinit pch_phub_probe(struct pci_dev *pdev,
 					       CLKCFG_CANCLK_MASK);
 
 		/* quirk for CM-iTC board */
-		if (strstr(dmi_get_system_info(DMI_BOARD_NAME), "CM-iTC"))
+		if (sysfw_callback(pcih_phub_quirk_id))
 			pch_phub_read_modify_write_reg(chip,
 						(unsigned int)CLKCFG_REG_OFFSET,
 						CLKCFG_UART_48MHZ | CLKCFG_BAUDDIV |
-- 
1.6.5.2


^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [PATCH 18/34] drivers/mtd changes for SMBIOS and System Firmware
  2011-07-18 13:08 [PATCH 00/34] System Firmware and SMBIOS Support [v3] Prarit Bhargava
                   ` (16 preceding siblings ...)
  2011-07-18 13:08 ` [PATCH 17/34] drivers/misc " Prarit Bhargava
@ 2011-07-18 13:08 ` Prarit Bhargava
  2011-07-18 13:08 ` [PATCH 19/34] drivers/net " Prarit Bhargava
                   ` (15 subsequent siblings)
  33 siblings, 0 replies; 48+ messages in thread
From: Prarit Bhargava @ 2011-07-18 13:08 UTC (permalink / raw)
  To: linux-kernel; +Cc: Prarit Bhargava

As part of the new SMBIOS and System Firmware code:

- cleanup of includes for dmi.h and mod_devicetable.h which were included in
some files that did not need them

Signed-off-by: Prarit Bhargava <prarit@redhat.com>
---
 drivers/mtd/devices/m25p80.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
index 35180e4..e418e7e 100644
--- a/drivers/mtd/devices/m25p80.c
+++ b/drivers/mtd/devices/m25p80.c
@@ -25,7 +25,6 @@
 #include <linux/math64.h>
 #include <linux/slab.h>
 #include <linux/sched.h>
-#include <linux/mod_devicetable.h>
 
 #include <linux/mtd/cfi.h>
 #include <linux/mtd/mtd.h>
-- 
1.6.5.2


^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [PATCH 19/34] drivers/net changes for SMBIOS and System Firmware
  2011-07-18 13:08 [PATCH 00/34] System Firmware and SMBIOS Support [v3] Prarit Bhargava
                   ` (17 preceding siblings ...)
  2011-07-18 13:08 ` [PATCH 18/34] drivers/mtd " Prarit Bhargava
@ 2011-07-18 13:08 ` Prarit Bhargava
  2011-07-18 13:08 ` [PATCH 20/34] drivers/pci " Prarit Bhargava
                   ` (14 subsequent siblings)
  33 siblings, 0 replies; 48+ messages in thread
From: Prarit Bhargava @ 2011-07-18 13:08 UTC (permalink / raw)
  To: linux-kernel; +Cc: Prarit Bhargava, netdev

As part of the new SMBIOS and System Firmware code:

- Replace old dmi* structures and functions with new sysfw* and smbios*
structures and functions in individual drivers
- cleanup sysfw_id lookup tables
- cleanup of includes for dmi.h and mod_devicetable.h which were included in
some files that did not need them

Cc: netdev@vger.kernel.org
Signed-off-by: Prarit Bhargava <prarit@redhat.com>
---
 drivers/net/skge.c                 |   11 ++++++-----
 drivers/net/via-rhine.c            |   18 ++++++++++--------
 drivers/net/wireless/wl1251/sdio.c |    1 -
 3 files changed, 16 insertions(+), 14 deletions(-)

diff --git a/drivers/net/skge.c b/drivers/net/skge.c
index f4be5c7..1200c53 100644
--- a/drivers/net/skge.c
+++ b/drivers/net/skge.c
@@ -43,7 +43,7 @@
 #include <linux/seq_file.h>
 #include <linux/mii.h>
 #include <linux/slab.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include <linux/prefetch.h>
 #include <asm/irq.h>
 
@@ -4089,12 +4089,13 @@ static struct pci_driver skge_driver = {
 	.driver.pm =	SKGE_PM_OPS,
 };
 
-static struct dmi_system_id skge_32bit_dma_boards[] = {
+static struct sysfw_id skge_32bit_dma_boards[] = {
 	{
 		.ident = "Gigabyte nForce boards",
 		.matches = {
-			DMI_MATCH(DMI_BOARD_VENDOR, "Gigabyte Technology Co"),
-			DMI_MATCH(DMI_BOARD_NAME, "nForce"),
+			SYSFW_MATCH(SYSFW_BOARD_VENDOR,
+				     "Gigabyte Technology Co"),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "nForce"),
 		},
 	},
 	{}
@@ -4102,7 +4103,7 @@ static struct dmi_system_id skge_32bit_dma_boards[] = {
 
 static int __init skge_init_module(void)
 {
-	if (dmi_check_system(skge_32bit_dma_boards))
+	if (sysfw_callback(skge_32bit_dma_boards))
 		only_32bit_dma = 1;
 	skge_debug_init();
 	return pci_register_driver(&skge_driver);
diff --git a/drivers/net/via-rhine.c b/drivers/net/via-rhine.c
index 7f23ab9..81725d5 100644
--- a/drivers/net/via-rhine.c
+++ b/drivers/net/via-rhine.c
@@ -110,7 +110,7 @@ static const int multicast_filter_limit = 32;
 #include <asm/io.h>
 #include <asm/irq.h>
 #include <asm/uaccess.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 
 /* These identify the driver base version and may not be removed. */
 static const char version[] __devinitconst =
@@ -2294,22 +2294,24 @@ static struct pci_driver rhine_driver = {
 	.shutdown =	rhine_shutdown,
 };
 
-static struct dmi_system_id __initdata rhine_dmi_table[] = {
+static struct sysfw_id __initdata rhine_id_table[] = {
 	{
 		.ident = "EPIA-M",
 		.matches = {
-			DMI_MATCH(DMI_BIOS_VENDOR, "Award Software International, Inc."),
-			DMI_MATCH(DMI_BIOS_VERSION, "6.00 PG"),
+			SYSFW_MATCH(SYSFW_BIOS_VENDOR,
+				    "Award Software International, Inc."),
+			SYSFW_MATCH(SYSFW_BIOS_VERSION, "6.00 PG"),
 		},
 	},
 	{
 		.ident = "KV7",
 		.matches = {
-			DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies, LTD"),
-			DMI_MATCH(DMI_BIOS_VERSION, "6.00 PG"),
+			SYSFW_MATCH(SYSFW_BIOS_VENDOR,
+				    "Phoenix Technologies, LTD"),
+			SYSFW_MATCH(SYSFW_BIOS_VERSION, "6.00 PG"),
 		},
 	},
-	{ NULL }
+	{}
 };
 
 static int __init rhine_init(void)
@@ -2318,7 +2320,7 @@ static int __init rhine_init(void)
 #ifdef MODULE
 	pr_info("%s\n", version);
 #endif
-	if (dmi_check_system(rhine_dmi_table)) {
+	if (sysfw_callback(rhine_id_table)) {
 		/* these BIOSes fail at PXE boot if chip is in D3 */
 		avoid_D3 = 1;
 		pr_warn("Broken BIOS detected, avoid_D3 enabled\n");
diff --git a/drivers/net/wireless/wl1251/sdio.c b/drivers/net/wireless/wl1251/sdio.c
index f51a024..68e36d7 100644
--- a/drivers/net/wireless/wl1251/sdio.c
+++ b/drivers/net/wireless/wl1251/sdio.c
@@ -20,7 +20,6 @@
  * Copyright (C) 2009 Bob Copeland (me@bobcopeland.com)
  */
 #include <linux/module.h>
-#include <linux/mod_devicetable.h>
 #include <linux/mmc/sdio_func.h>
 #include <linux/mmc/sdio_ids.h>
 #include <linux/platform_device.h>
-- 
1.6.5.2


^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [PATCH 20/34] drivers/pci changes for SMBIOS and System Firmware
  2011-07-18 13:08 [PATCH 00/34] System Firmware and SMBIOS Support [v3] Prarit Bhargava
                   ` (18 preceding siblings ...)
  2011-07-18 13:08 ` [PATCH 19/34] drivers/net " Prarit Bhargava
@ 2011-07-18 13:08 ` Prarit Bhargava
  2011-07-18 13:08 ` [PATCH 21/34] drivers/platform " Prarit Bhargava
                   ` (13 subsequent siblings)
  33 siblings, 0 replies; 48+ messages in thread
From: Prarit Bhargava @ 2011-07-18 13:08 UTC (permalink / raw)
  To: linux-kernel; +Cc: Prarit Bhargava, linux-pci

As part of the new SMBIOS and System Firmware code:

- Replace old dmi* structures and functions with new sysfw* and smbios*
structures and functions in individual drivers
- cleanup sysfw_id lookup tables
- add exactmatch functionality

Cc: linux-pci@vger.kernel.org
Signed-off-by: Prarit Bhargava <prarit@redhat.com>
---
 drivers/pci/dmar.c                |   14 ++--
 drivers/pci/hotplug/cpqphp.h      |   81 +--------------
 drivers/pci/hotplug/cpqphp_core.c |  207 +++++--------------------------------
 drivers/pci/intel-iommu.c         |   20 ++--
 drivers/pci/pci-label.c           |   82 +++++++--------
 drivers/pci/pci.h                 |    2 +-
 drivers/pci/pcie/portdrv_pci.c    |   26 +++---
 drivers/pci/quirks.c              |   29 ++++-
 8 files changed, 120 insertions(+), 341 deletions(-)

diff --git a/drivers/pci/dmar.c b/drivers/pci/dmar.c
index 3dc9bef..1f8352a 100644
--- a/drivers/pci/dmar.c
+++ b/drivers/pci/dmar.c
@@ -34,7 +34,7 @@
 #include <linux/irq.h>
 #include <linux/interrupt.h>
 #include <linux/tboot.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include <linux/slab.h>
 #include <asm/iommu_table.h>
 
@@ -367,9 +367,9 @@ dmar_parse_one_rhsa(struct acpi_dmar_header *header)
 		"Your BIOS is broken; RHSA refers to non-existent DMAR unit at %llx\n"
 		"BIOS vendor: %s; Ver: %s; Product Version: %s\n",
 		drhd->reg_base_addr,
-		dmi_get_system_info(DMI_BIOS_VENDOR),
-		dmi_get_system_info(DMI_BIOS_VERSION),
-		dmi_get_system_info(DMI_PRODUCT_VERSION));
+		sysfw_lookup(SYSFW_BIOS_VENDOR),
+		sysfw_lookup(SYSFW_BIOS_VERSION),
+		sysfw_lookup(SYSFW_PRODUCT_VERSION));
 
 	return 0;
 }
@@ -629,9 +629,9 @@ static void warn_invalid_dmar(u64 addr, const char *message)
 		"Your BIOS is broken; DMAR reported at address %llx%s!\n"
 		"BIOS vendor: %s; Ver: %s; Product Version: %s\n",
 		addr, message,
-		dmi_get_system_info(DMI_BIOS_VENDOR),
-		dmi_get_system_info(DMI_BIOS_VERSION),
-		dmi_get_system_info(DMI_PRODUCT_VERSION));
+		sysfw_lookup(SYSFW_BIOS_VENDOR),
+		sysfw_lookup(SYSFW_BIOS_VERSION),
+		sysfw_lookup(SYSFW_PRODUCT_VERSION));
 }
 
 int __init check_zero_address(void)
diff --git a/drivers/pci/hotplug/cpqphp.h b/drivers/pci/hotplug/cpqphp.h
index d8ffc73..6af1de3 100644
--- a/drivers/pci/hotplug/cpqphp.h
+++ b/drivers/pci/hotplug/cpqphp.h
@@ -33,6 +33,7 @@
 #include <linux/delay.h>	/* for delays */
 #include <linux/mutex.h>
 #include <linux/sched.h>	/* for signal_pending() */
+#include <linux/smbios.h>
 
 #define MY_NAME	"cpqphp"
 
@@ -41,84 +42,6 @@
 #define info(format, arg...) printk(KERN_INFO "%s: " format , MY_NAME , ## arg)
 #define warn(format, arg...) printk(KERN_WARNING "%s: " format , MY_NAME , ## arg)
 
-
-
-struct smbios_system_slot {
-	u8 type;
-	u8 length;
-	u16 handle;
-	u8 name_string_num;
-	u8 slot_type;
-	u8 slot_width;
-	u8 slot_current_usage;
-	u8 slot_length;
-	u16 slot_number;
-	u8 properties1;
-	u8 properties2;
-} __attribute__ ((packed));
-
-/* offsets to the smbios generic type based on the above structure layout */
-enum smbios_system_slot_offsets {
-	SMBIOS_SLOT_GENERIC_TYPE =	offsetof(struct smbios_system_slot, type),
-	SMBIOS_SLOT_GENERIC_LENGTH =	offsetof(struct smbios_system_slot, length),
-	SMBIOS_SLOT_GENERIC_HANDLE =	offsetof(struct smbios_system_slot, handle),
-	SMBIOS_SLOT_NAME_STRING_NUM =	offsetof(struct smbios_system_slot, name_string_num),
-	SMBIOS_SLOT_TYPE =		offsetof(struct smbios_system_slot, slot_type),
-	SMBIOS_SLOT_WIDTH =		offsetof(struct smbios_system_slot, slot_width),
-	SMBIOS_SLOT_CURRENT_USAGE =	offsetof(struct smbios_system_slot, slot_current_usage),
-	SMBIOS_SLOT_LENGTH =		offsetof(struct smbios_system_slot, slot_length),
-	SMBIOS_SLOT_NUMBER =		offsetof(struct smbios_system_slot, slot_number),
-	SMBIOS_SLOT_PROPERTIES1 =	offsetof(struct smbios_system_slot, properties1),
-	SMBIOS_SLOT_PROPERTIES2 =	offsetof(struct smbios_system_slot, properties2),
-};
-
-struct smbios_generic {
-	u8 type;
-	u8 length;
-	u16 handle;
-} __attribute__ ((packed));
-
-/* offsets to the smbios generic type based on the above structure layout */
-enum smbios_generic_offsets {
-	SMBIOS_GENERIC_TYPE =	offsetof(struct smbios_generic, type),
-	SMBIOS_GENERIC_LENGTH =	offsetof(struct smbios_generic, length),
-	SMBIOS_GENERIC_HANDLE =	offsetof(struct smbios_generic, handle),
-};
-
-struct smbios_entry_point {
-	char anchor[4];
-	u8 ep_checksum;
-	u8 ep_length;
-	u8 major_version;
-	u8 minor_version;
-	u16 max_size_entry;
-	u8 ep_rev;
-	u8 reserved[5];
-	char int_anchor[5];
-	u8 int_checksum;
-	u16 st_length;
-	u32 st_address;
-	u16 number_of_entrys;
-	u8 bcd_rev;
-} __attribute__ ((packed));
-
-/* offsets to the smbios entry point based on the above structure layout */
-enum smbios_entry_point_offsets {
-	ANCHOR =		offsetof(struct smbios_entry_point, anchor[0]),
-	EP_CHECKSUM =		offsetof(struct smbios_entry_point, ep_checksum),
-	EP_LENGTH =		offsetof(struct smbios_entry_point, ep_length),
-	MAJOR_VERSION =		offsetof(struct smbios_entry_point, major_version),
-	MINOR_VERSION =		offsetof(struct smbios_entry_point, minor_version),
-	MAX_SIZE_ENTRY =	offsetof(struct smbios_entry_point, max_size_entry),
-	EP_REV =		offsetof(struct smbios_entry_point, ep_rev),
-	INT_ANCHOR =		offsetof(struct smbios_entry_point, int_anchor[0]),
-	INT_CHECKSUM =		offsetof(struct smbios_entry_point, int_checksum),
-	ST_LENGTH =		offsetof(struct smbios_entry_point, st_length),
-	ST_ADDRESS =		offsetof(struct smbios_entry_point, st_address),
-	NUMBER_OF_ENTRYS =	offsetof(struct smbios_entry_point, number_of_entrys),
-	BCD_REV =		offsetof(struct smbios_entry_point, bcd_rev),
-};
-
 struct ctrl_reg {			/* offset */
 	u8	slot_RST;		/* 0x00 */
 	u8	slot_enable;		/* 0x01 */
@@ -273,7 +196,7 @@ struct slot {
 	struct timer_list task_event;
 	u8 hp_slot;
 	struct controller *ctrl;
-	void __iomem *p_sm_slot;
+	const union smbios_struct *ss;
 	struct hotplug_slot *hotplug_slot;
 };
 
diff --git a/drivers/pci/hotplug/cpqphp_core.c b/drivers/pci/hotplug/cpqphp_core.c
index 4952c3b..70bb361 100644
--- a/drivers/pci/hotplug/cpqphp_core.c
+++ b/drivers/pci/hotplug/cpqphp_core.c
@@ -39,6 +39,7 @@
 #include <linux/pci_hotplug.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
+#include <linux/sysfw.h>
 
 #include <asm/uaccess.h>
 
@@ -54,8 +55,6 @@ struct pci_func *cpqhp_slot_list[256];
 struct irq_routing_table *cpqhp_routing_table;
 
 /* local variables */
-static void __iomem *smbios_table;
-static void __iomem *smbios_start;
 static void __iomem *cpqhp_rom_start;
 static int power_mode;
 static int debug;
@@ -79,50 +78,12 @@ MODULE_PARM_DESC(debug, "Debugging mode enabled or not");
 
 static inline int is_slot64bit(struct slot *slot)
 {
-	return (readb(slot->p_sm_slot + SMBIOS_SLOT_WIDTH) == 0x06) ? 1 : 0;
+	return (slot->ss->type9.slot_data_bus_width == 0x06) ? 1 : 0;
 }
 
 static inline int is_slot66mhz(struct slot *slot)
 {
-	return (readb(slot->p_sm_slot + SMBIOS_SLOT_TYPE) == 0x0E) ? 1 : 0;
-}
-
-/**
- * detect_SMBIOS_pointer - find the System Management BIOS Table in mem region.
- * @begin: begin pointer for region to be scanned.
- * @end: end pointer for region to be scanned.
- *
- * Returns pointer to the head of the SMBIOS tables (or %NULL).
- */
-static void __iomem * detect_SMBIOS_pointer(void __iomem *begin, void __iomem *end)
-{
-	void __iomem *fp;
-	void __iomem *endp;
-	u8 temp1, temp2, temp3, temp4;
-	int status = 0;
-
-	endp = (end - sizeof(u32) + 1);
-
-	for (fp = begin; fp <= endp; fp += 16) {
-		temp1 = readb(fp);
-		temp2 = readb(fp+1);
-		temp3 = readb(fp+2);
-		temp4 = readb(fp+3);
-		if (temp1 == '_' &&
-		    temp2 == 'S' &&
-		    temp3 == 'M' &&
-		    temp4 == '_') {
-			status = 1;
-			break;
-		}
-	}
-
-	if (!status)
-		fp = NULL;
-
-	dbg("Discovered SMBIOS Entry point at %p\n", fp);
-
-	return fp;
+	return (slot->ss->type9.slot_type == 0x0E) ? 1 : 0;
 }
 
 /**
@@ -192,94 +153,6 @@ static void pci_print_IRQ_route(void)
 	return;
 }
 
-
-/**
- * get_subsequent_smbios_entry: get the next entry from bios table.
- * @smbios_start: where to start in the SMBIOS table
- * @smbios_table: location of the SMBIOS table
- * @curr: %NULL or pointer to previously returned structure
- *
- * Gets the first entry if previous == NULL;
- * otherwise, returns the next entry.
- * Uses global SMBIOS Table pointer.
- *
- * Returns a pointer to an SMBIOS structure or NULL if none found.
- */
-static void __iomem *get_subsequent_smbios_entry(void __iomem *smbios_start,
-						void __iomem *smbios_table,
-						void __iomem *curr)
-{
-	u8 bail = 0;
-	u8 previous_byte = 1;
-	void __iomem *p_temp;
-	void __iomem *p_max;
-
-	if (!smbios_table || !curr)
-		return NULL;
-
-	/* set p_max to the end of the table */
-	p_max = smbios_start + readw(smbios_table + ST_LENGTH);
-
-	p_temp = curr;
-	p_temp += readb(curr + SMBIOS_GENERIC_LENGTH);
-
-	while ((p_temp < p_max) && !bail) {
-		/* Look for the double NULL terminator
-		 * The first condition is the previous byte
-		 * and the second is the curr
-		 */
-		if (!previous_byte && !(readb(p_temp)))
-			bail = 1;
-
-		previous_byte = readb(p_temp);
-		p_temp++;
-	}
-
-	if (p_temp < p_max)
-		return p_temp;
-	else
-		return NULL;
-}
-
-
-/**
- * get_SMBIOS_entry - return the requested SMBIOS entry or %NULL
- * @smbios_start: where to start in the SMBIOS table
- * @smbios_table: location of the SMBIOS table
- * @type: SMBIOS structure type to be returned
- * @previous: %NULL or pointer to previously returned structure
- *
- * Gets the first entry of the specified type if previous == %NULL;
- * Otherwise, returns the next entry of the given type.
- * Uses global SMBIOS Table pointer.
- * Uses get_subsequent_smbios_entry.
- *
- * Returns a pointer to an SMBIOS structure or %NULL if none found.
- */
-static void __iomem *get_SMBIOS_entry(void __iomem *smbios_start,
-					void __iomem *smbios_table,
-					u8 type,
-					void __iomem *previous)
-{
-	if (!smbios_table)
-		return NULL;
-
-	if (!previous)
-		previous = smbios_start;
-	else
-		previous = get_subsequent_smbios_entry(smbios_start,
-					smbios_table, previous);
-
-	while (previous)
-		if (readb(previous + SMBIOS_GENERIC_TYPE) != type)
-			previous = get_subsequent_smbios_entry(smbios_start,
-						smbios_table, previous);
-		else
-			break;
-
-	return previous;
-}
-
 static void release_slot(struct hotplug_slot *hotplug_slot)
 {
 	struct slot *slot = hotplug_slot->private;
@@ -596,9 +469,26 @@ static struct hotplug_slot_ops cpqphp_hotplug_slot_ops = {
 
 #define SLOT_NAME_SIZE 10
 
-static int ctrl_slot_setup(struct controller *ctrl,
-			void __iomem *smbios_start,
-			void __iomem *smbios_table)
+static int cpqphp_find_smbios_slot(const union smbios_struct *ss, void *data)
+{
+	struct slot *slot = data;
+
+	/* Don't do anything if an SMBIOS struct has already been found */
+	if (slot->ss)
+		return SMBIOS_WALK_CONTINUE;
+
+	if (ss->header.type != 9)
+		return SMBIOS_WALK_CONTINUE;
+
+	if (slot->number == ss->type9.slot_id) {
+		slot->ss = ss;
+		return SMBIOS_WALK_STOP;
+	}
+
+	return SMBIOS_WALK_CONTINUE;
+}
+
+static int ctrl_slot_setup(struct controller *ctrl)
 {
 	struct slot *slot;
 	struct hotplug_slot *hotplug_slot;
@@ -610,7 +500,6 @@ static int ctrl_slot_setup(struct controller *ctrl,
 	u8 ctrl_slot;
 	u32 tempdword;
 	char name[SLOT_NAME_SIZE];
-	void __iomem *slot_entry= NULL;
 	int result = -ENOMEM;
 
 	dbg("%s\n", __func__);
@@ -644,16 +533,8 @@ static int ctrl_slot_setup(struct controller *ctrl,
 		slot->number = slot_number;
 		dbg("slot->number = %u\n", slot->number);
 
-		slot_entry = get_SMBIOS_entry(smbios_start, smbios_table, 9,
-					slot_entry);
-
-		while (slot_entry && (readw(slot_entry + SMBIOS_SLOT_NUMBER) !=
-				slot->number)) {
-			slot_entry = get_SMBIOS_entry(smbios_start,
-						smbios_table, 9, slot_entry);
-		}
-
-		slot->p_sm_slot = slot_entry;
+		/* match SMBIOS slot information */
+		smbios_walk(cpqphp_find_smbios_slot, slot);
 
 		init_timer(&slot->task_event);
 		slot->task_event.expires = jiffies + 5 * HZ;
@@ -764,44 +645,14 @@ static int one_time_init(void)
 	 * this also needs to be worked with Christoph
 	 * register_NMI_handler();
 	 */
-	/* Map rom address */
-	cpqhp_rom_start = ioremap(ROM_PHY_ADDR, ROM_PHY_LEN);
-	if (!cpqhp_rom_start) {
-		err ("Could not ioremap memory region for ROM\n");
-		retval = -EIO;
-		goto error;
-	}
 
 	/* Now, map the int15 entry point if we are on compaq specific
 	 * hardware
 	 */
 	compaq_nvram_init(cpqhp_rom_start);
 
-	/* Map smbios table entry point structure */
-	smbios_table = detect_SMBIOS_pointer(cpqhp_rom_start,
-					cpqhp_rom_start + ROM_PHY_LEN);
-	if (!smbios_table) {
-		err ("Could not find the SMBIOS pointer in memory\n");
-		retval = -EIO;
-		goto error_rom_start;
-	}
-
-	smbios_start = ioremap(readl(smbios_table + ST_ADDRESS),
-					readw(smbios_table + ST_LENGTH));
-	if (!smbios_start) {
-		err ("Could not ioremap memory region taken from SMBIOS values\n");
-		retval = -EIO;
-		goto error_smbios_start;
-	}
-
-	initialized = 1;
-
-	return retval;
-
-error_smbios_start:
-	iounmap(smbios_start);
-error_rom_start:
-	iounmap(cpqhp_rom_start);
+	if (!smbios_available)
+		retval = -ENODEV;
 error:
 	return retval;
 }
@@ -1190,7 +1041,7 @@ static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	ctrl->next_event = 0;
 
 	/* Setup the slot information structures */
-	rc = ctrl_slot_setup(ctrl, smbios_start, smbios_table);
+	rc = ctrl_slot_setup(ctrl);
 	if (rc) {
 		err(msg_initialization_err, 6);
 		err("%s: unable to save PCI configuration data, error %d\n",
@@ -1416,8 +1267,6 @@ static void __exit unload_cpqphpd(void)
 	/* unmap the rom address */
 	if (cpqhp_rom_start)
 		iounmap(cpqhp_rom_start);
-	if (smbios_start)
-		iounmap(smbios_start);
 }
 
 static struct pci_device_id hpcd_pci_tbl[] = {
diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c
index f02c34d..9525da1 100644
--- a/drivers/pci/intel-iommu.c
+++ b/drivers/pci/intel-iommu.c
@@ -38,7 +38,7 @@
 #include <linux/intel-iommu.h>
 #include <linux/syscore_ops.h>
 #include <linux/tboot.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include <linux/pci-ats.h>
 #include <asm/cacheflush.h>
 #include <asm/iommu.h>
@@ -2108,9 +2108,9 @@ static int iommu_prepare_identity_map(struct pci_dev *pdev,
 	if (end < start) {
 		WARN(1, "Your BIOS is broken; RMRR ends before it starts!\n"
 			"BIOS vendor: %s; Ver: %s; Product Version: %s\n",
-			dmi_get_system_info(DMI_BIOS_VENDOR),
-			dmi_get_system_info(DMI_BIOS_VERSION),
-		     dmi_get_system_info(DMI_PRODUCT_VERSION));
+			sysfw_lookup(SYSFW_BIOS_VENDOR),
+			sysfw_lookup(SYSFW_BIOS_VERSION),
+		     sysfw_lookup(SYSFW_PRODUCT_VERSION));
 		ret = -EIO;
 		goto error;
 	}
@@ -2119,9 +2119,9 @@ static int iommu_prepare_identity_map(struct pci_dev *pdev,
 		WARN(1, "Your BIOS is broken; RMRR exceeds permitted address width (%d bits)\n"
 		     "BIOS vendor: %s; Ver: %s; Product Version: %s\n",
 		     agaw_to_width(domain->agaw),
-		     dmi_get_system_info(DMI_BIOS_VENDOR),
-		     dmi_get_system_info(DMI_BIOS_VERSION),
-		     dmi_get_system_info(DMI_PRODUCT_VERSION));
+		     sysfw_lookup(SYSFW_BIOS_VENDOR),
+		     sysfw_lookup(SYSFW_BIOS_VERSION),
+		     sysfw_lookup(SYSFW_PRODUCT_VERSION));
 		ret = -EIO;
 		goto error;
 	}
@@ -4005,9 +4005,9 @@ static void __init check_tylersburg_isoch(void)
 	if (!vtisochctrl) {
 		WARN(1, "Your BIOS is broken; DMA routed to ISOCH DMAR unit but no TLB space.\n"
 		     "BIOS vendor: %s; Ver: %s; Product Version: %s\n",
-		     dmi_get_system_info(DMI_BIOS_VENDOR),
-		     dmi_get_system_info(DMI_BIOS_VERSION),
-		     dmi_get_system_info(DMI_PRODUCT_VERSION));
+		     sysfw_lookup(SYSFW_BIOS_VENDOR),
+		     sysfw_lookup(SYSFW_BIOS_VERSION),
+		     sysfw_lookup(SYSFW_PRODUCT_VERSION));
 		iommu_identity_mapping |= IDENTMAP_AZALIA;
 		return;
 	}
diff --git a/drivers/pci/pci-label.c b/drivers/pci/pci-label.c
index 77cb2a1..bb4f11c 100644
--- a/drivers/pci/pci-label.c
+++ b/drivers/pci/pci-label.c
@@ -20,7 +20,7 @@
  * information.
  */
 
-#include <linux/dmi.h>
+#include <linux/smbios.h>
 #include <linux/sysfs.h>
 #include <linux/pci.h>
 #include <linux/pci_ids.h>
@@ -34,59 +34,47 @@
 
 #define	DEVICE_LABEL_DSM	0x07
 
-#ifndef CONFIG_DMI
-
-static inline int
-pci_create_smbiosname_file(struct pci_dev *pdev)
-{
-	return -1;
-}
-
-static inline void
-pci_remove_smbiosname_file(struct pci_dev *pdev)
-{
-}
-
-#else
-
 enum smbios_attr_enum {
 	SMBIOS_ATTR_NONE = 0,
 	SMBIOS_ATTR_LABEL_SHOW,
 	SMBIOS_ATTR_INSTANCE_SHOW,
 };
 
+static int pci_label_smbios_walk(const union smbios_struct *ss, void *data)
+{
+	struct pci_dev *pdev = (struct pci_dev *)data;
+
+	if (ss->header.type != 41)
+		return SMBIOS_WALK_CONTINUE;
+
+	if ((pdev->bus->number == ss->type41.bus_number) &&
+	    (pdev->devfn == ss->type41.device_function_number))
+		return SMBIOS_WALK_STOP;
+
+	return SMBIOS_WALK_CONTINUE;
+}
+
+
 static mode_t
 find_smbios_instance_string(struct pci_dev *pdev, char *buf,
 			    enum smbios_attr_enum attribute)
 {
-	const struct dmi_device *dmi;
-	struct dmi_dev_onboard *donboard;
-	int bus;
-	int devfn;
-
-	bus = pdev->bus->number;
-	devfn = pdev->devfn;
-
-	dmi = NULL;
-	while ((dmi = dmi_find_device(DMI_DEV_TYPE_DEV_ONBOARD,
-				      NULL, dmi)) != NULL) {
-		donboard = dmi->device_data;
-		if (donboard && donboard->bus == bus &&
-					donboard->devfn == devfn) {
-			if (buf) {
-				if (attribute == SMBIOS_ATTR_INSTANCE_SHOW)
-					return scnprintf(buf, PAGE_SIZE,
-							 "%d\n",
-							 donboard->instance);
-				else if (attribute == SMBIOS_ATTR_LABEL_SHOW)
-					return scnprintf(buf, PAGE_SIZE,
-							 "%s\n",
-							 dmi->name);
-			}
-			return strlen(dmi->name);
-		}
-	}
-	return 0;
+	const char *str;
+	const union smbios_struct *ss;
+
+	ss = smbios_walk(pci_label_smbios_walk, pdev);
+	if (!ss)
+		return 0;
+
+	if (attribute == SMBIOS_ATTR_INSTANCE_SHOW)
+		return scnprintf(buf, PAGE_SIZE, "%d\n",
+				 ss->type41.device_type_instance);
+
+	str = smbios_get_string(ss, ss->type41.reference_designation);
+	if (attribute == SMBIOS_ATTR_LABEL_SHOW)
+		return scnprintf(buf, PAGE_SIZE, "%s\n", str);
+	/* SMBIOS_ATTR_NONE */
+	return strlen(str);
 }
 
 static mode_t
@@ -148,17 +136,19 @@ static struct attribute_group smbios_attr_group = {
 static int
 pci_create_smbiosname_file(struct pci_dev *pdev)
 {
+	if (!smbios_available)
+		return -1;
 	return sysfs_create_group(&pdev->dev.kobj, &smbios_attr_group);
 }
 
 static void
 pci_remove_smbiosname_file(struct pci_dev *pdev)
 {
+	if (!smbios_available)
+		return;
 	sysfs_remove_group(&pdev->dev.kobj, &smbios_attr_group);
 }
 
-#endif
-
 #ifndef CONFIG_ACPI
 
 static inline int
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
index 3a39bf1..6aff3aa 100644
--- a/drivers/pci/pci.h
+++ b/drivers/pci/pci.h
@@ -11,7 +11,7 @@
 extern int pci_uevent(struct device *dev, struct kobj_uevent_env *env);
 extern int pci_create_sysfs_dev_files(struct pci_dev *pdev);
 extern void pci_remove_sysfs_dev_files(struct pci_dev *pdev);
-#if !defined(CONFIG_DMI) && !defined(CONFIG_ACPI)
+#ifndef CONFIG_ACPI
 static inline void pci_create_firmware_label_files(struct pci_dev *pdev)
 { return; }
 static inline void pci_remove_firmware_label_files(struct pci_dev *pdev)
diff --git a/drivers/pci/pcie/portdrv_pci.c b/drivers/pci/pcie/portdrv_pci.c
index e0610bd..30ffd66 100644
--- a/drivers/pci/pcie/portdrv_pci.c
+++ b/drivers/pci/pcie/portdrv_pci.c
@@ -14,7 +14,7 @@
 #include <linux/init.h>
 #include <linux/pcieport_if.h>
 #include <linux/aer.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include <linux/pci-aspm.h>
 
 #include "portdrv.h"
@@ -330,7 +330,7 @@ static struct pci_driver pcie_portdriver = {
 	.driver.pm 	= PCIE_PORTDRV_PM_OPS,
 };
 
-static int __init dmi_pcie_pme_disable_msi(const struct dmi_system_id *d)
+static int __init id_pcie_pme_disable_msi(const struct sysfw_id *d)
 {
 	pr_notice("%s detected: will not use MSI for PCIe PME signaling\n",
 			d->ident);
@@ -338,20 +338,20 @@ static int __init dmi_pcie_pme_disable_msi(const struct dmi_system_id *d)
 	return 0;
 }
 
-static struct dmi_system_id __initdata pcie_portdrv_dmi_table[] = {
+static struct sysfw_id __initdata pcie_portdrv_id_table[] = {
 	/*
 	 * Boxes that should not use MSI for PCIe PME signaling.
 	 */
 	{
-	 .callback = dmi_pcie_pme_disable_msi,
-	 .ident = "MSI Wind U-100",
-	 .matches = {
-		     DMI_MATCH(DMI_SYS_VENDOR,
-		     		"MICRO-STAR INTERNATIONAL CO., LTD"),
-		     DMI_MATCH(DMI_PRODUCT_NAME, "U-100"),
-		     },
-	 },
-	 {}
+		.callback = id_pcie_pme_disable_msi,
+		.ident = "MSI Wind U-100",
+		.matches = {
+				SYSFW_MATCH(SYSFW_SYS_VENDOR,
+					   "MICRO-STAR INTERNATIONAL CO., LTD"),
+				SYSFW_MATCH(SYSFW_PRODUCT_NAME, "U-100"),
+		},
+	},
+	{}
 };
 
 static int __init pcie_portdrv_init(void)
@@ -361,7 +361,7 @@ static int __init pcie_portdrv_init(void)
 	if (pcie_ports_disabled)
 		return pci_register_driver(&pcie_portdriver);
 
-	dmi_check_system(pcie_portdrv_dmi_table);
+	sysfw_callback(pcie_portdrv_id_table);
 
 	retval = pcie_port_bus_register();
 	if (retval) {
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 02145e9..5ff7e9c 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -22,7 +22,7 @@
 #include <linux/delay.h>
 #include <linux/acpi.h>
 #include <linux/kallsyms.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include <linux/pci-aspm.h>
 #include <linux/ioport.h>
 #include <asm/dma.h>	/* isa_dma_bridge_buggy */
@@ -2343,19 +2343,36 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SERVERWORKS,
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_8132_BRIDGE,
 			 ht_enable_msi_mapping);
 
+static const struct sysfw_id __initdata nvenet_msi_disable_table[] = {
+	{
+		.ident = "5N32-SLI PREMIUM",
+		.matches = {
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "P5N32-SLI PREMIUM"),
+		},
+		.exactmatch = 1,
+	},
+	{
+		.ident = "P5N32-E SLI",
+		.matches = {
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "P5N32-E SLI"),
+		},
+		.exactmatch = 1,
+	},
+	{}
+};
+
 /* The P5N32-SLI motherboards from Asus have a problem with msi
  * for the MCP55 NIC. It is not yet determined whether the msi problem
  * also affects other devices. As for now, turn off msi for this device.
  */
 static void __devinit nvenet_msi_disable(struct pci_dev *dev)
 {
-	const char *board_name = dmi_get_system_info(DMI_BOARD_NAME);
+	const struct sysfw_id *id;
 
-	if (board_name &&
-	    (strstr(board_name, "P5N32-SLI PREMIUM") ||
-	     strstr(board_name, "P5N32-E SLI"))) {
+	id = sysfw_callback(nvenet_msi_disable_table);
+	if (id) {
 		dev_info(&dev->dev,
-			 "Disabling msi for MCP55 NIC on P5N32-SLI\n");
+			 "Disabling msi for MCP55 NIC on %s\n", id->ident);
 		dev->no_msi = 1;
 	}
 }
-- 
1.6.5.2


^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [PATCH 21/34] drivers/platform changes for SMBIOS and System  Firmware
  2011-07-18 13:08 [PATCH 00/34] System Firmware and SMBIOS Support [v3] Prarit Bhargava
                   ` (19 preceding siblings ...)
  2011-07-18 13:08 ` [PATCH 20/34] drivers/pci " Prarit Bhargava
@ 2011-07-18 13:08 ` Prarit Bhargava
  2011-08-11  4:30   ` Jonathan Woithe
  2011-07-18 13:08 ` [PATCH 22/34] drivers/pnp " Prarit Bhargava
                   ` (12 subsequent siblings)
  33 siblings, 1 reply; 48+ messages in thread
From: Prarit Bhargava @ 2011-07-18 13:08 UTC (permalink / raw)
  To: linux-kernel; +Cc: Prarit Bhargava, platform-driver-x86

- Replace old dmi* structures and functions with new sysfw* and smbios*
structures and functions in individual drivers
- cleanup sysfw_id lookup tables
- add exactmatch functionality
- edit udev notifiers
- cleanup of includes for dmi.h and mod_devicetable.h which were included in
some files that did not need them

[v2]: Re-exported dmi MODULE_ALIAS

Cc: platform-driver-x86@vger.kernel.org
Signed-off-by: Prarit Bhargava <prarit@redhat.com>
---
 drivers/platform/x86/acer-wmi.c       |  119 +++++++++++-----------
 drivers/platform/x86/acerhdf.c        |   18 +++-
 drivers/platform/x86/asus-laptop.c    |   29 +++---
 drivers/platform/x86/compal-laptop.c  |  106 +++++++++++---------
 drivers/platform/x86/dell-laptop.c    |   66 +++++++------
 drivers/platform/x86/dell-wmi.c       |   15 ++-
 drivers/platform/x86/eeepc-laptop.c   |   58 +++++++++--
 drivers/platform/x86/eeepc-wmi.c      |   30 +++---
 drivers/platform/x86/fujitsu-laptop.c |   41 ++++----
 drivers/platform/x86/hdaps.c          |   76 +++++++-------
 drivers/platform/x86/hp_accel.c       |   98 +++++++++---------
 drivers/platform/x86/ibm_rtl.c        |   21 ++--
 drivers/platform/x86/intel_oaktrail.c |   15 ++--
 drivers/platform/x86/msi-laptop.c     |  115 +++++++++++---------
 drivers/platform/x86/samsung-laptop.c |  183 +++++++++++++++++----------------
 drivers/platform/x86/sony-laptop.c    |   16 ++--
 drivers/platform/x86/thinkpad_acpi.c  |   64 ++++++------
 17 files changed, 580 insertions(+), 490 deletions(-)

diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c
index e1c4938..3a9dba1 100644
--- a/drivers/platform/x86/acer-wmi.c
+++ b/drivers/platform/x86/acer-wmi.c
@@ -28,7 +28,8 @@
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/types.h>
-#include <linux/dmi.h>
+#include <linux/smbios.h>
+#include <linux/sysfw.h>
 #include <linux/fb.h>
 #include <linux/backlight.h>
 #include <linux/leds.h>
@@ -278,9 +279,9 @@ static void set_quirks(void)
 		interface->capability |= ACER_CAP_BRIGHTNESS;
 }
 
-static int dmi_matched(const struct dmi_system_id *dmi)
+static int quirk_matched(const struct sysfw_id *quirk)
 {
-	quirks = dmi->driver_data;
+	quirks = quirk->driver_data;
 	return 1;
 }
 
@@ -305,148 +306,148 @@ static struct quirk_entry quirk_fujitsu_amilo_li_1718 = {
 };
 
 /* The Aspire One has a dummy ACPI-WMI interface - disable it */
-static struct dmi_system_id __devinitdata acer_blacklist[] = {
+static struct sysfw_id __devinitdata acer_blacklist[] = {
 	{
 		.ident = "Acer Aspire One (SSD)",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "AOA110"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Acer"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "AOA110"),
 		},
 	},
 	{
 		.ident = "Acer Aspire One (HDD)",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "AOA150"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Acer"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "AOA150"),
 		},
 	},
 	{}
 };
 
-static struct dmi_system_id acer_quirks[] = {
+static struct sysfw_id acer_quirks[] = {
 	{
-		.callback = dmi_matched,
+		.callback = quirk_matched,
 		.ident = "Acer Aspire 1360",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 1360"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Acer"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Aspire 1360"),
 		},
 		.driver_data = &quirk_acer_aspire_1520,
 	},
 	{
-		.callback = dmi_matched,
+		.callback = quirk_matched,
 		.ident = "Acer Aspire 1520",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 1520"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Acer"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Aspire 1520"),
 		},
 		.driver_data = &quirk_acer_aspire_1520,
 	},
 	{
-		.callback = dmi_matched,
+		.callback = quirk_matched,
 		.ident = "Acer Aspire 3100",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 3100"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Acer"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Aspire 3100"),
 		},
 		.driver_data = &quirk_acer_travelmate_2490,
 	},
 	{
-		.callback = dmi_matched,
+		.callback = quirk_matched,
 		.ident = "Acer Aspire 3610",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 3610"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Acer"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Aspire 3610"),
 		},
 		.driver_data = &quirk_acer_travelmate_2490,
 	},
 	{
-		.callback = dmi_matched,
+		.callback = quirk_matched,
 		.ident = "Acer Aspire 5100",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5100"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Acer"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Aspire 5100"),
 		},
 		.driver_data = &quirk_acer_travelmate_2490,
 	},
 	{
-		.callback = dmi_matched,
+		.callback = quirk_matched,
 		.ident = "Acer Aspire 5610",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5610"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Acer"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Aspire 5610"),
 		},
 		.driver_data = &quirk_acer_travelmate_2490,
 	},
 	{
-		.callback = dmi_matched,
+		.callback = quirk_matched,
 		.ident = "Acer Aspire 5630",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5630"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Acer"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Aspire 5630"),
 		},
 		.driver_data = &quirk_acer_travelmate_2490,
 	},
 	{
-		.callback = dmi_matched,
+		.callback = quirk_matched,
 		.ident = "Acer Aspire 5650",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5650"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Acer"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Aspire 5650"),
 		},
 		.driver_data = &quirk_acer_travelmate_2490,
 	},
 	{
-		.callback = dmi_matched,
+		.callback = quirk_matched,
 		.ident = "Acer Aspire 5680",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5680"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Acer"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Aspire 5680"),
 		},
 		.driver_data = &quirk_acer_travelmate_2490,
 	},
 	{
-		.callback = dmi_matched,
+		.callback = quirk_matched,
 		.ident = "Acer Aspire 9110",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 9110"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Acer"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Aspire 9110"),
 		},
 		.driver_data = &quirk_acer_travelmate_2490,
 	},
 	{
-		.callback = dmi_matched,
+		.callback = quirk_matched,
 		.ident = "Acer TravelMate 2490",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 2490"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Acer"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "TravelMate 2490"),
 		},
 		.driver_data = &quirk_acer_travelmate_2490,
 	},
 	{
-		.callback = dmi_matched,
+		.callback = quirk_matched,
 		.ident = "Acer TravelMate 4200",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 4200"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Acer"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "TravelMate 4200"),
 		},
 		.driver_data = &quirk_acer_travelmate_2490,
 	},
 	{
-		.callback = dmi_matched,
+		.callback = quirk_matched,
 		.ident = "Fujitsu Siemens Amilo Li 1718",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "AMILO Li 1718"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "FUJITSU SIEMENS"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "AMILO Li 1718"),
 		},
 		.driver_data = &quirk_fujitsu_amilo_li_1718,
 	},
 	{
-		.callback = dmi_matched,
+		.callback = quirk_matched,
 		.ident = "Medion MD 98300",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "MEDION"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "WAM2030"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "MEDION"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "WAM2030"),
 		},
 		.driver_data = &quirk_medion_md_98300,
 	},
@@ -457,7 +458,7 @@ static struct dmi_system_id acer_quirks[] = {
 static void find_quirks(void)
 {
 	if (!force_series) {
-		dmi_check_system(acer_quirks);
+		sysfw_callback(acer_quirks);
 	} else if (force_series == 2490) {
 		quirks = &quirk_acer_travelmate_2490;
 	}
@@ -848,16 +849,16 @@ static acpi_status WMID_set_u32(u32 value, u32 cap, struct wmi_interface *iface)
 	return WMI_execute_u32(method_id, (u32)value, NULL);
 }
 
-static void type_aa_dmi_decode(const struct dmi_header *header, void *dummy)
+static int type_aa_smbios_decode(const union smbios_struct *ss, void *dummy)
 {
 	struct hotkey_function_type_aa *type_aa;
 
 	/* We are looking for OEM-specific Type AAh */
-	if (header->type != 0xAA)
-		return;
+	if (ss->header.type != 0xAA)
+		return SMBIOS_WALK_CONTINUE;
 
 	has_type_aa = true;
-	type_aa = (struct hotkey_function_type_aa *) header;
+	type_aa = (struct hotkey_function_type_aa *) &ss->header;
 
 	pr_info("Function bitmap for Communication Button: 0x%x\n",
 		type_aa->commun_func_bitmap);
@@ -868,6 +869,8 @@ static void type_aa_dmi_decode(const struct dmi_header *header, void *dummy)
 		interface->capability |= ACER_CAP_THREEG;
 	if (type_aa->commun_func_bitmap & ACER_WMID3_GDS_BLUETOOTH)
 		interface->capability |= ACER_CAP_BLUETOOTH;
+
+	return SMBIOS_WALK_STOP;
 }
 
 static acpi_status WMID_set_capabilities(void)
@@ -893,7 +896,7 @@ static acpi_status WMID_set_capabilities(void)
 		return AE_ERROR;
 	}
 
-	dmi_walk(type_aa_dmi_decode, NULL);
+	smbios_walk(type_aa_smbios_decode, NULL);
 	if (!has_type_aa) {
 		interface->capability |= ACER_CAP_WIRELESS;
 		if (devices & 0x40)
@@ -1835,7 +1838,7 @@ static int __init acer_wmi_init(void)
 
 	pr_info("Acer Laptop ACPI-WMI Extras\n");
 
-	if (dmi_check_system(acer_blacklist)) {
+	if (sysfw_callback(acer_blacklist)) {
 		pr_info("Blacklisted hardware detected - not loading\n");
 		return -ENODEV;
 	}
diff --git a/drivers/platform/x86/acerhdf.c b/drivers/platform/x86/acerhdf.c
index fca3489..3f951fc 100644
--- a/drivers/platform/x86/acerhdf.c
+++ b/drivers/platform/x86/acerhdf.c
@@ -35,7 +35,7 @@
 
 #include <linux/kernel.h>
 #include <linux/module.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include <linux/acpi.h>
 #include <linux/thermal.h>
 #include <linux/platform_device.h>
@@ -544,9 +544,9 @@ static int acerhdf_check_hardware(void)
 	const struct bios_settings_t *bt = NULL;
 
 	/* get BIOS data */
-	vendor  = dmi_get_system_info(DMI_SYS_VENDOR);
-	version = dmi_get_system_info(DMI_BIOS_VERSION);
-	product = dmi_get_system_info(DMI_PRODUCT_NAME);
+	vendor  = sysfw_lookup(SYSFW_SYS_VENDOR);
+	version = sysfw_lookup(SYSFW_BIOS_VERSION);
+	product = sysfw_lookup(SYSFW_PRODUCT_NAME);
 
 	if (!vendor || !version || !product) {
 		pr_err("error getting hardware information\n");
@@ -712,6 +712,16 @@ MODULE_ALIAS("dmi:*:*Packard Bell*:pnAOA*:");
 MODULE_ALIAS("dmi:*:*Packard Bell*:pnDOA*:");
 MODULE_ALIAS("dmi:*:*Packard Bell*:pnDOTMU*:");
 MODULE_ALIAS("dmi:*:*Packard Bell*:pnDOTMA*:");
+MODULE_ALIAS("sysfw:*:*Acer*:pnAOA*:");
+MODULE_ALIAS("sysfw:*:*Acer*:pnAspire 1410*:");
+MODULE_ALIAS("sysfw:*:*Acer*:pnAspire 1810*:");
+MODULE_ALIAS("sysfw:*:*Acer*:pnAO531*:");
+MODULE_ALIAS("sysfw:*:*Gateway*:pnAOA*:");
+MODULE_ALIAS("sysfw:*:*Gateway*:pnLT31*:");
+MODULE_ALIAS("sysfw:*:*Packard Bell*:pnAOA*:");
+MODULE_ALIAS("sysfw:*:*Packard Bell*:pnDOA*:");
+MODULE_ALIAS("sysfw:*:*Packard Bell*:pnDOTMU*:");
+MODULE_ALIAS("sysfw:*:*Packard Bell*:pnDOTMA*:");
 
 module_init(acerhdf_init);
 module_exit(acerhdf_exit);
diff --git a/drivers/platform/x86/asus-laptop.c b/drivers/platform/x86/asus-laptop.c
index d65df92..1841e01 100644
--- a/drivers/platform/x86/asus-laptop.c
+++ b/drivers/platform/x86/asus-laptop.c
@@ -50,7 +50,7 @@
 #include <linux/input/sparse-keymap.h>
 #include <linux/rfkill.h>
 #include <linux/slab.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include <acpi/acpi_drivers.h>
 #include <acpi/acpi_bus.h>
 
@@ -1401,19 +1401,16 @@ static int __devinit asus_acpi_init(struct asus_laptop *asus)
 	return result;
 }
 
-static void __devinit asus_dmi_check(void)
-{
-	const char *model;
-
-	model = dmi_get_system_info(DMI_PRODUCT_NAME);
-	if (!model)
-		return;
-
-	/* On L1400B WLED control the sound card, don't mess with it ... */
-	if (strncmp(model, "L1400B", 6) == 0) {
-		wlan_status = -1;
-	}
-}
+static struct sysfw_id asus_wlan_table[] = {
+	{
+		 .ident = "L1400B",
+		.matches = {
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "L1400B"),
+		},
+		.exactmatch = 1,
+	},
+	{},
+};
 
 static bool asus_device_present;
 
@@ -1433,7 +1430,9 @@ static int __devinit asus_acpi_add(struct acpi_device *device)
 	device->driver_data = asus;
 	asus->device = device;
 
-	asus_dmi_check();
+	/* On L1400B WLED control the sound card, don't mess with it ... */
+	if (sysfw_callback(asus_wlan_table))
+		wlan_status = -1;
 
 	result = asus_acpi_init(asus);
 	if (result)
diff --git a/drivers/platform/x86/compal-laptop.c b/drivers/platform/x86/compal-laptop.c
index 8877b83..3d6e37e 100644
--- a/drivers/platform/x86/compal-laptop.c
+++ b/drivers/platform/x86/compal-laptop.c
@@ -46,7 +46,7 @@
  *
  * This driver might work on other laptops produced by Compal. If you
  * want to try it you can pass force=1 as argument to the module which
- * will force it to load even when the DMI data doesn't identify the
+ * will force it to load even when the SMBIOS data doesn't identify the
  * laptop as compatible.
  *
  * Lots of data available at:
@@ -74,7 +74,7 @@
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/acpi.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include <linux/backlight.h>
 #include <linux/platform_device.h>
 #include <linux/rfkill.h>
@@ -191,7 +191,7 @@ struct compal_data{
 /* =============== */
 static int force;
 module_param(force, bool, 0);
-MODULE_PARM_DESC(force, "Force driver load, ignore DMI data");
+MODULE_PARM_DESC(force, "Force driver load, ignore SMBIOS data");
 
 /* Support for the wake_on_XXX, hwmon and power_supply interface. Currently
  * only gets enabled on a JHL90 board. Might work with the others too */
@@ -760,14 +760,14 @@ static struct rfkill *bt_rfkill;
 /* Initialization & clean-up functions */
 /* =================================== */
 
-static int dmi_check_cb(const struct dmi_system_id *id)
+static int id_check_cb(const struct sysfw_id *id)
 {
 	pr_info("Identified laptop model '%s'\n", id->ident);
 	extra_features = false;
 	return 1;
 }
 
-static int dmi_check_cb_extra(const struct dmi_system_id *id)
+static int id_check_cb_extra(const struct sysfw_id *id)
 {
 	pr_info("Identified laptop model '%s', enabling extra features\n",
 		id->ident);
@@ -775,112 +775,112 @@ static int dmi_check_cb_extra(const struct dmi_system_id *id)
 	return 1;
 }
 
-static struct dmi_system_id __initdata compal_dmi_table[] = {
+static struct sysfw_id __initdata compal_id_table[] = {
 	{
 		.ident = "FL90/IFL90",
 		.matches = {
-			DMI_MATCH(DMI_BOARD_NAME, "IFL90"),
-			DMI_MATCH(DMI_BOARD_VERSION, "IFT00"),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "IFL90"),
+			SYSFW_MATCH(SYSFW_BOARD_VERSION, "IFT00"),
 		},
-		.callback = dmi_check_cb
+		.callback = id_check_cb
 	},
 	{
 		.ident = "FL90/IFL90",
 		.matches = {
-			DMI_MATCH(DMI_BOARD_NAME, "IFL90"),
-			DMI_MATCH(DMI_BOARD_VERSION, "REFERENCE"),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "IFL90"),
+			SYSFW_MATCH(SYSFW_BOARD_VERSION, "REFERENCE"),
 		},
-		.callback = dmi_check_cb
+		.callback = id_check_cb
 	},
 	{
 		.ident = "FL91/IFL91",
 		.matches = {
-			DMI_MATCH(DMI_BOARD_NAME, "IFL91"),
-			DMI_MATCH(DMI_BOARD_VERSION, "IFT00"),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "IFL91"),
+			SYSFW_MATCH(SYSFW_BOARD_VERSION, "IFT00"),
 		},
-		.callback = dmi_check_cb
+		.callback = id_check_cb
 	},
 	{
 		.ident = "FL92/JFL92",
 		.matches = {
-			DMI_MATCH(DMI_BOARD_NAME, "JFL92"),
-			DMI_MATCH(DMI_BOARD_VERSION, "IFT00"),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "JFL92"),
+			SYSFW_MATCH(SYSFW_BOARD_VERSION, "IFT00"),
 		},
-		.callback = dmi_check_cb
+		.callback = id_check_cb
 	},
 	{
 		.ident = "FT00/IFT00",
 		.matches = {
-			DMI_MATCH(DMI_BOARD_NAME, "IFT00"),
-			DMI_MATCH(DMI_BOARD_VERSION, "IFT00"),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "IFT00"),
+			SYSFW_MATCH(SYSFW_BOARD_VERSION, "IFT00"),
 		},
-		.callback = dmi_check_cb
+		.callback = id_check_cb
 	},
 	{
 		.ident = "Dell Mini 9",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 910"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell Inc."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Inspiron 910"),
 		},
-		.callback = dmi_check_cb
+		.callback = id_check_cb
 	},
 	{
 		.ident = "Dell Mini 10",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 1010"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell Inc."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Inspiron 1010"),
 		},
-		.callback = dmi_check_cb
+		.callback = id_check_cb
 	},
 	{
 		.ident = "Dell Mini 10v",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 1011"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell Inc."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Inspiron 1011"),
 		},
-		.callback = dmi_check_cb
+		.callback = id_check_cb
 	},
 	{
 		.ident = "Dell Mini 1012",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 1012"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell Inc."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Inspiron 1012"),
 		},
-		.callback = dmi_check_cb
+		.callback = id_check_cb
 	},
 	{
 		.ident = "Dell Inspiron 11z",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 1110"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell Inc."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Inspiron 1110"),
 		},
-		.callback = dmi_check_cb
+		.callback = id_check_cb
 	},
 	{
 		.ident = "Dell Mini 12",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 1210"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell Inc."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Inspiron 1210"),
 		},
-		.callback = dmi_check_cb
+		.callback = id_check_cb
 	},
 	{
 		.ident = "JHL90",
 		.matches = {
-			DMI_MATCH(DMI_BOARD_NAME, "JHL90"),
-			DMI_MATCH(DMI_BOARD_VERSION, "REFERENCE"),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "JHL90"),
+			SYSFW_MATCH(SYSFW_BOARD_VERSION, "REFERENCE"),
 		},
-		.callback = dmi_check_cb_extra
+		.callback = id_check_cb_extra
 	},
 	{
 		.ident = "KHLB2",
 		.matches = {
-			DMI_MATCH(DMI_BOARD_NAME, "KHLB2"),
-			DMI_MATCH(DMI_BOARD_VERSION, "REFERENCE"),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "KHLB2"),
+			SYSFW_MATCH(SYSFW_BOARD_VERSION, "REFERENCE"),
 		},
-		.callback = dmi_check_cb_extra
+		.callback = id_check_cb_extra
 	},
-	{ }
+	{}
 };
 
 static void initialize_power_supply_data(struct compal_data *data)
@@ -960,7 +960,7 @@ static int __init compal_init(void)
 		return -ENODEV;
 	}
 
-	if (!force && !dmi_check_system(compal_dmi_table)) {
+	if (!force && !sysfw_callback(compal_id_table)) {
 		pr_err("Motherboard not recognized (You could try the module's force-parameter)\n");
 		return -ENODEV;
 	}
@@ -1110,3 +1110,15 @@ MODULE_ALIAS("dmi:*:svnDellInc.:pnInspiron1011:*");
 MODULE_ALIAS("dmi:*:svnDellInc.:pnInspiron1012:*");
 MODULE_ALIAS("dmi:*:svnDellInc.:pnInspiron1110:*");
 MODULE_ALIAS("dmi:*:svnDellInc.:pnInspiron1210:*");
+MODULE_ALIAS("sysfw:*:rnIFL90:rvrIFT00:*");
+MODULE_ALIAS("sysfw:*:rnIFL90:rvrREFERENCE:*");
+MODULE_ALIAS("sysfw:*:rnIFL91:rvrIFT00:*");
+MODULE_ALIAS("sysfw:*:rnJFL92:rvrIFT00:*");
+MODULE_ALIAS("sysfw:*:rnIFT00:rvrIFT00:*");
+MODULE_ALIAS("sysfw:*:rnJHL90:rvrREFERENCE:*");
+MODULE_ALIAS("sysfw:*:svnDellInc.:pnInspiron910:*");
+MODULE_ALIAS("sysfw:*:svnDellInc.:pnInspiron1010:*");
+MODULE_ALIAS("sysfw:*:svnDellInc.:pnInspiron1011:*");
+MODULE_ALIAS("sysfw:*:svnDellInc.:pnInspiron1012:*");
+MODULE_ALIAS("sysfw:*:svnDellInc.:pnInspiron1110:*");
+MODULE_ALIAS("sysfw:*:svnDellInc.:pnInspiron1210:*");
diff --git a/drivers/platform/x86/dell-laptop.c b/drivers/platform/x86/dell-laptop.c
index e39ab1d..53a83a6 100644
--- a/drivers/platform/x86/dell-laptop.c
+++ b/drivers/platform/x86/dell-laptop.c
@@ -19,7 +19,8 @@
 #include <linux/platform_device.h>
 #include <linux/backlight.h>
 #include <linux/err.h>
-#include <linux/dmi.h>
+#include <linux/smbios.h>
+#include <linux/sysfw.h>
 #include <linux/io.h>
 #include <linux/rfkill.h>
 #include <linux/power_supply.h>
@@ -53,7 +54,7 @@ struct calling_interface_token {
 };
 
 struct calling_interface_structure {
-	struct dmi_header header;
+	struct smbios_header header;
 	u16 cmdIOAddress;
 	u8 cmdIOCode;
 	u32 supportedCmds;
@@ -78,72 +79,73 @@ static struct rfkill *wifi_rfkill;
 static struct rfkill *bluetooth_rfkill;
 static struct rfkill *wwan_rfkill;
 
-static const struct dmi_system_id __initdata dell_device_table[] = {
+static const struct sysfw_id __initdata dell_device_table[] = {
 	{
 		.ident = "Dell laptop",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-			DMI_MATCH(DMI_CHASSIS_TYPE, "8"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell Inc."),
+			SYSFW_MATCH(SYSFW_CHASSIS_TYPE, "8"),
 		},
 	},
 	{
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-			DMI_MATCH(DMI_CHASSIS_TYPE, "9"), /*Laptop*/
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell Inc."),
+			SYSFW_MATCH(SYSFW_CHASSIS_TYPE, "9"), /*Laptop*/
 		},
 	},
 	{
 		.ident = "Dell Computer Corporation",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
-			DMI_MATCH(DMI_CHASSIS_TYPE, "8"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR,
+				    "Dell Computer Corporation"),
+			SYSFW_MATCH(SYSFW_CHASSIS_TYPE, "8"),
 		},
 	},
-	{ }
+	{}
 };
 
-static struct dmi_system_id __devinitdata dell_blacklist[] = {
+static struct sysfw_id __devinitdata dell_blacklist[] = {
 	/* Supported by compal-laptop */
 	{
 		.ident = "Dell Mini 9",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 910"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell Inc."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Inspiron 910"),
 		},
 	},
 	{
 		.ident = "Dell Mini 10",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 1010"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell Inc."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Inspiron 1010"),
 		},
 	},
 	{
 		.ident = "Dell Mini 10v",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 1011"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell Inc."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Inspiron 1011"),
 		},
 	},
 	{
 		.ident = "Dell Mini 1012",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 1012"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell Inc."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Inspiron 1012"),
 		},
 	},
 	{
 		.ident = "Dell Inspiron 11z",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 1110"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell Inc."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Inspiron 1110"),
 		},
 	},
 	{
 		.ident = "Dell Mini 12",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 1210"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell Inc."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Inspiron 1210"),
 		},
 	},
 	{}
@@ -166,7 +168,7 @@ static void release_buffer(void)
 	mutex_unlock(&buffer_mutex);
 }
 
-static void __init parse_da_table(const struct dmi_header *dm)
+static void __init parse_da_table(const struct smbios_header *dm)
 {
 	/* Final token is a terminator, so we don't want to copy it */
 	int tokens = (dm->length-11)/sizeof(struct calling_interface_token)-1;
@@ -195,9 +197,9 @@ static void __init parse_da_table(const struct dmi_header *dm)
 	da_num_tokens += tokens;
 }
 
-static void __init find_tokens(const struct dmi_header *dm, void *dummy)
+static int __init find_tokens(const union smbios_struct *ss, void *dummy)
 {
-	switch (dm->type) {
+	switch (ss->header.type) {
 	case 0xd4: /* Indexed IO */
 		break;
 	case 0xd5: /* Protected Area Type 1 */
@@ -205,9 +207,10 @@ static void __init find_tokens(const struct dmi_header *dm, void *dummy)
 	case 0xd6: /* Protected Area Type 2 */
 		break;
 	case 0xda: /* Calling interface */
-		parse_da_table(dm);
+		parse_da_table(&ss->header);
 		break;
 	}
+	return SMBIOS_WALK_CONTINUE;
 }
 
 static int find_token_location(int tokenid)
@@ -415,7 +418,7 @@ static int __init dell_setup_rfkill(void)
 	int status;
 	int ret;
 
-	if (dmi_check_system(dell_blacklist)) {
+	if (sysfw_callback(dell_blacklist)) {
 		pr_info("Blacklisted hardware detected - not enabling rfkill\n");
 		return 0;
 	}
@@ -581,10 +584,10 @@ static int __init dell_init(void)
 	int max_intensity = 0;
 	int ret;
 
-	if (!dmi_check_system(dell_device_table))
+	if (!sysfw_callback(dell_device_table))
 		return -ENODEV;
 
-	dmi_walk(find_tokens, NULL);
+	smbios_walk(find_tokens, NULL);
 
 	if (!da_tokens)  {
 		pr_info("Unable to find dmi tokens\n");
@@ -714,3 +717,6 @@ MODULE_LICENSE("GPL");
 MODULE_ALIAS("dmi:*svnDellInc.:*:ct8:*");
 MODULE_ALIAS("dmi:*svnDellInc.:*:ct9:*");
 MODULE_ALIAS("dmi:*svnDellComputerCorporation.:*:ct8:*");
+MODULE_ALIAS("sysfw:*svnDellInc.:*:ct8:*");
+MODULE_ALIAS("sysfw:*svnDellInc.:*:ct9:*");
+MODULE_ALIAS("sysfw:*svnDellComputerCorporation.:*:ct8:*");
diff --git a/drivers/platform/x86/dell-wmi.c b/drivers/platform/x86/dell-wmi.c
index ce79082..b71c908 100644
--- a/drivers/platform/x86/dell-wmi.c
+++ b/drivers/platform/x86/dell-wmi.c
@@ -35,7 +35,7 @@
 #include <acpi/acpi_drivers.h>
 #include <linux/acpi.h>
 #include <linux/string.h>
-#include <linux/dmi.h>
+#include <linux/smbios.h>
 
 MODULE_AUTHOR("Matthew Garrett <mjg@redhat.com>");
 MODULE_DESCRIPTION("Dell laptop WMI hotkeys driver");
@@ -103,7 +103,7 @@ struct dell_bios_keymap_entry {
 };
 
 struct dell_bios_hotkey_table {
-	struct dmi_header header;
+	struct smbios_header header;
 	struct dell_bios_keymap_entry keymap[];
 
 };
@@ -261,13 +261,16 @@ static void dell_wmi_input_destroy(void)
 	input_unregister_device(dell_wmi_input_dev);
 }
 
-static void __init find_hk_type(const struct dmi_header *dm, void *dummy)
+static int __init find_hk_type(const union smbios_struct *ss, void *dummy)
 {
-	if (dm->type == 0xb2 && dm->length > 6) {
+	if (ss->header.type == 0xb2 && ss->header.length > 6) {
 		dell_new_hk_type = true;
 		dell_bios_hotkey_table =
-			container_of(dm, struct dell_bios_hotkey_table, header);
+			container_of(&ss->header, struct dell_bios_hotkey_table,
+				     header);
+		return SMBIOS_WALK_STOP;
 	}
+	return SMBIOS_WALK_CONTINUE;
 }
 
 static int __init dell_wmi_init(void)
@@ -280,7 +283,7 @@ static int __init dell_wmi_init(void)
 		return -ENODEV;
 	}
 
-	dmi_walk(find_hk_type, NULL);
+	smbios_walk(find_hk_type, NULL);
 	acpi_video = acpi_video_backlight_support();
 
 	err = dell_wmi_input_setup();
diff --git a/drivers/platform/x86/eeepc-laptop.c b/drivers/platform/x86/eeepc-laptop.c
index 1c45d92..8fcc6f5 100644
--- a/drivers/platform/x86/eeepc-laptop.c
+++ b/drivers/platform/x86/eeepc-laptop.c
@@ -37,7 +37,7 @@
 #include <linux/pci.h>
 #include <linux/pci_hotplug.h>
 #include <linux/leds.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 
 #define EEEPC_LAPTOP_VERSION	"0.1"
 #define EEEPC_LAPTOP_NAME	"Eee PC Hotkey Driver"
@@ -1296,11 +1296,54 @@ static void eeepc_acpi_notify(struct acpi_device *device, u32 event)
 	}
 }
 
-static void eeepc_dmi_check(struct eeepc_laptop *eeepc)
+static struct sysfw_id eeepc_disable_cpufv_id[] = {
+	{
+		 .ident = "701",
+		.matches = {
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "701"),
+		},
+		.exactmatch = 1,
+	},
+	{
+		 .ident = "702",
+		.matches = {
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "702"),
+		},
+		.exactmatch = 1,
+	},
+	{},
+};
+
+static struct sysfw_id eeepc_wlan_hotplug_id[] = {
+	{
+		 .ident = "1005HA",
+		.matches = {
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "1005HA"),
+		},
+		.exactmatch = 1,
+	},
+	{
+		 .ident = "1201N",
+		.matches = {
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "1201N"),
+		},
+		.exactmatch = 1,
+	},
+	{
+		 .ident = "1005PE",
+		.matches = {
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "1005PE"),
+		},
+		.exactmatch = 1,
+	},
+	{},
+};
+
+static void eeepc_sysfw_check(struct eeepc_laptop *eeepc)
 {
 	const char *model;
 
-	model = dmi_get_system_info(DMI_PRODUCT_NAME);
+	model = sysfw_lookup(SYSFW_PRODUCT_NAME);
 	if (!model)
 		return;
 
@@ -1319,11 +1362,11 @@ static void eeepc_dmi_check(struct eeepc_laptop *eeepc)
 	 *
 	 * The hang has also been reported on a "702" (Model name "8G"?).
 	 *
-	 * We avoid dmi_check_system() / dmi_match(), because they use
+	 * We avoid sysfw_*() functions, because they use
 	 * substring matching.  We don't want to affect the "701SD"
 	 * and "701SDX" models, because they do support S.H.E.
 	 */
-	if (strcmp(model, "701") == 0 || strcmp(model, "702") == 0) {
+	if (sysfw_callback(eeepc_disable_cpufv_id)) {
 		eeepc->cpufv_disabled = true;
 		pr_info("model %s does not officially support setting cpu "
 			"speed\n", model);
@@ -1337,8 +1380,7 @@ static void eeepc_dmi_check(struct eeepc_laptop *eeepc)
 	 * hotplug code. In fact, current hotplug code seems to unplug another
 	 * device...
 	 */
-	if (strcmp(model, "1005HA") == 0 || strcmp(model, "1201N") == 0 ||
-	    strcmp(model, "1005PE") == 0) {
+	if (sysfw_callback(eeepc_wlan_hotplug_id)) {
 		eeepc->hotplug_disabled = true;
 		pr_info("wlan hotplug disabled\n");
 	}
@@ -1427,7 +1469,7 @@ static int __devinit eeepc_acpi_add(struct acpi_device *device)
 
 	eeepc->hotplug_disabled = hotplug_disabled;
 
-	eeepc_dmi_check(eeepc);
+	eeepc_sysfw_check(eeepc);
 
 	result = eeepc_acpi_init(eeepc);
 	if (result)
diff --git a/drivers/platform/x86/eeepc-wmi.c b/drivers/platform/x86/eeepc-wmi.c
index 4aa867a..8494074 100644
--- a/drivers/platform/x86/eeepc-wmi.c
+++ b/drivers/platform/x86/eeepc-wmi.c
@@ -31,7 +31,7 @@
 #include <linux/init.h>
 #include <linux/input.h>
 #include <linux/input/sparse-keymap.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include <acpi/acpi_bus.h>
 
 #include "asus-wmi.h"
@@ -116,14 +116,20 @@ static int eeepc_wmi_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static void eeepc_dmi_check(struct asus_wmi_driver *driver)
-{
-	const char *model;
-
-	model = dmi_get_system_info(DMI_PRODUCT_NAME);
-	if (!model)
-		return;
+static struct sysfw_id eeepc_wlan_hotplug_id[] = {
+	{
+		 .ident = "Asus 1000H",
+		.matches = {
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "1000H"),
+		},
+		.exactmatch = 1,
+	},
+	{},
+};
 
+static void eeepc_wmi_quirks(struct asus_wmi_driver *driver)
+{
+	driver->hotplug_wireless = hotplug_wireless;
 	/*
 	 * Whitelist for wlan hotplug
 	 *
@@ -132,18 +138,12 @@ static void eeepc_dmi_check(struct asus_wmi_driver *driver)
 	 * it seems that most of the laptops supported by asus-wmi
 	 * don't need to be on this list
 	 */
-	if (strcmp(model, "1000H") == 0) {
+	if (sysfw_callback(eeepc_wlan_hotplug_id)) {
 		driver->hotplug_wireless = true;
 		pr_info("wlan hotplug enabled\n");
 	}
 }
 
-static void eeepc_wmi_quirks(struct asus_wmi_driver *driver)
-{
-	driver->hotplug_wireless = hotplug_wireless;
-	eeepc_dmi_check(driver);
-}
-
 static struct asus_wmi_driver asus_wmi_driver = {
 	.name = EEEPC_WMI_FILE,
 	.owner = THIS_MODULE,
diff --git a/drivers/platform/x86/fujitsu-laptop.c b/drivers/platform/x86/fujitsu-laptop.c
index 6b26666..819324d 100644
--- a/drivers/platform/x86/fujitsu-laptop.c
+++ b/drivers/platform/x86/fujitsu-laptop.c
@@ -62,7 +62,7 @@
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/acpi.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include <linux/backlight.h>
 #include <linux/input.h>
 #include <linux/kfifo.h>
@@ -584,7 +584,7 @@ static struct platform_driver fujitsupf_driver = {
 		   }
 };
 
-static void dmi_check_cb_common(const struct dmi_system_id *id)
+static void id_check_cb_common(const struct sysfw_id *id)
 {
 	acpi_handle handle;
 	pr_info("Identified laptop model '%s'\n", id->ident);
@@ -599,53 +599,53 @@ static void dmi_check_cb_common(const struct dmi_system_id *id)
 	}
 }
 
-static int dmi_check_cb_s6410(const struct dmi_system_id *id)
+static int id_check_cb_s6410(const struct sysfw_id *id)
 {
-	dmi_check_cb_common(id);
+	id_check_cb_common(id);
 	fujitsu->keycode1 = KEY_SCREENLOCK;	/* "Lock" */
 	fujitsu->keycode2 = KEY_HELP;	/* "Mobility Center" */
 	return 1;
 }
 
-static int dmi_check_cb_s6420(const struct dmi_system_id *id)
+static int id_check_cb_s6420(const struct sysfw_id *id)
 {
-	dmi_check_cb_common(id);
+	id_check_cb_common(id);
 	fujitsu->keycode1 = KEY_SCREENLOCK;	/* "Lock" */
 	fujitsu->keycode2 = KEY_HELP;	/* "Mobility Center" */
 	return 1;
 }
 
-static int dmi_check_cb_p8010(const struct dmi_system_id *id)
+static int id_check_cb_p8010(const struct sysfw_id *id)
 {
-	dmi_check_cb_common(id);
+	id_check_cb_common(id);
 	fujitsu->keycode1 = KEY_HELP;	/* "Support" */
 	fujitsu->keycode3 = KEY_SWITCHVIDEOMODE;	/* "Presentation" */
 	fujitsu->keycode4 = KEY_WWW;	/* "Internet" */
 	return 1;
 }
 
-static struct dmi_system_id fujitsu_dmi_table[] = {
+static struct sysfw_id fujitsu_id_table[] = {
 	{
 	 .ident = "Fujitsu Siemens S6410",
 	 .matches = {
-		     DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
-		     DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK S6410"),
+		     SYSFW_MATCH(SYSFW_SYS_VENDOR, "FUJITSU SIEMENS"),
+		     SYSFW_MATCH(SYSFW_PRODUCT_NAME, "LIFEBOOK S6410"),
 		     },
-	 .callback = dmi_check_cb_s6410},
+	 .callback = id_check_cb_s6410},
 	{
 	 .ident = "Fujitsu Siemens S6420",
 	 .matches = {
-		     DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
-		     DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK S6420"),
+		     SYSFW_MATCH(SYSFW_SYS_VENDOR, "FUJITSU SIEMENS"),
+		     SYSFW_MATCH(SYSFW_PRODUCT_NAME, "LIFEBOOK S6420"),
 		     },
-	 .callback = dmi_check_cb_s6420},
+	 .callback = id_check_cb_s6420},
 	{
 	 .ident = "Fujitsu LifeBook P8010",
 	 .matches = {
-		     DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
-		     DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook P8010"),
+		     SYSFW_MATCH(SYSFW_SYS_VENDOR, "FUJITSU"),
+		     SYSFW_MATCH(SYSFW_PRODUCT_NAME, "LifeBook P8010"),
 		     },
-	 .callback = dmi_check_cb_p8010},
+	 .callback = id_check_cb_p8010},
 	{}
 };
 
@@ -1095,7 +1095,7 @@ static int __init fujitsu_init(void)
 	fujitsu->keycode2 = KEY_PROG2;
 	fujitsu->keycode3 = KEY_PROG3;
 	fujitsu->keycode4 = KEY_PROG4;
-	dmi_check_system(fujitsu_dmi_table);
+	sysfw_callback(fujitsu_id_table);
 
 	result = acpi_bus_register_driver(&acpi_fujitsu_driver);
 	if (result < 0) {
@@ -1239,6 +1239,9 @@ MODULE_LICENSE("GPL");
 MODULE_ALIAS("dmi:*:svnFUJITSUSIEMENS:*:pvr:rvnFUJITSU:rnFJNB1D3:*:cvrS6410:*");
 MODULE_ALIAS("dmi:*:svnFUJITSUSIEMENS:*:pvr:rvnFUJITSU:rnFJNB1E6:*:cvrS6420:*");
 MODULE_ALIAS("dmi:*:svnFUJITSU:*:pvr:rvnFUJITSU:rnFJNB19C:*:cvrS7020:*");
+MODULE_ALIAS("sysfw:*:svnFUJITSUSIEMENS:*:pvr:rvnFUJITSU:rnFJNB1D3:*:cvrS6410:*");
+MODULE_ALIAS("sysfw:*:svnFUJITSUSIEMENS:*:pvr:rvnFUJITSU:rnFJNB1E6:*:cvrS6420:*");
+MODULE_ALIAS("sysfw:*:svnFUJITSU:*:pvr:rvnFUJITSU:rnFJNB19C:*:cvrS7020:*");
 
 static struct pnp_device_id pnp_ids[] __used = {
 	{.id = "FUJ02bf"},
diff --git a/drivers/platform/x86/hdaps.c b/drivers/platform/x86/hdaps.c
index 5a34973..d705002 100644
--- a/drivers/platform/x86/hdaps.c
+++ b/drivers/platform/x86/hdaps.c
@@ -35,7 +35,7 @@
 #include <linux/mutex.h>
 #include <linux/module.h>
 #include <linux/timer.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include <linux/jiffies.h>
 #include <linux/io.h>
 
@@ -479,62 +479,62 @@ static struct attribute_group hdaps_attribute_group = {
 
 /* Module stuff */
 
-/* hdaps_dmi_match - found a match.  return one, short-circuiting the hunt. */
-static int __init hdaps_dmi_match(const struct dmi_system_id *id)
+/* hdaps_id_match - found a match.  return one, short-circuiting the hunt. */
+static int __init hdaps_id_match(const struct sysfw_id *id)
 {
 	pr_info("%s detected\n", id->ident);
 	return 1;
 }
 
-/* hdaps_dmi_match_invert - found an inverted match. */
-static int __init hdaps_dmi_match_invert(const struct dmi_system_id *id)
+/* hdaps_id_match_invert - found an inverted match. */
+static int __init hdaps_id_match_invert(const struct sysfw_id *id)
 {
 	hdaps_invert = (unsigned long)id->driver_data;
 	pr_info("inverting axis (%u) readings\n", hdaps_invert);
-	return hdaps_dmi_match(id);
+	return hdaps_id_match(id);
 }
 
-#define HDAPS_DMI_MATCH_INVERT(vendor, model, axes) {	\
+#define HDAPS_SYSFW_MATCH_INVERT(vendor, model, axes) {	\
 	.ident = vendor " " model,			\
-	.callback = hdaps_dmi_match_invert,		\
+	.callback = hdaps_id_match_invert,		\
 	.driver_data = (void *)axes,			\
 	.matches = {					\
-		DMI_MATCH(DMI_BOARD_VENDOR, vendor),	\
-		DMI_MATCH(DMI_PRODUCT_VERSION, model)	\
+		SYSFW_MATCH(SYSFW_BOARD_VENDOR, vendor),	\
+		SYSFW_MATCH(SYSFW_PRODUCT_VERSION, model)	\
 	}						\
 }
 
-#define HDAPS_DMI_MATCH_NORMAL(vendor, model)		\
-	HDAPS_DMI_MATCH_INVERT(vendor, model, 0)
+#define HDAPS_SYSFW_MATCH_NORMAL(vendor, model)		\
+	HDAPS_SYSFW_MATCH_INVERT(vendor, model, 0)
 
-/* Note that HDAPS_DMI_MATCH_NORMAL("ThinkPad T42") would match
+/* Note that HDAPS_SYSFW_MATCH_NORMAL("ThinkPad T42") would match
    "ThinkPad T42p", so the order of the entries matters.
    If your ThinkPad is not recognized, please update to latest
    BIOS. This is especially the case for some R52 ThinkPads. */
-static struct dmi_system_id __initdata hdaps_whitelist[] = {
-	HDAPS_DMI_MATCH_INVERT("IBM", "ThinkPad R50p", HDAPS_BOTH_AXES),
-	HDAPS_DMI_MATCH_NORMAL("IBM", "ThinkPad R50"),
-	HDAPS_DMI_MATCH_NORMAL("IBM", "ThinkPad R51"),
-	HDAPS_DMI_MATCH_NORMAL("IBM", "ThinkPad R52"),
-	HDAPS_DMI_MATCH_INVERT("LENOVO", "ThinkPad R61i", HDAPS_BOTH_AXES),
-	HDAPS_DMI_MATCH_INVERT("LENOVO", "ThinkPad R61", HDAPS_BOTH_AXES),
-	HDAPS_DMI_MATCH_INVERT("IBM", "ThinkPad T41p", HDAPS_BOTH_AXES),
-	HDAPS_DMI_MATCH_NORMAL("IBM", "ThinkPad T41"),
-	HDAPS_DMI_MATCH_INVERT("IBM", "ThinkPad T42p", HDAPS_BOTH_AXES),
-	HDAPS_DMI_MATCH_NORMAL("IBM", "ThinkPad T42"),
-	HDAPS_DMI_MATCH_NORMAL("IBM", "ThinkPad T43"),
-	HDAPS_DMI_MATCH_INVERT("LENOVO", "ThinkPad T400", HDAPS_BOTH_AXES),
-	HDAPS_DMI_MATCH_INVERT("LENOVO", "ThinkPad T60", HDAPS_BOTH_AXES),
-	HDAPS_DMI_MATCH_INVERT("LENOVO", "ThinkPad T61p", HDAPS_BOTH_AXES),
-	HDAPS_DMI_MATCH_INVERT("LENOVO", "ThinkPad T61", HDAPS_BOTH_AXES),
-	HDAPS_DMI_MATCH_NORMAL("IBM", "ThinkPad X40"),
-	HDAPS_DMI_MATCH_INVERT("IBM", "ThinkPad X41", HDAPS_Y_AXIS),
-	HDAPS_DMI_MATCH_INVERT("LENOVO", "ThinkPad X60", HDAPS_BOTH_AXES),
-	HDAPS_DMI_MATCH_INVERT("LENOVO", "ThinkPad X61s", HDAPS_BOTH_AXES),
-	HDAPS_DMI_MATCH_INVERT("LENOVO", "ThinkPad X61", HDAPS_BOTH_AXES),
-	HDAPS_DMI_MATCH_NORMAL("IBM", "ThinkPad Z60m"),
-	HDAPS_DMI_MATCH_INVERT("LENOVO", "ThinkPad Z61m", HDAPS_BOTH_AXES),
-	HDAPS_DMI_MATCH_INVERT("LENOVO", "ThinkPad Z61p", HDAPS_BOTH_AXES),
+static struct sysfw_id __initdata hdaps_whitelist[] = {
+	HDAPS_SYSFW_MATCH_INVERT("IBM", "ThinkPad R50p", HDAPS_BOTH_AXES),
+	HDAPS_SYSFW_MATCH_NORMAL("IBM", "ThinkPad R50"),
+	HDAPS_SYSFW_MATCH_NORMAL("IBM", "ThinkPad R51"),
+	HDAPS_SYSFW_MATCH_NORMAL("IBM", "ThinkPad R52"),
+	HDAPS_SYSFW_MATCH_INVERT("LENOVO", "ThinkPad R61i", HDAPS_BOTH_AXES),
+	HDAPS_SYSFW_MATCH_INVERT("LENOVO", "ThinkPad R61", HDAPS_BOTH_AXES),
+	HDAPS_SYSFW_MATCH_INVERT("IBM", "ThinkPad T41p", HDAPS_BOTH_AXES),
+	HDAPS_SYSFW_MATCH_NORMAL("IBM", "ThinkPad T41"),
+	HDAPS_SYSFW_MATCH_INVERT("IBM", "ThinkPad T42p", HDAPS_BOTH_AXES),
+	HDAPS_SYSFW_MATCH_NORMAL("IBM", "ThinkPad T42"),
+	HDAPS_SYSFW_MATCH_NORMAL("IBM", "ThinkPad T43"),
+	HDAPS_SYSFW_MATCH_INVERT("LENOVO", "ThinkPad T400", HDAPS_BOTH_AXES),
+	HDAPS_SYSFW_MATCH_INVERT("LENOVO", "ThinkPad T60", HDAPS_BOTH_AXES),
+	HDAPS_SYSFW_MATCH_INVERT("LENOVO", "ThinkPad T61p", HDAPS_BOTH_AXES),
+	HDAPS_SYSFW_MATCH_INVERT("LENOVO", "ThinkPad T61", HDAPS_BOTH_AXES),
+	HDAPS_SYSFW_MATCH_NORMAL("IBM", "ThinkPad X40"),
+	HDAPS_SYSFW_MATCH_INVERT("IBM", "ThinkPad X41", HDAPS_Y_AXIS),
+	HDAPS_SYSFW_MATCH_INVERT("LENOVO", "ThinkPad X60", HDAPS_BOTH_AXES),
+	HDAPS_SYSFW_MATCH_INVERT("LENOVO", "ThinkPad X61s", HDAPS_BOTH_AXES),
+	HDAPS_SYSFW_MATCH_INVERT("LENOVO", "ThinkPad X61", HDAPS_BOTH_AXES),
+	HDAPS_SYSFW_MATCH_NORMAL("IBM", "ThinkPad Z60m"),
+	HDAPS_SYSFW_MATCH_INVERT("LENOVO", "ThinkPad Z61m", HDAPS_BOTH_AXES),
+	HDAPS_SYSFW_MATCH_INVERT("LENOVO", "ThinkPad Z61p", HDAPS_BOTH_AXES),
 	{ .ident = NULL }
 };
 
@@ -543,7 +543,7 @@ static int __init hdaps_init(void)
 	struct input_dev *idev;
 	int ret;
 
-	if (!dmi_check_system(hdaps_whitelist)) {
+	if (!sysfw_callback(hdaps_whitelist)) {
 		pr_warn("supported laptop not found!\n");
 		ret = -ENODEV;
 		goto out;
diff --git a/drivers/platform/x86/hp_accel.c b/drivers/platform/x86/hp_accel.c
index 1b52d00..6a47d3e 100644
--- a/drivers/platform/x86/hp_accel.c
+++ b/drivers/platform/x86/hp_accel.c
@@ -24,7 +24,7 @@
 
 #include <linux/kernel.h>
 #include <linux/init.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/platform_device.h>
@@ -146,10 +146,10 @@ int lis3lv02d_acpi_write(struct lis3lv02d *lis3, int reg, u8 val)
 	return 0;
 }
 
-static int lis3lv02d_dmi_matched(const struct dmi_system_id *dmi)
+static int lis3lv02d_id_matched(const struct sysfw_id *id)
 {
-	lis3_dev.ac = *((union axis_conversion *)dmi->driver_data);
-	pr_info("hardware type %s found\n", dmi->ident);
+	lis3_dev.ac = *((union axis_conversion *)id->driver_data);
+	pr_info("hardware type %s found\n", id->ident);
 
 	return 1;
 }
@@ -170,64 +170,64 @@ DEFINE_CONV(xy_swap_inverted, -2, -1, 3);
 DEFINE_CONV(xy_rotated_right, 2, -1, 3);
 DEFINE_CONV(xy_swap_yz_inverted, 2, -1, -3);
 
-#define AXIS_DMI_MATCH(_ident, _name, _axis) {		\
+#define AXIS_SYSFW_MATCH(_ident, _name, _axis) {	\
 	.ident = _ident,				\
-	.callback = lis3lv02d_dmi_matched,		\
+	.callback = lis3lv02d_id_matched,		\
 	.matches = {					\
-		DMI_MATCH(DMI_PRODUCT_NAME, _name)	\
+		SYSFW_MATCH(SYSFW_PRODUCT_NAME, _name)	\
 	},						\
 	.driver_data = &lis3lv02d_axis_##_axis		\
 }
 
-#define AXIS_DMI_MATCH2(_ident, _class1, _name1,	\
-				_class2, _name2,	\
-				_axis) {		\
+#define AXIS_SYSFW_MATCH2(_ident, _class1, _name1,	\
+			   _class2, _name2,		\
+			   _axis) {			\
 	.ident = _ident,				\
-	.callback = lis3lv02d_dmi_matched,		\
+	.callback = lis3lv02d_id_matched,		\
 	.matches = {					\
-		DMI_MATCH(DMI_##_class1, _name1),	\
-		DMI_MATCH(DMI_##_class2, _name2),	\
+		SYSFW_MATCH(SYSFW_##_class1, _name1),	\
+		SYSFW_MATCH(SYSFW_##_class2, _name2),	\
 	},						\
 	.driver_data = &lis3lv02d_axis_##_axis		\
 }
-static struct dmi_system_id lis3lv02d_dmi_ids[] = {
+static struct sysfw_id lis3lv02d_ids[] = {
 	/* product names are truncated to match all kinds of a same model */
-	AXIS_DMI_MATCH("NC64x0", "HP Compaq nc64", x_inverted),
-	AXIS_DMI_MATCH("NC84x0", "HP Compaq nc84", z_inverted),
-	AXIS_DMI_MATCH("NX9420", "HP Compaq nx9420", x_inverted),
-	AXIS_DMI_MATCH("NW9440", "HP Compaq nw9440", x_inverted),
-	AXIS_DMI_MATCH("NC2510", "HP Compaq 2510", y_inverted),
-	AXIS_DMI_MATCH("NC2710", "HP Compaq 2710", xy_swap),
-	AXIS_DMI_MATCH("NC8510", "HP Compaq 8510", xy_swap_inverted),
-	AXIS_DMI_MATCH("HP2133", "HP 2133", xy_rotated_left),
-	AXIS_DMI_MATCH("HP2140", "HP 2140", xy_swap_inverted),
-	AXIS_DMI_MATCH("NC653x", "HP Compaq 653", xy_rotated_left_usd),
-	AXIS_DMI_MATCH("NC6730b", "HP Compaq 6730b", xy_rotated_left_usd),
-	AXIS_DMI_MATCH("NC6730s", "HP Compaq 6730s", xy_swap),
-	AXIS_DMI_MATCH("NC651xx", "HP Compaq 651", xy_rotated_right),
-	AXIS_DMI_MATCH("NC6710x", "HP Compaq 6710", xy_swap_yz_inverted),
-	AXIS_DMI_MATCH("NC6715x", "HP Compaq 6715", y_inverted),
-	AXIS_DMI_MATCH("NC693xx", "HP EliteBook 693", xy_rotated_right),
-	AXIS_DMI_MATCH("NC693xx", "HP EliteBook 853", xy_swap),
+	AXIS_SYSFW_MATCH("NC64x0", "HP Compaq nc64", x_inverted),
+	AXIS_SYSFW_MATCH("NC84x0", "HP Compaq nc84", z_inverted),
+	AXIS_SYSFW_MATCH("NX9420", "HP Compaq nx9420", x_inverted),
+	AXIS_SYSFW_MATCH("NW9440", "HP Compaq nw9440", x_inverted),
+	AXIS_SYSFW_MATCH("NC2510", "HP Compaq 2510", y_inverted),
+	AXIS_SYSFW_MATCH("NC2710", "HP Compaq 2710", xy_swap),
+	AXIS_SYSFW_MATCH("NC8510", "HP Compaq 8510", xy_swap_inverted),
+	AXIS_SYSFW_MATCH("HP2133", "HP 2133", xy_rotated_left),
+	AXIS_SYSFW_MATCH("HP2140", "HP 2140", xy_swap_inverted),
+	AXIS_SYSFW_MATCH("NC653x", "HP Compaq 653", xy_rotated_left_usd),
+	AXIS_SYSFW_MATCH("NC6730b", "HP Compaq 6730b", xy_rotated_left_usd),
+	AXIS_SYSFW_MATCH("NC6730s", "HP Compaq 6730s", xy_swap),
+	AXIS_SYSFW_MATCH("NC651xx", "HP Compaq 651", xy_rotated_right),
+	AXIS_SYSFW_MATCH("NC6710x", "HP Compaq 6710", xy_swap_yz_inverted),
+	AXIS_SYSFW_MATCH("NC6715x", "HP Compaq 6715", y_inverted),
+	AXIS_SYSFW_MATCH("NC693xx", "HP EliteBook 693", xy_rotated_right),
+	AXIS_SYSFW_MATCH("NC693xx", "HP EliteBook 853", xy_swap),
 	/* Intel-based HP Pavilion dv5 */
-	AXIS_DMI_MATCH2("HPDV5_I",
-			PRODUCT_NAME, "HP Pavilion dv5",
-			BOARD_NAME, "3603",
-			x_inverted),
+	AXIS_SYSFW_MATCH2("HPDV5_I",
+			   PRODUCT_NAME, "HP Pavilion dv5",
+			   BOARD_NAME, "3603",
+			   x_inverted),
 	/* AMD-based HP Pavilion dv5 */
-	AXIS_DMI_MATCH2("HPDV5_A",
-			PRODUCT_NAME, "HP Pavilion dv5",
-			BOARD_NAME, "3600",
-			y_inverted),
-	AXIS_DMI_MATCH("DV7", "HP Pavilion dv7", x_inverted),
-	AXIS_DMI_MATCH("HP8710", "HP Compaq 8710", y_inverted),
-	AXIS_DMI_MATCH("HDX18", "HP HDX 18", x_inverted),
-	AXIS_DMI_MATCH("HPB432x", "HP ProBook 432", xy_rotated_left),
-	AXIS_DMI_MATCH("HPB442x", "HP ProBook 442", xy_rotated_left),
-	AXIS_DMI_MATCH("HPB452x", "HP ProBook 452", y_inverted),
-	AXIS_DMI_MATCH("HPB522x", "HP ProBook 522", xy_swap),
-	AXIS_DMI_MATCH("HPB532x", "HP ProBook 532", y_inverted),
-	AXIS_DMI_MATCH("Mini510x", "HP Mini 510", xy_rotated_left_usd),
+	AXIS_SYSFW_MATCH2("HPDV5_A",
+			   PRODUCT_NAME, "HP Pavilion dv5",
+			   BOARD_NAME, "3600",
+			   y_inverted),
+	AXIS_SYSFW_MATCH("DV7", "HP Pavilion dv7", x_inverted),
+	AXIS_SYSFW_MATCH("HP8710", "HP Compaq 8710", y_inverted),
+	AXIS_SYSFW_MATCH("HDX18", "HP HDX 18", x_inverted),
+	AXIS_SYSFW_MATCH("HPB432x", "HP ProBook 432", xy_rotated_left),
+	AXIS_SYSFW_MATCH("HPB442x", "HP ProBook 442", xy_rotated_left),
+	AXIS_SYSFW_MATCH("HPB452x", "HP ProBook 452", y_inverted),
+	AXIS_SYSFW_MATCH("HPB522x", "HP ProBook 522", xy_swap),
+	AXIS_SYSFW_MATCH("HPB532x", "HP ProBook 532", y_inverted),
+	AXIS_SYSFW_MATCH("Mini510x", "HP Mini 510", xy_rotated_left_usd),
 	{ NULL, }
 /* Laptop models without axis info (yet):
  * "NC6910" "HP Compaq 6910"
@@ -307,7 +307,7 @@ static int lis3lv02d_add(struct acpi_device *device)
 	if (lis3_dev.ac.x && lis3_dev.ac.y && lis3_dev.ac.z) {
 		pr_info("Using custom axes %d,%d,%d\n",
 			lis3_dev.ac.x, lis3_dev.ac.y, lis3_dev.ac.z);
-	} else if (dmi_check_system(lis3lv02d_dmi_ids) == 0) {
+	} else if (!sysfw_callback(lis3lv02d_ids)) {
 		pr_info("laptop model unknown, using default axes configuration\n");
 		lis3_dev.ac = lis3lv02d_axis_normal;
 	}
diff --git a/drivers/platform/x86/ibm_rtl.c b/drivers/platform/x86/ibm_rtl.c
index 811d436..570106c 100644
--- a/drivers/platform/x86/ibm_rtl.c
+++ b/drivers/platform/x86/ibm_rtl.c
@@ -29,14 +29,15 @@
 #include <linux/module.h>
 #include <linux/io.h>
 #include <linux/sysdev.h>
-#include <linux/dmi.h>
 #include <linux/efi.h>
 #include <linux/mutex.h>
+#include <linux/sysfw.h>
+
 #include <asm/bios_ebda.h>
 
 static bool force;
 module_param(force, bool, 0);
-MODULE_PARM_DESC(force, "Force driver load, ignore DMI data");
+MODULE_PARM_DESC(force, "Force driver load, ignore SMBIOS data");
 
 static bool debug;
 module_param(debug, bool, 0644);
@@ -237,14 +238,14 @@ static void rtl_teardown_sysfs(void) {
 	sysdev_class_unregister(&class_rtl);
 }
 
-
-static struct dmi_system_id __initdata ibm_rtl_dmi_table[] = {
-	{                                                  \
-		.matches = {                               \
-			DMI_MATCH(DMI_SYS_VENDOR, "IBM"),  \
-		},                                         \
+static struct sysfw_id __initdata ibm_rtl_smbios_table[] = {
+	{
+		.ident = "IBM",
+		.matches = {
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "IBM"),
+		},
 	},
-	{ }
+	{}
 };
 
 static int __init ibm_rtl_init(void) {
@@ -255,7 +256,7 @@ static int __init ibm_rtl_init(void) {
 	if (force)
 		pr_warn("module loaded by force\n");
 	/* first ensure that we are running on IBM HW */
-	else if (efi_enabled || !dmi_check_system(ibm_rtl_dmi_table))
+	else if (efi_enabled || !sysfw_callback(ibm_rtl_smbios_table))
 		return -ENODEV;
 
 	/* Get the address for the Extended BIOS Data Area */
diff --git a/drivers/platform/x86/intel_oaktrail.c b/drivers/platform/x86/intel_oaktrail.c
index 7f88c79..76f1c9d 100644
--- a/drivers/platform/x86/intel_oaktrail.c
+++ b/drivers/platform/x86/intel_oaktrail.c
@@ -48,7 +48,7 @@
 #include <linux/i2c.h>
 #include <linux/backlight.h>
 #include <linux/platform_device.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include <linux/rfkill.h>
 #include <acpi/acpi_bus.h>
 #include <acpi/acpi_drivers.h>
@@ -297,21 +297,21 @@ static struct platform_driver oaktrail_driver = {
 	.remove	= __devexit_p(oaktrail_remove)
 };
 
-static int dmi_check_cb(const struct dmi_system_id *id)
+static int system_check_cb(const struct sysfw_id *id)
 {
 	pr_info("Identified model '%s'\n", id->ident);
 	return 0;
 }
 
-static struct dmi_system_id __initdata oaktrail_dmi_table[] = {
+static struct sysfw_id __initdata oaktrail_system_table[] = {
 	{
 		.ident = "OakTrail platform",
 		.matches = {
-			DMI_MATCH(DMI_PRODUCT_NAME, "OakTrail platform"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "OakTrail platform"),
 		},
-		.callback = dmi_check_cb
+		.callback = system_check_cb
 	},
-	{ }
+	{}
 };
 
 static int __init oaktrail_init(void)
@@ -323,7 +323,7 @@ static int __init oaktrail_init(void)
 		return -ENODEV;
 	}
 
-	if (!force && !dmi_check_system(oaktrail_dmi_table)) {
+	if (!force && !sysfw_callback(oaktrail_system_table)) {
 		pr_err("Platform not recognized (You could try the module's force-parameter)");
 		return -ENODEV;
 	}
@@ -395,3 +395,4 @@ MODULE_DESCRIPTION("Intel Oaktrail Platform ACPI Extras");
 MODULE_VERSION(DRIVER_VERSION);
 MODULE_LICENSE("GPL");
 MODULE_ALIAS("dmi:*:svnIntelCorporation:pnOakTrailplatform:*");
+MODULE_ALIAS("sysfw:*:svnIntelCorporation:pnOakTrailplatform:*");
diff --git a/drivers/platform/x86/msi-laptop.c b/drivers/platform/x86/msi-laptop.c
index 3ff629d..d636560 100644
--- a/drivers/platform/x86/msi-laptop.c
+++ b/drivers/platform/x86/msi-laptop.c
@@ -47,7 +47,7 @@
  *
  * This driver might work on other laptops produced by MSI. If you
  * want to try it you can pass force=1 as argument to the module which
- * will force it to load even when the DMI data doesn't identify the
+ * will force it to load even when the SMBIOS data doesn't identify the
  * laptop as MSI S270. YMMV.
  */
 
@@ -57,7 +57,7 @@
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/acpi.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include <linux/backlight.h>
 #include <linux/platform_device.h>
 #include <linux/rfkill.h>
@@ -91,7 +91,7 @@ static int msi_laptop_resume(struct platform_device *device);
 
 static int force;
 module_param(force, bool, 0);
-MODULE_PARM_DESC(force, "Force driver load, ignore DMI data");
+MODULE_PARM_DESC(force, "Force driver load, ignore SMBIOS data");
 
 static int auto_brightness;
 module_param(auto_brightness, int, 0);
@@ -445,100 +445,103 @@ static struct platform_device *msipf_device;
 
 /* Initialization */
 
-static int dmi_check_cb(const struct dmi_system_id *id)
+static int id_check_cb(const struct sysfw_id *id)
 {
 	pr_info("Identified laptop model '%s'\n", id->ident);
 	return 1;
 }
 
-static struct dmi_system_id __initdata msi_dmi_table[] = {
+static struct sysfw_id __initdata msi_id_table[] = {
 	{
 		.ident = "MSI S270",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "MICRO-STAR INT'L CO.,LTD"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "MS-1013"),
-			DMI_MATCH(DMI_PRODUCT_VERSION, "0131"),
-			DMI_MATCH(DMI_CHASSIS_VENDOR,
-				  "MICRO-STAR INT'L CO.,LTD")
+			SYSFW_MATCH(SYSFW_SYS_VENDOR,
+				    "MICRO-STAR INT'L CO.,LTD"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "MS-1013"),
+			SYSFW_MATCH(SYSFW_PRODUCT_VERSION, "0131"),
+			SYSFW_MATCH(SYSFW_CHASSIS_VENDOR,
+				    "MICRO-STAR INT'L CO.,LTD")
 		},
-		.callback = dmi_check_cb
+		.callback = id_check_cb
 	},
 	{
 		.ident = "MSI S271",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Micro-Star International"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "MS-1058"),
-			DMI_MATCH(DMI_PRODUCT_VERSION, "0581"),
-			DMI_MATCH(DMI_BOARD_NAME, "MS-1058")
+			SYSFW_MATCH(SYSFW_SYS_VENDOR,
+				    "Micro-Star International"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "MS-1058"),
+			SYSFW_MATCH(SYSFW_PRODUCT_VERSION, "0581"),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "MS-1058")
 		},
-		.callback = dmi_check_cb
+		.callback = id_check_cb
 	},
 	{
 		.ident = "MSI S420",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Micro-Star International"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "MS-1412"),
-			DMI_MATCH(DMI_BOARD_VENDOR, "MSI"),
-			DMI_MATCH(DMI_BOARD_NAME, "MS-1412")
+			SYSFW_MATCH(SYSFW_SYS_VENDOR,
+				    "Micro-Star International"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "MS-1412"),
+			SYSFW_MATCH(SYSFW_BOARD_VENDOR, "MSI"),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "MS-1412")
 		},
-		.callback = dmi_check_cb
+		.callback = id_check_cb
 	},
 	{
 		.ident = "Medion MD96100",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "NOTEBOOK"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "SAM2000"),
-			DMI_MATCH(DMI_PRODUCT_VERSION, "0131"),
-			DMI_MATCH(DMI_CHASSIS_VENDOR,
-				  "MICRO-STAR INT'L CO.,LTD")
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "NOTEBOOK"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "SAM2000"),
+			SYSFW_MATCH(SYSFW_PRODUCT_VERSION, "0131"),
+			SYSFW_MATCH(SYSFW_CHASSIS_VENDOR,
+				    "MICRO-STAR INT'L CO.,LTD")
 		},
-		.callback = dmi_check_cb
+		.callback = id_check_cb
 	},
-	{ }
+	{}
 };
 
-static struct dmi_system_id __initdata msi_load_scm_models_dmi_table[] = {
+static struct sysfw_id __initdata msi_load_scm_models_id_table[] = {
 	{
 		.ident = "MSI N034",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR,
-				"MICRO-STAR INTERNATIONAL CO., LTD"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "MS-N034"),
-			DMI_MATCH(DMI_CHASSIS_VENDOR,
-			"MICRO-STAR INTERNATIONAL CO., LTD")
+			SYSFW_MATCH(SYSFW_SYS_VENDOR,
+				    "MICRO-STAR INTERNATIONAL CO., LTD"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "MS-N034"),
+			SYSFW_MATCH(SYSFW_CHASSIS_VENDOR,
+					    "MICRO-STAR INTERNATIONAL CO., LTD")
 		},
-		.callback = dmi_check_cb
+		.callback = id_check_cb
 	},
 	{
 		.ident = "MSI N051",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR,
-				"MICRO-STAR INTERNATIONAL CO., LTD"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "MS-N051"),
-			DMI_MATCH(DMI_CHASSIS_VENDOR,
-			"MICRO-STAR INTERNATIONAL CO., LTD")
+			SYSFW_MATCH(SYSFW_SYS_VENDOR,
+				    "MICRO-STAR INTERNATIONAL CO., LTD"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "MS-N051"),
+			SYSFW_MATCH(SYSFW_CHASSIS_VENDOR,
+					    "MICRO-STAR INTERNATIONAL CO., LTD")
 		},
-		.callback = dmi_check_cb
+		.callback = id_check_cb
 	},
 	{
 		.ident = "MSI N014",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR,
-				"MICRO-STAR INTERNATIONAL CO., LTD"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "MS-N014"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR,
+				    "MICRO-STAR INTERNATIONAL CO., LTD"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "MS-N014"),
 		},
-		.callback = dmi_check_cb
+		.callback = id_check_cb
 	},
 	{
 		.ident = "MSI CR620",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR,
-				"Micro-Star International"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "CR620"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR,
+				    "Micro-Star International"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "CR620"),
 		},
-		.callback = dmi_check_cb
+		.callback = id_check_cb
 	},
-	{ }
+	{}
 };
 
 static int rfkill_bluetooth_set(void *data, bool blocked)
@@ -860,13 +863,13 @@ static int __init msi_init(void)
 	if (acpi_disabled)
 		return -ENODEV;
 
-	if (force || dmi_check_system(msi_dmi_table))
+	if (force || sysfw_callback(msi_id_table))
 		old_ec_model = 1;
 
 	if (!old_ec_model)
 		get_threeg_exists();
 
-	if (!old_ec_model && dmi_check_system(msi_load_scm_models_dmi_table))
+	if (!old_ec_model && sysfw_callback(msi_load_scm_models_id_table))
 		load_scm_model = 1;
 
 	if (auto_brightness < 0 || auto_brightness > 2)
@@ -996,3 +999,11 @@ MODULE_ALIAS("dmi:*:svnMICRO-STARINTERNATIONAL*:pnMS-N034:*");
 MODULE_ALIAS("dmi:*:svnMICRO-STARINTERNATIONAL*:pnMS-N051:*");
 MODULE_ALIAS("dmi:*:svnMICRO-STARINTERNATIONAL*:pnMS-N014:*");
 MODULE_ALIAS("dmi:*:svnMicro-StarInternational*:pnCR620:*");
+MODULE_ALIAS("sysfw:*:svnMICRO-STARINT'LCO.,LTD:pnMS-1013:pvr0131*:cvnMICRO-STARINT'LCO.,LTD:ct10:*");
+MODULE_ALIAS("sysfw:*:svnMicro-StarInternational:pnMS-1058:pvr0581:rvnMSI:rnMS-1058:*:ct10:*");
+MODULE_ALIAS("sysfw:*:svnMicro-StarInternational:pnMS-1412:*:rvnMSI:rnMS-1412:*:cvnMICRO-STARINT'LCO.,LTD:ct10:*");
+MODULE_ALIAS("sysfw:*:svnNOTEBOOK:pnSAM2000:pvr0131*:cvnMICRO-STARINT'LCO.,LTD:ct10:*");
+MODULE_ALIAS("sysfw:*:svnMICRO-STARINTERNATIONAL*:pnMS-N034:*");
+MODULE_ALIAS("sysfw:*:svnMICRO-STARINTERNATIONAL*:pnMS-N051:*");
+MODULE_ALIAS("sysfw:*:svnMICRO-STARINTERNATIONAL*:pnMS-N014:*");
+MODULE_ALIAS("sysfw:*:svnMicro-StarInternational*:pnCR620:*");
diff --git a/drivers/platform/x86/samsung-laptop.c b/drivers/platform/x86/samsung-laptop.c
index d347116..80456c1 100644
--- a/drivers/platform/x86/samsung-laptop.c
+++ b/drivers/platform/x86/samsung-laptop.c
@@ -18,9 +18,9 @@
 #include <linux/pci.h>
 #include <linux/backlight.h>
 #include <linux/fb.h>
-#include <linux/dmi.h>
 #include <linux/platform_device.h>
 #include <linux/rfkill.h>
+#include <linux/sysfw.h>
 
 /*
  * This driver is needed because a number of Samsung laptops do not hook
@@ -230,7 +230,7 @@ static struct rfkill *rfk;
 static int force;
 module_param(force, bool, 0);
 MODULE_PARM_DESC(force,
-		"Disable the DMI check and forces the driver to be loaded");
+		"Disable the SMBIOS check and forces the driver to be loaded");
 
 static int debug;
 module_param(debug, bool, S_IRUGO | S_IWUSR);
@@ -492,183 +492,186 @@ static DEVICE_ATTR(performance_level, S_IWUSR | S_IRUGO,
 		   get_performance_level, set_performance_level);
 
 
-static int __init dmi_check_cb(const struct dmi_system_id *id)
+static int __init samsung_check_cb(const struct sysfw_id *id)
 {
-	pr_info("found laptop model '%s'\n",
-		id->ident);
+	pr_info("found laptop model '%s'\n", id->ident);
 	return 1;
 }
 
-static struct dmi_system_id __initdata samsung_dmi_table[] = {
+static struct sysfw_id __initdata samsung_id_table[] = {
 	{
 		.ident = "N128",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR,
-					"SAMSUNG ELECTRONICS CO., LTD."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "N128"),
-			DMI_MATCH(DMI_BOARD_NAME, "N128"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR,
+				    "SAMSUNG ELECTRONICS CO., LTD."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "N128"),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "N128"),
 		},
-		.callback = dmi_check_cb,
+		.callback = samsung_check_cb,
 	},
 	{
 		.ident = "N130",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR,
-					"SAMSUNG ELECTRONICS CO., LTD."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "N130"),
-			DMI_MATCH(DMI_BOARD_NAME, "N130"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR,
+				    "SAMSUNG ELECTRONICS CO., LTD."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "N130"),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "N130"),
 		},
-		.callback = dmi_check_cb,
+		.callback = samsung_check_cb,
 	},
 	{
 		.ident = "X125",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR,
-					"SAMSUNG ELECTRONICS CO., LTD."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "X125"),
-			DMI_MATCH(DMI_BOARD_NAME, "X125"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR,
+				    "SAMSUNG ELECTRONICS CO., LTD."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "X125"),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "X125"),
 		},
-		.callback = dmi_check_cb,
+		.callback = samsung_check_cb,
 	},
 	{
 		.ident = "X120/X170",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR,
-					"SAMSUNG ELECTRONICS CO., LTD."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "X120/X170"),
-			DMI_MATCH(DMI_BOARD_NAME, "X120/X170"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR,
+				    "SAMSUNG ELECTRONICS CO., LTD."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "X120/X170"),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "X120/X170"),
 		},
-		.callback = dmi_check_cb,
+		.callback = samsung_check_cb,
 	},
 	{
 		.ident = "NC10",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR,
-					"SAMSUNG ELECTRONICS CO., LTD."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "NC10"),
-			DMI_MATCH(DMI_BOARD_NAME, "NC10"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR,
+				    "SAMSUNG ELECTRONICS CO., LTD."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "NC10"),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "NC10"),
 		},
-		.callback = dmi_check_cb,
+		.callback = samsung_check_cb,
 	},
 		{
 		.ident = "NP-Q45",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR,
-					"SAMSUNG ELECTRONICS CO., LTD."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "SQ45S70S"),
-			DMI_MATCH(DMI_BOARD_NAME, "SQ45S70S"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR,
+				    "SAMSUNG ELECTRONICS CO., LTD."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "SQ45S70S"),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "SQ45S70S"),
 		},
-		.callback = dmi_check_cb,
+		.callback = samsung_check_cb,
 		},
 	{
 		.ident = "X360",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR,
-					"SAMSUNG ELECTRONICS CO., LTD."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "X360"),
-			DMI_MATCH(DMI_BOARD_NAME, "X360"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR,
+				    "SAMSUNG ELECTRONICS CO., LTD."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "X360"),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "X360"),
 		},
-		.callback = dmi_check_cb,
+		.callback = samsung_check_cb,
 	},
 	{
 		.ident = "R410 Plus",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR,
-					"SAMSUNG ELECTRONICS CO., LTD."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "R410P"),
-			DMI_MATCH(DMI_BOARD_NAME, "R460"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR,
+				    "SAMSUNG ELECTRONICS CO., LTD."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "R410P"),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "R460"),
 		},
-		.callback = dmi_check_cb,
+		.callback = samsung_check_cb,
 	},
 	{
 		.ident = "R518",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR,
-					"SAMSUNG ELECTRONICS CO., LTD."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "R518"),
-			DMI_MATCH(DMI_BOARD_NAME, "R518"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR,
+				    "SAMSUNG ELECTRONICS CO., LTD."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "R518"),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "R518"),
 		},
-		.callback = dmi_check_cb,
+		.callback = samsung_check_cb,
 	},
 	{
 		.ident = "R519/R719",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR,
-					"SAMSUNG ELECTRONICS CO., LTD."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "R519/R719"),
-			DMI_MATCH(DMI_BOARD_NAME, "R519/R719"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR,
+				    "SAMSUNG ELECTRONICS CO., LTD."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "R519/R719"),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "R519/R719"),
 		},
-		.callback = dmi_check_cb,
+		.callback = samsung_check_cb,
 	},
 	{
 		.ident = "N150/N210/N220/N230",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR,
-					"SAMSUNG ELECTRONICS CO., LTD."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "N150/N210/N220/N230"),
-			DMI_MATCH(DMI_BOARD_NAME, "N150/N210/N220/N230"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR,
+				    "SAMSUNG ELECTRONICS CO., LTD."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "N150/N210/N220/N230"),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "N150/N210/N220/N230"),
 		},
-		.callback = dmi_check_cb,
+		.callback = samsung_check_cb,
 	},
 	{
 		.ident = "N150P/N210P/N220P",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR,
-					"SAMSUNG ELECTRONICS CO., LTD."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "N150P/N210P/N220P"),
-			DMI_MATCH(DMI_BOARD_NAME, "N150P/N210P/N220P"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR,
+				    "SAMSUNG ELECTRONICS CO., LTD."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "N150P/N210P/N220P"),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "N150P/N210P/N220P"),
 		},
-		.callback = dmi_check_cb,
+		.callback = samsung_check_cb,
 	},
 	{
 		.ident = "R530/R730",
 		.matches = {
-		      DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."),
-		      DMI_MATCH(DMI_PRODUCT_NAME, "R530/R730"),
-		      DMI_MATCH(DMI_BOARD_NAME, "R530/R730"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR,
+					  "SAMSUNG ELECTRONICS CO., LTD."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "R530/R730"),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "R530/R730"),
 		},
-		.callback = dmi_check_cb,
+		.callback = samsung_check_cb,
 	},
 	{
 		.ident = "NF110/NF210/NF310",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "NF110/NF210/NF310"),
-			DMI_MATCH(DMI_BOARD_NAME, "NF110/NF210/NF310"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR,
+				    "SAMSUNG ELECTRONICS CO., LTD."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "NF110/NF210/NF310"),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "NF110/NF210/NF310"),
 		},
-		.callback = dmi_check_cb,
+		.callback = samsung_check_cb,
 	},
 	{
 		.ident = "N145P/N250P/N260P",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "N145P/N250P/N260P"),
-			DMI_MATCH(DMI_BOARD_NAME, "N145P/N250P/N260P"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR,
+				    "SAMSUNG ELECTRONICS CO., LTD."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "N145P/N250P/N260P"),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "N145P/N250P/N260P"),
 		},
-		.callback = dmi_check_cb,
+		.callback = samsung_check_cb,
 	},
 	{
 		.ident = "R70/R71",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR,
-					"SAMSUNG ELECTRONICS CO., LTD."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "R70/R71"),
-			DMI_MATCH(DMI_BOARD_NAME, "R70/R71"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR,
+				    "SAMSUNG ELECTRONICS CO., LTD."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "R70/R71"),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "R70/R71"),
 		},
-		.callback = dmi_check_cb,
+		.callback = samsung_check_cb,
 	},
 	{
 		.ident = "P460",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "P460"),
-			DMI_MATCH(DMI_BOARD_NAME, "P460"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR,
+				    "SAMSUNG ELECTRONICS CO., LTD."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "P460"),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "P460"),
 		},
-		.callback = dmi_check_cb,
+		.callback = samsung_check_cb,
 	},
-	{ },
+	{},
 };
-MODULE_DEVICE_TABLE(dmi, samsung_dmi_table);
+MODULE_DEVICE_TABLE(sysfw, samsung_id_table);
 
 static int find_signature(void __iomem *memcheck, const char *testStr)
 {
@@ -700,7 +703,7 @@ static int __init samsung_init(void)
 
 	mutex_init(&sabi_mutex);
 
-	if (!force && !dmi_check_system(samsung_dmi_table))
+	if (!force && !sysfw_callback(samsung_id_table))
 		return -ENODEV;
 
 	f0000_segment = ioremap_nocache(0xf0000, 0xffff);
diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c
index bbd182e..b708f04 100644
--- a/drivers/platform/x86/sony-laptop.c
+++ b/drivers/platform/x86/sony-laptop.c
@@ -52,7 +52,7 @@
 #include <linux/backlight.h>
 #include <linux/platform_device.h>
 #include <linux/err.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include <linux/pci.h>
 #include <linux/interrupt.h>
 #include <linux/delay.h>
@@ -3385,29 +3385,29 @@ static struct acpi_driver sony_pic_driver = {
 		},
 };
 
-static struct dmi_system_id __initdata sonypi_dmi_table[] = {
+static struct sysfw_id __initdata sonypi_id_table[] = {
 	{
 		.ident = "Sony Vaio",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "PCG-"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Sony Corporation"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "PCG-"),
 		},
 	},
 	{
 		.ident = "Sony Vaio",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "VGN-"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Sony Corporation"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "VGN-"),
 		},
 	},
-	{ }
+	{}
 };
 
 static int __init sony_laptop_init(void)
 {
 	int result;
 
-	if (!no_spic && dmi_check_system(sonypi_dmi_table)) {
+	if (!no_spic && sysfw_callback(sonypi_id_table)) {
 		result = acpi_bus_register_driver(&sony_pic_driver);
 		if (result) {
 			pr_err("Unable to register SPIC driver\n");
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index 26c5b11..58d3a42 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -76,7 +76,8 @@
 #include <linux/rfkill.h>
 #include <asm/uaccess.h>
 
-#include <linux/dmi.h>
+#include <linux/smbios.h>
+#include <linux/sysfw.h>
 #include <linux/jiffies.h>
 #include <linux/workqueue.h>
 
@@ -1775,7 +1776,7 @@ static const struct tpacpi_quirk tpacpi_bios_version_qtable[] __initconst = {
 	TPV_QL1('7', 'B',  'D', '7',  '4', '0'), /* X60/s */
 	TPV_QL1('7', 'J',  '3', '0',  '1', '3'), /* X60t */
 
-	/* (0) - older versions lack DMI EC fw string and functionality */
+	/* (0) - older versions lack SMBIOS EC fw string and functionality */
 	/* (1) - older versions known to lack functionality */
 };
 
@@ -8587,7 +8588,6 @@ static bool __pure __init tpacpi_is_valid_fw_id(const char* const s,
 static int __must_check __init get_thinkpad_model_data(
 						struct thinkpad_id_data *tp)
 {
-	const struct dmi_device *dev = NULL;
 	char ec_fw_string[18];
 	char const *s;
 
@@ -8596,14 +8596,14 @@ static int __must_check __init get_thinkpad_model_data(
 
 	memset(tp, 0, sizeof(*tp));
 
-	if (dmi_name_in_vendors("IBM"))
+	if (sysfw_vendor_is("IBM"))
 		tp->vendor = PCI_VENDOR_ID_IBM;
-	else if (dmi_name_in_vendors("LENOVO"))
+	else if (sysfw_vendor_is("LENOVO"))
 		tp->vendor = PCI_VENDOR_ID_LENOVO;
 	else
 		return 0;
 
-	s = dmi_get_system_info(DMI_BIOS_VERSION);
+	s = sysfw_lookup(SYSFW_BIOS_VERSION);
 	tp->bios_version_str = kstrdup(s, GFP_KERNEL);
 	if (s && !tp->bios_version_str)
 		return -ENOMEM;
@@ -8624,41 +8624,37 @@ static int __must_check __init get_thinkpad_model_data(
 	 *
 	 * See http://thinkwiki.org/wiki/List_of_DMI_IDs
 	 */
-	while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, NULL, dev))) {
-		if (sscanf(dev->name,
-			   "IBM ThinkPad Embedded Controller -[%17c",
-			   ec_fw_string) == 1) {
-			ec_fw_string[sizeof(ec_fw_string) - 1] = 0;
-			ec_fw_string[strcspn(ec_fw_string, " ]")] = 0;
-
-			tp->ec_version_str = kstrdup(ec_fw_string, GFP_KERNEL);
-			if (!tp->ec_version_str)
-				return -ENOMEM;
-
-			if (tpacpi_is_valid_fw_id(ec_fw_string, 'H')) {
-				tp->ec_model = ec_fw_string[0]
-						| (ec_fw_string[1] << 8);
-				tp->ec_release = (ec_fw_string[4] << 8)
-						| ec_fw_string[5];
-			} else {
-				pr_notice("ThinkPad firmware release %s "
-					  "doesn't match the known patterns\n",
-					  ec_fw_string);
-				pr_notice("please report this to %s\n",
-					  TPACPI_MAIL);
-			}
-			break;
+	s = smbios_match_oem_string("IBM ThinkPad Embedded Controller -[");
+	if (sscanf(s, "IBM ThinkPad Embedded Controller -[%17c",
+		   ec_fw_string) == 1) {
+		ec_fw_string[sizeof(ec_fw_string) - 1] = 0;
+		ec_fw_string[strcspn(ec_fw_string, " ]")] = 0;
+
+		tp->ec_version_str = kstrdup(ec_fw_string, GFP_KERNEL);
+		if (!tp->ec_version_str)
+			return -ENOMEM;
+
+		if (tpacpi_is_valid_fw_id(ec_fw_string, 'H')) {
+			tp->ec_model = ec_fw_string[0]
+					| (ec_fw_string[1] << 8);
+			tp->ec_release = (ec_fw_string[4] << 8)
+					| ec_fw_string[5];
+		} else {
+			pr_notice("ThinkPad firmware release %s "
+				  "doesn't match the known patterns\n",
+				  ec_fw_string);
+			pr_notice("please report this to %s\n", TPACPI_MAIL);
 		}
 	}
 
-	s = dmi_get_system_info(DMI_PRODUCT_VERSION);
+	s = sysfw_lookup(SYSFW_PRODUCT_VERSION);
 	if (s && !strnicmp(s, "ThinkPad", 8)) {
 		tp->model_str = kstrdup(s, GFP_KERNEL);
 		if (!tp->model_str)
 			return -ENOMEM;
 	}
 
-	s = dmi_get_system_info(DMI_PRODUCT_NAME);
+	s = sysfw_lookup(SYSFW_PRODUCT_NAME);
 	tp->nummodel_str = kstrdup(s, GFP_KERNEL);
 	if (s && !tp->nummodel_str)
 		return -ENOMEM;
@@ -8678,7 +8674,7 @@ static int __init probe_for_thinkpad(void)
 		return -ENODEV;
 
 	/*
-	 * Non-ancient models have better DMI tagging, but very old models
+	 * Non-ancient models have better SMBIOS tagging, but very old models
 	 * don't.  tpacpi_is_fw_known() is a cheat to help in that case.
 	 */
 	is_thinkpad = (thinkpad_id.model_str != NULL) ||
@@ -9133,7 +9129,7 @@ MODULE_ALIAS(TPACPI_DRVR_SHORTNAME);
 MODULE_DEVICE_TABLE(acpi, ibm_htk_device_ids);
 
 /*
- * DMI matching for module autoloading
+ * SMBIOS matching for module autoloading
  *
  * See http://thinkwiki.org/wiki/List_of_DMI_IDs
  * See http://thinkwiki.org/wiki/BIOS_Upgrade_Downloads
-- 
1.6.5.2


^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [PATCH 22/34] drivers/pnp changes for SMBIOS and System Firmware
  2011-07-18 13:08 [PATCH 00/34] System Firmware and SMBIOS Support [v3] Prarit Bhargava
                   ` (20 preceding siblings ...)
  2011-07-18 13:08 ` [PATCH 21/34] drivers/platform " Prarit Bhargava
@ 2011-07-18 13:08 ` Prarit Bhargava
  2011-07-18 13:08 ` [PATCH 23/34] drivers/power " Prarit Bhargava
                   ` (11 subsequent siblings)
  33 siblings, 0 replies; 48+ messages in thread
From: Prarit Bhargava @ 2011-07-18 13:08 UTC (permalink / raw)
  To: linux-kernel; +Cc: Prarit Bhargava, abelay

As part of the new SMBIOS and System Firmware code:

- Replace old dmi* structures and functions with new sysfw* and smbios*
structures and functions in individual drivers
- cleanup sysfw_id lookup tables
- cleanup of includes for dmi.h and mod_devicetable.h which were included in
some files that did not need them

Cc: abelay@mit.edu
Signed-off-by: Prarit Bhargava <prarit@redhat.com>
---
 drivers/pnp/pnpacpi/core.c |    1 -
 drivers/pnp/pnpbios/core.c |   20 ++++++++++----------
 2 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/drivers/pnp/pnpacpi/core.c b/drivers/pnp/pnpacpi/core.c
index ca84d50..8971996 100644
--- a/drivers/pnp/pnpacpi/core.c
+++ b/drivers/pnp/pnpacpi/core.c
@@ -22,7 +22,6 @@
 #include <linux/acpi.h>
 #include <linux/pnp.h>
 #include <linux/slab.h>
-#include <linux/mod_devicetable.h>
 #include <acpi/acpi_bus.h>
 
 #include "../base.h"
diff --git a/drivers/pnp/pnpbios/core.c b/drivers/pnp/pnpbios/core.c
index cfe8685..7a59d1c 100644
--- a/drivers/pnp/pnpbios/core.c
+++ b/drivers/pnp/pnpbios/core.c
@@ -57,11 +57,11 @@
 #include <linux/slab.h>
 #include <linux/completion.h>
 #include <linux/spinlock.h>
-#include <linux/dmi.h>
 #include <linux/delay.h>
 #include <linux/acpi.h>
 #include <linux/freezer.h>
 #include <linux/kthread.h>
+#include <linux/sysfw.h>
 
 #include <asm/page.h>
 #include <asm/desc.h>
@@ -486,29 +486,29 @@ static int __init pnpbios_probe_system(void)
 	return 0;
 }
 
-static int __init exploding_pnp_bios(const struct dmi_system_id *d)
+static int __init exploding_pnp_bios(const struct sysfw_id *d)
 {
 	printk(KERN_WARNING "%s detected. Disabling PnPBIOS\n", d->ident);
 	return 0;
 }
 
-static struct dmi_system_id pnpbios_dmi_table[] __initdata = {
+static struct sysfw_id pnpbios_smbios_table[] __initdata = {
 	{			/* PnPBIOS GPF on boot */
 	 .callback = exploding_pnp_bios,
 	 .ident = "Higraded P14H",
 	 .matches = {
-		     DMI_MATCH(DMI_BIOS_VENDOR, "American Megatrends Inc."),
-		     DMI_MATCH(DMI_BIOS_VERSION, "07.00T"),
-		     DMI_MATCH(DMI_SYS_VENDOR, "Higraded"),
-		     DMI_MATCH(DMI_PRODUCT_NAME, "P14H"),
+		     SYSFW_MATCH(SYSFW_BIOS_VENDOR, "American Megatrends Inc."),
+		     SYSFW_MATCH(SYSFW_BIOS_VERSION, "07.00T"),
+		     SYSFW_MATCH(SYSFW_SYS_VENDOR, "Higraded"),
+		     SYSFW_MATCH(SYSFW_PRODUCT_NAME, "P14H"),
 		     },
 	 },
 	{			/* PnPBIOS GPF on boot */
 	 .callback = exploding_pnp_bios,
 	 .ident = "ASUS P4P800",
 	 .matches = {
-		     DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer Inc."),
-		     DMI_MATCH(DMI_BOARD_NAME, "P4P800"),
+		     SYSFW_MATCH(SYSFW_BOARD_VENDOR, "ASUSTeK Computer Inc."),
+		     SYSFW_MATCH(SYSFW_BOARD_NAME, "P4P800"),
 		     },
 	 },
 	{}
@@ -522,7 +522,7 @@ static int __init pnpbios_init(void)
 	if (check_legacy_ioport(PNPBIOS_BASE))
 		return -ENODEV;
 #endif
-	if (pnpbios_disabled || dmi_check_system(pnpbios_dmi_table) ||
+	if (pnpbios_disabled || sysfw_callback(pnpbios_smbios_table) ||
 	    paravirt_enabled()) {
 		printk(KERN_INFO "PnPBIOS: Disabled\n");
 		return -ENODEV;
-- 
1.6.5.2


^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [PATCH 23/34] drivers/power changes for SMBIOS and System Firmware
  2011-07-18 13:08 [PATCH 00/34] System Firmware and SMBIOS Support [v3] Prarit Bhargava
                   ` (21 preceding siblings ...)
  2011-07-18 13:08 ` [PATCH 22/34] drivers/pnp " Prarit Bhargava
@ 2011-07-18 13:08 ` Prarit Bhargava
  2011-07-18 13:08 ` [PATCH 24/34] drivers/rtc " Prarit Bhargava
                   ` (10 subsequent siblings)
  33 siblings, 0 replies; 48+ messages in thread
From: Prarit Bhargava @ 2011-07-18 13:08 UTC (permalink / raw)
  To: linux-kernel; +Cc: Prarit Bhargava

As part of the new SMBIOS and System Firmware code:

- cleanup of includes for dmi.h and mod_devicetable.h which were included in
some files that did not need them

Signed-off-by: Prarit Bhargava <prarit@redhat.com>
---
 drivers/power/max17042_battery.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/power/max17042_battery.c b/drivers/power/max17042_battery.c
index c5c8805..58d75aa 100644
--- a/drivers/power/max17042_battery.c
+++ b/drivers/power/max17042_battery.c
@@ -25,7 +25,6 @@
 #include <linux/init.h>
 #include <linux/slab.h>
 #include <linux/i2c.h>
-#include <linux/mod_devicetable.h>
 #include <linux/power_supply.h>
 #include <linux/power/max17042_battery.h>
 
-- 
1.6.5.2


^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [PATCH 24/34] drivers/rtc changes for SMBIOS and System Firmware
  2011-07-18 13:08 [PATCH 00/34] System Firmware and SMBIOS Support [v3] Prarit Bhargava
                   ` (22 preceding siblings ...)
  2011-07-18 13:08 ` [PATCH 23/34] drivers/power " Prarit Bhargava
@ 2011-07-18 13:08 ` Prarit Bhargava
  2011-07-18 13:08 ` [PATCH 25/34] drivers/staging " Prarit Bhargava
                   ` (9 subsequent siblings)
  33 siblings, 0 replies; 48+ messages in thread
From: Prarit Bhargava @ 2011-07-18 13:08 UTC (permalink / raw)
  To: linux-kernel; +Cc: Prarit Bhargava, rtc-linux

As part of the new SMBIOS and System Firmware code:

- cleanup of includes for dmi.h and mod_devicetable.h which were included in
some files that did not need them

Cc: rtc-linux@googlegroups.com
Signed-off-by: Prarit Bhargava <prarit@redhat.com>
---
 drivers/rtc/rtc-cmos.c |    1 -
 drivers/rtc/rtc-mrst.c |    1 -
 2 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/drivers/rtc/rtc-cmos.c b/drivers/rtc/rtc-cmos.c
index 911e75c..56b9d6d 100644
--- a/drivers/rtc/rtc-cmos.c
+++ b/drivers/rtc/rtc-cmos.c
@@ -34,7 +34,6 @@
 #include <linux/interrupt.h>
 #include <linux/spinlock.h>
 #include <linux/platform_device.h>
-#include <linux/mod_devicetable.h>
 #include <linux/log2.h>
 #include <linux/pm.h>
 #include <linux/of.h>
diff --git a/drivers/rtc/rtc-mrst.c b/drivers/rtc/rtc-mrst.c
index 0cec565..ce8cef4 100644
--- a/drivers/rtc/rtc-mrst.c
+++ b/drivers/rtc/rtc-mrst.c
@@ -27,7 +27,6 @@
  *  * Alarm function is also limited to hr/min/sec.
  */
 
-#include <linux/mod_devicetable.h>
 #include <linux/platform_device.h>
 #include <linux/interrupt.h>
 #include <linux/spinlock.h>
-- 
1.6.5.2


^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [PATCH 25/34] drivers/staging changes for SMBIOS and System Firmware
  2011-07-18 13:08 [PATCH 00/34] System Firmware and SMBIOS Support [v3] Prarit Bhargava
                   ` (23 preceding siblings ...)
  2011-07-18 13:08 ` [PATCH 24/34] drivers/rtc " Prarit Bhargava
@ 2011-07-18 13:08 ` Prarit Bhargava
  2011-07-18 13:08 ` [PATCH 26/34] drivers/tty " Prarit Bhargava
                   ` (8 subsequent siblings)
  33 siblings, 0 replies; 48+ messages in thread
From: Prarit Bhargava @ 2011-07-18 13:08 UTC (permalink / raw)
  To: linux-kernel; +Cc: Prarit Bhargava, evel

As part of the new SMBIOS and System Firmware code:

- Replace old dmi* structures and functions with new sysfw* and smbios*
structures and functions in individual drivers
- cleanup sysfw_id lookup tables
- cleanup of includes for dmi.h and mod_devicetable.h which were included in
some files that did not need them

[v2]: Re-exported dmi MODULE_ALIAS

Cc: evel@driverdev.osuosl.org
Signed-off-by: Prarit Bhargava <prarit@redhat.com>
---
 drivers/staging/hv/hv_mouse.c      |    1 -
 drivers/staging/hv/hv_timesource.c |   18 +++++++++---------
 drivers/staging/hv/hv_util.c       |   17 ++++++++---------
 drivers/staging/hv/netvsc_drv.c    |   17 ++++++++---------
 drivers/staging/hv/vmbus_drv.c     |    1 -
 5 files changed, 25 insertions(+), 29 deletions(-)

diff --git a/drivers/staging/hv/hv_mouse.c b/drivers/staging/hv/hv_mouse.c
index 359e737..b40c23f 100644
--- a/drivers/staging/hv/hv_mouse.c
+++ b/drivers/staging/hv/hv_mouse.c
@@ -23,7 +23,6 @@
 #include <linux/hid.h>
 #include <linux/hiddev.h>
 #include <linux/pci.h>
-#include <linux/dmi.h>
 #include <linux/delay.h>
 
 #include "hyperv.h"
diff --git a/drivers/staging/hv/hv_timesource.c b/drivers/staging/hv/hv_timesource.c
index 0efb049..34dc583 100644
--- a/drivers/staging/hv/hv_timesource.c
+++ b/drivers/staging/hv/hv_timesource.c
@@ -27,7 +27,7 @@
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/pci.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include <asm/hyperv.h>
 #include <asm/mshyperv.h>
 #include <asm/hypervisor.h>
@@ -61,19 +61,19 @@ static struct clocksource hyperv_cs = {
 	.shift          = HV_CLOCK_SHIFT,
 };
 
-static const struct dmi_system_id __initconst
-hv_timesource_dmi_table[] __maybe_unused  = {
+static const struct sysfw_id __initconst
+hv_timesource_smbios_table[] __maybe_unused = {
 	{
 		.ident = "Hyper-V",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Virtual Machine"),
-			DMI_MATCH(DMI_BOARD_NAME, "Virtual Machine"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Microsoft Corporation"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Virtual Machine"),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "Virtual Machine"),
 		},
 	},
-	{ },
+	{},
 };
-MODULE_DEVICE_TABLE(dmi, hv_timesource_dmi_table);
+MODULE_DEVICE_TABLE(smbios, hv_timesource_smbios_table);
 
 static const struct pci_device_id __initconst
 hv_timesource_pci_table[] __maybe_unused = {
@@ -89,7 +89,7 @@ static int __init init_hv_clocksource(void)
 		!(ms_hyperv.features & HV_X64_MSR_TIME_REF_COUNT_AVAILABLE))
 		return -ENODEV;
 
-	if (!dmi_check_system(hv_timesource_dmi_table))
+	if (!sysfw_callback(hv_timesource_smbios_table))
 		return -ENODEV;
 
 	pr_info("Registering HyperV clock source\n");
diff --git a/drivers/staging/hv/hv_util.c b/drivers/staging/hv/hv_util.c
index c164b54..2d672b8 100644
--- a/drivers/staging/hv/hv_util.c
+++ b/drivers/staging/hv/hv_util.c
@@ -26,8 +26,8 @@
 #include <linux/slab.h>
 #include <linux/sysctl.h>
 #include <linux/reboot.h>
-#include <linux/dmi.h>
 #include <linux/pci.h>
+#include <linux/sysfw.h>
 
 #include "hyperv.h"
 #include "hv_kvp.h"
@@ -218,19 +218,18 @@ hv_utils_pci_table[] __maybe_unused = {
 MODULE_DEVICE_TABLE(pci, hv_utils_pci_table);
 
 
-static const struct dmi_system_id __initconst
-hv_utils_dmi_table[] __maybe_unused  = {
+static const struct sysfw_id __initconst hv_utils_id_table[] __maybe_unused = {
 	{
 		.ident = "Hyper-V",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Virtual Machine"),
-			DMI_MATCH(DMI_BOARD_NAME, "Virtual Machine"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Microsoft Corporation"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Virtual Machine"),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "Virtual Machine"),
 		},
 	},
-	{ },
+	{},
 };
-MODULE_DEVICE_TABLE(dmi, hv_utils_dmi_table);
+MODULE_DEVICE_TABLE(sysfw, hv_utils_id_table);
 
 
 static int __init init_hyperv_utils(void)
@@ -241,7 +240,7 @@ static int __init init_hyperv_utils(void)
 		return -ENODEV;
 
 
-	if (!dmi_check_system(hv_utils_dmi_table))
+	if (!sysfw_callback(hv_utils_id_table))
 		return -ENODEV;
 
 	shut_txf_buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
diff --git a/drivers/staging/hv/netvsc_drv.c b/drivers/staging/hv/netvsc_drv.c
index 7b9c229..0ffc210 100644
--- a/drivers/staging/hv/netvsc_drv.c
+++ b/drivers/staging/hv/netvsc_drv.c
@@ -32,8 +32,8 @@
 #include <linux/skbuff.h>
 #include <linux/in.h>
 #include <linux/slab.h>
-#include <linux/dmi.h>
 #include <linux/pci.h>
+#include <linux/sysfw.h>
 #include <net/arp.h>
 #include <net/route.h>
 #include <net/sock.h>
@@ -439,19 +439,18 @@ static void __exit netvsc_drv_exit(void)
 }
 
 
-static const struct dmi_system_id __initconst
-hv_netvsc_dmi_table[] __maybe_unused  = {
+static const struct sysfw_id __initconst hv_netvsc_id_table[] __maybe_unused = {
 	{
 		.ident = "Hyper-V",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Virtual Machine"),
-			DMI_MATCH(DMI_BOARD_NAME, "Virtual Machine"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Microsoft Corporation"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Virtual Machine"),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "Virtual Machine"),
 		},
 	},
-	{ },
+	{},
 };
-MODULE_DEVICE_TABLE(dmi, hv_netvsc_dmi_table);
+MODULE_DEVICE_TABLE(sysfw, hv_netvsc_id_table);
 
 static int __init netvsc_drv_init(void)
 {
@@ -460,7 +459,7 @@ static int __init netvsc_drv_init(void)
 
 	pr_info("initializing....");
 
-	if (!dmi_check_system(hv_netvsc_dmi_table))
+	if (!sysfw_callback(hv_netvsc_id_table))
 		return -ENODEV;
 
 
diff --git a/drivers/staging/hv/vmbus_drv.c b/drivers/staging/hv/vmbus_drv.c
index ec1d38c..18e3687 100644
--- a/drivers/staging/hv/vmbus_drv.c
+++ b/drivers/staging/hv/vmbus_drv.c
@@ -29,7 +29,6 @@
 #include <linux/interrupt.h>
 #include <linux/sysctl.h>
 #include <linux/pci.h>
-#include <linux/dmi.h>
 #include <linux/slab.h>
 #include <linux/acpi.h>
 #include <acpi/acpi_bus.h>
-- 
1.6.5.2


^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [PATCH 26/34] drivers/tty changes for SMBIOS and System Firmware
  2011-07-18 13:08 [PATCH 00/34] System Firmware and SMBIOS Support [v3] Prarit Bhargava
                   ` (24 preceding siblings ...)
  2011-07-18 13:08 ` [PATCH 25/34] drivers/staging " Prarit Bhargava
@ 2011-07-18 13:08 ` Prarit Bhargava
  2011-07-18 13:08 ` [PATCH 27/34] drivers/usb " Prarit Bhargava
                   ` (7 subsequent siblings)
  33 siblings, 0 replies; 48+ messages in thread
From: Prarit Bhargava @ 2011-07-18 13:08 UTC (permalink / raw)
  To: linux-kernel; +Cc: Prarit Bhargava, gregkh

As part of the new SMBIOS and System Firmware code:

- Replace old dmi* structures and functions with new sysfw* and smbios*
structures and functions in individual drivers

Cc: gregkh@suse.de
Signed-off-by: Prarit Bhargava <prarit@redhat.com>
---
 drivers/tty/serial/pch_uart.c |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/drivers/tty/serial/pch_uart.c b/drivers/tty/serial/pch_uart.c
index 4652109..ab2e2af 100644
--- a/drivers/tty/serial/pch_uart.c
+++ b/drivers/tty/serial/pch_uart.c
@@ -21,7 +21,7 @@
 #include <linux/serial_core.h>
 #include <linux/interrupt.h>
 #include <linux/io.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 
 #include <linux/dmaengine.h>
 #include <linux/pch_dma.h>
@@ -1386,6 +1386,16 @@ static struct uart_driver pch_uart_driver = {
 	.nr = PCH_UART_NR,
 };
 
+static const struct sysfw_id pcih_uart_quirk_id[] = {
+	{
+		.ident = "CM-iTC",
+		.matches = {
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "CM-iTC"),
+		},
+	},
+	{}
+};
+
 static struct eg20t_port *pch_uart_init_port(struct pci_dev *pdev,
 					     const struct pci_device_id *id)
 {
@@ -1397,7 +1407,6 @@ static struct eg20t_port *pch_uart_init_port(struct pci_dev *pdev,
 	int fifosize, base_baud;
 	int port_type;
 	struct pch_uart_driver_data *board;
-	const char *board_name;
 
 	board = &drv_dat[id->driver_data];
 	port_type = board->port_type;
@@ -1413,8 +1422,7 @@ static struct eg20t_port *pch_uart_init_port(struct pci_dev *pdev,
 	base_baud = 1843200; /* 1.8432MHz */
 
 	/* quirk for CM-iTC board */
-	board_name = dmi_get_system_info(DMI_BOARD_NAME);
-	if (board_name && strstr(board_name, "CM-iTC"))
+	if (sysfw_callback(pcih_uart_quirk_id))
 		base_baud = 192000000; /* 192.0MHz */
 
 	switch (port_type) {
-- 
1.6.5.2


^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [PATCH 27/34] drivers/usb changes for SMBIOS and System Firmware
  2011-07-18 13:08 [PATCH 00/34] System Firmware and SMBIOS Support [v3] Prarit Bhargava
                   ` (25 preceding siblings ...)
  2011-07-18 13:08 ` [PATCH 26/34] drivers/tty " Prarit Bhargava
@ 2011-07-18 13:08 ` Prarit Bhargava
  2011-07-19 19:47   ` Alan Stern
  2011-07-18 13:08 ` [PATCH 28/34] drivers/video " Prarit Bhargava
                   ` (6 subsequent siblings)
  33 siblings, 1 reply; 48+ messages in thread
From: Prarit Bhargava @ 2011-07-18 13:08 UTC (permalink / raw)
  To: linux-kernel; +Cc: Prarit Bhargava, linux-usb

As part of the new SMBIOS and System Firmware code:

- Replace old dmi* structures and functions with new sysfw* and smbios*
structures and functions in individual drivers
- cleanup sysfw_id lookup tables
- add exactmatch functionality

Cc: linux-usb@vger.kernel.org
Signed-off-by: Prarit Bhargava <prarit@redhat.com>
---
 drivers/usb/host/pci-quirks.c |   19 ++++++++++++++-----
 drivers/usb/host/uhci-hcd.c   |    2 +-
 drivers/usb/host/uhci-pci.c   |   15 +++++++++++----
 3 files changed, 26 insertions(+), 10 deletions(-)

diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c
index fd93061..ae2a681 100644
--- a/drivers/usb/host/pci-quirks.c
+++ b/drivers/usb/host/pci-quirks.c
@@ -14,7 +14,7 @@
 #include <linux/init.h>
 #include <linux/delay.h>
 #include <linux/acpi.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include "pci-quirks.h"
 #include "xhci-ext-caps.h"
 
@@ -507,6 +507,18 @@ static void __devinit quirk_usb_handoff_ohci(struct pci_dev *pdev)
 	iounmap(base);
 }
 
+static const struct sysfw_id __devinitdata ehci_bios_handoff_table[] = {
+	{
+		.ident = "Pegatron Lucid (ExoPC) Tablet",
+		.matches = {
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "EXOPG06411"),
+			SYSFW_MATCH(SYSFW_BIOS_VERSION, "Lucid-CE-133"),
+		},
+		.exactmatch = 1,
+	},
+	{}
+};
+
 static void __devinit ehci_bios_handoff(struct pci_dev *pdev,
 					void __iomem *op_reg_base,
 					u32 cap, u8 offset)
@@ -517,10 +529,7 @@ static void __devinit ehci_bios_handoff(struct pci_dev *pdev,
 	 * seconds trying the handoff on its unused controller.  Skip
 	 * it. */
 	if (pdev->vendor == 0x8086 && pdev->device == 0x283a) {
-		const char *dmi_bn = dmi_get_system_info(DMI_BOARD_NAME);
-		const char *dmi_bv = dmi_get_system_info(DMI_BIOS_VERSION);
-		if (dmi_bn && !strcmp(dmi_bn, "EXOPG06411") &&
-		    dmi_bv && !strcmp(dmi_bv, "Lucid-CE-133"))
+		if (sysfw_callback(ehci_bios_handoff_table))
 			try_handoff = 0;
 	}
 
diff --git a/drivers/usb/host/uhci-hcd.c b/drivers/usb/host/uhci-hcd.c
index fba99b1..1b03b7a 100644
--- a/drivers/usb/host/uhci-hcd.c
+++ b/drivers/usb/host/uhci-hcd.c
@@ -40,7 +40,7 @@
 #include <linux/usb.h>
 #include <linux/usb/hcd.h>
 #include <linux/bitops.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 
 #include <asm/uaccess.h>
 #include <asm/io.h>
diff --git a/drivers/usb/host/uhci-pci.c b/drivers/usb/host/uhci-pci.c
index c300bd2..ef3de10 100644
--- a/drivers/usb/host/uhci-pci.c
+++ b/drivers/usb/host/uhci-pci.c
@@ -88,18 +88,25 @@ static int uhci_pci_resume_detect_interrupts_are_broken(struct uhci_hcd *uhci)
 	return 0;
 }
 
+static const struct sysfw_id bad_Asus_board_id[] = {
+	{
+		.ident = "A7V8X",
+		.matches = {
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "A7V8X"),
+		},
+	},
+	{}
+};
+
 static int uhci_pci_global_suspend_mode_is_broken(struct uhci_hcd *uhci)
 {
 	int port;
-	const char *sys_info;
-	static const char bad_Asus_board[] = "A7V8X";
 
 	/* One of Asus's motherboards has a bug which causes it to
 	 * wake up immediately from suspend-to-RAM if any of the ports
 	 * are connected.  In such cases we will not set EGSM.
 	 */
-	sys_info = dmi_get_system_info(DMI_BOARD_NAME);
-	if (sys_info && !strcmp(sys_info, bad_Asus_board)) {
+	if (sysfw_callback(bad_Asus_board_id)) {
 		for (port = 0; port < uhci->rh_numports; ++port) {
 			if (inw(uhci->io_addr + USBPORTSC1 + port * 2) &
 					USBPORTSC_CCS)
-- 
1.6.5.2


^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [PATCH 28/34] drivers/video changes for SMBIOS and System Firmware
  2011-07-18 13:08 [PATCH 00/34] System Firmware and SMBIOS Support [v3] Prarit Bhargava
                   ` (26 preceding siblings ...)
  2011-07-18 13:08 ` [PATCH 27/34] drivers/usb " Prarit Bhargava
@ 2011-07-18 13:08 ` Prarit Bhargava
  2011-07-18 13:08 ` [PATCH 29/34] drivers/w1 " Prarit Bhargava
                   ` (5 subsequent siblings)
  33 siblings, 0 replies; 48+ messages in thread
From: Prarit Bhargava @ 2011-07-18 13:08 UTC (permalink / raw)
  To: linux-kernel; +Cc: Prarit Bhargava, device-drivers-devel

As part of the new SMBIOS and System Firmware code:

- Replace old dmi* structures and functions with new sysfw* and smbios*
structures and functions in individual drivers
- cleanup sysfw_id lookup tables

[v2]: Added sysfw MODULE_ALIAS

Cc: device-drivers-devel@blackfin.uclinux.org
Signed-off-by: Prarit Bhargava <prarit@redhat.com>
---
 drivers/video/aty/atyfb_base.c      |   18 +++---
 drivers/video/backlight/kb3886_bl.c |   13 ++--
 drivers/video/efifb.c               |  124 ++++++++++++++++++-----------------
 3 files changed, 80 insertions(+), 75 deletions(-)

diff --git a/drivers/video/aty/atyfb_base.c b/drivers/video/aty/atyfb_base.c
index d7aaec5..5f0e777 100644
--- a/drivers/video/aty/atyfb_base.c
+++ b/drivers/video/aty/atyfb_base.c
@@ -67,7 +67,7 @@
 #include <linux/wait.h>
 #include <linux/backlight.h>
 #include <linux/reboot.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 
 #include <asm/io.h>
 #include <linux/uaccess.h>
@@ -3955,17 +3955,17 @@ static struct notifier_block atyfb_reboot_notifier = {
 	.notifier_call = atyfb_reboot_notify,
 };
 
-static const struct dmi_system_id atyfb_reboot_ids[] = {
+static const struct sysfw_id atyfb_reboot_ids[] = {
 	{
 		.ident = "HP OmniBook 500",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "HP OmniBook PC"),
-			DMI_MATCH(DMI_PRODUCT_VERSION, "HP OmniBook 500 FA"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Hewlett-Packard"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "HP OmniBook PC"),
+			SYSFW_MATCH(SYSFW_PRODUCT_VERSION,
+				    "HP OmniBook 500 FA"),
 		},
 	},
-
-	{ }
+	{}
 };
 
 static int __init atyfb_init(void)
@@ -3989,7 +3989,7 @@ static int __init atyfb_init(void)
 	if (err1 && err2)
 		return -ENODEV;
 
-	if (dmi_check_system(atyfb_reboot_ids))
+	if (sysfw_callback(atyfb_reboot_ids))
 		register_reboot_notifier(&atyfb_reboot_notifier);
 
 	return 0;
@@ -3997,7 +3997,7 @@ static int __init atyfb_init(void)
 
 static void __exit atyfb_exit(void)
 {
-	if (dmi_check_system(atyfb_reboot_ids))
+	if (sysfw_callback(atyfb_reboot_ids))
 		unregister_reboot_notifier(&atyfb_reboot_notifier);
 
 #ifdef CONFIG_PCI
diff --git a/drivers/video/backlight/kb3886_bl.c b/drivers/video/backlight/kb3886_bl.c
index 72dd555..297c649 100644
--- a/drivers/video/backlight/kb3886_bl.c
+++ b/drivers/video/backlight/kb3886_bl.c
@@ -19,7 +19,7 @@
 #include <linux/fb.h>
 #include <linux/backlight.h>
 #include <linux/delay.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 
 #define KB3886_PARENT 0x64
 #define KB3886_IO 0x60
@@ -78,15 +78,15 @@ static struct kb3886bl_machinfo *bl_machinfo;
 static unsigned long kb3886bl_flags;
 #define KB3886BL_SUSPENDED     0x01
 
-static struct dmi_system_id __initdata kb3886bl_device_table[] = {
+static struct sysfw_id __initdata kb3886bl_device_table[] = {
 	{
 		.ident = "Sahara Touch-iT",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "SDV"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "iTouch T201"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "SDV"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "iTouch T201"),
 		},
 	},
-	{ }
+	{}
 };
 
 static int kb3886bl_send_intensity(struct backlight_device *bd)
@@ -188,7 +188,7 @@ static struct platform_driver kb3886bl_driver = {
 
 static int __init kb3886_init(void)
 {
-	if (!dmi_check_system(kb3886bl_device_table))
+	if (!sysfw_callback(kb3886bl_device_table))
 		return -ENODEV;
 
 	platform_add_devices(devices, ARRAY_SIZE(devices));
@@ -207,3 +207,4 @@ MODULE_AUTHOR("Claudio Nieder <private@claudio.ch>");
 MODULE_DESCRIPTION("Tabletkiosk Sahara Touch-iT Backlight Driver");
 MODULE_LICENSE("GPL");
 MODULE_ALIAS("dmi:*:svnSDV:pniTouchT201:*");
+MODULE_ALIAS("sysfw:*:svnSDV:pniTouchT201:*");
diff --git a/drivers/video/efifb.c b/drivers/video/efifb.c
index 784139a..7e0c97c 100644
--- a/drivers/video/efifb.c
+++ b/drivers/video/efifb.c
@@ -12,7 +12,7 @@
 #include <linux/fb.h>
 #include <linux/platform_device.h>
 #include <linux/screen_info.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include <linux/pci.h>
 #include <video/vga.h>
 
@@ -77,14 +77,14 @@ enum {
 #define OVERRIDE_HEIGHT	0x4
 #define OVERRIDE_WIDTH	0x8
 
-static struct efifb_dmi_info {
+static struct efifb_smbios_info {
 	char *optname;
 	unsigned long base;
 	int stride;
 	int width;
 	int height;
 	int flags;
-} dmi_list[] __initdata = {
+} smbios_list[] __initdata = {
 	[M_I17] = { "i17", 0x80010000, 1472 * 4, 1440, 900, OVERRIDE_NONE },
 	[M_I20] = { "i20", 0x80010000, 1728 * 4, 1680, 1050, OVERRIDE_NONE }, /* guess */
 	[M_I20_SR] = { "imac7", 0x40010000, 1728 * 4, 1680, 1050, OVERRIDE_NONE },
@@ -117,71 +117,74 @@ static struct efifb_dmi_info {
 	[M_UNKNOWN] = { NULL, 0, 0, 0, 0, OVERRIDE_NONE }
 };
 
-static int set_system(const struct dmi_system_id *id);
+static int set_system(const struct sysfw_id *id);
 
-#define EFIFB_DMI_SYSTEM_ID(vendor, name, enumid)		\
+#define EFIFB_SMBIOS_SYSTEM_ID(vendor, name, enumid)		\
 	{ set_system, name, {					\
-		DMI_MATCH(DMI_BIOS_VENDOR, vendor),		\
-		DMI_MATCH(DMI_PRODUCT_NAME, name) },		\
-	  &dmi_list[enumid] }
+		SYSFW_MATCH(SYSFW_BIOS_VENDOR, vendor),		\
+		SYSFW_MATCH(SYSFW_PRODUCT_NAME, name) },		\
+	  &smbios_list[enumid] }
 
-static const struct dmi_system_id dmi_system_table[] __initconst = {
-	EFIFB_DMI_SYSTEM_ID("Apple Computer, Inc.", "iMac4,1", M_I17),
+static const struct sysfw_id smbios_system_table[] __initconst = {
+	EFIFB_SMBIOS_SYSTEM_ID("Apple Computer, Inc.", "iMac4,1", M_I17),
 	/* At least one of these two will be right; maybe both? */
-	EFIFB_DMI_SYSTEM_ID("Apple Computer, Inc.", "iMac5,1", M_I20),
-	EFIFB_DMI_SYSTEM_ID("Apple Inc.", "iMac5,1", M_I20),
+	EFIFB_SMBIOS_SYSTEM_ID("Apple Computer, Inc.", "iMac5,1", M_I20),
+	EFIFB_SMBIOS_SYSTEM_ID("Apple Inc.", "iMac5,1", M_I20),
 	/* At least one of these two will be right; maybe both? */
-	EFIFB_DMI_SYSTEM_ID("Apple Computer, Inc.", "iMac6,1", M_I24),
-	EFIFB_DMI_SYSTEM_ID("Apple Inc.", "iMac6,1", M_I24),
-	EFIFB_DMI_SYSTEM_ID("Apple Inc.", "iMac7,1", M_I20_SR),
-	EFIFB_DMI_SYSTEM_ID("Apple Inc.", "iMac8,1", M_I24_8_1),
-	EFIFB_DMI_SYSTEM_ID("Apple Inc.", "iMac10,1", M_I24_10_1),
-	EFIFB_DMI_SYSTEM_ID("Apple Inc.", "iMac11,1", M_I27_11_1),
-	EFIFB_DMI_SYSTEM_ID("Apple Computer, Inc.", "Macmini1,1", M_MINI),
-	EFIFB_DMI_SYSTEM_ID("Apple Inc.", "Macmini3,1", M_MINI_3_1),
-	EFIFB_DMI_SYSTEM_ID("Apple Inc.", "Macmini4,1", M_MINI_4_1),
-	EFIFB_DMI_SYSTEM_ID("Apple Computer, Inc.", "MacBook1,1", M_MB),
+	EFIFB_SMBIOS_SYSTEM_ID("Apple Computer, Inc.", "iMac6,1", M_I24),
+	EFIFB_SMBIOS_SYSTEM_ID("Apple Inc.", "iMac6,1", M_I24),
+	EFIFB_SMBIOS_SYSTEM_ID("Apple Inc.", "iMac7,1", M_I20_SR),
+	EFIFB_SMBIOS_SYSTEM_ID("Apple Inc.", "iMac8,1", M_I24_8_1),
+	EFIFB_SMBIOS_SYSTEM_ID("Apple Inc.", "iMac10,1", M_I24_10_1),
+	EFIFB_SMBIOS_SYSTEM_ID("Apple Inc.", "iMac11,1", M_I27_11_1),
+	EFIFB_SMBIOS_SYSTEM_ID("Apple Computer, Inc.", "Macmini1,1", M_MINI),
+	EFIFB_SMBIOS_SYSTEM_ID("Apple Inc.", "Macmini3,1", M_MINI_3_1),
+	EFIFB_SMBIOS_SYSTEM_ID("Apple Inc.", "Macmini4,1", M_MINI_4_1),
+	EFIFB_SMBIOS_SYSTEM_ID("Apple Computer, Inc.", "MacBook1,1", M_MB),
 	/* At least one of these two will be right; maybe both? */
-	EFIFB_DMI_SYSTEM_ID("Apple Computer, Inc.", "MacBook2,1", M_MB),
-	EFIFB_DMI_SYSTEM_ID("Apple Inc.", "MacBook2,1", M_MB),
+	EFIFB_SMBIOS_SYSTEM_ID("Apple Computer, Inc.", "MacBook2,1", M_MB),
+	EFIFB_SMBIOS_SYSTEM_ID("Apple Inc.", "MacBook2,1", M_MB),
 	/* At least one of these two will be right; maybe both? */
-	EFIFB_DMI_SYSTEM_ID("Apple Computer, Inc.", "MacBook3,1", M_MB),
-	EFIFB_DMI_SYSTEM_ID("Apple Inc.", "MacBook3,1", M_MB),
-	EFIFB_DMI_SYSTEM_ID("Apple Inc.", "MacBook4,1", M_MB),
-	EFIFB_DMI_SYSTEM_ID("Apple Inc.", "MacBook5,1", M_MB_5_1),
-	EFIFB_DMI_SYSTEM_ID("Apple Inc.", "MacBook6,1", M_MB_6_1),
-	EFIFB_DMI_SYSTEM_ID("Apple Inc.", "MacBook7,1", M_MB_7_1),
-	EFIFB_DMI_SYSTEM_ID("Apple Inc.", "MacBookAir1,1", M_MBA),
-	EFIFB_DMI_SYSTEM_ID("Apple Inc.", "MacBookAir3,1", M_MBA_3),
-	EFIFB_DMI_SYSTEM_ID("Apple Computer, Inc.", "MacBookPro1,1", M_MBP),
-	EFIFB_DMI_SYSTEM_ID("Apple Computer, Inc.", "MacBookPro2,1", M_MBP_2),
-	EFIFB_DMI_SYSTEM_ID("Apple Computer, Inc.", "MacBookPro2,2", M_MBP_2_2),
-	EFIFB_DMI_SYSTEM_ID("Apple Inc.", "MacBookPro2,1", M_MBP_2),
-	EFIFB_DMI_SYSTEM_ID("Apple Computer, Inc.", "MacBookPro3,1", M_MBP_SR),
-	EFIFB_DMI_SYSTEM_ID("Apple Inc.", "MacBookPro3,1", M_MBP_SR),
-	EFIFB_DMI_SYSTEM_ID("Apple Inc.", "MacBookPro4,1", M_MBP_4),
-	EFIFB_DMI_SYSTEM_ID("Apple Inc.", "MacBookPro5,1", M_MBP_5_1),
-	EFIFB_DMI_SYSTEM_ID("Apple Inc.", "MacBookPro5,2", M_MBP_5_2),
-	EFIFB_DMI_SYSTEM_ID("Apple Inc.", "MacBookPro5,3", M_MBP_5_3),
-	EFIFB_DMI_SYSTEM_ID("Apple Inc.", "MacBookPro6,1", M_MBP_6_1),
-	EFIFB_DMI_SYSTEM_ID("Apple Inc.", "MacBookPro6,2", M_MBP_6_2),
-	EFIFB_DMI_SYSTEM_ID("Apple Inc.", "MacBookPro7,1", M_MBP_7_1),
-	EFIFB_DMI_SYSTEM_ID("Apple Inc.", "MacBookPro8,2", M_MBP_8_2),
+	EFIFB_SMBIOS_SYSTEM_ID("Apple Computer, Inc.", "MacBook3,1", M_MB),
+	EFIFB_SMBIOS_SYSTEM_ID("Apple Inc.", "MacBook3,1", M_MB),
+	EFIFB_SMBIOS_SYSTEM_ID("Apple Inc.", "MacBook4,1", M_MB),
+	EFIFB_SMBIOS_SYSTEM_ID("Apple Inc.", "MacBook5,1", M_MB_5_1),
+	EFIFB_SMBIOS_SYSTEM_ID("Apple Inc.", "MacBook6,1", M_MB_6_1),
+	EFIFB_SMBIOS_SYSTEM_ID("Apple Inc.", "MacBook7,1", M_MB_7_1),
+	EFIFB_SMBIOS_SYSTEM_ID("Apple Inc.", "MacBookAir1,1", M_MBA),
+	EFIFB_SMBIOS_SYSTEM_ID("Apple Inc.", "MacBookAir3,1", M_MBA_3),
+	EFIFB_SMBIOS_SYSTEM_ID("Apple Computer, Inc.", "MacBookPro1,1", M_MBP),
+	EFIFB_SMBIOS_SYSTEM_ID("Apple Computer, Inc.", "MacBookPro2,1",
+			       M_MBP_2),
+	EFIFB_SMBIOS_SYSTEM_ID("Apple Computer, Inc.", "MacBookPro2,2",
+			       M_MBP_2_2),
+	EFIFB_SMBIOS_SYSTEM_ID("Apple Inc.", "MacBookPro2,1", M_MBP_2),
+	EFIFB_SMBIOS_SYSTEM_ID("Apple Computer, Inc.", "MacBookPro3,1",
+			       M_MBP_SR),
+	EFIFB_SMBIOS_SYSTEM_ID("Apple Inc.", "MacBookPro3,1", M_MBP_SR),
+	EFIFB_SMBIOS_SYSTEM_ID("Apple Inc.", "MacBookPro4,1", M_MBP_4),
+	EFIFB_SMBIOS_SYSTEM_ID("Apple Inc.", "MacBookPro5,1", M_MBP_5_1),
+	EFIFB_SMBIOS_SYSTEM_ID("Apple Inc.", "MacBookPro5,2", M_MBP_5_2),
+	EFIFB_SMBIOS_SYSTEM_ID("Apple Inc.", "MacBookPro5,3", M_MBP_5_3),
+	EFIFB_SMBIOS_SYSTEM_ID("Apple Inc.", "MacBookPro6,1", M_MBP_6_1),
+	EFIFB_SMBIOS_SYSTEM_ID("Apple Inc.", "MacBookPro6,2", M_MBP_6_2),
+	EFIFB_SMBIOS_SYSTEM_ID("Apple Inc.", "MacBookPro7,1", M_MBP_7_1),
+	EFIFB_SMBIOS_SYSTEM_ID("Apple Inc.", "MacBookPro8,2", M_MBP_8_2),
 	{},
 };
 
-#define choose_value(dmivalue, fwvalue, field, flags) ({	\
+#define choose_value(smbiosvalue, fwvalue, field, flags) ({	\
 		typeof(fwvalue) _ret_ = fwvalue;		\
 		if ((flags) & (field))				\
-			_ret_ = dmivalue;			\
+			_ret_ = smbiosvalue;			\
 		else if ((fwvalue) == 0)			\
-			_ret_ = dmivalue;			\
+			_ret_ = smbiosvalue;			\
 		_ret_;						\
 	})
 
-static int set_system(const struct dmi_system_id *id)
+static int set_system(const struct sysfw_id *id)
 {
-	struct efifb_dmi_info *info = id->driver_data;
+	struct efifb_smbios_info *info = id->driver_data;
 
 	if (info->base == 0 && info->height == 0 && info->width == 0
 			&& info->stride == 0)
@@ -244,7 +247,7 @@ static int set_system(const struct dmi_system_id *id)
 		return 0;
 	}
 
-	printk(KERN_INFO "efifb: dmi detected %s - framebuffer at 0x%08x "
+	printk(KERN_INFO "efifb: smbios detected %s - framebuffer at 0x%08x "
 			 "(%dx%d, stride %d)\n", id->ident,
 			 screen_info.lfb_base, screen_info.lfb_width,
 			 screen_info.lfb_height, screen_info.lfb_linelength);
@@ -310,12 +313,13 @@ static int __init efifb_setup(char *options)
 		if (!*this_opt) continue;
 
 		for (i = 0; i < M_UNKNOWN; i++) {
-			if (!strcmp(this_opt, dmi_list[i].optname) &&
-					dmi_list[i].base != 0) {
-				screen_info.lfb_base = dmi_list[i].base;
-				screen_info.lfb_linelength = dmi_list[i].stride;
-				screen_info.lfb_width = dmi_list[i].width;
-				screen_info.lfb_height = dmi_list[i].height;
+			if (!strcmp(this_opt, smbios_list[i].optname) &&
+					smbios_list[i].base != 0) {
+				screen_info.lfb_base = smbios_list[i].base;
+				screen_info.lfb_linelength =
+							  smbios_list[i].stride;
+				screen_info.lfb_width = smbios_list[i].width;
+				screen_info.lfb_height = smbios_list[i].height;
 			}
 		}
 		if (!strncmp(this_opt, "base:", 5))
@@ -514,7 +518,7 @@ static int __init efifb_init(void)
 	int ret;
 	char *option = NULL;
 
-	dmi_check_system(dmi_system_table);
+	sysfw_callback(smbios_system_table);
 
 	if (screen_info.orig_video_isVGA != VIDEO_TYPE_EFI)
 		return -ENODEV;
@@ -524,7 +528,7 @@ static int __init efifb_init(void)
 	efifb_setup(option);
 
 	/* We don't get linelength from UGA Draw Protocol, only from
-	 * EFI Graphics Protocol.  So if it's not in DMI, and it's not
+	 * EFI Graphics Protocol.  So if it's not in SMBIOS, and it's not
 	 * passed in from the user, we really can't use the framebuffer.
 	 */
 	if (!screen_info.lfb_linelength)
-- 
1.6.5.2


^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [PATCH 29/34] drivers/w1 changes for SMBIOS and System Firmware
  2011-07-18 13:08 [PATCH 00/34] System Firmware and SMBIOS Support [v3] Prarit Bhargava
                   ` (27 preceding siblings ...)
  2011-07-18 13:08 ` [PATCH 28/34] drivers/video " Prarit Bhargava
@ 2011-07-18 13:08 ` Prarit Bhargava
  2011-07-18 13:08 ` [PATCH 30/34] drivers/watchdog " Prarit Bhargava
                   ` (4 subsequent siblings)
  33 siblings, 0 replies; 48+ messages in thread
From: Prarit Bhargava @ 2011-07-18 13:08 UTC (permalink / raw)
  To: linux-kernel; +Cc: Prarit Bhargava, johnpol

As part of the new SMBIOS and System Firmware code:

- cleanup of includes for dmi.h and mod_devicetable.h which were included in
some files that did not need them

Cc: johnpol@2ka.mipt.ru
Signed-off-by: Prarit Bhargava <prarit@redhat.com>
---
 drivers/w1/masters/ds2490.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/w1/masters/ds2490.c b/drivers/w1/masters/ds2490.c
index 02bf7bf..56c2f90 100644
--- a/drivers/w1/masters/ds2490.c
+++ b/drivers/w1/masters/ds2490.c
@@ -21,7 +21,6 @@
 
 #include <linux/module.h>
 #include <linux/kernel.h>
-#include <linux/mod_devicetable.h>
 #include <linux/usb.h>
 #include <linux/slab.h>
 
-- 
1.6.5.2


^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [PATCH 30/34] drivers/watchdog changes for SMBIOS and System Firmware
  2011-07-18 13:08 [PATCH 00/34] System Firmware and SMBIOS Support [v3] Prarit Bhargava
                   ` (28 preceding siblings ...)
  2011-07-18 13:08 ` [PATCH 29/34] drivers/w1 " Prarit Bhargava
@ 2011-07-18 13:08 ` Prarit Bhargava
  2011-07-18 13:08 ` [PATCH 31/34] include/linux/acpi.h " Prarit Bhargava
                   ` (3 subsequent siblings)
  33 siblings, 0 replies; 48+ messages in thread
From: Prarit Bhargava @ 2011-07-18 13:08 UTC (permalink / raw)
  To: linux-kernel; +Cc: Prarit Bhargava, linux-watchdog

As part of the new SMBIOS and System Firmware code:

- Replace old dmi* structures and functions with new sysfw* and smbios*
structures and functions in individual drivers
- cleanup sysfw_id lookup tables

Cc: linux-watchdog@vger.kernel.org
Signed-off-by: Prarit Bhargava <prarit@redhat.com>
---
 drivers/watchdog/hpwdt.c          |   16 +++++++++-------
 drivers/watchdog/ibmasr.c         |    9 +++------
 drivers/watchdog/sbc_fitpc2_wdt.c |   22 +++++++++++++++-------
 3 files changed, 27 insertions(+), 20 deletions(-)

diff --git a/drivers/watchdog/hpwdt.c b/drivers/watchdog/hpwdt.c
index 8cb2685..8849eac 100644
--- a/drivers/watchdog/hpwdt.c
+++ b/drivers/watchdog/hpwdt.c
@@ -28,7 +28,7 @@
 #include <linux/uaccess.h>
 #include <linux/watchdog.h>
 #ifdef CONFIG_HPWDT_NMI_DECODING
-#include <linux/dmi.h>
+#include <linux/smbios.h>
 #include <linux/spinlock.h>
 #include <linux/nmi.h>
 #include <linux/kdebug.h>
@@ -374,19 +374,19 @@ asm(".text                      \n\t"
     ".previous");
 
 /*
- *	dmi_find_cru
+ *	smbios_find_cru
  *
  *	Routine Description:
- *	This function checks whether or not a SMBIOS/DMI record is
+ *	This function checks whether or not a SMBIOS/SMBIOS record is
  *	the 64bit CRU info or not
  */
-static void __devinit dmi_find_cru(const struct dmi_header *dm, void *dummy)
+static int __devinit smbios_find_cru(const union smbios_struct *ss, void *dummy)
 {
 	struct smbios_cru64_info *smbios_cru64_ptr;
 	unsigned long cru_physical_address;
 
-	if (dm->type == SMBIOS_CRU64_INFORMATION) {
-		smbios_cru64_ptr = (struct smbios_cru64_info *) dm;
+	if (ss->header.type == SMBIOS_CRU64_INFORMATION) {
+		smbios_cru64_ptr = (struct smbios_cru64_info *) &ss;
 		if (smbios_cru64_ptr->signature == CRU_BIOS_SIGNATURE_VALUE) {
 			cru_physical_address =
 				smbios_cru64_ptr->physical_address +
@@ -395,15 +395,17 @@ static void __devinit dmi_find_cru(const struct dmi_header *dm, void *dummy)
 				smbios_cru64_ptr->double_length);
 			set_memory_x((unsigned long)cru_rom_addr & PAGE_MASK,
 				smbios_cru64_ptr->double_length >> PAGE_SHIFT);
+			return SMBIOS_WALK_STOP;
 		}
 	}
+	return SMBIOS_WALK_CONTINUE;
 }
 
 static int __devinit detect_cru_service(void)
 {
 	cru_rom_addr = NULL;
 
-	dmi_walk(dmi_find_cru, NULL);
+	smbios_walk(smbios_find_cru, NULL);
 
 	/* if cru_rom_addr has been set then we found a CRU service */
 	return ((cru_rom_addr != NULL) ? 0 : -ENODEV);
diff --git a/drivers/watchdog/ibmasr.c b/drivers/watchdog/ibmasr.c
index 195e0f7..b8cc126 100644
--- a/drivers/watchdog/ibmasr.c
+++ b/drivers/watchdog/ibmasr.c
@@ -17,7 +17,7 @@
 #include <linux/timer.h>
 #include <linux/miscdevice.h>
 #include <linux/watchdog.h>
-#include <linux/dmi.h>
+#include <linux/smbios.h>
 #include <linux/io.h>
 #include <linux/uaccess.h>
 
@@ -376,12 +376,9 @@ static int __init ibmasr_init(void)
 	struct ibmasr_id *id;
 	int rc;
 
-	for (id = ibmasr_id_table; id->desc; id++) {
-		if (dmi_find_device(DMI_DEV_TYPE_OTHER, id->desc, NULL)) {
+	for (id = ibmasr_id_table; id->desc; id++)
+		if (smbios_is_onboard_device(id->desc, 0))
 			asr_type = id->type;
-			break;
-		}
-	}
 
 	if (!asr_type)
 		return -ENODEV;
diff --git a/drivers/watchdog/sbc_fitpc2_wdt.c b/drivers/watchdog/sbc_fitpc2_wdt.c
index d5d3994..0419e01 100644
--- a/drivers/watchdog/sbc_fitpc2_wdt.c
+++ b/drivers/watchdog/sbc_fitpc2_wdt.c
@@ -21,7 +21,7 @@
 #include <linux/fs.h>
 #include <linux/init.h>
 #include <linux/moduleparam.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include <linux/io.h>
 #include <linux/uaccess.h>
 
@@ -198,17 +198,25 @@ static struct miscdevice fitpc2_wdt_miscdev = {
 	.fops		= &fitpc2_wdt_fops,
 };
 
+static struct sysfw_id __initdata fitpc2_device_table[] = {
+	{
+		.ident = "SBC-FITPC2 Watchdog",
+		.matches = {
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "SBC-FITPC2"),
+		},
+	},
+	{}
+};
+
 static int __init fitpc2_wdt_init(void)
 {
 	int err;
-	const char *brd_name;
+	const struct sysfw_id *id;
 
-	brd_name = dmi_get_system_info(DMI_BOARD_NAME);
-
-	if (!brd_name || !strstr(brd_name, "SBC-FITPC2"))
+	id = sysfw_callback(fitpc2_device_table);
+	if (!id)
 		return -ENODEV;
-
-	pr_info("%s found\n", brd_name);
+	pr_info("%s found\n", id->ident);
 
 	if (!request_region(COMMAND_PORT, 1, WATCHDOG_NAME)) {
 		pr_err("I/O address 0x%04x already in use\n", COMMAND_PORT);
-- 
1.6.5.2


^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [PATCH 31/34] include/linux/acpi.h changes for SMBIOS and System Firmware
  2011-07-18 13:08 [PATCH 00/34] System Firmware and SMBIOS Support [v3] Prarit Bhargava
                   ` (29 preceding siblings ...)
  2011-07-18 13:08 ` [PATCH 30/34] drivers/watchdog " Prarit Bhargava
@ 2011-07-18 13:08 ` Prarit Bhargava
  2011-07-18 13:08 ` [PATCH 32/34] Kernel panic " Prarit Bhargava
                   ` (2 subsequent siblings)
  33 siblings, 0 replies; 48+ messages in thread
From: Prarit Bhargava @ 2011-07-18 13:08 UTC (permalink / raw)
  To: linux-kernel; +Cc: Prarit Bhargava, linux-acpi

As part of the new SMBIOS and System Firmware code:

- Replace old dmi* structures and functions with new sysfw* and smbios*
structures and functions in individual drivers

Cc: linux-acpi@vger.kernel.org
Signed-off-by: Prarit Bhargava <prarit@redhat.com>
---
 include/linux/acpi.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index 1deb2a7..29d7de8 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -217,7 +217,7 @@ static inline int acpi_video_display_switch_support(void)
 #endif /* defined(CONFIG_ACPI_VIDEO) || defined(CONFIG_ACPI_VIDEO_MODULE) */
 
 extern int acpi_blacklisted(void);
-extern void acpi_dmi_osi_linux(int enable, const struct dmi_system_id *d);
+extern void acpi_smbios_osi_linux(int enable, const struct sysfw_id *d);
 extern void acpi_osi_setup(char *str);
 
 #ifdef CONFIG_ACPI_NUMA
-- 
1.6.5.2


^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [PATCH 32/34] Kernel panic changes for SMBIOS and System Firmware
  2011-07-18 13:08 [PATCH 00/34] System Firmware and SMBIOS Support [v3] Prarit Bhargava
                   ` (30 preceding siblings ...)
  2011-07-18 13:08 ` [PATCH 31/34] include/linux/acpi.h " Prarit Bhargava
@ 2011-07-18 13:08 ` Prarit Bhargava
  2011-07-18 13:08 ` [PATCH 33/34] sound/pci/hda " Prarit Bhargava
  2011-07-18 13:08 ` [PATCH 34/34] Remove old DMI & SMBIOS code and make SMBIOS default on Prarit Bhargava
  33 siblings, 0 replies; 48+ messages in thread
From: Prarit Bhargava @ 2011-07-18 13:08 UTC (permalink / raw)
  To: linux-kernel; +Cc: Prarit Bhargava

As part of the new SMBIOS and System Firmware code:

- Replace old dmi* structures and functions with new sysfw* and smbios*
structures and functions in individual drivers

Signed-off-by: Prarit Bhargava <prarit@redhat.com>
---
 kernel/panic.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/panic.c b/kernel/panic.c
index 6923167..7b35089 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -22,7 +22,7 @@
 #include <linux/sysrq.h>
 #include <linux/init.h>
 #include <linux/nmi.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 
 #define PANIC_TIMER_STEP 100
 #define PANIC_BLINK_SPD 18
@@ -370,7 +370,7 @@ static void warn_slowpath_common(const char *file, int line, void *caller,
 
 	printk(KERN_WARNING "------------[ cut here ]------------\n");
 	printk(KERN_WARNING "WARNING: at %s:%d %pS()\n", file, line, caller);
-	board = dmi_get_system_info(DMI_PRODUCT_NAME);
+	board = sysfw_lookup(SYSFW_PRODUCT_NAME);
 	if (board)
 		printk(KERN_WARNING "Hardware name: %s\n", board);
 
-- 
1.6.5.2


^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [PATCH 33/34] sound/pci/hda changes for SMBIOS and System Firmware
  2011-07-18 13:08 [PATCH 00/34] System Firmware and SMBIOS Support [v3] Prarit Bhargava
                   ` (31 preceding siblings ...)
  2011-07-18 13:08 ` [PATCH 32/34] Kernel panic " Prarit Bhargava
@ 2011-07-18 13:08 ` Prarit Bhargava
  2011-07-18 13:08 ` [PATCH 34/34] Remove old DMI & SMBIOS code and make SMBIOS default on Prarit Bhargava
  33 siblings, 0 replies; 48+ messages in thread
From: Prarit Bhargava @ 2011-07-18 13:08 UTC (permalink / raw)
  To: linux-kernel; +Cc: Prarit Bhargava

As part of the new SMBIOS and System Firmware code:

- Replace old dmi* structures and functions with new sysfw* and smbios*
structures and functions in individual drivers

Signed-off-by: Prarit Bhargava <prarit@redhat.com>
---
 sound/pci/hda/patch_sigmatel.c |   29 +++++++++++++----------------
 1 files changed, 13 insertions(+), 16 deletions(-)

diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index 7f81cc2..271ea6a 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -28,7 +28,7 @@
 #include <linux/delay.h>
 #include <linux/slab.h>
 #include <linux/pci.h>
-#include <linux/dmi.h>
+#include <linux/smbios.h>
 #include <sound/core.h>
 #include <sound/asoundef.h>
 #include <sound/jack.h>
@@ -4798,26 +4798,23 @@ static void set_hp_led_gpio(struct hda_codec *codec)
 static int find_mute_led_gpio(struct hda_codec *codec, int default_polarity)
 {
 	struct sigmatel_spec *spec = codec->spec;
-	const struct dmi_device *dev = NULL;
+	const char *str;
 
 	if ((codec->subsystem_id >> 16) == PCI_VENDOR_ID_HP) {
-		while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING,
-								NULL, dev))) {
-			if (sscanf(dev->name, "HP_Mute_LED_%d_%d",
-				  &spec->gpio_led_polarity,
-				  &spec->gpio_led) == 2) {
-				spec->gpio_led = 1 << spec->gpio_led;
-				return 1;
-			}
-			if (sscanf(dev->name, "HP_Mute_LED_%d",
-				  &spec->gpio_led_polarity) == 1) {
-				set_hp_led_gpio(codec);
-				return 1;
-			}
+		str = smbios_match_oem_string("HP_Mute_LED_");
+		if (sscanf(str, "HP_Mute_LED_%d_%d", &spec->gpio_led_polarity,
+			   &spec->gpio_led) == 2) {
+			spec->gpio_led = 1 << spec->gpio_led;
+			return 1;
+		}
+		if (sscanf(str, "HP_Mute_LED_%d",
+			   &spec->gpio_led_polarity) == 1) {
+			set_hp_led_gpio(codec);
+			return 1;
 		}
 
 		/*
-		 * Fallback case - if we don't find the DMI strings,
+		 * Fallback case - if we don't find the SMBIOS strings,
 		 * we statically set the GPIO - if not a B-series system.
 		 */
 		if (!hp_blike_system(codec->subsystem_id)) {
-- 
1.6.5.2


^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [PATCH 34/34] Remove old DMI & SMBIOS code and make SMBIOS default on
  2011-07-18 13:08 [PATCH 00/34] System Firmware and SMBIOS Support [v3] Prarit Bhargava
                   ` (32 preceding siblings ...)
  2011-07-18 13:08 ` [PATCH 33/34] sound/pci/hda " Prarit Bhargava
@ 2011-07-18 13:08 ` Prarit Bhargava
  33 siblings, 0 replies; 48+ messages in thread
From: Prarit Bhargava @ 2011-07-18 13:08 UTC (permalink / raw)
  To: linux-kernel
  Cc: Prarit Bhargava, linux-ia64, x86, linux-acpi, linux-ide,
	openipmi-developer, platform-driver-x86, linux-crypto, dri-devel,
	lm-sensors, linux-i2c, linux-input, linux-media, netdev,
	linux-pci, rtc-linux, evel, linux-usb, device-drivers-devel,
	linux-watchdog, grant.likely, dz, rpurdie, eric.piel, abelay,
	johnpol

This code has now been completely replaced by the new System Firmware
Interface (SYSFW) and SMBIOS code.  It is no longer needed in the kernel.

Cc: linux-ia64@vger.kernel.org
Cc: x86@kernel.org
Cc: linux-acpi@vger.kernel.org
Cc: linux-ide@vger.kernel.org
Cc: openipmi-developer@lists.sourceforge.net
Cc: platform-driver-x86@vger.kernel.org
Cc: linux-crypto@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Cc: lm-sensors@lm-sensors.org
Cc: linux-i2c@vger.kernel.org
Cc: linux-ide@vger.kernel.org
Cc: linux-input@vger.kernel.org
Cc: linux-media@vger.kernel.org
Cc: netdev@vger.kernel.org
Cc: linux-pci@vger.kernel.org
Cc: rtc-linux@googlegroups.com
Cc: evel@driverdev.osuosl.org
Cc: linux-usb@vger.kernel.org
Cc: device-drivers-devel@blackfin.uclinux.org
Cc: linux-watchdog@vger.kernel.org
Cc: grant.likely@secretlab.ca
Cc: dz@debian.org
Cc: rpurdie@rpsys.net
Cc: eric.piel@tremplin-utc.net
Cc: abelay@mit.edu
Cc: johnpol@2ka.mipt.ru
Signed-off-by: Prarit Bhargava <prarit@redhat.com>
---
 arch/ia64/include/asm/dmi.h     |   12 -
 arch/x86/Kconfig                |    9 -
 arch/x86/include/asm/dmi.h      |   19 -
 drivers/firmware/Kconfig        |   20 -
 drivers/firmware/Makefile       |    3 -
 drivers/firmware/dmi-id.c       |  245 -------------
 drivers/firmware/dmi-sysfs.c    |  696 ------------------------------------
 drivers/firmware/dmi_scan.c     |  751 ---------------------------------------
 include/linux/dmi.h             |  139 -------
 include/linux/mod_devicetable.h |   55 ---
 10 files changed, 0 insertions(+), 1949 deletions(-)
 delete mode 100644 arch/ia64/include/asm/dmi.h
 delete mode 100644 arch/x86/include/asm/dmi.h
 delete mode 100644 drivers/firmware/dmi-id.c
 delete mode 100644 drivers/firmware/dmi-sysfs.c
 delete mode 100644 drivers/firmware/dmi_scan.c
 delete mode 100644 include/linux/dmi.h

diff --git a/arch/ia64/include/asm/dmi.h b/arch/ia64/include/asm/dmi.h
deleted file mode 100644
index 1ed4c8f..0000000
--- a/arch/ia64/include/asm/dmi.h
+++ /dev/null
@@ -1,12 +0,0 @@
-#ifndef _ASM_DMI_H
-#define _ASM_DMI_H 1
-
-#include <linux/slab.h>
-#include <asm/io.h>
-
-/* Use normal IO mappings for DMI */
-#define dmi_ioremap ioremap
-#define dmi_iounmap(x,l) iounmap(x)
-#define dmi_alloc(l) kmalloc(l, GFP_ATOMIC)
-
-#endif
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index e7cdde8..92ee12b 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -626,15 +626,6 @@ config APB_TIMER
 
 # Mark as expert because too many people got it wrong.
 # The code disables itself when not needed.
-config DMI
-	default y
-	bool "Enable DMI scanning" if EXPERT
-	---help---
-	  Enabled scanning of DMI to identify machine quirks. Say Y
-	  here unless you have verified that your setup is not
-	  affected by entries in the DMI blacklist. Required by PNP
-	  BIOS code.
-
 config SMBIOS
 	depends on SYSTEM_FIRMWARE
 	bool "Enable SMBIOS scanning" if EXPERT
diff --git a/arch/x86/include/asm/dmi.h b/arch/x86/include/asm/dmi.h
deleted file mode 100644
index fd8f9e2..0000000
--- a/arch/x86/include/asm/dmi.h
+++ /dev/null
@@ -1,19 +0,0 @@
-#ifndef _ASM_X86_DMI_H
-#define _ASM_X86_DMI_H
-
-#include <linux/compiler.h>
-#include <linux/init.h>
-
-#include <asm/io.h>
-#include <asm/setup.h>
-
-static __always_inline __init void *dmi_alloc(unsigned len)
-{
-	return extend_brk(len, sizeof(int));
-}
-
-/* Use early IO mappings for DMI because it's initialized early */
-#define dmi_ioremap early_ioremap
-#define dmi_iounmap early_iounmap
-
-#endif /* _ASM_X86_DMI_H */
diff --git a/drivers/firmware/Kconfig b/drivers/firmware/Kconfig
index 23066d8..a46c162 100644
--- a/drivers/firmware/Kconfig
+++ b/drivers/firmware/Kconfig
@@ -104,26 +104,6 @@ config DCDBAS
 	  Say Y or M here to enable the driver for use by Dell systems
 	  management software such as Dell OpenManage.
 
-config DMIID
-    bool "Export DMI identification via sysfs to userspace"
-    depends on DMI
-    default y
-	help
-	  Say Y here if you want to query SMBIOS/DMI system identification
-	  information from userspace through /sys/class/dmi/id/ or if you want
-	  DMI-based module auto-loading.
-
-config DMI_SYSFS
-	tristate "DMI table support in sysfs"
-	depends on SYSFS && DMI
-	default n
-	help
-	  Say Y or M here to enable the exporting of the raw DMI table
-	  data via sysfs.  This is useful for consuming the data without
-	  requiring any access to /dev/mem at all.  Tables are found
-	  under /sys/firmware/dmi when this option is enabled and
-	  loaded.
-
 config ISCSI_IBFT_FIND
 	bool "iSCSI Boot Firmware Table Attributes"
 	depends on X86
diff --git a/drivers/firmware/Makefile b/drivers/firmware/Makefile
index 5c9d81f..f372289 100644
--- a/drivers/firmware/Makefile
+++ b/drivers/firmware/Makefile
@@ -1,14 +1,11 @@
 #
 # Makefile for the linux kernel.
 #
-obj-$(CONFIG_DMI)		+= dmi_scan.o
-obj-$(CONFIG_DMI_SYSFS)		+= dmi-sysfs.o
 obj-$(CONFIG_EDD)		+= edd.o
 obj-$(CONFIG_EFI_VARS)		+= efivars.o
 obj-$(CONFIG_EFI_PCDP)		+= pcdp.o
 obj-$(CONFIG_DELL_RBU)          += dell_rbu.o
 obj-$(CONFIG_DCDBAS)		+= dcdbas.o
-obj-$(CONFIG_DMIID)		+= dmi-id.o
 obj-$(CONFIG_ISCSI_IBFT_FIND)	+= iscsi_ibft_find.o
 obj-$(CONFIG_ISCSI_IBFT)	+= iscsi_ibft.o
 obj-$(CONFIG_FIRMWARE_MEMMAP)	+= memmap.o
diff --git a/drivers/firmware/dmi-id.c b/drivers/firmware/dmi-id.c
deleted file mode 100644
index 94a58a0..0000000
--- a/drivers/firmware/dmi-id.c
+++ /dev/null
@@ -1,245 +0,0 @@
-/*
- * Export SMBIOS/DMI info via sysfs to userspace
- *
- * Copyright 2007, Lennart Poettering
- *
- * Licensed under GPLv2
- */
-
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/dmi.h>
-#include <linux/device.h>
-#include <linux/slab.h>
-
-struct dmi_device_attribute{
-	struct device_attribute dev_attr;
-	int field;
-};
-#define to_dmi_dev_attr(_dev_attr) \
-	container_of(_dev_attr, struct dmi_device_attribute, dev_attr)
-
-static ssize_t sys_dmi_field_show(struct device *dev,
-				  struct device_attribute *attr,
-				  char *page)
-{
-	int field = to_dmi_dev_attr(attr)->field;
-	ssize_t len;
-	len = scnprintf(page, PAGE_SIZE, "%s\n", dmi_get_system_info(field));
-	page[len-1] = '\n';
-	return len;
-}
-
-#define DMI_ATTR(_name, _mode, _show, _field)			\
-	{ .dev_attr = __ATTR(_name, _mode, _show, NULL),	\
-	  .field = _field }
-
-#define DEFINE_DMI_ATTR_WITH_SHOW(_name, _mode, _field)		\
-static struct dmi_device_attribute sys_dmi_##_name##_attr =	\
-	DMI_ATTR(_name, _mode, sys_dmi_field_show, _field);
-
-DEFINE_DMI_ATTR_WITH_SHOW(bios_vendor,		0444, DMI_BIOS_VENDOR);
-DEFINE_DMI_ATTR_WITH_SHOW(bios_version,		0444, DMI_BIOS_VERSION);
-DEFINE_DMI_ATTR_WITH_SHOW(bios_date,		0444, DMI_BIOS_DATE);
-DEFINE_DMI_ATTR_WITH_SHOW(sys_vendor,		0444, DMI_SYS_VENDOR);
-DEFINE_DMI_ATTR_WITH_SHOW(product_name,		0444, DMI_PRODUCT_NAME);
-DEFINE_DMI_ATTR_WITH_SHOW(product_version,	0444, DMI_PRODUCT_VERSION);
-DEFINE_DMI_ATTR_WITH_SHOW(product_serial,	0400, DMI_PRODUCT_SERIAL);
-DEFINE_DMI_ATTR_WITH_SHOW(product_uuid,		0400, DMI_PRODUCT_UUID);
-DEFINE_DMI_ATTR_WITH_SHOW(board_vendor,		0444, DMI_BOARD_VENDOR);
-DEFINE_DMI_ATTR_WITH_SHOW(board_name,		0444, DMI_BOARD_NAME);
-DEFINE_DMI_ATTR_WITH_SHOW(board_version,	0444, DMI_BOARD_VERSION);
-DEFINE_DMI_ATTR_WITH_SHOW(board_serial,		0400, DMI_BOARD_SERIAL);
-DEFINE_DMI_ATTR_WITH_SHOW(board_asset_tag,	0444, DMI_BOARD_ASSET_TAG);
-DEFINE_DMI_ATTR_WITH_SHOW(chassis_vendor,	0444, DMI_CHASSIS_VENDOR);
-DEFINE_DMI_ATTR_WITH_SHOW(chassis_type,		0444, DMI_CHASSIS_TYPE);
-DEFINE_DMI_ATTR_WITH_SHOW(chassis_version,	0444, DMI_CHASSIS_VERSION);
-DEFINE_DMI_ATTR_WITH_SHOW(chassis_serial,	0400, DMI_CHASSIS_SERIAL);
-DEFINE_DMI_ATTR_WITH_SHOW(chassis_asset_tag,	0444, DMI_CHASSIS_ASSET_TAG);
-
-static void ascii_filter(char *d, const char *s)
-{
-	/* Filter out characters we don't want to see in the modalias string */
-	for (; *s; s++)
-		if (*s > ' ' && *s < 127 && *s != ':')
-			*(d++) = *s;
-
-	*d = 0;
-}
-
-static ssize_t get_modalias(char *buffer, size_t buffer_size)
-{
-	static const struct mafield {
-		const char *prefix;
-		int field;
-	} fields[] = {
-		{ "bvn", DMI_BIOS_VENDOR },
-		{ "bvr", DMI_BIOS_VERSION },
-		{ "bd",  DMI_BIOS_DATE },
-		{ "svn", DMI_SYS_VENDOR },
-		{ "pn",  DMI_PRODUCT_NAME },
-		{ "pvr", DMI_PRODUCT_VERSION },
-		{ "rvn", DMI_BOARD_VENDOR },
-		{ "rn",  DMI_BOARD_NAME },
-		{ "rvr", DMI_BOARD_VERSION },
-		{ "cvn", DMI_CHASSIS_VENDOR },
-		{ "ct",  DMI_CHASSIS_TYPE },
-		{ "cvr", DMI_CHASSIS_VERSION },
-		{ NULL,  DMI_NONE }
-	};
-
-	ssize_t l, left;
-	char *p;
-	const struct mafield *f;
-
-	strcpy(buffer, "dmi");
-	p = buffer + 3; left = buffer_size - 4;
-
-	for (f = fields; f->prefix && left > 0; f++) {
-		const char *c;
-		char *t;
-
-		c = dmi_get_system_info(f->field);
-		if (!c)
-			continue;
-
-		t = kmalloc(strlen(c) + 1, GFP_KERNEL);
-		if (!t)
-			break;
-		ascii_filter(t, c);
-		l = scnprintf(p, left, ":%s%s", f->prefix, t);
-		kfree(t);
-
-		p += l;
-		left -= l;
-	}
-
-	p[0] = ':';
-	p[1] = 0;
-
-	return p - buffer + 1;
-}
-
-static ssize_t sys_dmi_modalias_show(struct device *dev,
-				     struct device_attribute *attr, char *page)
-{
-	ssize_t r;
-	r = get_modalias(page, PAGE_SIZE-1);
-	page[r] = '\n';
-	page[r+1] = 0;
-	return r+1;
-}
-
-static struct device_attribute sys_dmi_modalias_attr =
-	__ATTR(modalias, 0444, sys_dmi_modalias_show, NULL);
-
-static struct attribute *sys_dmi_attributes[DMI_STRING_MAX+2];
-
-static struct attribute_group sys_dmi_attribute_group = {
-	.attrs = sys_dmi_attributes,
-};
-
-static const struct attribute_group* sys_dmi_attribute_groups[] = {
-	&sys_dmi_attribute_group,
-	NULL
-};
-
-static int dmi_dev_uevent(struct device *dev, struct kobj_uevent_env *env)
-{
-	ssize_t len;
-
-	if (add_uevent_var(env, "MODALIAS="))
-		return -ENOMEM;
-	len = get_modalias(&env->buf[env->buflen - 1],
-			   sizeof(env->buf) - env->buflen);
-	if (len >= (sizeof(env->buf) - env->buflen))
-		return -ENOMEM;
-	env->buflen += len;
-	return 0;
-}
-
-static struct class dmi_class = {
-	.name = "dmi",
-	.dev_release = (void(*)(struct device *)) kfree,
-	.dev_uevent = dmi_dev_uevent,
-};
-
-static struct device *dmi_dev;
-
-/* Initialization */
-
-#define ADD_DMI_ATTR(_name, _field) \
-	if (dmi_get_system_info(_field)) \
-		sys_dmi_attributes[i++] = &sys_dmi_##_name##_attr.dev_attr.attr;
-
-/* In a separate function to keep gcc 3.2 happy - do NOT merge this in
-   dmi_id_init! */
-static void __init dmi_id_init_attr_table(void)
-{
-	int i;
-
-	/* Not necessarily all DMI fields are available on all
-	 * systems, hence let's built an attribute table of just
-	 * what's available */
-	i = 0;
-	ADD_DMI_ATTR(bios_vendor,       DMI_BIOS_VENDOR);
-	ADD_DMI_ATTR(bios_version,      DMI_BIOS_VERSION);
-	ADD_DMI_ATTR(bios_date,         DMI_BIOS_DATE);
-	ADD_DMI_ATTR(sys_vendor,        DMI_SYS_VENDOR);
-	ADD_DMI_ATTR(product_name,      DMI_PRODUCT_NAME);
-	ADD_DMI_ATTR(product_version,   DMI_PRODUCT_VERSION);
-	ADD_DMI_ATTR(product_serial,    DMI_PRODUCT_SERIAL);
-	ADD_DMI_ATTR(product_uuid,      DMI_PRODUCT_UUID);
-	ADD_DMI_ATTR(board_vendor,      DMI_BOARD_VENDOR);
-	ADD_DMI_ATTR(board_name,        DMI_BOARD_NAME);
-	ADD_DMI_ATTR(board_version,     DMI_BOARD_VERSION);
-	ADD_DMI_ATTR(board_serial,      DMI_BOARD_SERIAL);
-	ADD_DMI_ATTR(board_asset_tag,   DMI_BOARD_ASSET_TAG);
-	ADD_DMI_ATTR(chassis_vendor,    DMI_CHASSIS_VENDOR);
-	ADD_DMI_ATTR(chassis_type,      DMI_CHASSIS_TYPE);
-	ADD_DMI_ATTR(chassis_version,   DMI_CHASSIS_VERSION);
-	ADD_DMI_ATTR(chassis_serial,    DMI_CHASSIS_SERIAL);
-	ADD_DMI_ATTR(chassis_asset_tag, DMI_CHASSIS_ASSET_TAG);
-	sys_dmi_attributes[i++] = &sys_dmi_modalias_attr.attr;
-}
-
-static int __init dmi_id_init(void)
-{
-	int ret;
-
-	if (!dmi_available)
-		return -ENODEV;
-
-	dmi_id_init_attr_table();
-
-	ret = class_register(&dmi_class);
-	if (ret)
-		return ret;
-
-	dmi_dev = kzalloc(sizeof(*dmi_dev), GFP_KERNEL);
-	if (!dmi_dev) {
-		ret = -ENOMEM;
-		goto fail_class_unregister;
-	}
-
-	dmi_dev->class = &dmi_class;
-	dev_set_name(dmi_dev, "id");
-	dmi_dev->groups = sys_dmi_attribute_groups;
-
-	ret = device_register(dmi_dev);
-	if (ret)
-		goto fail_free_dmi_dev;
-
-	return 0;
-
-fail_free_dmi_dev:
-	kfree(dmi_dev);
-fail_class_unregister:
-
-	class_unregister(&dmi_class);
-
-	return ret;
-}
-
-arch_initcall(dmi_id_init);
diff --git a/drivers/firmware/dmi-sysfs.c b/drivers/firmware/dmi-sysfs.c
deleted file mode 100644
index eb26d62..0000000
--- a/drivers/firmware/dmi-sysfs.c
+++ /dev/null
@@ -1,696 +0,0 @@
-/*
- * dmi-sysfs.c
- *
- * This module exports the DMI tables read-only to userspace through the
- * sysfs file system.
- *
- * Data is currently found below
- *    /sys/firmware/dmi/...
- *
- * DMI attributes are presented in attribute files with names
- * formatted using %d-%d, so that the first integer indicates the
- * structure type (0-255), and the second field is the instance of that
- * entry.
- *
- * Copyright 2011 Google, Inc.
- */
-
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/module.h>
-#include <linux/types.h>
-#include <linux/kobject.h>
-#include <linux/dmi.h>
-#include <linux/capability.h>
-#include <linux/slab.h>
-#include <linux/list.h>
-#include <linux/io.h>
-
-#define MAX_ENTRY_TYPE 255 /* Most of these aren't used, but we consider
-			      the top entry type is only 8 bits */
-
-struct dmi_sysfs_entry {
-	struct dmi_header dh;
-	struct kobject kobj;
-	int instance;
-	int position;
-	struct list_head list;
-	struct kobject *child;
-};
-
-/*
- * Global list of dmi_sysfs_entry.  Even though this should only be
- * manipulated at setup and teardown, the lazy nature of the kobject
- * system means we get lazy removes.
- */
-static LIST_HEAD(entry_list);
-static DEFINE_SPINLOCK(entry_list_lock);
-
-/* dmi_sysfs_attribute - Top level attribute. used by all entries. */
-struct dmi_sysfs_attribute {
-	struct attribute attr;
-	ssize_t (*show)(struct dmi_sysfs_entry *entry, char *buf);
-};
-
-#define DMI_SYSFS_ATTR(_entry, _name) \
-struct dmi_sysfs_attribute dmi_sysfs_attr_##_entry##_##_name = { \
-	.attr = {.name = __stringify(_name), .mode = 0400}, \
-	.show = dmi_sysfs_##_entry##_##_name, \
-}
-
-/*
- * dmi_sysfs_mapped_attribute - Attribute where we require the entry be
- * mapped in.  Use in conjunction with dmi_sysfs_specialize_attr_ops.
- */
-struct dmi_sysfs_mapped_attribute {
-	struct attribute attr;
-	ssize_t (*show)(struct dmi_sysfs_entry *entry,
-			const struct dmi_header *dh,
-			char *buf);
-};
-
-#define DMI_SYSFS_MAPPED_ATTR(_entry, _name) \
-struct dmi_sysfs_mapped_attribute dmi_sysfs_attr_##_entry##_##_name = { \
-	.attr = {.name = __stringify(_name), .mode = 0400}, \
-	.show = dmi_sysfs_##_entry##_##_name, \
-}
-
-/*************************************************
- * Generic DMI entry support.
- *************************************************/
-static void dmi_entry_free(struct kobject *kobj)
-{
-	kfree(kobj);
-}
-
-static struct dmi_sysfs_entry *to_entry(struct kobject *kobj)
-{
-	return container_of(kobj, struct dmi_sysfs_entry, kobj);
-}
-
-static struct dmi_sysfs_attribute *to_attr(struct attribute *attr)
-{
-	return container_of(attr, struct dmi_sysfs_attribute, attr);
-}
-
-static ssize_t dmi_sysfs_attr_show(struct kobject *kobj,
-				   struct attribute *_attr, char *buf)
-{
-	struct dmi_sysfs_entry *entry = to_entry(kobj);
-	struct dmi_sysfs_attribute *attr = to_attr(_attr);
-
-	/* DMI stuff is only ever admin visible */
-	if (!capable(CAP_SYS_ADMIN))
-		return -EACCES;
-
-	return attr->show(entry, buf);
-}
-
-static const struct sysfs_ops dmi_sysfs_attr_ops = {
-	.show = dmi_sysfs_attr_show,
-};
-
-typedef ssize_t (*dmi_callback)(struct dmi_sysfs_entry *,
-				const struct dmi_header *dh, void *);
-
-struct find_dmi_data {
-	struct dmi_sysfs_entry	*entry;
-	dmi_callback		callback;
-	void			*private;
-	int			instance_countdown;
-	ssize_t			ret;
-};
-
-static void find_dmi_entry_helper(const struct dmi_header *dh,
-				  void *_data)
-{
-	struct find_dmi_data *data = _data;
-	struct dmi_sysfs_entry *entry = data->entry;
-
-	/* Is this the entry we want? */
-	if (dh->type != entry->dh.type)
-		return;
-
-	if (data->instance_countdown != 0) {
-		/* try the next instance? */
-		data->instance_countdown--;
-		return;
-	}
-
-	/*
-	 * Don't ever revisit the instance.  Short circuit later
-	 * instances by letting the instance_countdown run negative
-	 */
-	data->instance_countdown--;
-
-	/* Found the entry */
-	data->ret = data->callback(entry, dh, data->private);
-}
-
-/* State for passing the read parameters through dmi_find_entry() */
-struct dmi_read_state {
-	char *buf;
-	loff_t pos;
-	size_t count;
-};
-
-static ssize_t find_dmi_entry(struct dmi_sysfs_entry *entry,
-			      dmi_callback callback, void *private)
-{
-	struct find_dmi_data data = {
-		.entry = entry,
-		.callback = callback,
-		.private = private,
-		.instance_countdown = entry->instance,
-		.ret = -EIO,  /* To signal the entry disappeared */
-	};
-	int ret;
-
-	ret = dmi_walk(find_dmi_entry_helper, &data);
-	/* This shouldn't happen, but just in case. */
-	if (ret)
-		return -EINVAL;
-	return data.ret;
-}
-
-/*
- * Calculate and return the byte length of the dmi entry identified by
- * dh.  This includes both the formatted portion as well as the
- * unformatted string space, including the two trailing nul characters.
- */
-static size_t dmi_entry_length(const struct dmi_header *dh)
-{
-	const char *p = (const char *)dh;
-
-	p += dh->length;
-
-	while (p[0] || p[1])
-		p++;
-
-	return 2 + p - (const char *)dh;
-}
-
-/*************************************************
- * Support bits for specialized DMI entry support
- *************************************************/
-struct dmi_entry_attr_show_data {
-	struct attribute *attr;
-	char *buf;
-};
-
-static ssize_t dmi_entry_attr_show_helper(struct dmi_sysfs_entry *entry,
-					  const struct dmi_header *dh,
-					  void *_data)
-{
-	struct dmi_entry_attr_show_data *data = _data;
-	struct dmi_sysfs_mapped_attribute *attr;
-
-	attr = container_of(data->attr,
-			    struct dmi_sysfs_mapped_attribute, attr);
-	return attr->show(entry, dh, data->buf);
-}
-
-static ssize_t dmi_entry_attr_show(struct kobject *kobj,
-				   struct attribute *attr,
-				   char *buf)
-{
-	struct dmi_entry_attr_show_data data = {
-		.attr = attr,
-		.buf  = buf,
-	};
-	/* Find the entry according to our parent and call the
-	 * normalized show method hanging off of the attribute */
-	return find_dmi_entry(to_entry(kobj->parent),
-			      dmi_entry_attr_show_helper, &data);
-}
-
-static const struct sysfs_ops dmi_sysfs_specialize_attr_ops = {
-	.show = dmi_entry_attr_show,
-};
-
-/*************************************************
- * Specialized DMI entry support.
- *************************************************/
-
-/*** Type 15 - System Event Table ***/
-
-#define DMI_SEL_ACCESS_METHOD_IO8	0x00
-#define DMI_SEL_ACCESS_METHOD_IO2x8	0x01
-#define DMI_SEL_ACCESS_METHOD_IO16	0x02
-#define DMI_SEL_ACCESS_METHOD_PHYS32	0x03
-#define DMI_SEL_ACCESS_METHOD_GPNV	0x04
-
-struct dmi_system_event_log {
-	struct dmi_header header;
-	u16	area_length;
-	u16	header_start_offset;
-	u16	data_start_offset;
-	u8	access_method;
-	u8	status;
-	u32	change_token;
-	union {
-		struct {
-			u16 index_addr;
-			u16 data_addr;
-		} io;
-		u32	phys_addr32;
-		u16	gpnv_handle;
-		u32	access_method_address;
-	};
-	u8	header_format;
-	u8	type_descriptors_supported_count;
-	u8	per_log_type_descriptor_length;
-	u8	supported_log_type_descriptos[0];
-} __packed;
-
-#define DMI_SYSFS_SEL_FIELD(_field) \
-static ssize_t dmi_sysfs_sel_##_field(struct dmi_sysfs_entry *entry, \
-				      const struct dmi_header *dh, \
-				      char *buf) \
-{ \
-	struct dmi_system_event_log sel; \
-	if (sizeof(sel) > dmi_entry_length(dh)) \
-		return -EIO; \
-	memcpy(&sel, dh, sizeof(sel)); \
-	return sprintf(buf, "%u\n", sel._field); \
-} \
-static DMI_SYSFS_MAPPED_ATTR(sel, _field)
-
-DMI_SYSFS_SEL_FIELD(area_length);
-DMI_SYSFS_SEL_FIELD(header_start_offset);
-DMI_SYSFS_SEL_FIELD(data_start_offset);
-DMI_SYSFS_SEL_FIELD(access_method);
-DMI_SYSFS_SEL_FIELD(status);
-DMI_SYSFS_SEL_FIELD(change_token);
-DMI_SYSFS_SEL_FIELD(access_method_address);
-DMI_SYSFS_SEL_FIELD(header_format);
-DMI_SYSFS_SEL_FIELD(type_descriptors_supported_count);
-DMI_SYSFS_SEL_FIELD(per_log_type_descriptor_length);
-
-static struct attribute *dmi_sysfs_sel_attrs[] = {
-	&dmi_sysfs_attr_sel_area_length.attr,
-	&dmi_sysfs_attr_sel_header_start_offset.attr,
-	&dmi_sysfs_attr_sel_data_start_offset.attr,
-	&dmi_sysfs_attr_sel_access_method.attr,
-	&dmi_sysfs_attr_sel_status.attr,
-	&dmi_sysfs_attr_sel_change_token.attr,
-	&dmi_sysfs_attr_sel_access_method_address.attr,
-	&dmi_sysfs_attr_sel_header_format.attr,
-	&dmi_sysfs_attr_sel_type_descriptors_supported_count.attr,
-	&dmi_sysfs_attr_sel_per_log_type_descriptor_length.attr,
-	NULL,
-};
-
-
-static struct kobj_type dmi_system_event_log_ktype = {
-	.release = dmi_entry_free,
-	.sysfs_ops = &dmi_sysfs_specialize_attr_ops,
-	.default_attrs = dmi_sysfs_sel_attrs,
-};
-
-typedef u8 (*sel_io_reader)(const struct dmi_system_event_log *sel,
-			    loff_t offset);
-
-static DEFINE_MUTEX(io_port_lock);
-
-static u8 read_sel_8bit_indexed_io(const struct dmi_system_event_log *sel,
-				   loff_t offset)
-{
-	u8 ret;
-
-	mutex_lock(&io_port_lock);
-	outb((u8)offset, sel->io.index_addr);
-	ret = inb(sel->io.data_addr);
-	mutex_unlock(&io_port_lock);
-	return ret;
-}
-
-static u8 read_sel_2x8bit_indexed_io(const struct dmi_system_event_log *sel,
-				     loff_t offset)
-{
-	u8 ret;
-
-	mutex_lock(&io_port_lock);
-	outb((u8)offset, sel->io.index_addr);
-	outb((u8)(offset >> 8), sel->io.index_addr + 1);
-	ret = inb(sel->io.data_addr);
-	mutex_unlock(&io_port_lock);
-	return ret;
-}
-
-static u8 read_sel_16bit_indexed_io(const struct dmi_system_event_log *sel,
-				    loff_t offset)
-{
-	u8 ret;
-
-	mutex_lock(&io_port_lock);
-	outw((u16)offset, sel->io.index_addr);
-	ret = inb(sel->io.data_addr);
-	mutex_unlock(&io_port_lock);
-	return ret;
-}
-
-static sel_io_reader sel_io_readers[] = {
-	[DMI_SEL_ACCESS_METHOD_IO8]	= read_sel_8bit_indexed_io,
-	[DMI_SEL_ACCESS_METHOD_IO2x8]	= read_sel_2x8bit_indexed_io,
-	[DMI_SEL_ACCESS_METHOD_IO16]	= read_sel_16bit_indexed_io,
-};
-
-static ssize_t dmi_sel_raw_read_io(struct dmi_sysfs_entry *entry,
-				   const struct dmi_system_event_log *sel,
-				   char *buf, loff_t pos, size_t count)
-{
-	ssize_t wrote = 0;
-
-	sel_io_reader io_reader = sel_io_readers[sel->access_method];
-
-	while (count && pos < sel->area_length) {
-		count--;
-		*(buf++) = io_reader(sel, pos++);
-		wrote++;
-	}
-
-	return wrote;
-}
-
-static ssize_t dmi_sel_raw_read_phys32(struct dmi_sysfs_entry *entry,
-				       const struct dmi_system_event_log *sel,
-				       char *buf, loff_t pos, size_t count)
-{
-	u8 __iomem *mapped;
-	ssize_t wrote = 0;
-
-	mapped = ioremap(sel->access_method_address, sel->area_length);
-	if (!mapped)
-		return -EIO;
-
-	while (count && pos < sel->area_length) {
-		count--;
-		*(buf++) = readb(mapped + pos++);
-		wrote++;
-	}
-
-	iounmap(mapped);
-	return wrote;
-}
-
-static ssize_t dmi_sel_raw_read_helper(struct dmi_sysfs_entry *entry,
-				       const struct dmi_header *dh,
-				       void *_state)
-{
-	struct dmi_read_state *state = _state;
-	struct dmi_system_event_log sel;
-
-	if (sizeof(sel) > dmi_entry_length(dh))
-		return -EIO;
-
-	memcpy(&sel, dh, sizeof(sel));
-
-	switch (sel.access_method) {
-	case DMI_SEL_ACCESS_METHOD_IO8:
-	case DMI_SEL_ACCESS_METHOD_IO2x8:
-	case DMI_SEL_ACCESS_METHOD_IO16:
-		return dmi_sel_raw_read_io(entry, &sel, state->buf,
-					   state->pos, state->count);
-	case DMI_SEL_ACCESS_METHOD_PHYS32:
-		return dmi_sel_raw_read_phys32(entry, &sel, state->buf,
-					       state->pos, state->count);
-	case DMI_SEL_ACCESS_METHOD_GPNV:
-		pr_info("dmi-sysfs: GPNV support missing.\n");
-		return -EIO;
-	default:
-		pr_info("dmi-sysfs: Unknown access method %02x\n",
-			sel.access_method);
-		return -EIO;
-	}
-}
-
-static ssize_t dmi_sel_raw_read(struct file *filp, struct kobject *kobj,
-				struct bin_attribute *bin_attr,
-				char *buf, loff_t pos, size_t count)
-{
-	struct dmi_sysfs_entry *entry = to_entry(kobj->parent);
-	struct dmi_read_state state = {
-		.buf = buf,
-		.pos = pos,
-		.count = count,
-	};
-
-	return find_dmi_entry(entry, dmi_sel_raw_read_helper, &state);
-}
-
-static struct bin_attribute dmi_sel_raw_attr = {
-	.attr = {.name = "raw_event_log", .mode = 0400},
-	.read = dmi_sel_raw_read,
-};
-
-static int dmi_system_event_log(struct dmi_sysfs_entry *entry)
-{
-	int ret;
-
-	entry->child = kzalloc(sizeof(*entry->child), GFP_KERNEL);
-	if (!entry->child)
-		return -ENOMEM;
-	ret = kobject_init_and_add(entry->child,
-				   &dmi_system_event_log_ktype,
-				   &entry->kobj,
-				   "system_event_log");
-	if (ret)
-		goto out_free;
-
-	ret = sysfs_create_bin_file(entry->child, &dmi_sel_raw_attr);
-	if (ret)
-		goto out_del;
-
-	return 0;
-
-out_del:
-	kobject_del(entry->child);
-out_free:
-	kfree(entry->child);
-	return ret;
-}
-
-/*************************************************
- * Generic DMI entry support.
- *************************************************/
-
-static ssize_t dmi_sysfs_entry_length(struct dmi_sysfs_entry *entry, char *buf)
-{
-	return sprintf(buf, "%d\n", entry->dh.length);
-}
-
-static ssize_t dmi_sysfs_entry_handle(struct dmi_sysfs_entry *entry, char *buf)
-{
-	return sprintf(buf, "%d\n", entry->dh.handle);
-}
-
-static ssize_t dmi_sysfs_entry_type(struct dmi_sysfs_entry *entry, char *buf)
-{
-	return sprintf(buf, "%d\n", entry->dh.type);
-}
-
-static ssize_t dmi_sysfs_entry_instance(struct dmi_sysfs_entry *entry,
-					char *buf)
-{
-	return sprintf(buf, "%d\n", entry->instance);
-}
-
-static ssize_t dmi_sysfs_entry_position(struct dmi_sysfs_entry *entry,
-					char *buf)
-{
-	return sprintf(buf, "%d\n", entry->position);
-}
-
-static DMI_SYSFS_ATTR(entry, length);
-static DMI_SYSFS_ATTR(entry, handle);
-static DMI_SYSFS_ATTR(entry, type);
-static DMI_SYSFS_ATTR(entry, instance);
-static DMI_SYSFS_ATTR(entry, position);
-
-static struct attribute *dmi_sysfs_entry_attrs[] = {
-	&dmi_sysfs_attr_entry_length.attr,
-	&dmi_sysfs_attr_entry_handle.attr,
-	&dmi_sysfs_attr_entry_type.attr,
-	&dmi_sysfs_attr_entry_instance.attr,
-	&dmi_sysfs_attr_entry_position.attr,
-	NULL,
-};
-
-static ssize_t dmi_entry_raw_read_helper(struct dmi_sysfs_entry *entry,
-					 const struct dmi_header *dh,
-					 void *_state)
-{
-	struct dmi_read_state *state = _state;
-	size_t entry_length;
-
-	entry_length = dmi_entry_length(dh);
-
-	return memory_read_from_buffer(state->buf, state->count,
-				       &state->pos, dh, entry_length);
-}
-
-static ssize_t dmi_entry_raw_read(struct file *filp,
-				  struct kobject *kobj,
-				  struct bin_attribute *bin_attr,
-				  char *buf, loff_t pos, size_t count)
-{
-	struct dmi_sysfs_entry *entry = to_entry(kobj);
-	struct dmi_read_state state = {
-		.buf = buf,
-		.pos = pos,
-		.count = count,
-	};
-
-	return find_dmi_entry(entry, dmi_entry_raw_read_helper, &state);
-}
-
-static const struct bin_attribute dmi_entry_raw_attr = {
-	.attr = {.name = "raw", .mode = 0400},
-	.read = dmi_entry_raw_read,
-};
-
-static void dmi_sysfs_entry_release(struct kobject *kobj)
-{
-	struct dmi_sysfs_entry *entry = to_entry(kobj);
-	sysfs_remove_bin_file(&entry->kobj, &dmi_entry_raw_attr);
-	spin_lock(&entry_list_lock);
-	list_del(&entry->list);
-	spin_unlock(&entry_list_lock);
-	kfree(entry);
-}
-
-static struct kobj_type dmi_sysfs_entry_ktype = {
-	.release = dmi_sysfs_entry_release,
-	.sysfs_ops = &dmi_sysfs_attr_ops,
-	.default_attrs = dmi_sysfs_entry_attrs,
-};
-
-static struct kobject *dmi_kobj;
-static struct kset *dmi_kset;
-
-/* Global count of all instances seen.  Only for setup */
-static int __initdata instance_counts[MAX_ENTRY_TYPE + 1];
-
-/* Global positional count of all entries seen.  Only for setup */
-static int __initdata position_count;
-
-static void __init dmi_sysfs_register_handle(const struct dmi_header *dh,
-					     void *_ret)
-{
-	struct dmi_sysfs_entry *entry;
-	int *ret = _ret;
-
-	/* If a previous entry saw an error, short circuit */
-	if (*ret)
-		return;
-
-	/* Allocate and register a new entry into the entries set */
-	entry = kzalloc(sizeof(*entry), GFP_KERNEL);
-	if (!entry) {
-		*ret = -ENOMEM;
-		return;
-	}
-
-	/* Set the key */
-	memcpy(&entry->dh, dh, sizeof(*dh));
-	entry->instance = instance_counts[dh->type]++;
-	entry->position = position_count++;
-
-	entry->kobj.kset = dmi_kset;
-	*ret = kobject_init_and_add(&entry->kobj, &dmi_sysfs_entry_ktype, NULL,
-				    "%d-%d", dh->type, entry->instance);
-
-	if (*ret) {
-		kfree(entry);
-		return;
-	}
-
-	/* Thread on the global list for cleanup */
-	spin_lock(&entry_list_lock);
-	list_add_tail(&entry->list, &entry_list);
-	spin_unlock(&entry_list_lock);
-
-	/* Handle specializations by type */
-	switch (dh->type) {
-	case DMI_ENTRY_SYSTEM_EVENT_LOG:
-		*ret = dmi_system_event_log(entry);
-		break;
-	default:
-		/* No specialization */
-		break;
-	}
-	if (*ret)
-		goto out_err;
-
-	/* Create the raw binary file to access the entry */
-	*ret = sysfs_create_bin_file(&entry->kobj, &dmi_entry_raw_attr);
-	if (*ret)
-		goto out_err;
-
-	return;
-out_err:
-	kobject_put(entry->child);
-	kobject_put(&entry->kobj);
-	return;
-}
-
-static void cleanup_entry_list(void)
-{
-	struct dmi_sysfs_entry *entry, *next;
-
-	/* No locks, we are on our way out */
-	list_for_each_entry_safe(entry, next, &entry_list, list) {
-		kobject_put(entry->child);
-		kobject_put(&entry->kobj);
-	}
-}
-
-static int __init dmi_sysfs_init(void)
-{
-	int error = -ENOMEM;
-	int val;
-
-	/* Set up our directory */
-	dmi_kobj = kobject_create_and_add("dmi", firmware_kobj);
-	if (!dmi_kobj)
-		goto err;
-
-	dmi_kset = kset_create_and_add("entries", NULL, dmi_kobj);
-	if (!dmi_kset)
-		goto err;
-
-	val = 0;
-	error = dmi_walk(dmi_sysfs_register_handle, &val);
-	if (error)
-		goto err;
-	if (val) {
-		error = val;
-		goto err;
-	}
-
-	pr_debug("dmi-sysfs: loaded.\n");
-
-	return 0;
-err:
-	cleanup_entry_list();
-	kset_unregister(dmi_kset);
-	kobject_put(dmi_kobj);
-	return error;
-}
-
-/* clean up everything. */
-static void __exit dmi_sysfs_exit(void)
-{
-	pr_debug("dmi-sysfs: unloading.\n");
-	cleanup_entry_list();
-	kset_unregister(dmi_kset);
-	kobject_put(dmi_kobj);
-}
-
-module_init(dmi_sysfs_init);
-module_exit(dmi_sysfs_exit);
-
-MODULE_AUTHOR("Mike Waychison <mikew@google.com>");
-MODULE_DESCRIPTION("DMI sysfs support");
-MODULE_LICENSE("GPL");
diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c
deleted file mode 100644
index bcb1126..0000000
--- a/drivers/firmware/dmi_scan.c
+++ /dev/null
@@ -1,751 +0,0 @@
-#include <linux/types.h>
-#include <linux/string.h>
-#include <linux/init.h>
-#include <linux/module.h>
-#include <linux/ctype.h>
-#include <linux/dmi.h>
-#include <linux/efi.h>
-#include <linux/bootmem.h>
-#include <asm/dmi.h>
-
-/*
- * DMI stands for "Desktop Management Interface".  It is part
- * of and an antecedent to, SMBIOS, which stands for System
- * Management BIOS.  See further: http://www.dmtf.org/standards
- */
-static char dmi_empty_string[] = "        ";
-
-/*
- * Catch too early calls to dmi_check_system():
- */
-static int dmi_initialized;
-
-static const char * __init dmi_string_nosave(const struct dmi_header *dm, u8 s)
-{
-	const u8 *bp = ((u8 *) dm) + dm->length;
-
-	if (s) {
-		s--;
-		while (s > 0 && *bp) {
-			bp += strlen(bp) + 1;
-			s--;
-		}
-
-		if (*bp != 0) {
-			size_t len = strlen(bp)+1;
-			size_t cmp_len = len > 8 ? 8 : len;
-
-			if (!memcmp(bp, dmi_empty_string, cmp_len))
-				return dmi_empty_string;
-			return bp;
-		}
-	}
-
-	return "";
-}
-
-static char * __init dmi_string(const struct dmi_header *dm, u8 s)
-{
-	const char *bp = dmi_string_nosave(dm, s);
-	char *str;
-	size_t len;
-
-	if (bp == dmi_empty_string)
-		return dmi_empty_string;
-
-	len = strlen(bp) + 1;
-	str = dmi_alloc(len);
-	if (str != NULL)
-		strcpy(str, bp);
-	else
-		printk(KERN_ERR "dmi_string: cannot allocate %Zu bytes.\n", len);
-
-	return str;
-}
-
-/*
- *	We have to be cautious here. We have seen BIOSes with DMI pointers
- *	pointing to completely the wrong place for example
- */
-static void dmi_table(u8 *buf, int len, int num,
-		      void (*decode)(const struct dmi_header *, void *),
-		      void *private_data)
-{
-	u8 *data = buf;
-	int i = 0;
-
-	/*
-	 *	Stop when we see all the items the table claimed to have
-	 *	OR we run off the end of the table (also happens)
-	 */
-	while ((i < num) && (data - buf + sizeof(struct dmi_header)) <= len) {
-		const struct dmi_header *dm = (const struct dmi_header *)data;
-
-		/*
-		 *  We want to know the total length (formatted area and
-		 *  strings) before decoding to make sure we won't run off the
-		 *  table in dmi_decode or dmi_string
-		 */
-		data += dm->length;
-		while ((data - buf < len - 1) && (data[0] || data[1]))
-			data++;
-		if (data - buf < len - 1)
-			decode(dm, private_data);
-		data += 2;
-		i++;
-	}
-}
-
-static u32 dmi_base;
-static u16 dmi_len;
-static u16 dmi_num;
-
-static int __init dmi_walk_early(void (*decode)(const struct dmi_header *,
-		void *))
-{
-	u8 *buf;
-
-	buf = dmi_ioremap(dmi_base, dmi_len);
-	if (buf == NULL)
-		return -1;
-
-	dmi_table(buf, dmi_len, dmi_num, decode, NULL);
-
-	dmi_iounmap(buf, dmi_len);
-	return 0;
-}
-
-static int __init dmi_checksum(const u8 *buf)
-{
-	u8 sum = 0;
-	int a;
-
-	for (a = 0; a < 15; a++)
-		sum += buf[a];
-
-	return sum == 0;
-}
-
-static char *dmi_ident[DMI_STRING_MAX];
-static LIST_HEAD(dmi_devices);
-int dmi_available;
-
-/*
- *	Save a DMI string
- */
-static void __init dmi_save_ident(const struct dmi_header *dm, int slot, int string)
-{
-	const char *d = (const char*) dm;
-	char *p;
-
-	if (dmi_ident[slot])
-		return;
-
-	p = dmi_string(dm, d[string]);
-	if (p == NULL)
-		return;
-
-	dmi_ident[slot] = p;
-}
-
-static void __init dmi_save_uuid(const struct dmi_header *dm, int slot, int index)
-{
-	const u8 *d = (u8*) dm + index;
-	char *s;
-	int is_ff = 1, is_00 = 1, i;
-
-	if (dmi_ident[slot])
-		return;
-
-	for (i = 0; i < 16 && (is_ff || is_00); i++) {
-		if(d[i] != 0x00) is_ff = 0;
-		if(d[i] != 0xFF) is_00 = 0;
-	}
-
-	if (is_ff || is_00)
-		return;
-
-	s = dmi_alloc(16*2+4+1);
-	if (!s)
-		return;
-
-	sprintf(s, "%pUB", d);
-
-        dmi_ident[slot] = s;
-}
-
-static void __init dmi_save_type(const struct dmi_header *dm, int slot, int index)
-{
-	const u8 *d = (u8*) dm + index;
-	char *s;
-
-	if (dmi_ident[slot])
-		return;
-
-	s = dmi_alloc(4);
-	if (!s)
-		return;
-
-	sprintf(s, "%u", *d & 0x7F);
-	dmi_ident[slot] = s;
-}
-
-static void __init dmi_save_one_device(int type, const char *name)
-{
-	struct dmi_device *dev;
-
-	/* No duplicate device */
-	if (dmi_find_device(type, name, NULL))
-		return;
-
-	dev = dmi_alloc(sizeof(*dev) + strlen(name) + 1);
-	if (!dev) {
-		printk(KERN_ERR "dmi_save_one_device: out of memory.\n");
-		return;
-	}
-
-	dev->type = type;
-	strcpy((char *)(dev + 1), name);
-	dev->name = (char *)(dev + 1);
-	dev->device_data = NULL;
-	list_add(&dev->list, &dmi_devices);
-}
-
-static void __init dmi_save_devices(const struct dmi_header *dm)
-{
-	int i, count = (dm->length - sizeof(struct dmi_header)) / 2;
-
-	for (i = 0; i < count; i++) {
-		const char *d = (char *)(dm + 1) + (i * 2);
-
-		/* Skip disabled device */
-		if ((*d & 0x80) == 0)
-			continue;
-
-		dmi_save_one_device(*d & 0x7f, dmi_string_nosave(dm, *(d + 1)));
-	}
-}
-
-static void __init dmi_save_oem_strings_devices(const struct dmi_header *dm)
-{
-	int i, count = *(u8 *)(dm + 1);
-	struct dmi_device *dev;
-
-	for (i = 1; i <= count; i++) {
-		char *devname = dmi_string(dm, i);
-
-		if (devname == dmi_empty_string)
-			continue;
-
-		dev = dmi_alloc(sizeof(*dev));
-		if (!dev) {
-			printk(KERN_ERR
-			   "dmi_save_oem_strings_devices: out of memory.\n");
-			break;
-		}
-
-		dev->type = DMI_DEV_TYPE_OEM_STRING;
-		dev->name = devname;
-		dev->device_data = NULL;
-
-		list_add(&dev->list, &dmi_devices);
-	}
-}
-
-static void __init dmi_save_ipmi_device(const struct dmi_header *dm)
-{
-	struct dmi_device *dev;
-	void * data;
-
-	data = dmi_alloc(dm->length);
-	if (data == NULL) {
-		printk(KERN_ERR "dmi_save_ipmi_device: out of memory.\n");
-		return;
-	}
-
-	memcpy(data, dm, dm->length);
-
-	dev = dmi_alloc(sizeof(*dev));
-	if (!dev) {
-		printk(KERN_ERR "dmi_save_ipmi_device: out of memory.\n");
-		return;
-	}
-
-	dev->type = DMI_DEV_TYPE_IPMI;
-	dev->name = "IPMI controller";
-	dev->device_data = data;
-
-	list_add_tail(&dev->list, &dmi_devices);
-}
-
-static void __init dmi_save_dev_onboard(int instance, int segment, int bus,
-					int devfn, const char *name)
-{
-	struct dmi_dev_onboard *onboard_dev;
-
-	onboard_dev = dmi_alloc(sizeof(*onboard_dev) + strlen(name) + 1);
-	if (!onboard_dev) {
-		printk(KERN_ERR "dmi_save_dev_onboard: out of memory.\n");
-		return;
-	}
-	onboard_dev->instance = instance;
-	onboard_dev->segment = segment;
-	onboard_dev->bus = bus;
-	onboard_dev->devfn = devfn;
-
-	strcpy((char *)&onboard_dev[1], name);
-	onboard_dev->dev.type = DMI_DEV_TYPE_DEV_ONBOARD;
-	onboard_dev->dev.name = (char *)&onboard_dev[1];
-	onboard_dev->dev.device_data = onboard_dev;
-
-	list_add(&onboard_dev->dev.list, &dmi_devices);
-}
-
-static void __init dmi_save_extended_devices(const struct dmi_header *dm)
-{
-	const u8 *d = (u8*) dm + 5;
-
-	/* Skip disabled device */
-	if ((*d & 0x80) == 0)
-		return;
-
-	dmi_save_dev_onboard(*(d+1), *(u16 *)(d+2), *(d+4), *(d+5),
-			     dmi_string_nosave(dm, *(d-1)));
-	dmi_save_one_device(*d & 0x7f, dmi_string_nosave(dm, *(d - 1)));
-}
-
-/*
- *	Process a DMI table entry. Right now all we care about are the BIOS
- *	and machine entries. For 2.5 we should pull the smbus controller info
- *	out of here.
- */
-static void __init dmi_decode(const struct dmi_header *dm, void *dummy)
-{
-	switch(dm->type) {
-	case 0:		/* BIOS Information */
-		dmi_save_ident(dm, DMI_BIOS_VENDOR, 4);
-		dmi_save_ident(dm, DMI_BIOS_VERSION, 5);
-		dmi_save_ident(dm, DMI_BIOS_DATE, 8);
-		break;
-	case 1:		/* System Information */
-		dmi_save_ident(dm, DMI_SYS_VENDOR, 4);
-		dmi_save_ident(dm, DMI_PRODUCT_NAME, 5);
-		dmi_save_ident(dm, DMI_PRODUCT_VERSION, 6);
-		dmi_save_ident(dm, DMI_PRODUCT_SERIAL, 7);
-		dmi_save_uuid(dm, DMI_PRODUCT_UUID, 8);
-		break;
-	case 2:		/* Base Board Information */
-		dmi_save_ident(dm, DMI_BOARD_VENDOR, 4);
-		dmi_save_ident(dm, DMI_BOARD_NAME, 5);
-		dmi_save_ident(dm, DMI_BOARD_VERSION, 6);
-		dmi_save_ident(dm, DMI_BOARD_SERIAL, 7);
-		dmi_save_ident(dm, DMI_BOARD_ASSET_TAG, 8);
-		break;
-	case 3:		/* Chassis Information */
-		dmi_save_ident(dm, DMI_CHASSIS_VENDOR, 4);
-		dmi_save_type(dm, DMI_CHASSIS_TYPE, 5);
-		dmi_save_ident(dm, DMI_CHASSIS_VERSION, 6);
-		dmi_save_ident(dm, DMI_CHASSIS_SERIAL, 7);
-		dmi_save_ident(dm, DMI_CHASSIS_ASSET_TAG, 8);
-		break;
-	case 10:	/* Onboard Devices Information */
-		dmi_save_devices(dm);
-		break;
-	case 11:	/* OEM Strings */
-		dmi_save_oem_strings_devices(dm);
-		break;
-	case 38:	/* IPMI Device Information */
-		dmi_save_ipmi_device(dm);
-		break;
-	case 41:	/* Onboard Devices Extended Information */
-		dmi_save_extended_devices(dm);
-	}
-}
-
-static void __init print_filtered(const char *info)
-{
-	const char *p;
-
-	if (!info)
-		return;
-
-	for (p = info; *p; p++)
-		if (isprint(*p))
-			printk(KERN_CONT "%c", *p);
-		else
-			printk(KERN_CONT "\\x%02x", *p & 0xff);
-}
-
-static void __init dmi_dump_ids(void)
-{
-	const char *board;	/* Board Name is optional */
-
-	printk(KERN_DEBUG "DMI: ");
-	print_filtered(dmi_get_system_info(DMI_SYS_VENDOR));
-	printk(KERN_CONT " ");
-	print_filtered(dmi_get_system_info(DMI_PRODUCT_NAME));
-	board = dmi_get_system_info(DMI_BOARD_NAME);
-	if (board) {
-		printk(KERN_CONT "/");
-		print_filtered(board);
-	}
-	printk(KERN_CONT ", BIOS ");
-	print_filtered(dmi_get_system_info(DMI_BIOS_VERSION));
-	printk(KERN_CONT " ");
-	print_filtered(dmi_get_system_info(DMI_BIOS_DATE));
-	printk(KERN_CONT "\n");
-}
-
-static int __init dmi_present(const char __iomem *p)
-{
-	u8 buf[15];
-
-	memcpy_fromio(buf, p, 15);
-	if ((memcmp(buf, "_DMI_", 5) == 0) && dmi_checksum(buf)) {
-		dmi_num = (buf[13] << 8) | buf[12];
-		dmi_len = (buf[7] << 8) | buf[6];
-		dmi_base = (buf[11] << 24) | (buf[10] << 16) |
-			(buf[9] << 8) | buf[8];
-
-		/*
-		 * DMI version 0.0 means that the real version is taken from
-		 * the SMBIOS version, which we don't know at this point.
-		 */
-		if (buf[14] != 0)
-			printk(KERN_INFO "DMI %d.%d present.\n",
-			       buf[14] >> 4, buf[14] & 0xF);
-		else
-			printk(KERN_INFO "DMI present.\n");
-		if (dmi_walk_early(dmi_decode) == 0) {
-			dmi_dump_ids();
-			return 0;
-		}
-	}
-	return 1;
-}
-
-void __init dmi_scan_machine(void)
-{
-	char __iomem *p, *q;
-	int rc;
-
-	if (efi_enabled) {
-		if (efi.smbios == EFI_INVALID_TABLE_ADDR)
-			goto error;
-
-		/* This is called as a core_initcall() because it isn't
-		 * needed during early boot.  This also means we can
-		 * iounmap the space when we're done with it.
-		 */
-		p = dmi_ioremap(efi.smbios, 32);
-		if (p == NULL)
-			goto error;
-
-		rc = dmi_present(p + 0x10); /* offset of _DMI_ string */
-		dmi_iounmap(p, 32);
-		if (!rc) {
-			dmi_available = 1;
-			goto out;
-		}
-	}
-	else {
-		/*
-		 * no iounmap() for that ioremap(); it would be a no-op, but
-		 * it's so early in setup that sucker gets confused into doing
-		 * what it shouldn't if we actually call it.
-		 */
-		p = dmi_ioremap(0xF0000, 0x10000);
-		if (p == NULL)
-			goto error;
-
-		for (q = p; q < p + 0x10000; q += 16) {
-			rc = dmi_present(q);
-			if (!rc) {
-				dmi_available = 1;
-				dmi_iounmap(p, 0x10000);
-				goto out;
-			}
-		}
-		dmi_iounmap(p, 0x10000);
-	}
- error:
-	printk(KERN_INFO "DMI not present or invalid.\n");
- out:
-	dmi_initialized = 1;
-}
-
-/**
- *	dmi_matches - check if dmi_system_id structure matches system DMI data
- *	@dmi: pointer to the dmi_system_id structure to check
- */
-static bool dmi_matches(const struct dmi_system_id *dmi)
-{
-	int i;
-
-	WARN(!dmi_initialized, KERN_ERR "dmi check: not initialized yet.\n");
-
-	for (i = 0; i < ARRAY_SIZE(dmi->matches); i++) {
-		int s = dmi->matches[i].slot;
-		if (s == DMI_NONE)
-			break;
-		if (dmi_ident[s]
-		    && strstr(dmi_ident[s], dmi->matches[i].substr))
-			continue;
-		/* No match */
-		return false;
-	}
-	return true;
-}
-
-/**
- *	dmi_is_end_of_table - check for end-of-table marker
- *	@dmi: pointer to the dmi_system_id structure to check
- */
-static bool dmi_is_end_of_table(const struct dmi_system_id *dmi)
-{
-	return dmi->matches[0].slot == DMI_NONE;
-}
-
-/**
- *	dmi_check_system - check system DMI data
- *	@list: array of dmi_system_id structures to match against
- *		All non-null elements of the list must match
- *		their slot's (field index's) data (i.e., each
- *		list string must be a substring of the specified
- *		DMI slot's string data) to be considered a
- *		successful match.
- *
- *	Walk the blacklist table running matching functions until someone
- *	returns non zero or we hit the end. Callback function is called for
- *	each successful match. Returns the number of matches.
- */
-int dmi_check_system(const struct dmi_system_id *list)
-{
-	int count = 0;
-	const struct dmi_system_id *d;
-
-	for (d = list; !dmi_is_end_of_table(d); d++)
-		if (dmi_matches(d)) {
-			count++;
-			if (d->callback && d->callback(d))
-				break;
-		}
-
-	return count;
-}
-EXPORT_SYMBOL(dmi_check_system);
-
-/**
- *	dmi_first_match - find dmi_system_id structure matching system DMI data
- *	@list: array of dmi_system_id structures to match against
- *		All non-null elements of the list must match
- *		their slot's (field index's) data (i.e., each
- *		list string must be a substring of the specified
- *		DMI slot's string data) to be considered a
- *		successful match.
- *
- *	Walk the blacklist table until the first match is found.  Return the
- *	pointer to the matching entry or NULL if there's no match.
- */
-const struct dmi_system_id *dmi_first_match(const struct dmi_system_id *list)
-{
-	const struct dmi_system_id *d;
-
-	for (d = list; !dmi_is_end_of_table(d); d++)
-		if (dmi_matches(d))
-			return d;
-
-	return NULL;
-}
-EXPORT_SYMBOL(dmi_first_match);
-
-/**
- *	dmi_get_system_info - return DMI data value
- *	@field: data index (see enum dmi_field)
- *
- *	Returns one DMI data value, can be used to perform
- *	complex DMI data checks.
- */
-const char *dmi_get_system_info(int field)
-{
-	return dmi_ident[field];
-}
-EXPORT_SYMBOL(dmi_get_system_info);
-
-/**
- * dmi_name_in_serial - Check if string is in the DMI product serial information
- * @str: string to check for
- */
-int dmi_name_in_serial(const char *str)
-{
-	int f = DMI_PRODUCT_SERIAL;
-	if (dmi_ident[f] && strstr(dmi_ident[f], str))
-		return 1;
-	return 0;
-}
-
-/**
- *	dmi_name_in_vendors - Check if string is anywhere in the DMI vendor information.
- *	@str: 	Case sensitive Name
- */
-int dmi_name_in_vendors(const char *str)
-{
-	static int fields[] = { DMI_BIOS_VENDOR, DMI_BIOS_VERSION, DMI_SYS_VENDOR,
-				DMI_PRODUCT_NAME, DMI_PRODUCT_VERSION, DMI_BOARD_VENDOR,
-				DMI_BOARD_NAME, DMI_BOARD_VERSION, DMI_NONE };
-	int i;
-	for (i = 0; fields[i] != DMI_NONE; i++) {
-		int f = fields[i];
-		if (dmi_ident[f] && strstr(dmi_ident[f], str))
-			return 1;
-	}
-	return 0;
-}
-EXPORT_SYMBOL(dmi_name_in_vendors);
-
-/**
- *	dmi_find_device - find onboard device by type/name
- *	@type: device type or %DMI_DEV_TYPE_ANY to match all device types
- *	@name: device name string or %NULL to match all
- *	@from: previous device found in search, or %NULL for new search.
- *
- *	Iterates through the list of known onboard devices. If a device is
- *	found with a matching @vendor and @device, a pointer to its device
- *	structure is returned.  Otherwise, %NULL is returned.
- *	A new search is initiated by passing %NULL as the @from argument.
- *	If @from is not %NULL, searches continue from next device.
- */
-const struct dmi_device * dmi_find_device(int type, const char *name,
-				    const struct dmi_device *from)
-{
-	const struct list_head *head = from ? &from->list : &dmi_devices;
-	struct list_head *d;
-
-	for(d = head->next; d != &dmi_devices; d = d->next) {
-		const struct dmi_device *dev =
-			list_entry(d, struct dmi_device, list);
-
-		if (((type == DMI_DEV_TYPE_ANY) || (dev->type == type)) &&
-		    ((name == NULL) || (strcmp(dev->name, name) == 0)))
-			return dev;
-	}
-
-	return NULL;
-}
-EXPORT_SYMBOL(dmi_find_device);
-
-/**
- *	dmi_get_date - parse a DMI date
- *	@field:	data index (see enum dmi_field)
- *	@yearp: optional out parameter for the year
- *	@monthp: optional out parameter for the month
- *	@dayp: optional out parameter for the day
- *
- *	The date field is assumed to be in the form resembling
- *	[mm[/dd]]/yy[yy] and the result is stored in the out
- *	parameters any or all of which can be omitted.
- *
- *	If the field doesn't exist, all out parameters are set to zero
- *	and false is returned.  Otherwise, true is returned with any
- *	invalid part of date set to zero.
- *
- *	On return, year, month and day are guaranteed to be in the
- *	range of [0,9999], [0,12] and [0,31] respectively.
- */
-bool dmi_get_date(int field, int *yearp, int *monthp, int *dayp)
-{
-	int year = 0, month = 0, day = 0;
-	bool exists;
-	const char *s, *y;
-	char *e;
-
-	s = dmi_get_system_info(field);
-	exists = s;
-	if (!exists)
-		goto out;
-
-	/*
-	 * Determine year first.  We assume the date string resembles
-	 * mm/dd/yy[yy] but the original code extracted only the year
-	 * from the end.  Keep the behavior in the spirit of no
-	 * surprises.
-	 */
-	y = strrchr(s, '/');
-	if (!y)
-		goto out;
-
-	y++;
-	year = simple_strtoul(y, &e, 10);
-	if (y != e && year < 100) {	/* 2-digit year */
-		year += 1900;
-		if (year < 1996)	/* no dates < spec 1.0 */
-			year += 100;
-	}
-	if (year > 9999)		/* year should fit in %04d */
-		year = 0;
-
-	/* parse the mm and dd */
-	month = simple_strtoul(s, &e, 10);
-	if (s == e || *e != '/' || !month || month > 12) {
-		month = 0;
-		goto out;
-	}
-
-	s = e + 1;
-	day = simple_strtoul(s, &e, 10);
-	if (s == y || s == e || *e != '/' || day > 31)
-		day = 0;
-out:
-	if (yearp)
-		*yearp = year;
-	if (monthp)
-		*monthp = month;
-	if (dayp)
-		*dayp = day;
-	return exists;
-}
-EXPORT_SYMBOL(dmi_get_date);
-
-/**
- *	dmi_walk - Walk the DMI table and get called back for every record
- *	@decode: Callback function
- *	@private_data: Private data to be passed to the callback function
- *
- *	Returns -1 when the DMI table can't be reached, 0 on success.
- */
-int dmi_walk(void (*decode)(const struct dmi_header *, void *),
-	     void *private_data)
-{
-	u8 *buf;
-
-	if (!dmi_available)
-		return -1;
-
-	buf = ioremap(dmi_base, dmi_len);
-	if (buf == NULL)
-		return -1;
-
-	dmi_table(buf, dmi_len, dmi_num, decode, private_data);
-
-	iounmap(buf);
-	return 0;
-}
-EXPORT_SYMBOL_GPL(dmi_walk);
-
-/**
- * dmi_match - compare a string to the dmi field (if exists)
- * @f: DMI field identifier
- * @str: string to compare the DMI field to
- *
- * Returns true if the requested field equals to the str (including NULL).
- */
-bool dmi_match(enum dmi_field f, const char *str)
-{
-	const char *info = dmi_get_system_info(f);
-
-	if (info == NULL || str == NULL)
-		return info == str;
-
-	return !strcmp(info, str);
-}
-EXPORT_SYMBOL_GPL(dmi_match);
diff --git a/include/linux/dmi.h b/include/linux/dmi.h
deleted file mode 100644
index f156cca..0000000
--- a/include/linux/dmi.h
+++ /dev/null
@@ -1,139 +0,0 @@
-#ifndef __DMI_H__
-#define __DMI_H__
-
-#include <linux/list.h>
-#include <linux/mod_devicetable.h>
-
-/* enum dmi_field is in mod_devicetable.h */
-
-enum dmi_device_type {
-	DMI_DEV_TYPE_ANY = 0,
-	DMI_DEV_TYPE_OTHER,
-	DMI_DEV_TYPE_UNKNOWN,
-	DMI_DEV_TYPE_VIDEO,
-	DMI_DEV_TYPE_SCSI,
-	DMI_DEV_TYPE_ETHERNET,
-	DMI_DEV_TYPE_TOKENRING,
-	DMI_DEV_TYPE_SOUND,
-	DMI_DEV_TYPE_PATA,
-	DMI_DEV_TYPE_SATA,
-	DMI_DEV_TYPE_SAS,
-	DMI_DEV_TYPE_IPMI = -1,
-	DMI_DEV_TYPE_OEM_STRING = -2,
-	DMI_DEV_TYPE_DEV_ONBOARD = -3,
-};
-
-enum dmi_entry_type {
-	DMI_ENTRY_BIOS = 0,
-	DMI_ENTRY_SYSTEM,
-	DMI_ENTRY_BASEBOARD,
-	DMI_ENTRY_CHASSIS,
-	DMI_ENTRY_PROCESSOR,
-	DMI_ENTRY_MEM_CONTROLLER,
-	DMI_ENTRY_MEM_MODULE,
-	DMI_ENTRY_CACHE,
-	DMI_ENTRY_PORT_CONNECTOR,
-	DMI_ENTRY_SYSTEM_SLOT,
-	DMI_ENTRY_ONBOARD_DEVICE,
-	DMI_ENTRY_OEMSTRINGS,
-	DMI_ENTRY_SYSCONF,
-	DMI_ENTRY_BIOS_LANG,
-	DMI_ENTRY_GROUP_ASSOC,
-	DMI_ENTRY_SYSTEM_EVENT_LOG,
-	DMI_ENTRY_PHYS_MEM_ARRAY,
-	DMI_ENTRY_MEM_DEVICE,
-	DMI_ENTRY_32_MEM_ERROR,
-	DMI_ENTRY_MEM_ARRAY_MAPPED_ADDR,
-	DMI_ENTRY_MEM_DEV_MAPPED_ADDR,
-	DMI_ENTRY_BUILTIN_POINTING_DEV,
-	DMI_ENTRY_PORTABLE_BATTERY,
-	DMI_ENTRY_SYSTEM_RESET,
-	DMI_ENTRY_HW_SECURITY,
-	DMI_ENTRY_SYSTEM_POWER_CONTROLS,
-	DMI_ENTRY_VOLTAGE_PROBE,
-	DMI_ENTRY_COOLING_DEV,
-	DMI_ENTRY_TEMP_PROBE,
-	DMI_ENTRY_ELECTRICAL_CURRENT_PROBE,
-	DMI_ENTRY_OOB_REMOTE_ACCESS,
-	DMI_ENTRY_BIS_ENTRY,
-	DMI_ENTRY_SYSTEM_BOOT,
-	DMI_ENTRY_MGMT_DEV,
-	DMI_ENTRY_MGMT_DEV_COMPONENT,
-	DMI_ENTRY_MGMT_DEV_THRES,
-	DMI_ENTRY_MEM_CHANNEL,
-	DMI_ENTRY_IPMI_DEV,
-	DMI_ENTRY_SYS_POWER_SUPPLY,
-	DMI_ENTRY_ADDITIONAL,
-	DMI_ENTRY_ONBOARD_DEV_EXT,
-	DMI_ENTRY_MGMT_CONTROLLER_HOST,
-	DMI_ENTRY_INACTIVE = 126,
-	DMI_ENTRY_END_OF_TABLE = 127,
-};
-
-struct dmi_header {
-	u8 type;
-	u8 length;
-	u16 handle;
-};
-
-struct dmi_device {
-	struct list_head list;
-	int type;
-	const char *name;
-	void *device_data;	/* Type specific data */
-};
-
-#ifdef CONFIG_DMI
-
-struct dmi_dev_onboard {
-	struct dmi_device dev;
-	int instance;
-	int segment;
-	int bus;
-	int devfn;
-};
-
-extern int dmi_check_system(const struct dmi_system_id *list);
-const struct dmi_system_id *dmi_first_match(const struct dmi_system_id *list);
-extern const char * dmi_get_system_info(int field);
-extern const struct dmi_device * dmi_find_device(int type, const char *name,
-	const struct dmi_device *from);
-extern void dmi_scan_machine(void);
-extern bool dmi_get_date(int field, int *yearp, int *monthp, int *dayp);
-extern int dmi_name_in_vendors(const char *str);
-extern int dmi_name_in_serial(const char *str);
-extern int dmi_available;
-extern int dmi_walk(void (*decode)(const struct dmi_header *, void *),
-	void *private_data);
-extern bool dmi_match(enum dmi_field f, const char *str);
-
-#else
-
-static inline int dmi_check_system(const struct dmi_system_id *list) { return 0; }
-static inline const char * dmi_get_system_info(int field) { return NULL; }
-static inline const struct dmi_device * dmi_find_device(int type, const char *name,
-	const struct dmi_device *from) { return NULL; }
-static inline void dmi_scan_machine(void) { return; }
-static inline bool dmi_get_date(int field, int *yearp, int *monthp, int *dayp)
-{
-	if (yearp)
-		*yearp = 0;
-	if (monthp)
-		*monthp = 0;
-	if (dayp)
-		*dayp = 0;
-	return false;
-}
-static inline int dmi_name_in_vendors(const char *s) { return 0; }
-static inline int dmi_name_in_serial(const char *s) { return 0; }
-#define dmi_available 0
-static inline int dmi_walk(void (*decode)(const struct dmi_header *, void *),
-	void *private_data) { return -1; }
-static inline bool dmi_match(enum dmi_field f, const char *str)
-	{ return false; }
-static inline const struct dmi_system_id *
-	dmi_first_match(const struct dmi_system_id *list) { return NULL; }
-
-#endif
-
-#endif	/* __DMI_H__ */
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
index 89153ad..5e8d1bc 100644
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
@@ -427,61 +427,6 @@ struct spi_device_id {
 			__attribute__((aligned(sizeof(kernel_ulong_t))));
 };
 
-/* dmi */
-enum dmi_field {
-	DMI_NONE,
-	DMI_BIOS_VENDOR,
-	DMI_BIOS_VERSION,
-	DMI_BIOS_DATE,
-	DMI_SYS_VENDOR,
-	DMI_PRODUCT_NAME,
-	DMI_PRODUCT_VERSION,
-	DMI_PRODUCT_SERIAL,
-	DMI_PRODUCT_UUID,
-	DMI_BOARD_VENDOR,
-	DMI_BOARD_NAME,
-	DMI_BOARD_VERSION,
-	DMI_BOARD_SERIAL,
-	DMI_BOARD_ASSET_TAG,
-	DMI_CHASSIS_VENDOR,
-	DMI_CHASSIS_TYPE,
-	DMI_CHASSIS_VERSION,
-	DMI_CHASSIS_SERIAL,
-	DMI_CHASSIS_ASSET_TAG,
-	DMI_STRING_MAX,
-};
-
-struct dmi_strmatch {
-	unsigned char slot;
-	char substr[79];
-};
-
-#ifndef __KERNEL__
-struct dmi_system_id {
-	kernel_ulong_t callback;
-	kernel_ulong_t ident;
-	struct dmi_strmatch matches[4];
-	kernel_ulong_t driver_data
-			__attribute__((aligned(sizeof(kernel_ulong_t))));
-};
-#else
-struct dmi_system_id {
-	int (*callback)(const struct dmi_system_id *);
-	const char *ident;
-	struct dmi_strmatch matches[4];
-	void *driver_data;
-};
-/*
- * struct dmi_device_id appears during expansion of
- * "MODULE_DEVICE_TABLE(dmi, x)". Compiler doesn't look inside it
- * but this is enough for gcc 3.4.6 to error out:
- *	error: storage size of '__mod_dmi_device_table' isn't known
- */
-#define dmi_device_id dmi_system_id
-#endif
-
-#define DMI_MATCH(a, b)	{ a, b }
-
 /*
  * sysfw field - right now these are based on x86/ia64's SMBIOS fields.  But
  * other arches are certainly welcome to add additional fields.  The
-- 
1.6.5.2


^ permalink raw reply related	[flat|nested] 48+ messages in thread

* Re: [PATCH 01/34] System Firmware Interface
  2011-07-18 13:08 ` [PATCH 01/34] System Firmware Interface Prarit Bhargava
@ 2011-07-19  0:43   ` Andi Kleen
  2011-07-19  9:05     ` Alan Cox
  2011-07-25 19:03   ` [lm-sensors] " Jean Delvare
  1 sibling, 1 reply; 48+ messages in thread
From: Andi Kleen @ 2011-07-19  0:43 UTC (permalink / raw)
  To: Prarit Bhargava; +Cc: linux-kernel

Prarit Bhargava <prarit@redhat.com> writes:

Wow that's a cc list from hell. Cut down to linux-kernel.

> This patch introduces a general System Firmware interface to the kernel, called
> sysfw.

Could you expand somewhat WHY you want this. What is wrong with the
current code?

As for user space access on x86 "dmidecode"/libdmi works for nearly everyone,
doesn't it?


-Andi

-- 
ak@linux.intel.com -- Speaking for myself only

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [PATCH 01/34] System Firmware Interface
  2011-07-19  0:43   ` Andi Kleen
@ 2011-07-19  9:05     ` Alan Cox
  2011-07-19 12:23       ` Prarit Bhargava
  2011-07-19 13:21       ` Andi Kleen
  0 siblings, 2 replies; 48+ messages in thread
From: Alan Cox @ 2011-07-19  9:05 UTC (permalink / raw)
  To: Andi Kleen; +Cc: Prarit Bhargava, linux-kernel

On Mon, 18 Jul 2011 17:43:08 -0700
Andi Kleen <andi@firstfloor.org> wrote:

> Prarit Bhargava <prarit@redhat.com> writes:
> 
> Wow that's a cc list from hell. Cut down to linux-kernel.

Which meant I very nearly missed it so you very nearly missed your answer
8)

> > This patch introduces a general System Firmware interface to the kernel, called
> > sysfw.
> 
> Could you expand somewhat WHY you want this. What is wrong with the
> current code?

See the previous discussions

> As for user space access on x86 "dmidecode"/libdmi works for nearly everyone,
> doesn't it?

"on x86" (and on PC only generally)

There are three core problems

1.	DMI in this sense is basically an x86 PC class device hack
2.	It is obsoleted and at some point it'll vanish even on PC
3.	Every other platform without DMI would benefit from the
	interface being generic

So either we carry on hacking other interfaces (often more informative
ones) into our dmi glue, and trying to keep up the fakery for every case,
or we do what I should have done originally and made the interface a
generic way to query firmware/board information that can be extended
nicely.

We'll still need a spot of fakery for userspace I suspect.

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [PATCH 01/34] System Firmware Interface
  2011-07-19  9:05     ` Alan Cox
@ 2011-07-19 12:23       ` Prarit Bhargava
  2011-07-19 13:25         ` Andi Kleen
  2011-07-19 13:21       ` Andi Kleen
  1 sibling, 1 reply; 48+ messages in thread
From: Prarit Bhargava @ 2011-07-19 12:23 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alan Cox, Andi Kleen



On 07/19/2011 05:05 AM, Alan Cox wrote:
> On Mon, 18 Jul 2011 17:43:08 -0700
> Andi Kleen <andi@firstfloor.org> wrote:
>
>   

Hey Andi,

>> Prarit Bhargava <prarit@redhat.com> writes:
>>
>> Wow that's a cc list from hell. Cut down to linux-kernel.
>>     
> Which meant I very nearly missed it so you very nearly missed your answer
> 8)
>   

Sorry everyone -- I was just following what I thought was the proper
protocol ... I'll definitely cut down the cc list on the next submission.

>   
>>> This patch introduces a general System Firmware interface to the kernel, called
>>> sysfw.
>>>       
>> Could you expand somewhat WHY you want this. What is wrong with the
>> current code?
>>     
> See the previous discussions
>
>   

There is some additional information I'd like to throw out here as
well.  SMBIOS also provides information on the system state after the
BIOS/EFI is finished and before the kernel has been booted.  This has
been *invaluable* to me when diagnosing some wonky hardware from OEMs. 
I want to expand the SMBIOS layer to dump that information out when I
need it... but that's all for a later patch.  I will note not all
SMBIOSes are the same and sometimes the information has not been
correct, but when it is correct it has been extremely useful.  The
problem is that kludging this stuff into the existing dmi layer is a
PITA and just makes things messier with adding new dmi "devices" and
other junk.  It feels like I'm just hacking more code in to an already
broken mechanism.

tl;dr: There are some other useful bits of SMBIOS we could take
advantage of but the current "dmi" layer is difficult to work with.

Beyond that, what Alan said.

P.
>> As for user space access on x86 "dmidecode"/libdmi works for nearly everyone,
>> doesn't it?
>>     
> "on x86" (and on PC only generally)
>
> There are three core problems
>
> 1.	DMI in this sense is basically an x86 PC class device hack
> 2.	It is obsoleted and at some point it'll vanish even on PC
> 3.	Every other platform without DMI would benefit from the
> 	interface being generic
>
> So either we carry on hacking other interfaces (often more informative
> ones) into our dmi glue, and trying to keep up the fakery for every case,
> or we do what I should have done originally and made the interface a
> generic way to query firmware/board information that can be extended
> nicely.
>
> We'll still need a spot of fakery for userspace I suspect.
>   

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [PATCH 01/34] System Firmware Interface
  2011-07-19  9:05     ` Alan Cox
  2011-07-19 12:23       ` Prarit Bhargava
@ 2011-07-19 13:21       ` Andi Kleen
  2011-07-19 13:39         ` Prarit Bhargava
  1 sibling, 1 reply; 48+ messages in thread
From: Andi Kleen @ 2011-07-19 13:21 UTC (permalink / raw)
  To: Alan Cox; +Cc: Andi Kleen, Prarit Bhargava, linux-kernel

On Tue, Jul 19, 2011 at 10:05:44AM +0100, Alan Cox wrote:
> > Could you expand somewhat WHY you want this. What is wrong with the
> > current code?
> 
> See the previous discussions

Ok I will put that now as description into all my code submissions @)

Seriously, that REALLY belongs into a patch description.

> 
> > As for user space access on x86 "dmidecode"/libdmi works for nearly everyone,
> > doesn't it?
> 
> "on x86" (and on PC only generally)
> 
> There are three core problems
> 
> 1.	DMI in this sense is basically an x86 PC class device hack
> 2.	It is obsoleted and at some point it'll vanish even on PC

Huh? What obsoleted it? 

> 3.	Every other platform without DMI would benefit from the
> 	interface being generic

Can you expand on that? The information will be always system
specific anyways. Do you really think there's that much commonality?


-Andi
-- 
ak@linux.intel.com -- Speaking for myself only.

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [PATCH 01/34] System Firmware Interface
  2011-07-19 12:23       ` Prarit Bhargava
@ 2011-07-19 13:25         ` Andi Kleen
  2011-07-19 13:52           ` Prarit Bhargava
  0 siblings, 1 reply; 48+ messages in thread
From: Andi Kleen @ 2011-07-19 13:25 UTC (permalink / raw)
  To: Prarit Bhargava; +Cc: linux-kernel, Alan Cox, Andi Kleen


Playing the devils advocate here, but this is really unclear...

> There is some additional information I'd like to throw out here as
> well.  SMBIOS also provides information on the system state after the
> BIOS/EFI is finished and before the kernel has been booted.  This has
> been *invaluable* to me when diagnosing some wonky hardware from OEMs. 

Hmm this is for SMBIOS tables that changes at runtime?
Why exactly is the kernel booting a good point to dump that?

Normally the kernel afaik doesn't change SMBIOS as far as I know.

There may be some hotplug events that change it, but they
have no particular relation to kernel boot.

> I want to expand the SMBIOS layer to dump that information out when I

What information exactly?

And dumping = print to system log?

> tl;dr: There are some other useful bits of SMBIOS we could take
> advantage of but the current "dmi" layer is difficult to work with.

Like what?

-Andi

-- 
ak@linux.intel.com -- Speaking for myself only.

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [PATCH 01/34] System Firmware Interface
  2011-07-19 13:21       ` Andi Kleen
@ 2011-07-19 13:39         ` Prarit Bhargava
  2011-07-19 13:46           ` Andi Kleen
  0 siblings, 1 reply; 48+ messages in thread
From: Prarit Bhargava @ 2011-07-19 13:39 UTC (permalink / raw)
  To: linux-kernel; +Cc: Andi Kleen, Alan Cox



On 07/19/2011 09:21 AM, Andi Kleen wrote:
> On Tue, Jul 19, 2011 at 10:05:44AM +0100, Alan Cox wrote:
>   
>>> Could you expand somewhat WHY you want this. What is wrong with the
>>> current code?
>>>       
>> See the previous discussions
>>     
> Ok I will put that now as description into all my code submissions @)
>
> Seriously, that REALLY belongs into a patch description.
>   

I can certainly do that on the next version.  Sorry about that Andi.

>   
>>     
>>> As for user space access on x86 "dmidecode"/libdmi works for nearly everyone,
>>> doesn't it?
>>>       
>> "on x86" (and on PC only generally)
>>
>> There are three core problems
>>
>> 1.	DMI in this sense is basically an x86 PC class device hack
>> 2.	It is obsoleted and at some point it'll vanish even on PC
>>     
> Huh? What obsoleted it? 
>
>   

The DMI specification has not been updated since January of 2003.  It
has been replaced by SMBIOS.

>> 3.	Every other platform without DMI would benefit from the
>> 	interface being generic
>>     
> Can you expand on that? The information will be always system
> specific anyways. Do you really think there's that much commonality?
>
>   

There seems to be some commonalities.  We have other arches checking for
model and vendor info.

P.


^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [PATCH 01/34] System Firmware Interface
  2011-07-19 13:39         ` Prarit Bhargava
@ 2011-07-19 13:46           ` Andi Kleen
  2011-07-19 13:58             ` Prarit Bhargava
  0 siblings, 1 reply; 48+ messages in thread
From: Andi Kleen @ 2011-07-19 13:46 UTC (permalink / raw)
  To: Prarit Bhargava; +Cc: linux-kernel, Andi Kleen, Alan Cox

On Tue, Jul 19, 2011 at 09:39:56AM -0400, Prarit Bhargava wrote:
> 
> The DMI specification has not been updated since January of 2003.  It
> has been replaced by SMBIOS.


Yes of course, but dmidecode and the current DMI layer implements
both anyways, don't they? (ok if you don't count the dynamic interfaces)

The tables are very similar, there are just more entries in SMBIOS.

> 
> >> 3.	Every other platform without DMI would benefit from the
> >> 	interface being generic
> >>     
> > Can you expand on that? The information will be always system
> > specific anyways. Do you really think there's that much commonality?
> >
> >   
> 
> There seems to be some commonalities.  We have other arches checking for
> model and vendor info.

That's two fields out of hundreds. Does that need a common layer?

Right now I still fail to see the point of all of this.

At some point I wanted a slightly more expansive sysfs interface for SMBIOS
to avoid having to start mcelog as root for reading /dev/mem, but I don't
think such a complicated approach is justified for that. What are 
the other use cases?

-Andi
-- 
ak@linux.intel.com -- Speaking for myself only.

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [PATCH 01/34] System Firmware Interface
  2011-07-19 13:25         ` Andi Kleen
@ 2011-07-19 13:52           ` Prarit Bhargava
  0 siblings, 0 replies; 48+ messages in thread
From: Prarit Bhargava @ 2011-07-19 13:52 UTC (permalink / raw)
  To: linux-kernel; +Cc: Andi Kleen, Alan Cox



On 07/19/2011 09:25 AM, Andi Kleen wrote:
> Playing the devils advocate here, but this is really unclear...
>
>   

Sorry, I'll try to be more specific.

>> There is some additional information I'd like to throw out here as
>> well.  SMBIOS also provides information on the system state after the
>> BIOS/EFI is finished and before the kernel has been booted.  This has
>> been *invaluable* to me when diagnosing some wonky hardware from OEMs. 
>>     
> Hmm this is for SMBIOS tables that changes at runtime?
> Why exactly is the kernel booting a good point to dump that?
>
>   

Let me back up :) as I clearly didn't do a good job of explaining this.

I have systems/have had systems in which NO kernel would boot because of
faulty hardware.  That hardware was identified as bad during the BIOS
POST but no information on it could be determined because we didn't make
it very far through boot :/.  As you know Andi, booting with bad memory
or a bad cpu is excruciatingly difficult to diagnose.

The SMBIOS does provide access to a system log in which details on
failed hardware (again, failed hardware having been identified by the
BIOS) and that information was immensely useful to me during the system
boot.  (see the Type 15 System Event Log Structure).

Plugging that into the existing "dmi" code was a headache.  The code is
just not laid out to make expansion of dmi devices easy.

>   
>> I want to expand the SMBIOS layer to dump that information out when I
>>     
> What information exactly?
>
> And dumping = print to system log?
>   

Yes, to the system log.

>   
>> tl;dr: There are some other useful bits of SMBIOS we could take
>> advantage of but the current "dmi" layer is difficult to work with.
>>     
> Like what?
>
>   

Like the above example ;) ... but there are other things like the type
of memory in the system from a HW debug point of view become important. 
My #1 goal is to get the SMBIOS version # exported via sysfs and to get
the type 15 stuff output as debug info.

P.

> -Andi
>
>   

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [PATCH 01/34] System Firmware Interface
  2011-07-19 13:46           ` Andi Kleen
@ 2011-07-19 13:58             ` Prarit Bhargava
  0 siblings, 0 replies; 48+ messages in thread
From: Prarit Bhargava @ 2011-07-19 13:58 UTC (permalink / raw)
  To: Andi Kleen; +Cc: linux-kernel, Alan Cox



On 07/19/2011 09:46 AM, Andi Kleen wrote:
> On Tue, Jul 19, 2011 at 09:39:56AM -0400, Prarit Bhargava wrote:
>   
>> The DMI specification has not been updated since January of 2003.  It
>> has been replaced by SMBIOS.
>>     
>
> Yes of course, but dmidecode and the current DMI layer implements
> both anyways, don't they? (ok if you don't count the dynamic interfaces)
>
> The tables are very similar, there are just more entries in SMBIOS.
>   

That's not the way I understand it (at least from reviewing the two
different specifications).  DMI is not SMBIOS.  They are two very
different things -- we (linux kernel) have bastardized the name DMI and
really have been using the SMBIOS tables.  It is NOT a DMI implementation.

SMBIOS *CAN* contain a DMI table but saying that SMBIOS is DMI + a few
more tables is really a stretch IMO.

>   
>>     
>>>> 3.	Every other platform without DMI would benefit from the
>>>> 	interface being generic
>>>>     
>>>>         
>>> Can you expand on that? The information will be always system
>>> specific anyways. Do you really think there's that much commonality?
>>>
>>>   
>>>       
>> There seems to be some commonalities.  We have other arches checking for
>> model and vendor info.
>>     
> That's two fields out of hundreds. Does that need a common layer?
>   

> Right now I still fail to see the point of all of this.
>
> At some point I wanted a slightly more expansive sysfs interface for SMBIOS
> to avoid having to start mcelog as root for reading /dev/mem, but I don't
> think such a complicated approach is justified for that. What are 
> the other use cases?
>   

See my previous email re: type 15 structure and trying to jam it into
the existing dmi layer.

P.
> -Andi
>   

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [PATCH 27/34] drivers/usb changes for SMBIOS and System Firmware
  2011-07-18 13:08 ` [PATCH 27/34] drivers/usb " Prarit Bhargava
@ 2011-07-19 19:47   ` Alan Stern
  0 siblings, 0 replies; 48+ messages in thread
From: Alan Stern @ 2011-07-19 19:47 UTC (permalink / raw)
  To: Prarit Bhargava; +Cc: linux-kernel, linux-usb

On Mon, 18 Jul 2011, Prarit Bhargava wrote:

> As part of the new SMBIOS and System Firmware code:
> 
> - Replace old dmi* structures and functions with new sysfw* and smbios*
> structures and functions in individual drivers
> - cleanup sysfw_id lookup tables
> - add exactmatch functionality
> 
> Cc: linux-usb@vger.kernel.org
> Signed-off-by: Prarit Bhargava <prarit@redhat.com>
> ---
>  drivers/usb/host/pci-quirks.c |   19 ++++++++++++++-----
>  drivers/usb/host/uhci-hcd.c   |    2 +-
>  drivers/usb/host/uhci-pci.c   |   15 +++++++++++----
>  3 files changed, 26 insertions(+), 10 deletions(-)

Acked-by: Alan Stern <stern@rowland.harvard.edu>


^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [lm-sensors] [PATCH 01/34] System Firmware Interface
  2011-07-18 13:08 ` [PATCH 01/34] System Firmware Interface Prarit Bhargava
  2011-07-19  0:43   ` Andi Kleen
@ 2011-07-25 19:03   ` Jean Delvare
  2011-08-10 13:26     ` Prarit Bhargava
  1 sibling, 1 reply; 48+ messages in thread
From: Jean Delvare @ 2011-07-25 19:03 UTC (permalink / raw)
  To: Prarit Bhargava
  Cc: linux-kernel, linux-ia64, linux-pci, dri-devel,
	platform-driver-x86, grant.likely, linux-ide, linux-i2c,
	device-drivers-devel, abelay, eric.piel, x86, lm-sensors,
	linux-acpi, linux-input, linux-media, johnpol, linux-watchdog,
	rtc-linux, dz, openipmi-developer, evel, netdev, linux-usb,
	rpurdie, linux-crypto

On Mon, 18 Jul 2011 09:08:15 -0400, Prarit Bhargava wrote:
> This patch introduces a general System Firmware interface to the kernel, called
> sysfw.
> 
> Inlcluded in this interface is the ability to search a standard set of fields,
> sysfw_lookup().  The fields are currently based upon the x86 and ia64 SMBIOS
> fields but exapandable to fields that other arches may introduce.  Also
> included is  the ability to search and match against those fields, and run
> a callback function against the matches, sysfw_callback().
> 
> Modify module code to use sysfw instead of old DMI interface.

This is a HUGE patch set. You'd need to have a good reason for such a
big and intrusive change, yet I see no such reason explained. I
understand that we _can_ abstract system information interfaces, but
just because we can doesn't mean we have to. I would at least wait for
a second DMI-like interface to be widely implemented and support before
any attempt to abstract, otherwise your design is bound to be missing
the target. And even then, you'd still need to convince me that there
is a need for a unified interface to access both backends at once. I
would guess that you know what backend is present on a system when you
try to identify it.

At this point, I see the work needed to review your patches, the risk
of regressions due to the large size of the patch set, but I don't see
any immediate benefit. Thus I am not going to look into it at all,
sorry.

-- 
Jean Delvare

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [lm-sensors] [PATCH 01/34] System Firmware Interface
  2011-07-25 19:03   ` [lm-sensors] " Jean Delvare
@ 2011-08-10 13:26     ` Prarit Bhargava
  0 siblings, 0 replies; 48+ messages in thread
From: Prarit Bhargava @ 2011-08-10 13:26 UTC (permalink / raw)
  To: Linux Kernel; +Cc: Jean Delvare, Alan Cox, Matthew Garrett



On 07/25/2011 03:03 PM, Jean Delvare wrote:
> On Mon, 18 Jul 2011 09:08:15 -0400, Prarit Bhargava wrote:
>   
>> This patch introduces a general System Firmware interface to the kernel, called
>> sysfw.
>>
>> Inlcluded in this interface is the ability to search a standard set of fields,
>> sysfw_lookup().  The fields are currently based upon the x86 and ia64 SMBIOS
>> fields but exapandable to fields that other arches may introduce.  Also
>> included is  the ability to search and match against those fields, and run
>> a callback function against the matches, sysfw_callback().
>>
>> Modify module code to use sysfw instead of old DMI interface.
>>     
> This is a HUGE patch set. You'd need to have a good reason for such a
> big and intrusive change, yet I see no such reason explained. I
> understand that we _can_ abstract system information interfaces, but
> just because we can doesn't mean we have to. I would at least wait for
> a second DMI-like interface to be widely implemented and support before
> any attempt to abstract, otherwise your design is bound to be missing
> the target. And even then, you'd still need to convince me that there
> is a need for a unified interface to access both backends at once. I
> would guess that you know what backend is present on a system when you
> try to identify it.
>   

It seems to me that the objection to this patchset isn't that I'm
rewriting the SMBIOS code, but that I'm adding in an additional
abstraction layer to the kernel which as Jean points out, probably isn't
going to be correct as it is based on the two Intel arches (x86 and ia64).

After discussing this with a few engineers in the office I'm leaning
toward dropping the System Firmware Interface *for now*.  I'm more than
willing to implement the SMBIOS code in such a way that it should be
easier to implement a generic interface at a later date -- I'm still
hoping that arm/arm64 will eventually need this interface but they're
realistically a year or two out from requiring such a thing.

Alan -- I know you wanted this, and there is merit in doing it but I
can't argue with what Jean wrote.  Right now we don't have an extensive
need for the sysfw stuff in the kernel ...

P.


^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [PATCH 21/34] drivers/platform changes for SMBIOS and System Firmware
  2011-07-18 13:08 ` [PATCH 21/34] drivers/platform " Prarit Bhargava
@ 2011-08-11  4:30   ` Jonathan Woithe
  0 siblings, 0 replies; 48+ messages in thread
From: Jonathan Woithe @ 2011-08-11  4:30 UTC (permalink / raw)
  To: Prarit Bhargava; +Cc: linux-kernel, platform-driver-x86, jwoithe

On Mon, Jul 18, 2011 at 09:08:35AM -0400, Prarit Bhargava wrote:
> - Replace old dmi* structures and functions with new sysfw* and smbios*
> structures and functions in individual drivers
> - cleanup sysfw_id lookup tables
> - add exactmatch functionality
> - edit udev notifiers
> - cleanup of includes for dmi.h and mod_devicetable.h which were included in
> some files that did not need them
> 
> [v2]: Re-exported dmi MODULE_ALIAS
> :
>  drivers/platform/x86/fujitsu-laptop.c |   41 ++++----
> :

In-so-far as I can tell with a quick inspection, this looks ok for the
fujitsu-laptop.c module.

Acked-by: Jonathan Woithe <jwoithe@physics.adelaide.edu.au>

At the risk of looking ill-informed, I assume the DMI infrastructure has
been deprecated by the more general sysfw.

Regards
  jonathan

^ permalink raw reply	[flat|nested] 48+ messages in thread

end of thread, other threads:[~2011-08-11  4:53 UTC | newest]

Thread overview: 48+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-18 13:08 [PATCH 00/34] System Firmware and SMBIOS Support [v3] Prarit Bhargava
2011-07-18 13:08 ` [PATCH 01/34] System Firmware Interface Prarit Bhargava
2011-07-19  0:43   ` Andi Kleen
2011-07-19  9:05     ` Alan Cox
2011-07-19 12:23       ` Prarit Bhargava
2011-07-19 13:25         ` Andi Kleen
2011-07-19 13:52           ` Prarit Bhargava
2011-07-19 13:21       ` Andi Kleen
2011-07-19 13:39         ` Prarit Bhargava
2011-07-19 13:46           ` Andi Kleen
2011-07-19 13:58             ` Prarit Bhargava
2011-07-25 19:03   ` [lm-sensors] " Jean Delvare
2011-08-10 13:26     ` Prarit Bhargava
2011-07-18 13:08 ` [PATCH 02/34] New SMBIOS driver for x86 and ia64 Prarit Bhargava
2011-07-18 13:08 ` [PATCH 03/34] arch specific changes for SMBIOS and System Firmware Prarit Bhargava
2011-07-18 13:08 ` [PATCH 04/34] drivers/acpi changes for SMBIOS and System Firmware interface Prarit Bhargava
2011-07-18 13:08 ` [PATCH 05/34] drivers/ata changes for SMBIOS and System Firmware Prarit Bhargava
2011-07-18 13:08 ` [PATCH 06/34] drivers/floppy " Prarit Bhargava
2011-07-18 13:08 ` [PATCH 07/34] drivers/char " Prarit Bhargava
2011-07-18 13:08 ` [PATCH 08/34] drivers/crypto " Prarit Bhargava
2011-07-18 13:08 ` [PATCH 09/34] drivers/gpio " Prarit Bhargava
2011-07-18 13:08 ` [PATCH 10/34] drivers/gpu " Prarit Bhargava
2011-07-18 13:08 ` [PATCH 11/34] drivers/hwmon " Prarit Bhargava
2011-07-18 13:08 ` [PATCH 12/34] drivers/i2c " Prarit Bhargava
2011-07-18 13:08 ` [PATCH 13/34] drivers/ide " Prarit Bhargava
2011-07-18 13:08 ` [PATCH 14/34] drivers/input " Prarit Bhargava
2011-07-18 13:08 ` [PATCH 15/34] drivers/leds " Prarit Bhargava
2011-07-18 13:08 ` [PATCH 16/34] drivers/media " Prarit Bhargava
2011-07-18 13:08 ` [PATCH 17/34] drivers/misc " Prarit Bhargava
2011-07-18 13:08 ` [PATCH 18/34] drivers/mtd " Prarit Bhargava
2011-07-18 13:08 ` [PATCH 19/34] drivers/net " Prarit Bhargava
2011-07-18 13:08 ` [PATCH 20/34] drivers/pci " Prarit Bhargava
2011-07-18 13:08 ` [PATCH 21/34] drivers/platform " Prarit Bhargava
2011-08-11  4:30   ` Jonathan Woithe
2011-07-18 13:08 ` [PATCH 22/34] drivers/pnp " Prarit Bhargava
2011-07-18 13:08 ` [PATCH 23/34] drivers/power " Prarit Bhargava
2011-07-18 13:08 ` [PATCH 24/34] drivers/rtc " Prarit Bhargava
2011-07-18 13:08 ` [PATCH 25/34] drivers/staging " Prarit Bhargava
2011-07-18 13:08 ` [PATCH 26/34] drivers/tty " Prarit Bhargava
2011-07-18 13:08 ` [PATCH 27/34] drivers/usb " Prarit Bhargava
2011-07-19 19:47   ` Alan Stern
2011-07-18 13:08 ` [PATCH 28/34] drivers/video " Prarit Bhargava
2011-07-18 13:08 ` [PATCH 29/34] drivers/w1 " Prarit Bhargava
2011-07-18 13:08 ` [PATCH 30/34] drivers/watchdog " Prarit Bhargava
2011-07-18 13:08 ` [PATCH 31/34] include/linux/acpi.h " Prarit Bhargava
2011-07-18 13:08 ` [PATCH 32/34] Kernel panic " Prarit Bhargava
2011-07-18 13:08 ` [PATCH 33/34] sound/pci/hda " Prarit Bhargava
2011-07-18 13:08 ` [PATCH 34/34] Remove old DMI & SMBIOS code and make SMBIOS default on Prarit Bhargava

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).