Add patches accepted for 2.6.29-rc2
authorHenrique de Moraes Holschuh <hmh@hmh.eng.br>
Sun, 25 Jan 2009 17:19:34 +0000 (25 15:19 -0200)
committerHenrique de Moraes Holschuh <hmh@hmh.eng.br>
Sun, 25 Jan 2009 17:19:34 +0000 (25 15:19 -0200)
Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
14 files changed:
releases/upstream/2.6.29-rc2/0001-ACPI-remove-private-acpica-headers-from-driver-file.patch [new file with mode: 0644]
releases/upstream/2.6.29-rc2/0002-create-drivers-platform-x86-from-drivers-misc.patch [new file with mode: 0644]
releases/upstream/2.6.29-rc2/0003-ACPI-thinkpad-acpi-struct-device-replace-bus_id.patch [new file with mode: 0644]
releases/upstream/2.6.29-rc2/0004-ACPI-thinkpad-acpi-debug-facility-to-emulate-the-r.patch [new file with mode: 0644]
releases/upstream/2.6.29-rc2/0005-ACPI-thinkpad-acpi-resume-with-radios-disabled.patch [new file with mode: 0644]
releases/upstream/2.6.29-rc2/0006-ACPI-thinkpad-acpi-preserve-radio-state-across-shu.patch [new file with mode: 0644]
releases/upstream/2.6.29-rc2/0007-ACPI-thinkpad-acpi-add-UWB-radio-support.patch [new file with mode: 0644]
releases/upstream/2.6.29-rc2/0008-ACPI-thinkpad-acpi-use-killable-instead-of-interru.patch [new file with mode: 0644]
releases/upstream/2.6.29-rc2/0009-ACPI-thinkpad-acpi-clean-up-hotkey_notify.patch [new file with mode: 0644]
releases/upstream/2.6.29-rc2/0010-ACPI-thinkpad-acpi-handle-HKEY-thermal-and-battery.patch [new file with mode: 0644]
releases/upstream/2.6.29-rc2/0011-ACPI-thinkpad-acpi-start-the-event-hunt-season.patch [new file with mode: 0644]
releases/upstream/2.6.29-rc2/0012-ACPI-thinkpad-acpi-clean-up-fan-subdriver-quirk.patch [new file with mode: 0644]
releases/upstream/2.6.29-rc2/0013-ACPI-thinkpad-acpi-handle-HKEY-event-6030.patch [new file with mode: 0644]
releases/upstream/2.6.29-rc2/0014-ACPI-thinkpad-acpi-bump-up-version-to-0.22.patch [new file with mode: 0644]

diff --git a/releases/upstream/2.6.29-rc2/0001-ACPI-remove-private-acpica-headers-from-driver-file.patch b/releases/upstream/2.6.29-rc2/0001-ACPI-remove-private-acpica-headers-from-driver-file.patch
new file mode 100644 (file)
index 0000000..fd09bd8
--- /dev/null
@@ -0,0 +1,321 @@
+From ea7e96e0f2277107d9ea14c3f16c86ba82b2e560 Mon Sep 17 00:00:00 2001
+From: Lin Ming <ming.m.lin@intel.com>
+Date: Tue, 16 Dec 2008 16:28:17 +0800
+Subject: ACPI: remove private acpica headers from driver files
+
+External driver files should not include any private acpica headers.
+
+Signed-off-by: Lin Ming <ming.m.lin@intel.com>
+Signed-off-by: Len Brown <len.brown@intel.com>
+---
+ arch/ia64/include/asm/acpi-ext.h   |    1 -
+ arch/ia64/include/asm/sn/acpi.h    |    2 --
+ arch/ia64/sn/kernel/io_acpi_init.c |    1 -
+ arch/ia64/sn/kernel/io_common.c    |    1 -
+ drivers/acpi/cm_sbs.c              |    3 ---
+ drivers/acpi/debug.c               |    1 -
+ drivers/acpi/ec.c                  |    1 -
+ drivers/acpi/numa.c                |    1 -
+ drivers/acpi/sbshc.c               |    1 -
+ drivers/acpi/scan.c                |    1 -
+ drivers/acpi/sleep/wakeup.c        |    1 -
+ drivers/ata/libata-acpi.c          |    6 ------
+ drivers/ata/pata_acpi.c            |    6 ------
+ drivers/char/tpm/tpm_bios.c        |    2 --
+ drivers/ide/ide-acpi.c             |    6 ------
+ drivers/misc/tc1100-wmi.c          |    1 -
+ drivers/misc/thinkpad_acpi.c       |    1 -
+ drivers/pci/hotplug/acpi_pcihp.c   |    1 -
+ drivers/pci/hotplug/pciehp.h       |    1 -
+ drivers/pci/pci-acpi.c             |    2 --
+ drivers/pnp/pnpacpi/core.c         |    1 -
+ include/linux/pci_hotplug.h        |    1 -
+ 22 files changed, 0 insertions(+), 42 deletions(-)
+
+diff --git a/arch/ia64/include/asm/acpi-ext.h b/arch/ia64/include/asm/acpi-ext.h
+index 734d137..7f8362b 100644
+--- a/arch/ia64/include/asm/acpi-ext.h
++++ b/arch/ia64/include/asm/acpi-ext.h
+@@ -14,7 +14,6 @@
+ #define _ASM_IA64_ACPI_EXT_H
+ #include <linux/types.h>
+-#include <acpi/actypes.h>
+ extern acpi_status hp_acpi_csr_space (acpi_handle, u64 *base, u64 *length);
+diff --git a/arch/ia64/include/asm/sn/acpi.h b/arch/ia64/include/asm/sn/acpi.h
+index 9ce2801..fd480db 100644
+--- a/arch/ia64/include/asm/sn/acpi.h
++++ b/arch/ia64/include/asm/sn/acpi.h
+@@ -9,8 +9,6 @@
+ #ifndef _ASM_IA64_SN_ACPI_H
+ #define _ASM_IA64_SN_ACPI_H
+-#include "acpi/acglobal.h"
+-
+ extern int sn_acpi_rev;
+ #define SN_ACPI_BASE_SUPPORT()   (sn_acpi_rev >= 0x20101)
+diff --git a/arch/ia64/sn/kernel/io_acpi_init.c b/arch/ia64/sn/kernel/io_acpi_init.c
+index 4c8bc8e..c5a2140 100644
+--- a/arch/ia64/sn/kernel/io_acpi_init.c
++++ b/arch/ia64/sn/kernel/io_acpi_init.c
+@@ -13,7 +13,6 @@
+ #include <asm/sn/sn_sal.h>
+ #include "xtalk/hubdev.h"
+ #include <linux/acpi.h>
+-#include <acpi/acnamesp.h>
+ /*
+diff --git a/arch/ia64/sn/kernel/io_common.c b/arch/ia64/sn/kernel/io_common.c
+index e1917ed..0d4ffa4 100644
+--- a/arch/ia64/sn/kernel/io_common.c
++++ b/arch/ia64/sn/kernel/io_common.c
+@@ -26,7 +26,6 @@
+ #include <linux/acpi.h>
+ #include <asm/sn/sn2/sn_hwperf.h>
+ #include <asm/sn/acpi.h>
+-#include "acpi/acglobal.h"
+ extern void sn_init_cpei_timer(void);
+ extern void register_sn_procfs(void);
+diff --git a/drivers/acpi/cm_sbs.c b/drivers/acpi/cm_sbs.c
+index 307963b..332fe4b 100644
+--- a/drivers/acpi/cm_sbs.c
++++ b/drivers/acpi/cm_sbs.c
+@@ -27,9 +27,6 @@
+ #include <linux/seq_file.h>
+ #include <acpi/acpi_bus.h>
+ #include <acpi/acpi_drivers.h>
+-#include <acpi/acmacros.h>
+-#include <acpi/actypes.h>
+-#include <acpi/acutils.h>
+ ACPI_MODULE_NAME("cm_sbs");
+ #define ACPI_AC_CLASS         "ac_adapter"
+diff --git a/drivers/acpi/debug.c b/drivers/acpi/debug.c
+index c483968..20223cb 100644
+--- a/drivers/acpi/debug.c
++++ b/drivers/acpi/debug.c
+@@ -9,7 +9,6 @@
+ #include <linux/moduleparam.h>
+ #include <asm/uaccess.h>
+ #include <acpi/acpi_drivers.h>
+-#include <acpi/acglobal.h>
+ #define _COMPONENT            ACPI_SYSTEM_COMPONENT
+ ACPI_MODULE_NAME("debug");
+diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
+index 2cbc2c9..3105e04 100644
+--- a/drivers/acpi/ec.c
++++ b/drivers/acpi/ec.c
+@@ -42,7 +42,6 @@
+ #include <asm/io.h>
+ #include <acpi/acpi_bus.h>
+ #include <acpi/acpi_drivers.h>
+-#include <acpi/actypes.h>
+ #define ACPI_EC_CLASS                 "embedded_controller"
+ #define ACPI_EC_DEVICE_NAME           "Embedded Controller"
+diff --git a/drivers/acpi/numa.c b/drivers/acpi/numa.c
+index 25ceae9..c5e292a 100644
+--- a/drivers/acpi/numa.c
++++ b/drivers/acpi/numa.c
+@@ -29,7 +29,6 @@
+ #include <linux/errno.h>
+ #include <linux/acpi.h>
+ #include <acpi/acpi_bus.h>
+-#include <acpi/acmacros.h>
+ #define ACPI_NUMA     0x80000000
+ #define _COMPONENT    ACPI_NUMA
+diff --git a/drivers/acpi/sbshc.c b/drivers/acpi/sbshc.c
+index e53e590..0619734 100644
+--- a/drivers/acpi/sbshc.c
++++ b/drivers/acpi/sbshc.c
+@@ -10,7 +10,6 @@
+ #include <acpi/acpi_bus.h>
+ #include <acpi/acpi_drivers.h>
+-#include <acpi/actypes.h>
+ #include <linux/wait.h>
+ #include <linux/delay.h>
+ #include <linux/interrupt.h>
+diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
+index 39b7233..c54d7b6 100644
+--- a/drivers/acpi/scan.c
++++ b/drivers/acpi/scan.c
+@@ -10,7 +10,6 @@
+ #include <linux/kthread.h>
+ #include <acpi/acpi_drivers.h>
+-#include <acpi/acinterp.h>    /* for acpi_ex_eisa_id_to_string() */
+ #define _COMPONENT            ACPI_BUS_COMPONENT
+ ACPI_MODULE_NAME("scan");
+diff --git a/drivers/acpi/sleep/wakeup.c b/drivers/acpi/sleep/wakeup.c
+index db325c2..2d34806 100644
+--- a/drivers/acpi/sleep/wakeup.c
++++ b/drivers/acpi/sleep/wakeup.c
+@@ -8,7 +8,6 @@
+ #include <acpi/acpi_drivers.h>
+ #include <linux/kernel.h>
+ #include <linux/types.h>
+-#include <acpi/acevents.h>
+ #include "sleep.h"
+ #define _COMPONENT            ACPI_SYSTEM_COMPONENT
+diff --git a/drivers/ata/libata-acpi.c b/drivers/ata/libata-acpi.c
+index c012307..246987f 100644
+--- a/drivers/ata/libata-acpi.c
++++ b/drivers/ata/libata-acpi.c
+@@ -19,12 +19,6 @@
+ #include "libata.h"
+ #include <acpi/acpi_bus.h>
+-#include <acpi/acnames.h>
+-#include <acpi/acnamesp.h>
+-#include <acpi/acparser.h>
+-#include <acpi/acexcep.h>
+-#include <acpi/acmacros.h>
+-#include <acpi/actypes.h>
+ enum {
+       ATA_ACPI_FILTER_SETXFER = 1 << 0,
+diff --git a/drivers/ata/pata_acpi.c b/drivers/ata/pata_acpi.c
+index e2e332d..8b77a98 100644
+--- a/drivers/ata/pata_acpi.c
++++ b/drivers/ata/pata_acpi.c
+@@ -13,12 +13,6 @@
+ #include <linux/device.h>
+ #include <scsi/scsi_host.h>
+ #include <acpi/acpi_bus.h>
+-#include <acpi/acnames.h>
+-#include <acpi/acnamesp.h>
+-#include <acpi/acparser.h>
+-#include <acpi/acexcep.h>
+-#include <acpi/acmacros.h>
+-#include <acpi/actypes.h>
+ #include <linux/libata.h>
+ #include <linux/ata.h>
+diff --git a/drivers/char/tpm/tpm_bios.c b/drivers/char/tpm/tpm_bios.c
+index 68f052b..ed306eb 100644
+--- a/drivers/char/tpm/tpm_bios.c
++++ b/drivers/char/tpm/tpm_bios.c
+@@ -23,8 +23,6 @@
+ #include <linux/security.h>
+ #include <linux/module.h>
+ #include <acpi/acpi.h>
+-#include <acpi/actypes.h>
+-#include <acpi/actbl.h>
+ #include "tpm.h"
+ #define TCG_EVENT_NAME_LEN_MAX        255
+diff --git a/drivers/ide/ide-acpi.c b/drivers/ide/ide-acpi.c
+index 244a8a0..9e8d52a 100644
+--- a/drivers/ide/ide-acpi.c
++++ b/drivers/ide/ide-acpi.c
+@@ -18,12 +18,6 @@
+ #include <linux/dmi.h>
+ #include <acpi/acpi_bus.h>
+-#include <acpi/acnames.h>
+-#include <acpi/acnamesp.h>
+-#include <acpi/acparser.h>
+-#include <acpi/acexcep.h>
+-#include <acpi/acmacros.h>
+-#include <acpi/actypes.h>
+ #define REGS_PER_GTF          7
+ struct taskfile_array {
+diff --git a/drivers/misc/tc1100-wmi.c b/drivers/misc/tc1100-wmi.c
+index f25e4c9..b4a4aa9 100644
+--- a/drivers/misc/tc1100-wmi.c
++++ b/drivers/misc/tc1100-wmi.c
+@@ -30,7 +30,6 @@
+ #include <linux/init.h>
+ #include <linux/types.h>
+ #include <acpi/acpi.h>
+-#include <acpi/actypes.h>
+ #include <acpi/acpi_bus.h>
+ #include <acpi/acpi_drivers.h>
+ #include <linux/platform_device.h>
+diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c
+index 899766e..3478453 100644
+--- a/drivers/misc/thinkpad_acpi.c
++++ b/drivers/misc/thinkpad_acpi.c
+@@ -76,7 +76,6 @@
+ #include <linux/workqueue.h>
+ #include <acpi/acpi_drivers.h>
+-#include <acpi/acnamesp.h>
+ #include <linux/pci_ids.h>
+diff --git a/drivers/pci/hotplug/acpi_pcihp.c b/drivers/pci/hotplug/acpi_pcihp.c
+index e17ef54..2c981cb 100644
+--- a/drivers/pci/hotplug/acpi_pcihp.c
++++ b/drivers/pci/hotplug/acpi_pcihp.c
+@@ -33,7 +33,6 @@
+ #include <linux/pci-acpi.h>
+ #include <acpi/acpi.h>
+ #include <acpi/acpi_bus.h>
+-#include <acpi/actypes.h>
+ #define MY_NAME       "acpi_pcihp"
+diff --git a/drivers/pci/hotplug/pciehp.h b/drivers/pci/hotplug/pciehp.h
+index b2801a7..7072952 100644
+--- a/drivers/pci/hotplug/pciehp.h
++++ b/drivers/pci/hotplug/pciehp.h
+@@ -217,7 +217,6 @@ struct hpc_ops {
+ #ifdef CONFIG_ACPI
+ #include <acpi/acpi.h>
+ #include <acpi/acpi_bus.h>
+-#include <acpi/actypes.h>
+ #include <linux/pci-acpi.h>
+ static inline int pciehp_get_hp_hw_control_from_firmware(struct pci_dev *dev)
+diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c
+index ae5ec76..9d976d5 100644
+--- a/drivers/pci/pci-acpi.c
++++ b/drivers/pci/pci-acpi.c
+@@ -13,8 +13,6 @@
+ #include <linux/module.h>
+ #include <linux/pci-aspm.h>
+ #include <acpi/acpi.h>
+-#include <acpi/acnamesp.h>
+-#include <acpi/acresrc.h>
+ #include <acpi/acpi_bus.h>
+ #include <linux/pci-acpi.h>
+diff --git a/drivers/pnp/pnpacpi/core.c b/drivers/pnp/pnpacpi/core.c
+index 383e47c..2834846 100644
+--- a/drivers/pnp/pnpacpi/core.c
++++ b/drivers/pnp/pnpacpi/core.c
+@@ -23,7 +23,6 @@
+ #include <linux/pnp.h>
+ #include <linux/mod_devicetable.h>
+ #include <acpi/acpi_bus.h>
+-#include <acpi/actypes.h>
+ #include "../base.h"
+ #include "pnpacpi.h"
+diff --git a/include/linux/pci_hotplug.h b/include/linux/pci_hotplug.h
+index a00bd1a..c2d1a7d 100644
+--- a/include/linux/pci_hotplug.h
++++ b/include/linux/pci_hotplug.h
+@@ -223,7 +223,6 @@ struct hotplug_params {
+ #ifdef CONFIG_ACPI
+ #include <acpi/acpi.h>
+ #include <acpi/acpi_bus.h>
+-#include <acpi/actypes.h>
+ extern acpi_status acpi_get_hp_params_from_firmware(struct pci_bus *bus,
+                               struct hotplug_params *hpp);
+ int acpi_get_hp_hw_control_from_firmware(struct pci_dev *dev, u32 flags);
+-- 
+1.5.6.5
+
diff --git a/releases/upstream/2.6.29-rc2/0002-create-drivers-platform-x86-from-drivers-misc.patch b/releases/upstream/2.6.29-rc2/0002-create-drivers-platform-x86-from-drivers-misc.patch
new file mode 100644 (file)
index 0000000..3656d9b
--- /dev/null
@@ -0,0 +1,808 @@
+From 41b16dce390510f550a4d2b12b98e0258bbed6e2 Mon Sep 17 00:00:00 2001
+From: Len Brown <len.brown@intel.com>
+Date: Mon, 1 Dec 2008 00:09:47 -0500
+Subject: create drivers/platform/x86/ from drivers/misc/
+
+Move x86 platform specific drivers from drivers/misc/
+to a new home under drivers/platform/x86/.
+
+The community has been maintaining x86 vendor-specific
+platform specific drivers under /drivers/misc/ for a few years.
+The oldest ones started life under drivers/acpi.
+They moved out of drivers/acpi/ because they don't actually
+implement the ACPI specification, but either simply
+use ACPI, or implement vendor-specific ACPI extensions.
+
+In the future we anticipate...
+drivers/misc/ will go away.
+other architectures will create drivers/platform/<arch>
+
+Signed-off-by: Len Brown <len.brown@intel.com>
+---
+ drivers/Kconfig                                   |    2 +
+ drivers/Makefile                                  |    1 +
+ drivers/misc/Kconfig                              |  280 --------------------
+ drivers/misc/Makefile                             |   12 -
+ drivers/platform/Kconfig                          |    5 +
+ drivers/platform/Makefile                         |    5 +
+ drivers/platform/x86/Kconfig                      |  290 +++++++++++++++++++++
+ drivers/platform/x86/Makefile                     |   16 ++
+ drivers/{misc => platform/x86}/acer-wmi.c         |    0 
+ drivers/{misc => platform/x86}/asus-laptop.c      |    0 
+ drivers/{misc => platform/x86}/compal-laptop.c    |    0 
+ drivers/{misc => platform/x86}/eeepc-laptop.c     |    0 
+ drivers/{misc => platform/x86}/fujitsu-laptop.c   |    0 
+ drivers/{misc => platform/x86}/hp-wmi.c           |    0 
+ drivers/{misc => platform/x86}/intel_menlow.c     |    0 
+ drivers/{misc => platform/x86}/msi-laptop.c       |    0 
+ drivers/{misc => platform/x86}/panasonic-laptop.c |    0 
+ drivers/{misc => platform/x86}/sony-laptop.c      |    0 
+ drivers/{misc => platform/x86}/tc1100-wmi.c       |    0 
+ drivers/{misc => platform/x86}/thinkpad_acpi.c    |    0 
+ 20 files changed, 319 insertions(+), 292 deletions(-)
+ create mode 100644 drivers/platform/Kconfig
+ create mode 100644 drivers/platform/Makefile
+ create mode 100644 drivers/platform/x86/Kconfig
+ create mode 100644 drivers/platform/x86/Makefile
+ rename drivers/{misc => platform/x86}/acer-wmi.c (100%)
+ rename drivers/{misc => platform/x86}/asus-laptop.c (100%)
+ rename drivers/{misc => platform/x86}/compal-laptop.c (100%)
+ rename drivers/{misc => platform/x86}/eeepc-laptop.c (100%)
+ rename drivers/{misc => platform/x86}/fujitsu-laptop.c (100%)
+ rename drivers/{misc => platform/x86}/hp-wmi.c (100%)
+ rename drivers/{misc => platform/x86}/intel_menlow.c (100%)
+ rename drivers/{misc => platform/x86}/msi-laptop.c (100%)
+ rename drivers/{misc => platform/x86}/panasonic-laptop.c (100%)
+ rename drivers/{misc => platform/x86}/sony-laptop.c (100%)
+ rename drivers/{misc => platform/x86}/tc1100-wmi.c (100%)
+ rename drivers/{misc => platform/x86}/thinkpad_acpi.c (100%)
+
+diff --git a/drivers/Kconfig b/drivers/Kconfig
+index 2f557f5..00cf955 100644
+--- a/drivers/Kconfig
++++ b/drivers/Kconfig
+@@ -107,4 +107,6 @@ source "drivers/uio/Kconfig"
+ source "drivers/xen/Kconfig"
+ source "drivers/staging/Kconfig"
++
++source "drivers/platform/Kconfig"
+ endmenu
+diff --git a/drivers/Makefile b/drivers/Makefile
+index fceb71a..46d4828 100644
+--- a/drivers/Makefile
++++ b/drivers/Makefile
+@@ -102,3 +102,4 @@ obj-$(CONFIG_SSB)          += ssb/
+ obj-$(CONFIG_VIRTIO)          += virtio/
+ obj-$(CONFIG_REGULATOR)               += regulator/
+ obj-$(CONFIG_STAGING)         += staging/
++obj-y                         += platform/
+diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
+index dcf6169..8574879 100644
+--- a/drivers/misc/Kconfig
++++ b/drivers/misc/Kconfig
+@@ -136,97 +136,6 @@ config TIFM_7XX1
+         To compile this driver as a module, choose M here: the module will
+         be called tifm_7xx1.
+-config ACER_WMI
+-      tristate "Acer WMI Laptop Extras (EXPERIMENTAL)"
+-      depends on X86
+-      depends on EXPERIMENTAL
+-      depends on ACPI
+-      depends on LEDS_CLASS
+-      depends on NEW_LEDS
+-      depends on BACKLIGHT_CLASS_DEVICE
+-      depends on SERIO_I8042
+-      depends on RFKILL
+-      select ACPI_WMI
+-      ---help---
+-        This is a driver for newer Acer (and Wistron) laptops. It adds
+-        wireless radio and bluetooth control, and on some laptops,
+-        exposes the mail LED and LCD backlight.
+-
+-        For more information about this driver see
+-        <file:Documentation/laptops/acer-wmi.txt>
+-
+-        If you have an ACPI-WMI compatible Acer/ Wistron laptop, say Y or M
+-        here.
+-
+-config ASUS_LAPTOP
+-      tristate "Asus Laptop Extras (EXPERIMENTAL)"
+-      depends on X86
+-      depends on ACPI
+-      depends on EXPERIMENTAL && !ACPI_ASUS
+-      depends on LEDS_CLASS
+-      depends on NEW_LEDS
+-      depends on BACKLIGHT_CLASS_DEVICE
+-      ---help---
+-        This is the new Linux driver for Asus laptops. It may also support some
+-        MEDION, JVC or VICTOR laptops. It makes all the extra buttons generate
+-        standard ACPI events that go through /proc/acpi/events. It also adds
+-        support for video output switching, LCD backlight control, Bluetooth and
+-        Wlan control, and most importantly, allows you to blink those fancy LEDs.
+-
+-        For more information and a userspace daemon for handling the extra
+-        buttons see <http://acpi4asus.sf.net/>.
+-
+-        If you have an ACPI-compatible ASUS laptop, say Y or M here.
+-
+-config FUJITSU_LAPTOP
+-      tristate "Fujitsu Laptop Extras"
+-      depends on X86
+-      depends on ACPI
+-      depends on INPUT
+-      depends on BACKLIGHT_CLASS_DEVICE
+-      ---help---
+-        This is a driver for laptops built by Fujitsu:
+-
+-          * P2xxx/P5xxx/S6xxx/S7xxx series Lifebooks
+-          * Possibly other Fujitsu laptop models
+-          * Tested with S6410 and S7020
+-
+-        It adds support for LCD brightness control and some hotkeys.
+-
+-        If you have a Fujitsu laptop, say Y or M here.
+-
+-config FUJITSU_LAPTOP_DEBUG
+-      bool "Verbose debug mode for Fujitsu Laptop Extras"
+-      depends on FUJITSU_LAPTOP
+-      default n
+-      ---help---
+-        Enables extra debug output from the fujitsu extras driver, at the
+-        expense of a slight increase in driver size.
+-
+-        If you are not sure, say N here.
+-
+-config TC1100_WMI
+-      tristate "HP Compaq TC1100 Tablet WMI Extras (EXPERIMENTAL)"
+-      depends on X86 && !X86_64
+-      depends on EXPERIMENTAL
+-      depends on ACPI
+-      select ACPI_WMI
+-      ---help---
+-        This is a driver for the WMI extensions (wireless and bluetooth power
+-        control) of the HP Compaq TC1100 tablet.
+-
+-config HP_WMI
+-       tristate "HP WMI extras"
+-       depends on ACPI_WMI
+-       depends on INPUT
+-       depends on RFKILL
+-       help
+-       Say Y here if you want to support WMI-based hotkeys on HP laptops and
+-       to read data from WMI such as docking or ambient light sensor state.
+-
+-       To compile this driver as a module, choose M here: the module will
+-       be called hp-wmi.
+-
+ config ICS932S401
+       tristate "Integrated Circuits ICS932S401"
+       depends on I2C && EXPERIMENTAL
+@@ -237,170 +146,6 @@ config ICS932S401
+         This driver can also be built as a module. If so, the module
+         will be called ics932s401.
+-config MSI_LAPTOP
+-      tristate "MSI Laptop Extras"
+-      depends on X86
+-      depends on ACPI
+-      depends on BACKLIGHT_CLASS_DEVICE
+-      ---help---
+-        This is a driver for laptops built by MSI (MICRO-STAR
+-        INTERNATIONAL):
+-
+-        MSI MegaBook S270 (MS-1013)
+-        Cytron/TCM/Medion/Tchibo MD96100/SAM2000
+-
+-        It adds support for Bluetooth, WLAN and LCD brightness control.
+-
+-        More information about this driver is available at
+-        <http://0pointer.de/lennart/tchibo.html>.
+-
+-        If you have an MSI S270 laptop, say Y or M here.
+-
+-config PANASONIC_LAPTOP
+-      tristate "Panasonic Laptop Extras"
+-      depends on X86 && INPUT && ACPI
+-      depends on BACKLIGHT_CLASS_DEVICE
+-      ---help---
+-        This driver adds support for access to backlight control and hotkeys
+-        on Panasonic Let's Note laptops.
+-
+-        If you have a Panasonic Let's note laptop (such as the R1(N variant),
+-        R2, R3, R5, T2, W2 and Y2 series), say Y.
+-
+-config COMPAL_LAPTOP
+-      tristate "Compal Laptop Extras"
+-      depends on X86
+-      depends on ACPI
+-      depends on BACKLIGHT_CLASS_DEVICE
+-      ---help---
+-        This is a driver for laptops built by Compal:
+-
+-        Compal FL90/IFL90
+-        Compal FL91/IFL91
+-        Compal FL92/JFL92
+-        Compal FT00/IFT00
+-
+-        It adds support for Bluetooth, WLAN and LCD brightness control.
+-
+-        If you have an Compal FL9x/IFL9x/FT00 laptop, say Y or M here.
+-
+-config SONY_LAPTOP
+-      tristate "Sony Laptop Extras"
+-      depends on X86 && ACPI
+-      select BACKLIGHT_CLASS_DEVICE
+-      depends on INPUT
+-        ---help---
+-        This mini-driver drives the SNC and SPIC devices present in the ACPI
+-        BIOS of the Sony Vaio laptops.
+-
+-        It gives access to some extra laptop functionalities like Bluetooth,
+-        screen brightness control, Fn keys and allows powering on/off some
+-        devices.
+-
+-        Read <file:Documentation/laptops/sony-laptop.txt> for more information.
+-
+-config SONYPI_COMPAT
+-      bool "Sonypi compatibility"
+-      depends on SONY_LAPTOP
+-        ---help---
+-        Build the sonypi driver compatibility code into the sony-laptop driver.
+-
+-config THINKPAD_ACPI
+-      tristate "ThinkPad ACPI Laptop Extras"
+-      depends on X86 && ACPI
+-      select BACKLIGHT_LCD_SUPPORT
+-      select BACKLIGHT_CLASS_DEVICE
+-      select HWMON
+-      select NVRAM
+-      select INPUT
+-      select NEW_LEDS
+-      select LEDS_CLASS
+-      select NET
+-      select RFKILL
+-      ---help---
+-        This is a driver for the IBM and Lenovo ThinkPad laptops. It adds
+-        support for Fn-Fx key combinations, Bluetooth control, video
+-        output switching, ThinkLight control, UltraBay eject and more.
+-        For more information about this driver see
+-        <file:Documentation/laptops/thinkpad-acpi.txt> and
+-        <http://ibm-acpi.sf.net/> .
+-
+-        This driver was formerly known as ibm-acpi.
+-
+-        If you have an IBM or Lenovo ThinkPad laptop, say Y or M here.
+-
+-config THINKPAD_ACPI_DEBUG
+-      bool "Verbose debug mode"
+-      depends on THINKPAD_ACPI
+-      default n
+-      ---help---
+-        Enables extra debugging information, at the expense of a slightly
+-        increase in driver size.
+-
+-        If you are not sure, say N here.
+-
+-config THINKPAD_ACPI_DOCK
+-      bool "Legacy Docking Station Support"
+-      depends on THINKPAD_ACPI
+-      depends on ACPI_DOCK=n
+-      default n
+-      ---help---
+-        Allows the thinkpad_acpi driver to handle docking station events.
+-        This support was made obsolete by the generic ACPI docking station
+-        support (CONFIG_ACPI_DOCK).  It will allow locking and removing the
+-        laptop from the docking station, but will not properly connect PCI
+-        devices.
+-
+-        If you are not sure, say N here.
+-
+-config THINKPAD_ACPI_BAY
+-      bool "Legacy Removable Bay Support"
+-      depends on THINKPAD_ACPI
+-      default y
+-      ---help---
+-        Allows the thinkpad_acpi driver to handle removable bays.  It will
+-        electrically disable the device in the bay, and also generate
+-        notifications when the bay lever is ejected or inserted.
+-
+-        If you are not sure, say Y here.
+-
+-config THINKPAD_ACPI_VIDEO
+-      bool "Video output control support"
+-      depends on THINKPAD_ACPI
+-      default y
+-      ---help---
+-        Allows the thinkpad_acpi driver to provide an interface to control
+-        the various video output ports.
+-
+-        This feature often won't work well, depending on ThinkPad model,
+-        display state, video output devices in use, whether there is a X
+-        server running, phase of the moon, and the current mood of
+-        Schroedinger's cat.  If you can use X.org's RandR to control
+-        your ThinkPad's video output ports instead of this feature,
+-        don't think twice: do it and say N here to save some memory.
+-
+-        If you are not sure, say Y here.
+-
+-config THINKPAD_ACPI_HOTKEY_POLL
+-      bool "Support NVRAM polling for hot keys"
+-      depends on THINKPAD_ACPI
+-      default y
+-      ---help---
+-        Some thinkpad models benefit from NVRAM polling to detect a few of
+-        the hot key press events.  If you know your ThinkPad model does not
+-        need to do NVRAM polling to support any of the hot keys you use,
+-        unselecting this option will save about 1kB of memory.
+-
+-        ThinkPads T40 and newer, R52 and newer, and X31 and newer are
+-        unlikely to need NVRAM polling in their latest BIOS versions.
+-
+-        NVRAM polling can detect at most the following keys: ThinkPad/Access
+-        IBM, Zoom, Switch Display (fn+F7), ThinkLight, Volume up/down/mute,
+-        Brightness up/down, Display Expand (fn+F8), Hibernate (fn+F12).
+-
+-        If you are not sure, say Y here.  The driver enables polling only if
+-        it is strictly necessary to do so.
+-
+ config ATMEL_SSC
+       tristate "Device driver for Atmel SSC peripheral"
+       depends on AVR32 || ARCH_AT91
+@@ -413,31 +158,6 @@ config ATMEL_SSC
+         If unsure, say N.
+-config INTEL_MENLOW
+-      tristate "Thermal Management driver for Intel menlow platform"
+-      depends on ACPI_THERMAL
+-      select THERMAL
+-      depends on X86
+-      ---help---
+-        ACPI thermal management enhancement driver on
+-        Intel Menlow platform.
+-
+-        If unsure, say N.
+-
+-config EEEPC_LAPTOP
+-      tristate "Eee PC Hotkey Driver (EXPERIMENTAL)"
+-      depends on X86
+-      depends on ACPI
+-      depends on BACKLIGHT_CLASS_DEVICE
+-      depends on HWMON
+-      depends on EXPERIMENTAL
+-      depends on RFKILL
+-      ---help---
+-        This driver supports the Fn-Fx keys on Eee PC laptops.
+-        It also adds the ability to switch camera/wlan on/off.
+-
+-        If you have an Eee PC laptop, say Y or M here.
+-
+ config ENCLOSURE_SERVICES
+       tristate "Enclosure Services"
+       default n
+diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile
+index 027e1ea..d5749a7 100644
+--- a/drivers/misc/Makefile
++++ b/drivers/misc/Makefile
+@@ -4,28 +4,16 @@
+ obj-$(CONFIG_IBM_ASM)         += ibmasm/
+ obj-$(CONFIG_HDPU_FEATURES)   += hdpuftrs/
+-obj-$(CONFIG_ASUS_LAPTOP)     += asus-laptop.o
+-obj-$(CONFIG_EEEPC_LAPTOP)    += eeepc-laptop.o
+-obj-$(CONFIG_MSI_LAPTOP)      += msi-laptop.o
+-obj-$(CONFIG_COMPAL_LAPTOP)   += compal-laptop.o
+-obj-$(CONFIG_ACER_WMI)                += acer-wmi.o
+ obj-$(CONFIG_ATMEL_PWM)               += atmel_pwm.o
+ obj-$(CONFIG_ATMEL_SSC)               += atmel-ssc.o
+ obj-$(CONFIG_ATMEL_TCLIB)     += atmel_tclib.o
+-obj-$(CONFIG_HP_WMI)          += hp-wmi.o
+ obj-$(CONFIG_ICS932S401)      += ics932s401.o
+-obj-$(CONFIG_TC1100_WMI)      += tc1100-wmi.o
+ obj-$(CONFIG_LKDTM)           += lkdtm.o
+ obj-$(CONFIG_TIFM_CORE)               += tifm_core.o
+ obj-$(CONFIG_TIFM_7XX1)               += tifm_7xx1.o
+ obj-$(CONFIG_PHANTOM)         += phantom.o
+ obj-$(CONFIG_SGI_IOC4)                += ioc4.o
+-obj-$(CONFIG_SONY_LAPTOP)     += sony-laptop.o
+-obj-$(CONFIG_THINKPAD_ACPI)   += thinkpad_acpi.o
+-obj-$(CONFIG_FUJITSU_LAPTOP)  += fujitsu-laptop.o
+-obj-$(CONFIG_PANASONIC_LAPTOP)        += panasonic-laptop.o
+ obj-$(CONFIG_EEPROM_93CX6)    += eeprom_93cx6.o
+-obj-$(CONFIG_INTEL_MENLOW)    += intel_menlow.o
+ obj-$(CONFIG_ENCLOSURE_SERVICES) += enclosure.o
+ obj-$(CONFIG_KGDB_TESTS)      += kgdbts.o
+ obj-$(CONFIG_SGI_XP)          += sgi-xp/
+diff --git a/drivers/platform/Kconfig b/drivers/platform/Kconfig
+new file mode 100644
+index 0000000..9652c3f
+--- /dev/null
++++ b/drivers/platform/Kconfig
+@@ -0,0 +1,5 @@
++# drivers/platform/Kconfig
++
++if X86
++source "drivers/platform/x86/Kconfig"
++endif
+diff --git a/drivers/platform/Makefile b/drivers/platform/Makefile
+new file mode 100644
+index 0000000..782953a
+--- /dev/null
++++ b/drivers/platform/Makefile
+@@ -0,0 +1,5 @@
++#
++# Makefile for linux/drivers/platform
++#
++
++obj-$(CONFIG_X86)             += x86/
+diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
+new file mode 100644
+index 0000000..0a9a5b9
+--- /dev/null
++++ b/drivers/platform/x86/Kconfig
+@@ -0,0 +1,290 @@
++#
++# X86 Platform Specific Drivers
++#
++
++menuconfig X86_PLATFORM_DEVICES
++      bool "X86 Platform Specific Device Drivers"
++      default y
++      ---help---
++        Say Y here to get to see options for device drivers for various
++        x86 platforms, including vendor-specific laptop extension drivers.
++        This option alone does not add any kernel code.
++
++        If you say N, all options in this submenu will be skipped and disabled.
++
++if X86_PLATFORM_DEVICES
++
++config ACER_WMI
++      tristate "Acer WMI Laptop Extras (EXPERIMENTAL)"
++      depends on EXPERIMENTAL
++      depends on ACPI
++      depends on LEDS_CLASS
++      depends on NEW_LEDS
++      depends on BACKLIGHT_CLASS_DEVICE
++      depends on SERIO_I8042
++      depends on RFKILL
++      select ACPI_WMI
++      ---help---
++        This is a driver for newer Acer (and Wistron) laptops. It adds
++        wireless radio and bluetooth control, and on some laptops,
++        exposes the mail LED and LCD backlight.
++
++        For more information about this driver see
++        <file:Documentation/laptops/acer-wmi.txt>
++
++        If you have an ACPI-WMI compatible Acer/ Wistron laptop, say Y or M
++        here.
++
++config ASUS_LAPTOP
++      tristate "Asus Laptop Extras (EXPERIMENTAL)"
++      depends on ACPI
++      depends on EXPERIMENTAL && !ACPI_ASUS
++      depends on LEDS_CLASS
++      depends on NEW_LEDS
++      depends on BACKLIGHT_CLASS_DEVICE
++      ---help---
++        This is the new Linux driver for Asus laptops. It may also support some
++        MEDION, JVC or VICTOR laptops. It makes all the extra buttons generate
++        standard ACPI events that go through /proc/acpi/events. It also adds
++        support for video output switching, LCD backlight control, Bluetooth and
++        Wlan control, and most importantly, allows you to blink those fancy LEDs.
++
++        For more information and a userspace daemon for handling the extra
++        buttons see <http://acpi4asus.sf.net/>.
++
++        If you have an ACPI-compatible ASUS laptop, say Y or M here.
++
++config FUJITSU_LAPTOP
++      tristate "Fujitsu Laptop Extras"
++      depends on ACPI
++      depends on INPUT
++      depends on BACKLIGHT_CLASS_DEVICE
++      ---help---
++        This is a driver for laptops built by Fujitsu:
++
++          * P2xxx/P5xxx/S6xxx/S7xxx series Lifebooks
++          * Possibly other Fujitsu laptop models
++          * Tested with S6410 and S7020
++
++        It adds support for LCD brightness control and some hotkeys.
++
++        If you have a Fujitsu laptop, say Y or M here.
++
++config FUJITSU_LAPTOP_DEBUG
++      bool "Verbose debug mode for Fujitsu Laptop Extras"
++      depends on FUJITSU_LAPTOP
++      default n
++      ---help---
++        Enables extra debug output from the fujitsu extras driver, at the
++        expense of a slight increase in driver size.
++
++        If you are not sure, say N here.
++
++config TC1100_WMI
++      tristate "HP Compaq TC1100 Tablet WMI Extras (EXPERIMENTAL)"
++      depends on !X86_64
++      depends on EXPERIMENTAL
++      depends on ACPI
++      select ACPI_WMI
++      ---help---
++        This is a driver for the WMI extensions (wireless and bluetooth power
++        control) of the HP Compaq TC1100 tablet.
++
++config HP_WMI
++      tristate "HP WMI extras"
++      depends on ACPI_WMI
++      depends on INPUT
++      depends on RFKILL
++      help
++       Say Y here if you want to support WMI-based hotkeys on HP laptops and
++       to read data from WMI such as docking or ambient light sensor state.
++
++       To compile this driver as a module, choose M here: the module will
++       be called hp-wmi.
++
++config MSI_LAPTOP
++      tristate "MSI Laptop Extras"
++      depends on ACPI
++      depends on BACKLIGHT_CLASS_DEVICE
++      ---help---
++        This is a driver for laptops built by MSI (MICRO-STAR
++        INTERNATIONAL):
++
++        MSI MegaBook S270 (MS-1013)
++        Cytron/TCM/Medion/Tchibo MD96100/SAM2000
++
++        It adds support for Bluetooth, WLAN and LCD brightness control.
++
++        More information about this driver is available at
++        <http://0pointer.de/lennart/tchibo.html>.
++
++        If you have an MSI S270 laptop, say Y or M here.
++
++config PANASONIC_LAPTOP
++      tristate "Panasonic Laptop Extras"
++      depends on INPUT && ACPI
++      depends on BACKLIGHT_CLASS_DEVICE
++      ---help---
++        This driver adds support for access to backlight control and hotkeys
++        on Panasonic Let's Note laptops.
++
++        If you have a Panasonic Let's note laptop (such as the R1(N variant),
++        R2, R3, R5, T2, W2 and Y2 series), say Y.
++
++config COMPAL_LAPTOP
++      tristate "Compal Laptop Extras"
++      depends on ACPI
++      depends on BACKLIGHT_CLASS_DEVICE
++      ---help---
++        This is a driver for laptops built by Compal:
++
++        Compal FL90/IFL90
++        Compal FL91/IFL91
++        Compal FL92/JFL92
++        Compal FT00/IFT00
++
++        It adds support for Bluetooth, WLAN and LCD brightness control.
++
++        If you have an Compal FL9x/IFL9x/FT00 laptop, say Y or M here.
++
++config SONY_LAPTOP
++      tristate "Sony Laptop Extras"
++      depends on ACPI
++      select BACKLIGHT_CLASS_DEVICE
++      depends on INPUT
++        ---help---
++        This mini-driver drives the SNC and SPIC devices present in the ACPI
++        BIOS of the Sony Vaio laptops.
++
++        It gives access to some extra laptop functionalities like Bluetooth,
++        screen brightness control, Fn keys and allows powering on/off some
++        devices.
++
++        Read <file:Documentation/laptops/sony-laptop.txt> for more information.
++
++config SONYPI_COMPAT
++      bool "Sonypi compatibility"
++      depends on SONY_LAPTOP
++        ---help---
++        Build the sonypi driver compatibility code into the sony-laptop driver.
++
++config THINKPAD_ACPI
++      tristate "ThinkPad ACPI Laptop Extras"
++      depends on ACPI
++      select BACKLIGHT_LCD_SUPPORT
++      select BACKLIGHT_CLASS_DEVICE
++      select HWMON
++      select NVRAM
++      select INPUT
++      select NEW_LEDS
++      select LEDS_CLASS
++      select NET
++      select RFKILL
++      ---help---
++        This is a driver for the IBM and Lenovo ThinkPad laptops. It adds
++        support for Fn-Fx key combinations, Bluetooth control, video
++        output switching, ThinkLight control, UltraBay eject and more.
++        For more information about this driver see
++        <file:Documentation/laptops/thinkpad-acpi.txt> and
++        <http://ibm-acpi.sf.net/> .
++
++        This driver was formerly known as ibm-acpi.
++
++        If you have an IBM or Lenovo ThinkPad laptop, say Y or M here.
++
++config THINKPAD_ACPI_DEBUG
++      bool "Verbose debug mode"
++      depends on THINKPAD_ACPI
++      default n
++      ---help---
++        Enables extra debugging information, at the expense of a slightly
++        increase in driver size.
++
++        If you are not sure, say N here.
++
++config THINKPAD_ACPI_DOCK
++      bool "Legacy Docking Station Support"
++      depends on THINKPAD_ACPI
++      depends on ACPI_DOCK=n
++      default n
++      ---help---
++        Allows the thinkpad_acpi driver to handle docking station events.
++        This support was made obsolete by the generic ACPI docking station
++        support (CONFIG_ACPI_DOCK).  It will allow locking and removing the
++        laptop from the docking station, but will not properly connect PCI
++        devices.
++
++        If you are not sure, say N here.
++
++config THINKPAD_ACPI_BAY
++      bool "Legacy Removable Bay Support"
++      depends on THINKPAD_ACPI
++      default y
++      ---help---
++        Allows the thinkpad_acpi driver to handle removable bays.  It will
++        electrically disable the device in the bay, and also generate
++        notifications when the bay lever is ejected or inserted.
++
++        If you are not sure, say Y here.
++
++config THINKPAD_ACPI_VIDEO
++      bool "Video output control support"
++      depends on THINKPAD_ACPI
++      default y
++      ---help---
++        Allows the thinkpad_acpi driver to provide an interface to control
++        the various video output ports.
++
++        This feature often won't work well, depending on ThinkPad model,
++        display state, video output devices in use, whether there is a X
++        server running, phase of the moon, and the current mood of
++        Schroedinger's cat.  If you can use X.org's RandR to control
++        your ThinkPad's video output ports instead of this feature,
++        don't think twice: do it and say N here to save some memory.
++
++        If you are not sure, say Y here.
++
++config THINKPAD_ACPI_HOTKEY_POLL
++      bool "Support NVRAM polling for hot keys"
++      depends on THINKPAD_ACPI
++      default y
++      ---help---
++        Some thinkpad models benefit from NVRAM polling to detect a few of
++        the hot key press events.  If you know your ThinkPad model does not
++        need to do NVRAM polling to support any of the hot keys you use,
++        unselecting this option will save about 1kB of memory.
++
++        ThinkPads T40 and newer, R52 and newer, and X31 and newer are
++        unlikely to need NVRAM polling in their latest BIOS versions.
++
++        NVRAM polling can detect at most the following keys: ThinkPad/Access
++        IBM, Zoom, Switch Display (fn+F7), ThinkLight, Volume up/down/mute,
++        Brightness up/down, Display Expand (fn+F8), Hibernate (fn+F12).
++
++        If you are not sure, say Y here.  The driver enables polling only if
++        it is strictly necessary to do so.
++
++config INTEL_MENLOW
++      tristate "Thermal Management driver for Intel menlow platform"
++      depends on ACPI_THERMAL
++      select THERMAL
++      ---help---
++        ACPI thermal management enhancement driver on
++        Intel Menlow platform.
++
++        If unsure, say N.
++
++config EEEPC_LAPTOP
++      tristate "Eee PC Hotkey Driver (EXPERIMENTAL)"
++      depends on ACPI
++      depends on BACKLIGHT_CLASS_DEVICE
++      depends on HWMON
++      depends on EXPERIMENTAL
++      depends on RFKILL
++      ---help---
++        This driver supports the Fn-Fx keys on Eee PC laptops.
++        It also adds the ability to switch camera/wlan on/off.
++
++        If you have an Eee PC laptop, say Y or M here.
++
++endif # X86_PLATFORM_DEVICES
+diff --git a/drivers/platform/x86/Makefile b/drivers/platform/x86/Makefile
+new file mode 100644
+index 0000000..4d26b1b
+--- /dev/null
++++ b/drivers/platform/x86/Makefile
+@@ -0,0 +1,16 @@
++#
++# Makefile for linux/drivers/platform/x86
++# x86 Platform-Specific Drivers
++#
++obj-$(CONFIG_ASUS_LAPTOP)     += asus-laptop.o
++obj-$(CONFIG_EEEPC_LAPTOP)    += eeepc-laptop.o
++obj-$(CONFIG_MSI_LAPTOP)      += msi-laptop.o
++obj-$(CONFIG_COMPAL_LAPTOP)   += compal-laptop.o
++obj-$(CONFIG_ACER_WMI)                += acer-wmi.o
++obj-$(CONFIG_HP_WMI)          += hp-wmi.o
++obj-$(CONFIG_TC1100_WMI)      += tc1100-wmi.o
++obj-$(CONFIG_SONY_LAPTOP)     += sony-laptop.o
++obj-$(CONFIG_THINKPAD_ACPI)   += thinkpad_acpi.o
++obj-$(CONFIG_FUJITSU_LAPTOP)  += fujitsu-laptop.o
++obj-$(CONFIG_PANASONIC_LAPTOP)        += panasonic-laptop.o
++obj-$(CONFIG_INTEL_MENLOW)    += intel_menlow.o
+diff --git a/drivers/misc/acer-wmi.c b/drivers/platform/x86/acer-wmi.c
+similarity index 100%
+rename from drivers/misc/acer-wmi.c
+rename to drivers/platform/x86/acer-wmi.c
+diff --git a/drivers/misc/asus-laptop.c b/drivers/platform/x86/asus-laptop.c
+similarity index 100%
+rename from drivers/misc/asus-laptop.c
+rename to drivers/platform/x86/asus-laptop.c
+diff --git a/drivers/misc/compal-laptop.c b/drivers/platform/x86/compal-laptop.c
+similarity index 100%
+rename from drivers/misc/compal-laptop.c
+rename to drivers/platform/x86/compal-laptop.c
+diff --git a/drivers/misc/eeepc-laptop.c b/drivers/platform/x86/eeepc-laptop.c
+similarity index 100%
+rename from drivers/misc/eeepc-laptop.c
+rename to drivers/platform/x86/eeepc-laptop.c
+diff --git a/drivers/misc/fujitsu-laptop.c b/drivers/platform/x86/fujitsu-laptop.c
+similarity index 100%
+rename from drivers/misc/fujitsu-laptop.c
+rename to drivers/platform/x86/fujitsu-laptop.c
+diff --git a/drivers/misc/hp-wmi.c b/drivers/platform/x86/hp-wmi.c
+similarity index 100%
+rename from drivers/misc/hp-wmi.c
+rename to drivers/platform/x86/hp-wmi.c
+diff --git a/drivers/misc/intel_menlow.c b/drivers/platform/x86/intel_menlow.c
+similarity index 100%
+rename from drivers/misc/intel_menlow.c
+rename to drivers/platform/x86/intel_menlow.c
+diff --git a/drivers/misc/msi-laptop.c b/drivers/platform/x86/msi-laptop.c
+similarity index 100%
+rename from drivers/misc/msi-laptop.c
+rename to drivers/platform/x86/msi-laptop.c
+diff --git a/drivers/misc/panasonic-laptop.c b/drivers/platform/x86/panasonic-laptop.c
+similarity index 100%
+rename from drivers/misc/panasonic-laptop.c
+rename to drivers/platform/x86/panasonic-laptop.c
+diff --git a/drivers/misc/sony-laptop.c b/drivers/platform/x86/sony-laptop.c
+similarity index 100%
+rename from drivers/misc/sony-laptop.c
+rename to drivers/platform/x86/sony-laptop.c
+diff --git a/drivers/misc/tc1100-wmi.c b/drivers/platform/x86/tc1100-wmi.c
+similarity index 100%
+rename from drivers/misc/tc1100-wmi.c
+rename to drivers/platform/x86/tc1100-wmi.c
+diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
+similarity index 100%
+rename from drivers/misc/thinkpad_acpi.c
+rename to drivers/platform/x86/thinkpad_acpi.c
+-- 
+1.5.6.5
+
diff --git a/releases/upstream/2.6.29-rc2/0003-ACPI-thinkpad-acpi-struct-device-replace-bus_id.patch b/releases/upstream/2.6.29-rc2/0003-ACPI-thinkpad-acpi-struct-device-replace-bus_id.patch
new file mode 100644 (file)
index 0000000..c65b69d
--- /dev/null
@@ -0,0 +1,56 @@
+From e0b36fc5efd610a208b6b80e821a49302ca424ab Mon Sep 17 00:00:00 2001
+From: Kay Sievers <kay.sievers@vrfy.org>
+Date: Sun, 11 Jan 2009 03:00:59 -0200
+Subject: ACPI: thinkpad-acpi: struct device - replace bus_id with dev_name(), dev_set_name()
+
+Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
+Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
+Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
+Signed-off-by: Len Brown <len.brown@intel.com>
+---
+ drivers/platform/x86/thinkpad_acpi.c |    8 ++++----
+ 1 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
+index 3478453..ee3fa00 100644
+--- a/drivers/platform/x86/thinkpad_acpi.c
++++ b/drivers/platform/x86/thinkpad_acpi.c
+@@ -2375,7 +2375,7 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event)
+               /* forward it to userspace, maybe it knows how to handle it */
+               acpi_bus_generate_netlink_event(
+                                       ibm->acpi->device->pnp.device_class,
+-                                      ibm->acpi->device->dev.bus_id,
++                                      dev_name(&ibm->acpi->device->dev),
+                                       event, 0);
+               return;
+       }
+@@ -2505,7 +2505,7 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event)
+               if (!ignore_acpi_ev && send_acpi_ev) {
+                       acpi_bus_generate_netlink_event(
+                                       ibm->acpi->device->pnp.device_class,
+-                                      ibm->acpi->device->dev.bus_id,
++                                      dev_name(&ibm->acpi->device->dev),
+                                       event, hkey);
+               }
+       }
+@@ -3724,7 +3724,7 @@ static void dock_notify(struct ibm_struct *ibm, u32 event)
+       }
+       acpi_bus_generate_proc_event(ibm->acpi->device, event, data);
+       acpi_bus_generate_netlink_event(ibm->acpi->device->pnp.device_class,
+-                                        ibm->acpi->device->dev.bus_id,
++                                        dev_name(&ibm->acpi->device->dev),
+                                         event, data);
+ }
+@@ -3826,7 +3826,7 @@ static void bay_notify(struct ibm_struct *ibm, u32 event)
+ {
+       acpi_bus_generate_proc_event(ibm->acpi->device, event, 0);
+       acpi_bus_generate_netlink_event(ibm->acpi->device->pnp.device_class,
+-                                        ibm->acpi->device->dev.bus_id,
++                                        dev_name(&ibm->acpi->device->dev),
+                                         event, 0);
+ }
+-- 
+1.5.6.5
+
diff --git a/releases/upstream/2.6.29-rc2/0004-ACPI-thinkpad-acpi-debug-facility-to-emulate-the-r.patch b/releases/upstream/2.6.29-rc2/0004-ACPI-thinkpad-acpi-debug-facility-to-emulate-the-r.patch
new file mode 100644 (file)
index 0000000..dd94bc7
--- /dev/null
@@ -0,0 +1,332 @@
+From a73f30916ee524437253739eacc682f6fb0f3ea8 Mon Sep 17 00:00:00 2001
+From: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
+Date: Sun, 11 Jan 2009 03:01:00 -0200
+Subject: ACPI: thinkpad-acpi: debug facility to emulate the rf switches
+
+This code is required to keep the thinkpad-acpi maintainer sane, and
+it is disabled by default.
+
+Add a debug facility to simulate an rfkill hardware rocker switch, a
+bluetooth rfkill soft-switch, a WWAN rfkill soft-switch on thinkpads.
+
+The simulated switches obviously do not kill any radios in hardware or
+firmware (unlike the real one).  They also don't issue deprecated proc
+events.
+
+Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
+Signed-off-by: Len Brown <len.brown@intel.com>
+---
+ drivers/platform/x86/Kconfig         |   11 ++
+ drivers/platform/x86/thinkpad_acpi.c |  190 ++++++++++++++++++++++++++++++++++
+ 2 files changed, 201 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
+index e65448e..431772b 100644
+--- a/drivers/platform/x86/Kconfig
++++ b/drivers/platform/x86/Kconfig
+@@ -192,6 +192,17 @@ config THINKPAD_ACPI
+         If you have an IBM or Lenovo ThinkPad laptop, say Y or M here.
++config THINKPAD_ACPI_DEBUGFACILITIES
++      bool "Maintainer debug facilities"
++      depends on THINKPAD_ACPI
++      default n
++      ---help---
++        Enables extra stuff in the thinkpad-acpi which is completely useless
++        for normal use.  Read the driver source to find out what it does.
++
++        Say N here, unless you were told by a kernel maintainer to do
++        otherwise.
++
+ config THINKPAD_ACPI_DEBUG
+       bool "Verbose debug mode"
+       depends on THINKPAD_ACPI
+diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
+index ee3fa00..a086ce8 100644
+--- a/drivers/platform/x86/thinkpad_acpi.c
++++ b/drivers/platform/x86/thinkpad_acpi.c
+@@ -288,6 +288,16 @@ struct tpacpi_led_classdev {
+       unsigned int led;
+ };
++#ifdef CONFIG_THINKPAD_ACPI_DEBUGFACILITIES
++static int dbg_wlswemul;
++static int tpacpi_wlsw_emulstate;
++static int dbg_bluetoothemul;
++static int tpacpi_bluetooth_emulstate;
++static int dbg_wwanemul;
++static int tpacpi_wwan_emulstate;
++#endif
++
++
+ /****************************************************************************
+  ****************************************************************************
+  *
+@@ -1006,6 +1016,94 @@ static DRIVER_ATTR(version, S_IRUGO,
+ /* --------------------------------------------------------------------- */
++#ifdef CONFIG_THINKPAD_ACPI_DEBUGFACILITIES
++
++static void tpacpi_send_radiosw_update(void);
++
++/* wlsw_emulstate ------------------------------------------------------ */
++static ssize_t tpacpi_driver_wlsw_emulstate_show(struct device_driver *drv,
++                                              char *buf)
++{
++      return snprintf(buf, PAGE_SIZE, "%d\n", !!tpacpi_wlsw_emulstate);
++}
++
++static ssize_t tpacpi_driver_wlsw_emulstate_store(struct device_driver *drv,
++                                              const char *buf, size_t count)
++{
++      unsigned long t;
++
++      if (parse_strtoul(buf, 1, &t))
++              return -EINVAL;
++
++      if (tpacpi_wlsw_emulstate != t) {
++              tpacpi_wlsw_emulstate = !!t;
++              tpacpi_send_radiosw_update();
++      } else
++              tpacpi_wlsw_emulstate = !!t;
++
++      return count;
++}
++
++static DRIVER_ATTR(wlsw_emulstate, S_IWUSR | S_IRUGO,
++              tpacpi_driver_wlsw_emulstate_show,
++              tpacpi_driver_wlsw_emulstate_store);
++
++/* bluetooth_emulstate ------------------------------------------------- */
++static ssize_t tpacpi_driver_bluetooth_emulstate_show(
++                                      struct device_driver *drv,
++                                      char *buf)
++{
++      return snprintf(buf, PAGE_SIZE, "%d\n", !!tpacpi_bluetooth_emulstate);
++}
++
++static ssize_t tpacpi_driver_bluetooth_emulstate_store(
++                                      struct device_driver *drv,
++                                      const char *buf, size_t count)
++{
++      unsigned long t;
++
++      if (parse_strtoul(buf, 1, &t))
++              return -EINVAL;
++
++      tpacpi_bluetooth_emulstate = !!t;
++
++      return count;
++}
++
++static DRIVER_ATTR(bluetooth_emulstate, S_IWUSR | S_IRUGO,
++              tpacpi_driver_bluetooth_emulstate_show,
++              tpacpi_driver_bluetooth_emulstate_store);
++
++/* wwan_emulstate ------------------------------------------------- */
++static ssize_t tpacpi_driver_wwan_emulstate_show(
++                                      struct device_driver *drv,
++                                      char *buf)
++{
++      return snprintf(buf, PAGE_SIZE, "%d\n", !!tpacpi_wwan_emulstate);
++}
++
++static ssize_t tpacpi_driver_wwan_emulstate_store(
++                                      struct device_driver *drv,
++                                      const char *buf, size_t count)
++{
++      unsigned long t;
++
++      if (parse_strtoul(buf, 1, &t))
++              return -EINVAL;
++
++      tpacpi_wwan_emulstate = !!t;
++
++      return count;
++}
++
++static DRIVER_ATTR(wwan_emulstate, S_IWUSR | S_IRUGO,
++              tpacpi_driver_wwan_emulstate_show,
++              tpacpi_driver_wwan_emulstate_store);
++
++#endif
++
++/* --------------------------------------------------------------------- */
++
+ static struct driver_attribute *tpacpi_driver_attributes[] = {
+       &driver_attr_debug_level, &driver_attr_version,
+       &driver_attr_interface_version,
+@@ -1022,6 +1120,15 @@ static int __init tpacpi_create_driver_attributes(struct device_driver *drv)
+               i++;
+       }
++#ifdef CONFIG_THINKPAD_ACPI_DEBUGFACILITIES
++      if (!res && dbg_wlswemul)
++              res = driver_create_file(drv, &driver_attr_wlsw_emulstate);
++      if (!res && dbg_bluetoothemul)
++              res = driver_create_file(drv, &driver_attr_bluetooth_emulstate);
++      if (!res && dbg_wwanemul)
++              res = driver_create_file(drv, &driver_attr_wwan_emulstate);
++#endif
++
+       return res;
+ }
+@@ -1031,6 +1138,12 @@ static void tpacpi_remove_driver_attributes(struct device_driver *drv)
+       for (i = 0; i < ARRAY_SIZE(tpacpi_driver_attributes); i++)
+               driver_remove_file(drv, tpacpi_driver_attributes[i]);
++
++#ifdef THINKPAD_ACPI_DEBUGFACILITIES
++      driver_remove_file(drv, &driver_attr_wlsw_emulstate);
++      driver_remove_file(drv, &driver_attr_bluetooth_emulstate);
++      driver_remove_file(drv, &driver_attr_wwan_emulstate);
++#endif
+ }
+ /****************************************************************************
+@@ -1216,6 +1329,12 @@ static struct attribute_set *hotkey_dev_attributes;
+ static int hotkey_get_wlsw(int *status)
+ {
++#ifdef CONFIG_THINKPAD_ACPI_DEBUGFACILITIES
++      if (dbg_wlswemul) {
++              *status = !!tpacpi_wlsw_emulstate;
++              return 0;
++      }
++#endif
+       if (!acpi_evalf(hkey_handle, status, "WLSW", "d"))
+               return -EIO;
+       return 0;
+@@ -2222,6 +2341,13 @@ static int __init hotkey_init(struct ibm_init_struct *iibm)
+                   hotkey_source_mask, hotkey_poll_freq);
+ #endif
++#ifdef CONFIG_THINKPAD_ACPI_DEBUGFACILITIES
++      if (dbg_wlswemul) {
++              tp_features.hotkey_wlsw = 1;
++              printk(TPACPI_INFO
++                      "radio switch emulation enabled\n");
++      } else
++#endif
+       /* Not all thinkpads have a hardware radio switch */
+       if (acpi_evalf(hkey_handle, &status, "WLSW", "qd")) {
+               tp_features.hotkey_wlsw = 1;
+@@ -2656,6 +2782,12 @@ static int bluetooth_get_radiosw(void)
+       if (tp_features.hotkey_wlsw && !hotkey_get_wlsw(&status) && !status)
+               return RFKILL_STATE_HARD_BLOCKED;
++#ifdef CONFIG_THINKPAD_ACPI_DEBUGFACILITIES
++      if (dbg_bluetoothemul)
++              return (tpacpi_bluetooth_emulstate) ?
++                      RFKILL_STATE_UNBLOCKED : RFKILL_STATE_SOFT_BLOCKED;
++#endif
++
+       if (!acpi_evalf(hkey_handle, &status, "GBDC", "d"))
+               return -EIO;
+@@ -2689,6 +2821,15 @@ static int bluetooth_set_radiosw(int radio_on, int update_rfk)
+           && radio_on)
+               return -EPERM;
++#ifdef CONFIG_THINKPAD_ACPI_DEBUGFACILITIES
++      if (dbg_bluetoothemul) {
++              tpacpi_bluetooth_emulstate = !!radio_on;
++              if (update_rfk)
++                      bluetooth_update_rfk();
++              return 0;
++      }
++#endif
++
+       if (!acpi_evalf(hkey_handle, &status, "GBDC", "d"))
+               return -EIO;
+       if (radio_on)
+@@ -2792,6 +2933,13 @@ static int __init bluetooth_init(struct ibm_init_struct *iibm)
+               str_supported(tp_features.bluetooth),
+               status);
++#ifdef CONFIG_THINKPAD_ACPI_DEBUGFACILITIES
++      if (dbg_bluetoothemul) {
++              tp_features.bluetooth = 1;
++              printk(TPACPI_INFO
++                      "bluetooth switch emulation enabled\n");
++      } else
++#endif
+       if (tp_features.bluetooth &&
+           !(status & TP_ACPI_BLUETOOTH_HWPRESENT)) {
+               /* no bluetooth hardware present in system */
+@@ -2890,6 +3038,12 @@ static int wan_get_radiosw(void)
+       if (tp_features.hotkey_wlsw && !hotkey_get_wlsw(&status) && !status)
+               return RFKILL_STATE_HARD_BLOCKED;
++#ifdef CONFIG_THINKPAD_ACPI_DEBUGFACILITIES
++      if (dbg_wwanemul)
++              return (tpacpi_wwan_emulstate) ?
++                      RFKILL_STATE_UNBLOCKED : RFKILL_STATE_SOFT_BLOCKED;
++#endif
++
+       if (!acpi_evalf(hkey_handle, &status, "GWAN", "d"))
+               return -EIO;
+@@ -2923,6 +3077,15 @@ static int wan_set_radiosw(int radio_on, int update_rfk)
+           && radio_on)
+               return -EPERM;
++#ifdef CONFIG_THINKPAD_ACPI_DEBUGFACILITIES
++      if (dbg_wwanemul) {
++              tpacpi_wwan_emulstate = !!radio_on;
++              if (update_rfk)
++                      wan_update_rfk();
++              return 0;
++      }
++#endif
++
+       if (!acpi_evalf(hkey_handle, &status, "GWAN", "d"))
+               return -EIO;
+       if (radio_on)
+@@ -3024,6 +3187,13 @@ static int __init wan_init(struct ibm_init_struct *iibm)
+               str_supported(tp_features.wan),
+               status);
++#ifdef CONFIG_THINKPAD_ACPI_DEBUGFACILITIES
++      if (dbg_wwanemul) {
++              tp_features.wan = 1;
++              printk(TPACPI_INFO
++                      "wwan switch emulation enabled\n");
++      } else
++#endif
+       if (tp_features.wan &&
+           !(status & TP_ACPI_WANCARD_HWPRESENT)) {
+               /* no wan hardware present in system */
+@@ -6701,6 +6871,26 @@ TPACPI_PARAM(brightness);
+ TPACPI_PARAM(volume);
+ TPACPI_PARAM(fan);
++#ifdef CONFIG_THINKPAD_ACPI_DEBUGFACILITIES
++module_param(dbg_wlswemul, uint, 0);
++MODULE_PARM_DESC(dbg_wlswemul, "Enables WLSW emulation");
++module_param_named(wlsw_state, tpacpi_wlsw_emulstate, bool, 0);
++MODULE_PARM_DESC(wlsw_state,
++               "Initial state of the emulated WLSW switch");
++
++module_param(dbg_bluetoothemul, uint, 0);
++MODULE_PARM_DESC(dbg_bluetoothemul, "Enables bluetooth switch emulation");
++module_param_named(bluetooth_state, tpacpi_bluetooth_emulstate, bool, 0);
++MODULE_PARM_DESC(bluetooth_state,
++               "Initial state of the emulated bluetooth switch");
++
++module_param(dbg_wwanemul, uint, 0);
++MODULE_PARM_DESC(dbg_wwanemul, "Enables WWAN switch emulation");
++module_param_named(wwan_state, tpacpi_wwan_emulstate, bool, 0);
++MODULE_PARM_DESC(wwan_state,
++               "Initial state of the emulated WWAN switch");
++#endif
++
+ static void thinkpad_acpi_module_exit(void)
+ {
+       struct ibm_struct *ibm, *itmp;
+-- 
+1.5.6.5
+
diff --git a/releases/upstream/2.6.29-rc2/0005-ACPI-thinkpad-acpi-resume-with-radios-disabled.patch b/releases/upstream/2.6.29-rc2/0005-ACPI-thinkpad-acpi-resume-with-radios-disabled.patch
new file mode 100644 (file)
index 0000000..cd0c9a3
--- /dev/null
@@ -0,0 +1,149 @@
+From 153f82207c51193e4d6a7e6f0e3f9442eabeba1c Mon Sep 17 00:00:00 2001
+From: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
+Date: Sun, 11 Jan 2009 03:01:01 -0200
+Subject: ACPI: thinkpad-acpi: resume with radios disabled
+
+Instruct the firmware to not enable the radios when resuming.  This
+is safer, and the rfkill core will take care to manually enable any
+radios that need to be enabled.
+
+Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
+Signed-off-by: Len Brown <len.brown@intel.com>
+---
+ drivers/platform/x86/thinkpad_acpi.c |   66 ++++++++++++++++++++++++++++-----
+ 1 files changed, 56 insertions(+), 10 deletions(-)
+
+diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
+index a086ce8..b2c5913 100644
+--- a/drivers/platform/x86/thinkpad_acpi.c
++++ b/drivers/platform/x86/thinkpad_acpi.c
+@@ -122,6 +122,27 @@ enum {
+ #define TPACPI_HKEY_INPUT_PRODUCT     0x5054 /* "TP" */
+ #define TPACPI_HKEY_INPUT_VERSION     0x4101
++/* ACPI \WGSV commands */
++enum {
++      TP_ACPI_WGSV_GET_STATE          = 0x01, /* Get state information */
++      TP_ACPI_WGSV_PWR_ON_ON_RESUME   = 0x02, /* Resume WWAN powered on */
++      TP_ACPI_WGSV_PWR_OFF_ON_RESUME  = 0x03, /* Resume WWAN powered off */
++      TP_ACPI_WGSV_SAVE_STATE         = 0x04, /* Save state for S4/S5 */
++};
++
++/* TP_ACPI_WGSV_GET_STATE bits */
++enum {
++      TP_ACPI_WGSV_STATE_WWANEXIST    = 0x0001, /* WWAN hw available */
++      TP_ACPI_WGSV_STATE_WWANPWR      = 0x0002, /* WWAN radio enabled */
++      TP_ACPI_WGSV_STATE_WWANPWRRES   = 0x0004, /* WWAN state at resume */
++      TP_ACPI_WGSV_STATE_WWANBIOSOFF  = 0x0008, /* WWAN disabled in BIOS */
++      TP_ACPI_WGSV_STATE_BLTHEXIST    = 0x0001, /* BLTH hw available */
++      TP_ACPI_WGSV_STATE_BLTHPWR      = 0x0002, /* BLTH radio enabled */
++      TP_ACPI_WGSV_STATE_BLTHPWRRES   = 0x0004, /* BLTH state at resume */
++      TP_ACPI_WGSV_STATE_BLTHBIOSOFF  = 0x0008, /* BLTH disabled in BIOS */
++      TP_ACPI_WGSV_STATE_UWBEXIST     = 0x0010, /* UWB hw available */
++      TP_ACPI_WGSV_STATE_UWBPWR       = 0x0020, /* UWB radio enabled */
++};
+ /****************************************************************************
+  * Main driver
+@@ -2766,11 +2787,28 @@ enum {
+       /* ACPI GBDC/SBDC bits */
+       TP_ACPI_BLUETOOTH_HWPRESENT     = 0x01, /* Bluetooth hw available */
+       TP_ACPI_BLUETOOTH_RADIOSSW      = 0x02, /* Bluetooth radio enabled */
+-      TP_ACPI_BLUETOOTH_UNK           = 0x04, /* unknown function */
++      TP_ACPI_BLUETOOTH_RESUMECTRL    = 0x04, /* Bluetooth state at resume:
++                                                 off / last state */
++};
++
++enum {
++      /* ACPI \BLTH commands */
++      TP_ACPI_BLTH_GET_ULTRAPORT_ID   = 0x00, /* Get Ultraport BT ID */
++      TP_ACPI_BLTH_GET_PWR_ON_RESUME  = 0x01, /* Get power-on-resume state */
++      TP_ACPI_BLTH_PWR_ON_ON_RESUME   = 0x02, /* Resume powered on */
++      TP_ACPI_BLTH_PWR_OFF_ON_RESUME  = 0x03, /* Resume powered off */
++      TP_ACPI_BLTH_SAVE_STATE         = 0x05, /* Save state for S4/S5 */
+ };
+ static struct rfkill *tpacpi_bluetooth_rfkill;
++static void bluetooth_suspend(pm_message_t state)
++{
++      /* Try to make sure radio will resume powered off */
++      acpi_evalf(NULL, NULL, "\\BLTH", "vd",
++                 TP_ACPI_BLTH_PWR_OFF_ON_RESUME);
++}
++
+ static int bluetooth_get_radiosw(void)
+ {
+       int status;
+@@ -2830,12 +2868,11 @@ static int bluetooth_set_radiosw(int radio_on, int update_rfk)
+       }
+ #endif
+-      if (!acpi_evalf(hkey_handle, &status, "GBDC", "d"))
+-              return -EIO;
++      /* We make sure to keep TP_ACPI_BLUETOOTH_RESUMECTRL off */
+       if (radio_on)
+-              status |= TP_ACPI_BLUETOOTH_RADIOSSW;
++              status = TP_ACPI_BLUETOOTH_RADIOSSW;
+       else
+-              status &= ~TP_ACPI_BLUETOOTH_RADIOSSW;
++              status = 0;
+       if (!acpi_evalf(hkey_handle, NULL, "SBDC", "vd", status))
+               return -EIO;
+@@ -3012,6 +3049,7 @@ static struct ibm_struct bluetooth_driver_data = {
+       .read = bluetooth_read,
+       .write = bluetooth_write,
+       .exit = bluetooth_exit,
++      .suspend = bluetooth_suspend,
+ };
+ /*************************************************************************
+@@ -3022,11 +3060,19 @@ enum {
+       /* ACPI GWAN/SWAN bits */
+       TP_ACPI_WANCARD_HWPRESENT       = 0x01, /* Wan hw available */
+       TP_ACPI_WANCARD_RADIOSSW        = 0x02, /* Wan radio enabled */
+-      TP_ACPI_WANCARD_UNK             = 0x04, /* unknown function */
++      TP_ACPI_WANCARD_RESUMECTRL      = 0x04, /* Wan state at resume:
++                                                 off / last state */
+ };
+ static struct rfkill *tpacpi_wan_rfkill;
++static void wan_suspend(pm_message_t state)
++{
++      /* Try to make sure radio will resume powered off */
++      acpi_evalf(NULL, NULL, "\\WGSV", "qvd",
++                 TP_ACPI_WGSV_PWR_OFF_ON_RESUME);
++}
++
+ static int wan_get_radiosw(void)
+ {
+       int status;
+@@ -3086,12 +3132,11 @@ static int wan_set_radiosw(int radio_on, int update_rfk)
+       }
+ #endif
+-      if (!acpi_evalf(hkey_handle, &status, "GWAN", "d"))
+-              return -EIO;
++      /* We make sure to keep TP_ACPI_WANCARD_RESUMECTRL off */
+       if (radio_on)
+-              status |= TP_ACPI_WANCARD_RADIOSSW;
++              status = TP_ACPI_WANCARD_RADIOSSW;
+       else
+-              status &= ~TP_ACPI_WANCARD_RADIOSSW;
++              status = 0;
+       if (!acpi_evalf(hkey_handle, NULL, "SWAN", "vd", status))
+               return -EIO;
+@@ -3266,6 +3311,7 @@ static struct ibm_struct wan_driver_data = {
+       .read = wan_read,
+       .write = wan_write,
+       .exit = wan_exit,
++      .suspend = wan_suspend,
+ };
+ /*************************************************************************
+-- 
+1.5.6.5
+
diff --git a/releases/upstream/2.6.29-rc2/0006-ACPI-thinkpad-acpi-preserve-radio-state-across-shu.patch b/releases/upstream/2.6.29-rc2/0006-ACPI-thinkpad-acpi-preserve-radio-state-across-shu.patch
new file mode 100644 (file)
index 0000000..4897db0
--- /dev/null
@@ -0,0 +1,149 @@
+From 90d9d3c79c44bcf95bc487e9bbceaff2de370310 Mon Sep 17 00:00:00 2001
+From: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
+Date: Sun, 11 Jan 2009 03:01:02 -0200
+Subject: ACPI: thinkpad-acpi: preserve radio state across shutdown
+
+Store in firmware NVRAM the radio state on machine shutdown for WWAN and
+bluetooth.  Also, try to set the initial boot state of these radios as the
+rfkill default state for their respective classes.
+
+Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
+Cc: Ivo van Doorn <IvDoorn@gmail.com>
+Signed-off-by: Len Brown <len.brown@intel.com>
+---
+ drivers/platform/x86/thinkpad_acpi.c |   59 +++++++++++++++++++++++++++++++--
+ 1 files changed, 55 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
+index b2c5913..27d709b 100644
+--- a/drivers/platform/x86/thinkpad_acpi.c
++++ b/drivers/platform/x86/thinkpad_acpi.c
+@@ -222,6 +222,7 @@ struct ibm_struct {
+       void (*exit) (void);
+       void (*resume) (void);
+       void (*suspend) (pm_message_t state);
++      void (*shutdown) (void);
+       struct list_head all_drivers;
+@@ -759,6 +760,18 @@ static int tpacpi_resume_handler(struct platform_device *pdev)
+       return 0;
+ }
++static void tpacpi_shutdown_handler(struct platform_device *pdev)
++{
++      struct ibm_struct *ibm, *itmp;
++
++      list_for_each_entry_safe(ibm, itmp,
++                               &tpacpi_all_drivers,
++                               all_drivers) {
++              if (ibm->shutdown)
++                      (ibm->shutdown)();
++      }
++}
++
+ static struct platform_driver tpacpi_pdriver = {
+       .driver = {
+               .name = TPACPI_DRVR_NAME,
+@@ -766,6 +779,7 @@ static struct platform_driver tpacpi_pdriver = {
+       },
+       .suspend = tpacpi_suspend_handler,
+       .resume = tpacpi_resume_handler,
++      .shutdown = tpacpi_shutdown_handler,
+ };
+ static struct platform_driver tpacpi_hwmon_pdriver = {
+@@ -957,7 +971,22 @@ static int __init tpacpi_new_rfkill(const unsigned int id,
+                       int (*get_state)(void *, enum rfkill_state *))
+ {
+       int res;
+-      enum rfkill_state initial_state;
++      enum rfkill_state initial_state = RFKILL_STATE_SOFT_BLOCKED;
++
++      res = get_state(NULL, &initial_state);
++      if (res < 0) {
++              printk(TPACPI_ERR
++                      "failed to read initial state for %s, error %d; "
++                      "will turn radio off\n", name, res);
++      } else {
++              /* try to set the initial state as the default for the rfkill
++               * type, since we ask the firmware to preserve it across S5 in
++               * NVRAM */
++              rfkill_set_default(rfktype,
++                              (initial_state == RFKILL_STATE_UNBLOCKED) ?
++                                      RFKILL_STATE_UNBLOCKED :
++                                      RFKILL_STATE_SOFT_BLOCKED);
++      }
+       *rfk = rfkill_allocate(&tpacpi_pdev->dev, rfktype);
+       if (!*rfk) {
+@@ -969,9 +998,7 @@ static int __init tpacpi_new_rfkill(const unsigned int id,
+       (*rfk)->name = name;
+       (*rfk)->get_state = get_state;
+       (*rfk)->toggle_radio = toggle_radio;
+-
+-      if (!get_state(NULL, &initial_state))
+-              (*rfk)->state = initial_state;
++      (*rfk)->state = initial_state;
+       res = rfkill_register(*rfk);
+       if (res < 0) {
+@@ -2943,8 +2970,19 @@ static int tpacpi_bluetooth_rfk_set(void *data, enum rfkill_state state)
+       return bluetooth_set_radiosw((state == RFKILL_STATE_UNBLOCKED), 0);
+ }
++static void bluetooth_shutdown(void)
++{
++      /* Order firmware to save current state to NVRAM */
++      if (!acpi_evalf(NULL, NULL, "\\BLTH", "vd",
++                      TP_ACPI_BLTH_SAVE_STATE))
++              printk(TPACPI_NOTICE
++                      "failed to save bluetooth state to NVRAM\n");
++}
++
+ static void bluetooth_exit(void)
+ {
++      bluetooth_shutdown();
++
+       if (tpacpi_bluetooth_rfkill)
+               rfkill_unregister(tpacpi_bluetooth_rfkill);
+@@ -3050,6 +3088,7 @@ static struct ibm_struct bluetooth_driver_data = {
+       .write = bluetooth_write,
+       .exit = bluetooth_exit,
+       .suspend = bluetooth_suspend,
++      .shutdown = bluetooth_shutdown,
+ };
+ /*************************************************************************
+@@ -3207,8 +3246,19 @@ static int tpacpi_wan_rfk_set(void *data, enum rfkill_state state)
+       return wan_set_radiosw((state == RFKILL_STATE_UNBLOCKED), 0);
+ }
++static void wan_shutdown(void)
++{
++      /* Order firmware to save current state to NVRAM */
++      if (!acpi_evalf(NULL, NULL, "\\WGSV", "vd",
++                      TP_ACPI_WGSV_SAVE_STATE))
++              printk(TPACPI_NOTICE
++                      "failed to save WWAN state to NVRAM\n");
++}
++
+ static void wan_exit(void)
+ {
++      wan_shutdown();
++
+       if (tpacpi_wan_rfkill)
+               rfkill_unregister(tpacpi_wan_rfkill);
+@@ -3312,6 +3362,7 @@ static struct ibm_struct wan_driver_data = {
+       .write = wan_write,
+       .exit = wan_exit,
+       .suspend = wan_suspend,
++      .shutdown = wan_shutdown,
+ };
+ /*************************************************************************
+-- 
+1.5.6.5
+
diff --git a/releases/upstream/2.6.29-rc2/0007-ACPI-thinkpad-acpi-add-UWB-radio-support.patch b/releases/upstream/2.6.29-rc2/0007-ACPI-thinkpad-acpi-add-UWB-radio-support.patch
new file mode 100644 (file)
index 0000000..c1498d5
--- /dev/null
@@ -0,0 +1,365 @@
+From 0045c0aa7d5e787f78938e6a10927b8a516f0b83 Mon Sep 17 00:00:00 2001
+From: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
+Date: Sun, 11 Jan 2009 03:01:03 -0200
+Subject: ACPI: thinkpad-acpi: add UWB radio support
+
+Add rfkill support for USB UWB radio devices on very recent ThinkPad
+laptop models.
+
+The new subdriver is moslty a trimmed down copy of the wwan subdriver.
+
+Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
+Cc: Ivo van Doorn <IvDoorn@gmail.com>
+Signed-off-by: Len Brown <len.brown@intel.com>
+---
+ Documentation/laptops/thinkpad-acpi.txt |   18 +++
+ drivers/platform/x86/thinkpad_acpi.c    |  206 ++++++++++++++++++++++++++++++-
+ 2 files changed, 223 insertions(+), 1 deletions(-)
+
+diff --git a/Documentation/laptops/thinkpad-acpi.txt b/Documentation/laptops/thinkpad-acpi.txt
+index ddc371e..91c0001 100644
+--- a/Documentation/laptops/thinkpad-acpi.txt
++++ b/Documentation/laptops/thinkpad-acpi.txt
+@@ -1413,6 +1413,24 @@ Sysfs notes:
+       rfkill controller switch "tpacpi_wwan_sw": refer to
+       Documentation/rfkill.txt for details.
++EXPERIMENTAL: UWB
++-----------------
++
++This feature is marked EXPERIMENTAL because it has not been extensively
++tested and validated in various ThinkPad models yet.  The feature may not
++work as expected. USE WITH CAUTION! To use this feature, you need to supply
++the experimental=1 parameter when loading the module.
++
++sysfs rfkill class: switch "tpacpi_uwb_sw"
++
++This feature exports an rfkill controller for the UWB device, if one is
++present and enabled in the BIOS.
++
++Sysfs notes:
++
++      rfkill controller switch "tpacpi_uwb_sw": refer to
++      Documentation/rfkill.txt for details.
++
+ Multiple Commands, Module Parameters
+ ------------------------------------
+diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
+index 27d709b..c1d4041 100644
+--- a/drivers/platform/x86/thinkpad_acpi.c
++++ b/drivers/platform/x86/thinkpad_acpi.c
+@@ -169,6 +169,7 @@ enum {
+ enum {
+       TPACPI_RFK_BLUETOOTH_SW_ID = 0,
+       TPACPI_RFK_WWAN_SW_ID,
++      TPACPI_RFK_UWB_SW_ID,
+ };
+ /* Debugging */
+@@ -261,6 +262,7 @@ static struct {
+       u32 bright_16levels:1;
+       u32 bright_acpimode:1;
+       u32 wan:1;
++      u32 uwb:1;
+       u32 fan_ctrl_status_undef:1;
+       u32 input_device_registered:1;
+       u32 platform_drv_registered:1;
+@@ -317,6 +319,8 @@ static int dbg_bluetoothemul;
+ static int tpacpi_bluetooth_emulstate;
+ static int dbg_wwanemul;
+ static int tpacpi_wwan_emulstate;
++static int dbg_uwbemul;
++static int tpacpi_uwb_emulstate;
+ #endif
+@@ -967,6 +971,7 @@ static int __init tpacpi_new_rfkill(const unsigned int id,
+                       struct rfkill **rfk,
+                       const enum rfkill_type rfktype,
+                       const char *name,
++                      const bool set_default,
+                       int (*toggle_radio)(void *, enum rfkill_state),
+                       int (*get_state)(void *, enum rfkill_state *))
+ {
+@@ -978,7 +983,7 @@ static int __init tpacpi_new_rfkill(const unsigned int id,
+               printk(TPACPI_ERR
+                       "failed to read initial state for %s, error %d; "
+                       "will turn radio off\n", name, res);
+-      } else {
++      } else if (set_default) {
+               /* try to set the initial state as the default for the rfkill
+                * type, since we ask the firmware to preserve it across S5 in
+                * NVRAM */
+@@ -1148,6 +1153,31 @@ static DRIVER_ATTR(wwan_emulstate, S_IWUSR | S_IRUGO,
+               tpacpi_driver_wwan_emulstate_show,
+               tpacpi_driver_wwan_emulstate_store);
++/* uwb_emulstate ------------------------------------------------- */
++static ssize_t tpacpi_driver_uwb_emulstate_show(
++                                      struct device_driver *drv,
++                                      char *buf)
++{
++      return snprintf(buf, PAGE_SIZE, "%d\n", !!tpacpi_uwb_emulstate);
++}
++
++static ssize_t tpacpi_driver_uwb_emulstate_store(
++                                      struct device_driver *drv,
++                                      const char *buf, size_t count)
++{
++      unsigned long t;
++
++      if (parse_strtoul(buf, 1, &t))
++              return -EINVAL;
++
++      tpacpi_uwb_emulstate = !!t;
++
++      return count;
++}
++
++static DRIVER_ATTR(uwb_emulstate, S_IWUSR | S_IRUGO,
++              tpacpi_driver_uwb_emulstate_show,
++              tpacpi_driver_uwb_emulstate_store);
+ #endif
+ /* --------------------------------------------------------------------- */
+@@ -1175,6 +1205,8 @@ static int __init tpacpi_create_driver_attributes(struct device_driver *drv)
+               res = driver_create_file(drv, &driver_attr_bluetooth_emulstate);
+       if (!res && dbg_wwanemul)
+               res = driver_create_file(drv, &driver_attr_wwan_emulstate);
++      if (!res && dbg_uwbemul)
++              res = driver_create_file(drv, &driver_attr_uwb_emulstate);
+ #endif
+       return res;
+@@ -1191,6 +1223,7 @@ static void tpacpi_remove_driver_attributes(struct device_driver *drv)
+       driver_remove_file(drv, &driver_attr_wlsw_emulstate);
+       driver_remove_file(drv, &driver_attr_bluetooth_emulstate);
+       driver_remove_file(drv, &driver_attr_wwan_emulstate);
++      driver_remove_file(drv, &driver_attr_uwb_emulstate);
+ #endif
+ }
+@@ -2125,6 +2158,7 @@ static struct attribute *hotkey_mask_attributes[] __initdata = {
+ static void bluetooth_update_rfk(void);
+ static void wan_update_rfk(void);
++static void uwb_update_rfk(void);
+ static void tpacpi_send_radiosw_update(void)
+ {
+       int wlsw;
+@@ -2134,6 +2168,8 @@ static void tpacpi_send_radiosw_update(void)
+               bluetooth_update_rfk();
+       if (tp_features.wan)
+               wan_update_rfk();
++      if (tp_features.uwb)
++              uwb_update_rfk();
+       if (tp_features.hotkey_wlsw && !hotkey_get_wlsw(&wlsw)) {
+               mutex_lock(&tpacpi_inputdev_send_mutex);
+@@ -3035,6 +3071,7 @@ static int __init bluetooth_init(struct ibm_init_struct *iibm)
+                               &tpacpi_bluetooth_rfkill,
+                               RFKILL_TYPE_BLUETOOTH,
+                               "tpacpi_bluetooth_sw",
++                              true,
+                               tpacpi_bluetooth_rfk_set,
+                               tpacpi_bluetooth_rfk_get);
+       if (res) {
+@@ -3309,6 +3346,7 @@ static int __init wan_init(struct ibm_init_struct *iibm)
+                               &tpacpi_wan_rfkill,
+                               RFKILL_TYPE_WWAN,
+                               "tpacpi_wwan_sw",
++                              true,
+                               tpacpi_wan_rfk_set,
+                               tpacpi_wan_rfk_get);
+       if (res) {
+@@ -3366,6 +3404,162 @@ static struct ibm_struct wan_driver_data = {
+ };
+ /*************************************************************************
++ * UWB subdriver
++ */
++
++enum {
++      /* ACPI GUWB/SUWB bits */
++      TP_ACPI_UWB_HWPRESENT   = 0x01, /* UWB hw available */
++      TP_ACPI_UWB_RADIOSSW    = 0x02, /* UWB radio enabled */
++};
++
++static struct rfkill *tpacpi_uwb_rfkill;
++
++static int uwb_get_radiosw(void)
++{
++      int status;
++
++      if (!tp_features.uwb)
++              return -ENODEV;
++
++      /* WLSW overrides UWB in firmware/hardware, reflect that */
++      if (tp_features.hotkey_wlsw && !hotkey_get_wlsw(&status) && !status)
++              return RFKILL_STATE_HARD_BLOCKED;
++
++#ifdef CONFIG_THINKPAD_ACPI_DEBUGFACILITIES
++      if (dbg_uwbemul)
++              return (tpacpi_uwb_emulstate) ?
++                      RFKILL_STATE_UNBLOCKED : RFKILL_STATE_SOFT_BLOCKED;
++#endif
++
++      if (!acpi_evalf(hkey_handle, &status, "GUWB", "d"))
++              return -EIO;
++
++      return ((status & TP_ACPI_UWB_RADIOSSW) != 0) ?
++              RFKILL_STATE_UNBLOCKED : RFKILL_STATE_SOFT_BLOCKED;
++}
++
++static void uwb_update_rfk(void)
++{
++      int status;
++
++      if (!tpacpi_uwb_rfkill)
++              return;
++
++      status = uwb_get_radiosw();
++      if (status < 0)
++              return;
++      rfkill_force_state(tpacpi_uwb_rfkill, status);
++}
++
++static int uwb_set_radiosw(int radio_on, int update_rfk)
++{
++      int status;
++
++      if (!tp_features.uwb)
++              return -ENODEV;
++
++      /* WLSW overrides UWB in firmware/hardware, but there is no
++       * reason to risk weird behaviour. */
++      if (tp_features.hotkey_wlsw && !hotkey_get_wlsw(&status) && !status
++          && radio_on)
++              return -EPERM;
++
++#ifdef CONFIG_THINKPAD_ACPI_DEBUGFACILITIES
++      if (dbg_uwbemul) {
++              tpacpi_uwb_emulstate = !!radio_on;
++              if (update_rfk)
++                      uwb_update_rfk();
++              return 0;
++      }
++#endif
++
++      status = (radio_on) ? TP_ACPI_UWB_RADIOSSW : 0;
++      if (!acpi_evalf(hkey_handle, NULL, "SUWB", "vd", status))
++              return -EIO;
++
++      if (update_rfk)
++              uwb_update_rfk();
++
++      return 0;
++}
++
++/* --------------------------------------------------------------------- */
++
++static int tpacpi_uwb_rfk_get(void *data, enum rfkill_state *state)
++{
++      int uwbs = uwb_get_radiosw();
++
++      if (uwbs < 0)
++              return uwbs;
++
++      *state = uwbs;
++      return 0;
++}
++
++static int tpacpi_uwb_rfk_set(void *data, enum rfkill_state state)
++{
++      return uwb_set_radiosw((state == RFKILL_STATE_UNBLOCKED), 0);
++}
++
++static void uwb_exit(void)
++{
++      if (tpacpi_uwb_rfkill)
++              rfkill_unregister(tpacpi_uwb_rfkill);
++}
++
++static int __init uwb_init(struct ibm_init_struct *iibm)
++{
++      int res;
++      int status = 0;
++
++      vdbg_printk(TPACPI_DBG_INIT, "initializing uwb subdriver\n");
++
++      TPACPI_ACPIHANDLE_INIT(hkey);
++
++      tp_features.uwb = hkey_handle &&
++          acpi_evalf(hkey_handle, &status, "GUWB", "qd");
++
++      vdbg_printk(TPACPI_DBG_INIT, "uwb is %s, status 0x%02x\n",
++              str_supported(tp_features.uwb),
++              status);
++
++#ifdef CONFIG_THINKPAD_ACPI_DEBUGFACILITIES
++      if (dbg_uwbemul) {
++              tp_features.uwb = 1;
++              printk(TPACPI_INFO
++                      "uwb switch emulation enabled\n");
++      } else
++#endif
++      if (tp_features.uwb &&
++          !(status & TP_ACPI_UWB_HWPRESENT)) {
++              /* no uwb hardware present in system */
++              tp_features.uwb = 0;
++              dbg_printk(TPACPI_DBG_INIT,
++                         "uwb hardware not installed\n");
++      }
++
++      if (!tp_features.uwb)
++              return 1;
++
++      res = tpacpi_new_rfkill(TPACPI_RFK_UWB_SW_ID,
++                              &tpacpi_uwb_rfkill,
++                              RFKILL_TYPE_UWB,
++                              "tpacpi_uwb_sw",
++                              false,
++                              tpacpi_uwb_rfk_set,
++                              tpacpi_uwb_rfk_get);
++
++      return res;
++}
++
++static struct ibm_struct uwb_driver_data = {
++      .name = "uwb",
++      .exit = uwb_exit,
++      .flags.experimental = 1,
++};
++
++/*************************************************************************
+  * Video subdriver
+  */
+@@ -6830,6 +7024,10 @@ static struct ibm_init_struct ibms_init[] __initdata = {
+               .init = wan_init,
+               .data = &wan_driver_data,
+       },
++      {
++              .init = uwb_init,
++              .data = &uwb_driver_data,
++      },
+ #ifdef CONFIG_THINKPAD_ACPI_VIDEO
+       {
+               .init = video_init,
+@@ -6986,6 +7184,12 @@ MODULE_PARM_DESC(dbg_wwanemul, "Enables WWAN switch emulation");
+ module_param_named(wwan_state, tpacpi_wwan_emulstate, bool, 0);
+ MODULE_PARM_DESC(wwan_state,
+                "Initial state of the emulated WWAN switch");
++
++module_param(dbg_uwbemul, uint, 0);
++MODULE_PARM_DESC(dbg_uwbemul, "Enables UWB switch emulation");
++module_param_named(uwb_state, tpacpi_uwb_emulstate, bool, 0);
++MODULE_PARM_DESC(uwb_state,
++               "Initial state of the emulated UWB switch");
+ #endif
+ static void thinkpad_acpi_module_exit(void)
+-- 
+1.5.6.5
+
diff --git a/releases/upstream/2.6.29-rc2/0008-ACPI-thinkpad-acpi-use-killable-instead-of-interru.patch b/releases/upstream/2.6.29-rc2/0008-ACPI-thinkpad-acpi-use-killable-instead-of-interru.patch
new file mode 100644 (file)
index 0000000..319cc70
--- /dev/null
@@ -0,0 +1,141 @@
+From 7646ea88af80a92f2775e17d4283830d7f09ea2d Mon Sep 17 00:00:00 2001
+From: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
+Date: Sun, 11 Jan 2009 03:01:04 -0200
+Subject: ACPI: thinkpad-acpi: use killable instead of interruptible mutexes
+
+Unfortunately, POSIX in all of its braindamage, do not state that userspace has
+to deal with EINTR in read/write and friends... so, lesser code just doesn't.
+
+Switch from *_interruptible to *_killable on the sysfs- and procfs-related
+mutexes.  This closes this possible can of worms.
+
+Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
+Signed-off-by: Len Brown <len.brown@intel.com>
+---
+ drivers/platform/x86/thinkpad_acpi.c |   26 +++++++++++++-------------
+ 1 files changed, 13 insertions(+), 13 deletions(-)
+
+diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
+index c1d4041..7670c8e 100644
+--- a/drivers/platform/x86/thinkpad_acpi.c
++++ b/drivers/platform/x86/thinkpad_acpi.c
+@@ -1878,7 +1878,7 @@ static ssize_t hotkey_mask_show(struct device *dev,
+ {
+       int res;
+-      if (mutex_lock_interruptible(&hotkey_mutex))
++      if (mutex_lock_killable(&hotkey_mutex))
+               return -ERESTARTSYS;
+       res = hotkey_mask_get();
+       mutex_unlock(&hotkey_mutex);
+@@ -1897,7 +1897,7 @@ static ssize_t hotkey_mask_store(struct device *dev,
+       if (parse_strtoul(buf, 0xffffffffUL, &t))
+               return -EINVAL;
+-      if (mutex_lock_interruptible(&hotkey_mutex))
++      if (mutex_lock_killable(&hotkey_mutex))
+               return -ERESTARTSYS;
+       res = hotkey_mask_set(t);
+@@ -1983,7 +1983,7 @@ static ssize_t hotkey_source_mask_store(struct device *dev,
+               ((t & ~TPACPI_HKEY_NVRAM_KNOWN_MASK) != 0))
+               return -EINVAL;
+-      if (mutex_lock_interruptible(&hotkey_mutex))
++      if (mutex_lock_killable(&hotkey_mutex))
+               return -ERESTARTSYS;
+       HOTKEY_CONFIG_CRITICAL_START
+@@ -2018,7 +2018,7 @@ static ssize_t hotkey_poll_freq_store(struct device *dev,
+       if (parse_strtoul(buf, 25, &t))
+               return -EINVAL;
+-      if (mutex_lock_interruptible(&hotkey_mutex))
++      if (mutex_lock_killable(&hotkey_mutex))
+               return -ERESTARTSYS;
+       hotkey_poll_freq = t;
+@@ -2754,7 +2754,7 @@ static int hotkey_read(char *p)
+               return len;
+       }
+-      if (mutex_lock_interruptible(&hotkey_mutex))
++      if (mutex_lock_killable(&hotkey_mutex))
+               return -ERESTARTSYS;
+       res = hotkey_status_get(&status);
+       if (!res)
+@@ -2785,7 +2785,7 @@ static int hotkey_write(char *buf)
+       if (!tp_features.hotkey)
+               return -ENODEV;
+-      if (mutex_lock_interruptible(&hotkey_mutex))
++      if (mutex_lock_killable(&hotkey_mutex))
+               return -ERESTARTSYS;
+       status = -1;
+@@ -5311,7 +5311,7 @@ static int brightness_set(int value)
+           value < 0)
+               return -EINVAL;
+-      res = mutex_lock_interruptible(&brightness_mutex);
++      res = mutex_lock_killable(&brightness_mutex);
+       if (res < 0)
+               return res;
+@@ -5849,7 +5849,7 @@ static int fan_get_status_safe(u8 *status)
+       int rc;
+       u8 s;
+-      if (mutex_lock_interruptible(&fan_mutex))
++      if (mutex_lock_killable(&fan_mutex))
+               return -ERESTARTSYS;
+       rc = fan_get_status(&s);
+       if (!rc)
+@@ -5932,7 +5932,7 @@ static int fan_set_level_safe(int level)
+       if (!fan_control_allowed)
+               return -EPERM;
+-      if (mutex_lock_interruptible(&fan_mutex))
++      if (mutex_lock_killable(&fan_mutex))
+               return -ERESTARTSYS;
+       if (level == TPACPI_FAN_LAST_LEVEL)
+@@ -5954,7 +5954,7 @@ static int fan_set_enable(void)
+       if (!fan_control_allowed)
+               return -EPERM;
+-      if (mutex_lock_interruptible(&fan_mutex))
++      if (mutex_lock_killable(&fan_mutex))
+               return -ERESTARTSYS;
+       switch (fan_control_access_mode) {
+@@ -6009,7 +6009,7 @@ static int fan_set_disable(void)
+       if (!fan_control_allowed)
+               return -EPERM;
+-      if (mutex_lock_interruptible(&fan_mutex))
++      if (mutex_lock_killable(&fan_mutex))
+               return -ERESTARTSYS;
+       rc = 0;
+@@ -6047,7 +6047,7 @@ static int fan_set_speed(int speed)
+       if (!fan_control_allowed)
+               return -EPERM;
+-      if (mutex_lock_interruptible(&fan_mutex))
++      if (mutex_lock_killable(&fan_mutex))
+               return -ERESTARTSYS;
+       rc = 0;
+@@ -6249,7 +6249,7 @@ static ssize_t fan_pwm1_store(struct device *dev,
+       /* scale down from 0-255 to 0-7 */
+       newlevel = (s >> 5) & 0x07;
+-      if (mutex_lock_interruptible(&fan_mutex))
++      if (mutex_lock_killable(&fan_mutex))
+               return -ERESTARTSYS;
+       rc = fan_get_status(&status);
+-- 
+1.5.6.5
+
diff --git a/releases/upstream/2.6.29-rc2/0009-ACPI-thinkpad-acpi-clean-up-hotkey_notify.patch b/releases/upstream/2.6.29-rc2/0009-ACPI-thinkpad-acpi-clean-up-hotkey_notify.patch
new file mode 100644 (file)
index 0000000..43a8ad4
--- /dev/null
@@ -0,0 +1,252 @@
+From 3827e7a3fd03718d4d204c66d9e3ab9b125ae552 Mon Sep 17 00:00:00 2001
+From: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
+Date: Sun, 11 Jan 2009 03:01:05 -0200
+Subject: ACPI: thinkpad-acpi: clean up hotkey_notify()
+
+Clean up the hotkey_notify() handler, which handles the HKEY notifications
+from the ACPI firmware.  It was getting too long and deep.
+
+No functional changes.
+
+Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
+Signed-off-by: Len Brown <len.brown@intel.com>
+---
+ drivers/platform/x86/thinkpad_acpi.c |  174 +++++++++++++++++++++-------------
+ 1 files changed, 109 insertions(+), 65 deletions(-)
+
+diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
+index 7670c8e..d833ee6 100644
+--- a/drivers/platform/x86/thinkpad_acpi.c
++++ b/drivers/platform/x86/thinkpad_acpi.c
+@@ -2571,13 +2571,100 @@ err_exit:
+       return (res < 0)? res : 1;
+ }
++static bool hotkey_notify_hotkey(const u32 hkey,
++                               bool *send_acpi_ev,
++                               bool *ignore_acpi_ev)
++{
++      /* 0x1000-0x1FFF: key presses */
++      unsigned int scancode = hkey & 0xfff;
++      *send_acpi_ev = true;
++      *ignore_acpi_ev = false;
++
++      if (scancode > 0 && scancode < 0x21) {
++              scancode--;
++              if (!(hotkey_source_mask & (1 << scancode))) {
++                      tpacpi_input_send_key(scancode);
++                      *send_acpi_ev = false;
++              } else {
++                      *ignore_acpi_ev = true;
++              }
++              return true;
++      }
++      return false;
++}
++
++static bool hotkey_notify_wakeup(const u32 hkey,
++                               bool *send_acpi_ev,
++                               bool *ignore_acpi_ev)
++{
++      /* 0x2000-0x2FFF: Wakeup reason */
++      *send_acpi_ev = true;
++      *ignore_acpi_ev = false;
++
++      switch (hkey) {
++      case 0x2304: /* suspend, undock */
++      case 0x2404: /* hibernation, undock */
++              hotkey_wakeup_reason = TP_ACPI_WAKEUP_UNDOCK;
++              *ignore_acpi_ev = true;
++              break;
++
++      case 0x2305: /* suspend, bay eject */
++      case 0x2405: /* hibernation, bay eject */
++              hotkey_wakeup_reason = TP_ACPI_WAKEUP_BAYEJ;
++              *ignore_acpi_ev = true;
++              break;
++
++      default:
++              return false;
++      }
++
++      if (hotkey_wakeup_reason != TP_ACPI_WAKEUP_NONE) {
++              printk(TPACPI_INFO
++                     "woke up due to a hot-unplug "
++                     "request...\n");
++              hotkey_wakeup_reason_notify_change();
++      }
++      return true;
++}
++
++static bool hotkey_notify_usrevent(const u32 hkey,
++                               bool *send_acpi_ev,
++                               bool *ignore_acpi_ev)
++{
++      /* 0x5000-0x5FFF: human interface helpers */
++      *send_acpi_ev = true;
++      *ignore_acpi_ev = false;
++
++      switch (hkey) {
++      case 0x5010: /* Lenovo new BIOS: brightness changed */
++      case 0x500b: /* X61t: tablet pen inserted into bay */
++      case 0x500c: /* X61t: tablet pen removed from bay */
++              return true;
++
++      case 0x5009: /* X41t-X61t: swivel up (tablet mode) */
++      case 0x500a: /* X41t-X61t: swivel down (normal mode) */
++              tpacpi_input_send_tabletsw();
++              hotkey_tablet_mode_notify_change();
++              *send_acpi_ev = false;
++              return true;
++
++      case 0x5001:
++      case 0x5002:
++              /* LID switch events.  Do not propagate */
++              *ignore_acpi_ev = true;
++              return true;
++
++      default:
++              return false;
++      }
++}
++
+ static void hotkey_notify(struct ibm_struct *ibm, u32 event)
+ {
+       u32 hkey;
+-      unsigned int scancode;
+-      int send_acpi_ev;
+-      int ignore_acpi_ev;
+-      int unk_ev;
++      bool send_acpi_ev;
++      bool ignore_acpi_ev;
++      bool known_ev;
+       if (event != 0x80) {
+               printk(TPACPI_ERR
+@@ -2601,105 +2688,62 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event)
+                       return;
+               }
+-              send_acpi_ev = 1;
+-              ignore_acpi_ev = 0;
+-              unk_ev = 0;
++              send_acpi_ev = true;
++              ignore_acpi_ev = false;
+               switch (hkey >> 12) {
+               case 1:
+                       /* 0x1000-0x1FFF: key presses */
+-                      scancode = hkey & 0xfff;
+-                      if (scancode > 0 && scancode < 0x21) {
+-                              scancode--;
+-                              if (!(hotkey_source_mask & (1 << scancode))) {
+-                                      tpacpi_input_send_key(scancode);
+-                                      send_acpi_ev = 0;
+-                              } else {
+-                                      ignore_acpi_ev = 1;
+-                              }
+-                      } else {
+-                              unk_ev = 1;
+-                      }
++                      known_ev = hotkey_notify_hotkey(hkey, &send_acpi_ev,
++                                               &ignore_acpi_ev);
+                       break;
+               case 2:
+-                      /* Wakeup reason */
+-                      switch (hkey) {
+-                      case 0x2304: /* suspend, undock */
+-                      case 0x2404: /* hibernation, undock */
+-                              hotkey_wakeup_reason = TP_ACPI_WAKEUP_UNDOCK;
+-                              ignore_acpi_ev = 1;
+-                              break;
+-                      case 0x2305: /* suspend, bay eject */
+-                      case 0x2405: /* hibernation, bay eject */
+-                              hotkey_wakeup_reason = TP_ACPI_WAKEUP_BAYEJ;
+-                              ignore_acpi_ev = 1;
+-                              break;
+-                      default:
+-                              unk_ev = 1;
+-                      }
+-                      if (hotkey_wakeup_reason != TP_ACPI_WAKEUP_NONE) {
+-                              printk(TPACPI_INFO
+-                                     "woke up due to a hot-unplug "
+-                                     "request...\n");
+-                              hotkey_wakeup_reason_notify_change();
+-                      }
++                      /* 0x2000-0x2FFF: Wakeup reason */
++                      known_ev = hotkey_notify_wakeup(hkey, &send_acpi_ev,
++                                               &ignore_acpi_ev);
+                       break;
+               case 3:
+-                      /* bay-related wakeups */
++                      /* 0x3000-0x3FFF: bay-related wakeups */
+                       if (hkey == 0x3003) {
+                               hotkey_autosleep_ack = 1;
+                               printk(TPACPI_INFO
+                                      "bay ejected\n");
+                               hotkey_wakeup_hotunplug_complete_notify_change();
++                              known_ev = true;
+                       } else {
+-                              unk_ev = 1;
++                              known_ev = false;
+                       }
+                       break;
+               case 4:
+-                      /* dock-related wakeups */
++                      /* 0x4000-0x4FFF: dock-related wakeups */
+                       if (hkey == 0x4003) {
+                               hotkey_autosleep_ack = 1;
+                               printk(TPACPI_INFO
+                                      "undocked\n");
+                               hotkey_wakeup_hotunplug_complete_notify_change();
++                              known_ev = true;
+                       } else {
+-                              unk_ev = 1;
++                              known_ev = false;
+                       }
+                       break;
+               case 5:
+                       /* 0x5000-0x5FFF: human interface helpers */
+-                      switch (hkey) {
+-                      case 0x5010: /* Lenovo new BIOS: brightness changed */
+-                      case 0x500b: /* X61t: tablet pen inserted into bay */
+-                      case 0x500c: /* X61t: tablet pen removed from bay */
+-                              break;
+-                      case 0x5009: /* X41t-X61t: swivel up (tablet mode) */
+-                      case 0x500a: /* X41t-X61t: swivel down (normal mode) */
+-                              tpacpi_input_send_tabletsw();
+-                              hotkey_tablet_mode_notify_change();
+-                              send_acpi_ev = 0;
+-                              break;
+-                      case 0x5001:
+-                      case 0x5002:
+-                              /* LID switch events.  Do not propagate */
+-                              ignore_acpi_ev = 1;
+-                              break;
+-                      default:
+-                              unk_ev = 1;
+-                      }
++                      known_ev = hotkey_notify_usrevent(hkey, &send_acpi_ev,
++                                               &ignore_acpi_ev);
+                       break;
+               case 7:
+                       /* 0x7000-0x7FFF: misc */
+                       if (tp_features.hotkey_wlsw && hkey == 0x7000) {
+                               tpacpi_send_radiosw_update();
+                               send_acpi_ev = 0;
++                              known_ev = true;
+                               break;
+                       }
+                       /* fallthrough to default */
+               default:
+-                      unk_ev = 1;
++                      known_ev = false;
+               }
+-              if (unk_ev) {
++              if (!known_ev) {
+                       printk(TPACPI_NOTICE
+                              "unhandled HKEY event 0x%04x\n", hkey);
+               }
+-- 
+1.5.6.5
+
diff --git a/releases/upstream/2.6.29-rc2/0010-ACPI-thinkpad-acpi-handle-HKEY-thermal-and-battery.patch b/releases/upstream/2.6.29-rc2/0010-ACPI-thinkpad-acpi-handle-HKEY-thermal-and-battery.patch
new file mode 100644 (file)
index 0000000..bc5676e
--- /dev/null
@@ -0,0 +1,119 @@
+From 106b4e6657e10831f35c32afa26d9c11e6312783 Mon Sep 17 00:00:00 2001
+From: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
+Date: Sun, 11 Jan 2009 03:01:06 -0200
+Subject: ACPI: thinkpad-acpi: handle HKEY thermal and battery alarms
+
+Handle some HKEY events that are actually firmware alarms.  For
+now, we do the simple thing: log specific messages to the log and let
+the thinkpad-specific event pass to userspace.
+
+In the future, these events will be migrated to generic notifications
+and subsystems.
+
+These alarms are NOT available on all ThinkPads.  E.g. the T43 only
+issues 0x6011 and 0x6012.
+
+Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
+Signed-off-by: Len Brown <len.brown@intel.com>
+---
+ drivers/platform/x86/thinkpad_acpi.c |   63 +++++++++++++++++++++++++++++++--
+ 1 files changed, 59 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
+index d833ee6..c4e4b64 100644
+--- a/drivers/platform/x86/thinkpad_acpi.c
++++ b/drivers/platform/x86/thinkpad_acpi.c
+@@ -174,10 +174,12 @@ enum {
+ /* Debugging */
+ #define TPACPI_LOG TPACPI_FILE ": "
+-#define TPACPI_ERR       KERN_ERR    TPACPI_LOG
+-#define TPACPI_NOTICE KERN_NOTICE TPACPI_LOG
+-#define TPACPI_INFO   KERN_INFO   TPACPI_LOG
+-#define TPACPI_DEBUG  KERN_DEBUG  TPACPI_LOG
++#define TPACPI_ALERT  KERN_ALERT  TPACPI_LOG
++#define TPACPI_CRIT   KERN_CRIT   TPACPI_LOG
++#define TPACPI_ERR    KERN_ERR    TPACPI_LOG
++#define TPACPI_NOTICE KERN_NOTICE TPACPI_LOG
++#define TPACPI_INFO   KERN_INFO   TPACPI_LOG
++#define TPACPI_DEBUG  KERN_DEBUG  TPACPI_LOG
+ #define TPACPI_DBG_ALL                0xffff
+ #define TPACPI_DBG_INIT               0x0001
+@@ -2614,6 +2616,15 @@ static bool hotkey_notify_wakeup(const u32 hkey,
+               *ignore_acpi_ev = true;
+               break;
++      case 0x2313: /* Battery on critical low level (S3) */
++      case 0x2413: /* Battery on critical low level (S4) */
++              printk(TPACPI_ALERT
++                      "EMERGENCY WAKEUP: battery almost empty\n");
++              /* how to auto-heal: */
++              /* 2313: woke up from S3, go to S4/S5 */
++              /* 2413: woke up from S4, go to S5 */
++              break;
++
+       default:
+               return false;
+       }
+@@ -2659,6 +2670,45 @@ static bool hotkey_notify_usrevent(const u32 hkey,
+       }
+ }
++static bool hotkey_notify_thermal(const u32 hkey,
++                               bool *send_acpi_ev,
++                               bool *ignore_acpi_ev)
++{
++      /* 0x6000-0x6FFF: thermal alarms */
++      *send_acpi_ev = true;
++      *ignore_acpi_ev = false;
++
++      switch (hkey) {
++      case 0x6011:
++              printk(TPACPI_CRIT
++                      "THERMAL ALARM: battery is too hot!\n");
++              /* recommended action: warn user through gui */
++              return true;
++      case 0x6012:
++              printk(TPACPI_ALERT
++                      "THERMAL EMERGENCY: battery is extremely hot!\n");
++              /* recommended action: immediate sleep/hibernate */
++              return true;
++      case 0x6021:
++              printk(TPACPI_CRIT
++                      "THERMAL ALARM: "
++                      "a sensor reports something is too hot!\n");
++              /* recommended action: warn user through gui, that */
++              /* some internal component is too hot */
++              return true;
++      case 0x6022:
++              printk(TPACPI_ALERT
++                      "THERMAL EMERGENCY: "
++                      "a sensor reports something is extremely hot!\n");
++              /* recommended action: immediate sleep/hibernate */
++              return true;
++      default:
++              printk(TPACPI_ALERT
++                       "THERMAL ALERT: unknown thermal alarm received\n");
++              return false;
++      }
++}
++
+ static void hotkey_notify(struct ibm_struct *ibm, u32 event)
+ {
+       u32 hkey;
+@@ -2731,6 +2781,11 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event)
+                       known_ev = hotkey_notify_usrevent(hkey, &send_acpi_ev,
+                                                &ignore_acpi_ev);
+                       break;
++              case 6:
++                      /* 0x6000-0x6FFF: thermal alarms */
++                      known_ev = hotkey_notify_thermal(hkey, &send_acpi_ev,
++                                               &ignore_acpi_ev);
++                      break;
+               case 7:
+                       /* 0x7000-0x7FFF: misc */
+                       if (tp_features.hotkey_wlsw && hkey == 0x7000) {
+-- 
+1.5.6.5
+
diff --git a/releases/upstream/2.6.29-rc2/0011-ACPI-thinkpad-acpi-start-the-event-hunt-season.patch b/releases/upstream/2.6.29-rc2/0011-ACPI-thinkpad-acpi-start-the-event-hunt-season.patch
new file mode 100644 (file)
index 0000000..0573ed2
--- /dev/null
@@ -0,0 +1,30 @@
+From cb4293589855714b6d5079336019bf2af5fc41f8 Mon Sep 17 00:00:00 2001
+From: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
+Date: Sun, 11 Jan 2009 03:01:07 -0200
+Subject: ACPI: thinkpad-acpi: start the event hunt season
+
+Ask users to tell us about any unhandled events they find.
+
+Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
+Signed-off-by: Len Brown <len.brown@intel.com>
+---
+ drivers/platform/x86/thinkpad_acpi.c |    3 +++
+ 1 files changed, 3 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
+index c4e4b64..d7d41ae 100644
+--- a/drivers/platform/x86/thinkpad_acpi.c
++++ b/drivers/platform/x86/thinkpad_acpi.c
+@@ -2801,6 +2801,9 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event)
+               if (!known_ev) {
+                       printk(TPACPI_NOTICE
+                              "unhandled HKEY event 0x%04x\n", hkey);
++                      printk(TPACPI_NOTICE
++                             "please report the conditions when this "
++                             "event happened to %s\n", TPACPI_MAIL);
+               }
+               /* Legacy events */
+-- 
+1.5.6.5
+
diff --git a/releases/upstream/2.6.29-rc2/0012-ACPI-thinkpad-acpi-clean-up-fan-subdriver-quirk.patch b/releases/upstream/2.6.29-rc2/0012-ACPI-thinkpad-acpi-clean-up-fan-subdriver-quirk.patch
new file mode 100644 (file)
index 0000000..df15881
--- /dev/null
@@ -0,0 +1,180 @@
+From 1c2ece758a36b48133717e4db060fbe8fa52c5cd Mon Sep 17 00:00:00 2001
+From: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
+Date: Sun, 11 Jan 2009 03:01:08 -0200
+Subject: ACPI: thinkpad-acpi: clean-up fan subdriver quirk
+
+Better document the Unitialized HFSP quirk, and modularize it a bit.
+This makes the code flow easier to read and reduces LOC.
+
+Apply the Unitialized HFSP closer to the source (i.e. inside the
+get_fan_status()), this fixes a harmless buglet where at driver init
+with the quirk active, the user could set the hwmon pwm1 attribute and
+switch out of pwm1_mode=2 to pwm1_mode=0 without changing pwm1_mode
+directly.
+
+Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
+Cc: Tino Keitel <tino.keitel@tikei.de>
+Signed-off-by: Len Brown <len.brown@intel.com>
+---
+ drivers/platform/x86/thinkpad_acpi.c |  109 ++++++++++++++++++----------------
+ 1 files changed, 58 insertions(+), 51 deletions(-)
+
+diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
+index d7d41ae..213219d 100644
+--- a/drivers/platform/x86/thinkpad_acpi.c
++++ b/drivers/platform/x86/thinkpad_acpi.c
+@@ -5897,6 +5897,60 @@ TPACPI_HANDLE(sfan, ec, "SFAN", /* 570 */
+          );                   /* all others */
+ /*
++ * Unitialized HFSP quirk: ACPI DSDT and EC fail to initialize the
++ * HFSP register at boot, so it contains 0x07 but the Thinkpad could
++ * be in auto mode (0x80).
++ *
++ * This is corrected by any write to HFSP either by the driver, or
++ * by the firmware.
++ *
++ * We assume 0x07 really means auto mode while this quirk is active,
++ * as this is far more likely than the ThinkPad being in level 7,
++ * which is only used by the firmware during thermal emergencies.
++ */
++
++static void fan_quirk1_detect(void)
++{
++      /* In some ThinkPads, neither the EC nor the ACPI
++       * DSDT initialize the HFSP register, and it ends up
++       * being initially set to 0x07 when it *could* be
++       * either 0x07 or 0x80.
++       *
++       * Enable for TP-1Y (T43), TP-78 (R51e),
++       * TP-76 (R52), TP-70 (T43, R52), which are known
++       * to be buggy. */
++      if (fan_control_initial_status == 0x07) {
++              switch (thinkpad_id.ec_model) {
++              case 0x5931: /* TP-1Y */
++              case 0x3837: /* TP-78 */
++              case 0x3637: /* TP-76 */
++              case 0x3037: /* TP-70 */
++                      printk(TPACPI_NOTICE
++                             "fan_init: initial fan status is unknown, "
++                             "assuming it is in auto mode\n");
++                      tp_features.fan_ctrl_status_undef = 1;
++                      ;;
++              }
++      }
++}
++
++static void fan_quirk1_handle(u8 *fan_status)
++{
++      if (unlikely(tp_features.fan_ctrl_status_undef)) {
++              if (*fan_status != fan_control_initial_status) {
++                      /* something changed the HFSP regisnter since
++                       * driver init time, so it is not undefined
++                       * anymore */
++                      tp_features.fan_ctrl_status_undef = 0;
++              } else {
++                      /* Return most likely status. In fact, it
++                       * might be the only possible status */
++                      *fan_status = TP_EC_FAN_AUTO;
++              }
++      }
++}
++
++/*
+  * Call with fan_mutex held
+  */
+ static void fan_update_desired_level(u8 status)
+@@ -5934,8 +5988,10 @@ static int fan_get_status(u8 *status)
+               if (unlikely(!acpi_ec_read(fan_status_offset, &s)))
+                       return -EIO;
+-              if (likely(status))
++              if (likely(status)) {
+                       *status = s;
++                      fan_quirk1_handle(status);
++              }
+               break;
+@@ -6245,16 +6301,6 @@ static ssize_t fan_pwm1_enable_show(struct device *dev,
+       if (res)
+               return res;
+-      if (unlikely(tp_features.fan_ctrl_status_undef)) {
+-              if (status != fan_control_initial_status) {
+-                      tp_features.fan_ctrl_status_undef = 0;
+-              } else {
+-                      /* Return most likely status. In fact, it
+-                       * might be the only possible status */
+-                      status = TP_EC_FAN_AUTO;
+-              }
+-      }
+-
+       if (status & TP_EC_FAN_FULLSPEED) {
+               mode = 0;
+       } else if (status & TP_EC_FAN_AUTO) {
+@@ -6319,14 +6365,6 @@ static ssize_t fan_pwm1_show(struct device *dev,
+       if (res)
+               return res;
+-      if (unlikely(tp_features.fan_ctrl_status_undef)) {
+-              if (status != fan_control_initial_status) {
+-                      tp_features.fan_ctrl_status_undef = 0;
+-              } else {
+-                      status = TP_EC_FAN_AUTO;
+-              }
+-      }
+-
+       if ((status &
+            (TP_EC_FAN_AUTO | TP_EC_FAN_FULLSPEED)) != 0)
+               status = fan_control_desired_level;
+@@ -6458,29 +6496,7 @@ static int __init fan_init(struct ibm_init_struct *iibm)
+               if (likely(acpi_ec_read(fan_status_offset,
+                                       &fan_control_initial_status))) {
+                       fan_status_access_mode = TPACPI_FAN_RD_TPEC;
+-
+-                      /* In some ThinkPads, neither the EC nor the ACPI
+-                       * DSDT initialize the fan status, and it ends up
+-                       * being set to 0x07 when it *could* be either
+-                       * 0x07 or 0x80.
+-                       *
+-                       * Enable for TP-1Y (T43), TP-78 (R51e),
+-                       * TP-76 (R52), TP-70 (T43, R52), which are known
+-                       * to be buggy. */
+-                      if (fan_control_initial_status == 0x07) {
+-                              switch (thinkpad_id.ec_model) {
+-                              case 0x5931: /* TP-1Y */
+-                              case 0x3837: /* TP-78 */
+-                              case 0x3637: /* TP-76 */
+-                              case 0x3037: /* TP-70 */
+-                                      printk(TPACPI_NOTICE
+-                                             "fan_init: initial fan status "
+-                                             "is unknown, assuming it is "
+-                                             "in auto mode\n");
+-                                      tp_features.fan_ctrl_status_undef = 1;
+-                                      ;;
+-                              }
+-                      }
++                      fan_quirk1_detect();
+               } else {
+                       printk(TPACPI_ERR
+                              "ThinkPad ACPI EC access misbehaving, "
+@@ -6669,15 +6685,6 @@ static int fan_read(char *p)
+               if (rc < 0)
+                       return rc;
+-              if (unlikely(tp_features.fan_ctrl_status_undef)) {
+-                      if (status != fan_control_initial_status)
+-                              tp_features.fan_ctrl_status_undef = 0;
+-                      else
+-                              /* Return most likely status. In fact, it
+-                               * might be the only possible status */
+-                              status = TP_EC_FAN_AUTO;
+-              }
+-
+               len += sprintf(p + len, "status:\t\t%s\n",
+                              (status != 0) ? "enabled" : "disabled");
+-- 
+1.5.6.5
+
diff --git a/releases/upstream/2.6.29-rc2/0013-ACPI-thinkpad-acpi-handle-HKEY-event-6030.patch b/releases/upstream/2.6.29-rc2/0013-ACPI-thinkpad-acpi-handle-HKEY-event-6030.patch
new file mode 100644 (file)
index 0000000..758756e
--- /dev/null
@@ -0,0 +1,37 @@
+From 54926ce8d2db7ebcbc4b80aae2cec571cd793e46 Mon Sep 17 00:00:00 2001
+From: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
+Date: Sun, 11 Jan 2009 03:01:09 -0200
+Subject: ACPI: thinkpad-acpi: handle HKEY event 6030
+
+HKEY event 0x6030 is a helper for Lenovo's Advanced Thermal Management
+Windows driver, which is, of course, completely undocumented.
+
+Silence any warnings about it being an unknown alarm, and report it
+unmodified for userspace.
+
+Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
+Signed-off-by: Len Brown <len.brown@intel.com>
+---
+ drivers/platform/x86/thinkpad_acpi.c |    6 ++++++
+ 1 files changed, 6 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
+index 213219d..886a430 100644
+--- a/drivers/platform/x86/thinkpad_acpi.c
++++ b/drivers/platform/x86/thinkpad_acpi.c
+@@ -2702,6 +2702,12 @@ static bool hotkey_notify_thermal(const u32 hkey,
+                       "a sensor reports something is extremely hot!\n");
+               /* recommended action: immediate sleep/hibernate */
+               return true;
++      case 0x6030:
++              printk(TPACPI_INFO
++                      "EC reports that Thermal Table has changed\n");
++              /* recommended action: do nothing, we don't have
++               * Lenovo ATM information */
++              return true;
+       default:
+               printk(TPACPI_ALERT
+                        "THERMAL ALERT: unknown thermal alarm received\n");
+-- 
+1.5.6.5
+
diff --git a/releases/upstream/2.6.29-rc2/0014-ACPI-thinkpad-acpi-bump-up-version-to-0.22.patch b/releases/upstream/2.6.29-rc2/0014-ACPI-thinkpad-acpi-bump-up-version-to-0.22.patch
new file mode 100644 (file)
index 0000000..8f1378a
--- /dev/null
@@ -0,0 +1,57 @@
+From aa2fbcec07b0d594808bc3058692395d24eba66e Mon Sep 17 00:00:00 2001
+From: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
+Date: Sun, 11 Jan 2009 03:01:10 -0200
+Subject: ACPI: thinkpad-acpi: bump up version to 0.22
+
+It is about time to bump up the version.
+
+Features added since 0.21:  fan suspend/resume support, preserve radio
+state across power off (for some radio types), built-in UWB radio
+rfkill support and thermal alarm events support.
+
+Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
+Signed-off-by: Len Brown <len.brown@intel.com>
+---
+ Documentation/laptops/thinkpad-acpi.txt |    6 +++---
+ drivers/platform/x86/thinkpad_acpi.c    |    2 +-
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/Documentation/laptops/thinkpad-acpi.txt b/Documentation/laptops/thinkpad-acpi.txt
+index 91c0001..41bc99f 100644
+--- a/Documentation/laptops/thinkpad-acpi.txt
++++ b/Documentation/laptops/thinkpad-acpi.txt
+@@ -1,7 +1,7 @@
+                    ThinkPad ACPI Extras Driver
+-                            Version 0.21
+-                           May 29th, 2008
++                            Version 0.22
++                        November 23rd,  2008
+                Borislav Deianov <borislav@users.sf.net>
+              Henrique de Moraes Holschuh <hmh@hmh.eng.br>
+@@ -17,7 +17,7 @@ This driver used to be named ibm-acpi until kernel 2.6.21 and release
+ 0.13-20070314.  It used to be in the drivers/acpi tree, but it was
+ moved to the drivers/misc tree and renamed to thinkpad-acpi for kernel
+ 2.6.22, and release 0.14.  It was moved to drivers/platform/x86 for
+-kernel 2.6.29.
++kernel 2.6.29 and release 0.22.
+ The driver is named "thinkpad-acpi".  In some places, like module
+ names, "thinkpad_acpi" is used because of userspace issues.
+diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
+index 886a430..bcbc051 100644
+--- a/drivers/platform/x86/thinkpad_acpi.c
++++ b/drivers/platform/x86/thinkpad_acpi.c
+@@ -21,7 +21,7 @@
+  *  02110-1301, USA.
+  */
+-#define TPACPI_VERSION "0.21"
++#define TPACPI_VERSION "0.22"
+ #define TPACPI_SYSFS_VERSION 0x020200
+ /*
+-- 
+1.5.6.5
+