From 918c9c8b87bb59109d4d50b5ff11a608c1834fab Mon Sep 17 00:00:00 2001 From: Henrique de Moraes Holschuh Date: Fri, 24 Apr 2009 22:40:39 -0300 Subject: [PATCH] Add patches accepted for 2.6.30-rc4 Signed-off-by: Henrique de Moraes Holschuh --- ...cpi-silence-hotkey-enable-warning-for-mod.patch | 57 +++++++++ ...cpi-fix-LED-blinking-through-timer-trigge.patch | 131 +++++++++++++++++++++ ...03-thinkpad-acpi-fix-use-of-MODULE_AUTHOR.patch | 30 +++++ ...thinkpad-acpi-simplify-module-autoloading.patch | 59 ++++++++++ ...005-thinkpad-acpi-bump-up-version-to-0.23.patch | 55 +++++++++ 5 files changed, 332 insertions(+) create mode 100644 releases/upstream/2.6.30-rc4/0001-thinkpad-acpi-silence-hotkey-enable-warning-for-mod.patch create mode 100644 releases/upstream/2.6.30-rc4/0002-thinkpad-acpi-fix-LED-blinking-through-timer-trigge.patch create mode 100644 releases/upstream/2.6.30-rc4/0003-thinkpad-acpi-fix-use-of-MODULE_AUTHOR.patch create mode 100644 releases/upstream/2.6.30-rc4/0004-thinkpad-acpi-simplify-module-autoloading.patch create mode 100644 releases/upstream/2.6.30-rc4/0005-thinkpad-acpi-bump-up-version-to-0.23.patch diff --git a/releases/upstream/2.6.30-rc4/0001-thinkpad-acpi-silence-hotkey-enable-warning-for-mod.patch b/releases/upstream/2.6.30-rc4/0001-thinkpad-acpi-silence-hotkey-enable-warning-for-mod.patch new file mode 100644 index 00000000000..9a831f91ba6 --- /dev/null +++ b/releases/upstream/2.6.30-rc4/0001-thinkpad-acpi-silence-hotkey-enable-warning-for-mod.patch @@ -0,0 +1,57 @@ +From 406e988bef742aa74cdc1f5fafc812ecebf7c02b Mon Sep 17 00:00:00 2001 +From: Henrique de Moraes Holschuh +Date: Tue, 14 Apr 2009 02:44:10 +0000 +Subject: thinkpad-acpi: silence hotkey enable warning for module parameter + +Avoid the WARN() when the procfs handler for hotkey enable is used by +a module parameter. Instead, urge the user to stop doing that. + +Reported-by: Niel Lambrechts +Signed-off-by: Henrique de Moraes Holschuh +Signed-off-by: Len Brown +--- + drivers/platform/x86/thinkpad_acpi.c | 18 ++++++++++++------ + 1 files changed, 12 insertions(+), 6 deletions(-) + +diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c +index a40b075..a186c5b 100644 +--- a/drivers/platform/x86/thinkpad_acpi.c ++++ b/drivers/platform/x86/thinkpad_acpi.c +@@ -2946,12 +2946,18 @@ static int hotkey_read(char *p) + return len; + } + +-static void hotkey_enabledisable_warn(void) ++static void hotkey_enabledisable_warn(bool enable) + { + tpacpi_log_usertask("procfs hotkey enable/disable"); +- WARN(1, TPACPI_WARN +- "hotkey enable/disable functionality has been " +- "removed from the driver. Hotkeys are always enabled.\n"); ++ if (!WARN((tpacpi_lifecycle == TPACPI_LIFE_RUNNING || !enable), ++ TPACPI_WARN ++ "hotkey enable/disable functionality has been " ++ "removed from the driver. Hotkeys are always " ++ "enabled\n")) ++ printk(TPACPI_ERR ++ "Please remove the hotkey=enable module " ++ "parameter, it is deprecated. Hotkeys are always " ++ "enabled\n"); + } + + static int hotkey_write(char *buf) +@@ -2971,9 +2977,9 @@ static int hotkey_write(char *buf) + res = 0; + while ((cmd = next_cmd(&buf))) { + if (strlencmp(cmd, "enable") == 0) { +- hotkey_enabledisable_warn(); ++ hotkey_enabledisable_warn(1); + } else if (strlencmp(cmd, "disable") == 0) { +- hotkey_enabledisable_warn(); ++ hotkey_enabledisable_warn(0); + res = -EPERM; + } else if (strlencmp(cmd, "reset") == 0) { + mask = hotkey_orig_mask; +-- +1.6.2.3 + diff --git a/releases/upstream/2.6.30-rc4/0002-thinkpad-acpi-fix-LED-blinking-through-timer-trigge.patch b/releases/upstream/2.6.30-rc4/0002-thinkpad-acpi-fix-LED-blinking-through-timer-trigge.patch new file mode 100644 index 00000000000..8f3474aa52b --- /dev/null +++ b/releases/upstream/2.6.30-rc4/0002-thinkpad-acpi-fix-LED-blinking-through-timer-trigge.patch @@ -0,0 +1,131 @@ +From 75bd3bf2ade9d548be0d2bde60b5ee0fdce0b127 Mon Sep 17 00:00:00 2001 +From: Henrique de Moraes Holschuh +Date: Tue, 14 Apr 2009 02:44:11 +0000 +Subject: thinkpad-acpi: fix LED blinking through timer trigger + +The set_blink hook code in the LED subdriver would never manage to get +a LED to blink, and instead it would just turn it on. The consequence +of this is that the "timer" trigger would not cause the LED to blink +if given default parameters. + +This problem exists since 2.6.26-rc1. + +To fix it, switch the deferred LED work handling to use the +thinkpad-acpi-specific LED status (off/on/blink) directly. + +This also makes the code easier to read, and to extend later. + +Signed-off-by: Henrique de Moraes Holschuh +Cc: stable@kernel.org +Signed-off-by: Len Brown +--- + drivers/platform/x86/thinkpad_acpi.c | 41 +++++++++++++++------------------ + 1 files changed, 19 insertions(+), 22 deletions(-) + +diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c +index a186c5b..a1d2abc 100644 +--- a/drivers/platform/x86/thinkpad_acpi.c ++++ b/drivers/platform/x86/thinkpad_acpi.c +@@ -303,11 +303,17 @@ static u32 dbg_level; + + static struct workqueue_struct *tpacpi_wq; + ++enum led_status_t { ++ TPACPI_LED_OFF = 0, ++ TPACPI_LED_ON, ++ TPACPI_LED_BLINK, ++}; ++ + /* Special LED class that can defer work */ + struct tpacpi_led_classdev { + struct led_classdev led_classdev; + struct work_struct work; +- enum led_brightness new_brightness; ++ enum led_status_t new_state; + unsigned int led; + }; + +@@ -4213,7 +4219,7 @@ static void light_set_status_worker(struct work_struct *work) + container_of(work, struct tpacpi_led_classdev, work); + + if (likely(tpacpi_lifecycle == TPACPI_LIFE_RUNNING)) +- light_set_status((data->new_brightness != LED_OFF)); ++ light_set_status((data->new_state != TPACPI_LED_OFF)); + } + + static void light_sysfs_set(struct led_classdev *led_cdev, +@@ -4223,7 +4229,8 @@ static void light_sysfs_set(struct led_classdev *led_cdev, + container_of(led_cdev, + struct tpacpi_led_classdev, + led_classdev); +- data->new_brightness = brightness; ++ data->new_state = (brightness != LED_OFF) ? ++ TPACPI_LED_ON : TPACPI_LED_OFF; + queue_work(tpacpi_wq, &data->work); + } + +@@ -4730,12 +4737,6 @@ enum { /* For TPACPI_LED_OLD */ + TPACPI_LED_EC_HLMS = 0x0e, /* EC reg to select led to command */ + }; + +-enum led_status_t { +- TPACPI_LED_OFF = 0, +- TPACPI_LED_ON, +- TPACPI_LED_BLINK, +-}; +- + static enum led_access_mode led_supported; + + TPACPI_HANDLE(led, ec, "SLED", /* 570 */ +@@ -4847,23 +4848,13 @@ static int led_set_status(const unsigned int led, + return rc; + } + +-static void led_sysfs_set_status(unsigned int led, +- enum led_brightness brightness) +-{ +- led_set_status(led, +- (brightness == LED_OFF) ? +- TPACPI_LED_OFF : +- (tpacpi_led_state_cache[led] == TPACPI_LED_BLINK) ? +- TPACPI_LED_BLINK : TPACPI_LED_ON); +-} +- + static void led_set_status_worker(struct work_struct *work) + { + struct tpacpi_led_classdev *data = + container_of(work, struct tpacpi_led_classdev, work); + + if (likely(tpacpi_lifecycle == TPACPI_LIFE_RUNNING)) +- led_sysfs_set_status(data->led, data->new_brightness); ++ led_set_status(data->led, data->new_state); + } + + static void led_sysfs_set(struct led_classdev *led_cdev, +@@ -4872,7 +4863,13 @@ static void led_sysfs_set(struct led_classdev *led_cdev, + struct tpacpi_led_classdev *data = container_of(led_cdev, + struct tpacpi_led_classdev, led_classdev); + +- data->new_brightness = brightness; ++ if (brightness == LED_OFF) ++ data->new_state = TPACPI_LED_OFF; ++ else if (tpacpi_led_state_cache[data->led] != TPACPI_LED_BLINK) ++ data->new_state = TPACPI_LED_ON; ++ else ++ data->new_state = TPACPI_LED_BLINK; ++ + queue_work(tpacpi_wq, &data->work); + } + +@@ -4890,7 +4887,7 @@ static int led_sysfs_blink_set(struct led_classdev *led_cdev, + } else if ((*delay_on != 500) || (*delay_off != 500)) + return -EINVAL; + +- data->new_brightness = TPACPI_LED_BLINK; ++ data->new_state = TPACPI_LED_BLINK; + queue_work(tpacpi_wq, &data->work); + + return 0; +-- +1.6.2.3 + diff --git a/releases/upstream/2.6.30-rc4/0003-thinkpad-acpi-fix-use-of-MODULE_AUTHOR.patch b/releases/upstream/2.6.30-rc4/0003-thinkpad-acpi-fix-use-of-MODULE_AUTHOR.patch new file mode 100644 index 00000000000..ef1b8d8d19f --- /dev/null +++ b/releases/upstream/2.6.30-rc4/0003-thinkpad-acpi-fix-use-of-MODULE_AUTHOR.patch @@ -0,0 +1,30 @@ +From f68f53a217b827580647d23fdc34eecdcb3739c6 Mon Sep 17 00:00:00 2001 +From: Henrique de Moraes Holschuh +Date: Tue, 14 Apr 2009 02:44:12 +0000 +Subject: thinkpad-acpi: fix use of MODULE_AUTHOR + +Fix the module to use one instance of MODULE_AUTHOR per author. + +Signed-off-by: Henrique de Moraes Holschuh +Signed-off-by: Len Brown +--- + drivers/platform/x86/thinkpad_acpi.c | 3 ++- + 1 files changed, 2 insertions(+), 1 deletions(-) + +diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c +index a1d2abc..7a7cac2 100644 +--- a/drivers/platform/x86/thinkpad_acpi.c ++++ b/drivers/platform/x86/thinkpad_acpi.c +@@ -7883,7 +7883,8 @@ IBM_BIOS_MODULE_ALIAS("I[BDHIMNOTWVYZ]"); + IBM_BIOS_MODULE_ALIAS("1[0368A-GIKM-PST]"); + IBM_BIOS_MODULE_ALIAS("K[UX-Z]"); + +-MODULE_AUTHOR("Borislav Deianov, Henrique de Moraes Holschuh"); ++MODULE_AUTHOR("Borislav Deianov "); ++MODULE_AUTHOR("Henrique de Moraes Holschuh "); + MODULE_DESCRIPTION(TPACPI_DESC); + MODULE_VERSION(TPACPI_VERSION); + MODULE_LICENSE("GPL"); +-- +1.6.2.3 + diff --git a/releases/upstream/2.6.30-rc4/0004-thinkpad-acpi-simplify-module-autoloading.patch b/releases/upstream/2.6.30-rc4/0004-thinkpad-acpi-simplify-module-autoloading.patch new file mode 100644 index 00000000000..7212a54db57 --- /dev/null +++ b/releases/upstream/2.6.30-rc4/0004-thinkpad-acpi-simplify-module-autoloading.patch @@ -0,0 +1,59 @@ +From 922fe097b1e8f2f2f23dbed61cfe6e0316fecff1 Mon Sep 17 00:00:00 2001 +From: Henrique de Moraes Holschuh +Date: Tue, 14 Apr 2009 02:44:13 +0000 +Subject: thinkpad-acpi: simplify module autoloading + +Simplify the module autoloading a great deal, by keying to the HID for +the HKEY interface. + +Only _really_ ancient IBM ThinkPad models like the 240, 240x and 570 +lack the HKEY interface, and they're getting their own trimmed-down +driver one of these days. + +Signed-off-by: Henrique de Moraes Holschuh +Signed-off-by: Len Brown +--- + drivers/platform/x86/thinkpad_acpi.c | 17 ++++++++++------- + 1 files changed, 10 insertions(+), 7 deletions(-) + +diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c +index 7a7cac2..caa774a 100644 +--- a/drivers/platform/x86/thinkpad_acpi.c ++++ b/drivers/platform/x86/thinkpad_acpi.c +@@ -7861,6 +7861,15 @@ static int __init thinkpad_acpi_module_init(void) + MODULE_ALIAS(TPACPI_DRVR_SHORTNAME); + + /* ++ * This will autoload the driver in almost every ThinkPad ++ * in widespread use. ++ * ++ * Only _VERY_ old models, like the 240, 240x and 570 lack ++ * the HKEY event interface. ++ */ ++MODULE_DEVICE_TABLE(acpi, ibm_htk_device_ids); ++ ++/* + * DMI matching for module autoloading + * + * See http://thinkwiki.org/wiki/List_of_DMI_IDs +@@ -7872,16 +7881,10 @@ MODULE_ALIAS(TPACPI_DRVR_SHORTNAME); + #define IBM_BIOS_MODULE_ALIAS(__type) \ + MODULE_ALIAS("dmi:bvnIBM:bvr" __type "ET??WW*") + +-/* Non-ancient thinkpads */ +-MODULE_ALIAS("dmi:bvnIBM:*:svnIBM:*:pvrThinkPad*:rvnIBM:*"); +-MODULE_ALIAS("dmi:bvnLENOVO:*:svnLENOVO:*:pvrThinkPad*:rvnLENOVO:*"); +- + /* Ancient thinkpad BIOSes have to be identified by + * BIOS type or model number, and there are far less + * BIOS types than model numbers... */ +-IBM_BIOS_MODULE_ALIAS("I[BDHIMNOTWVYZ]"); +-IBM_BIOS_MODULE_ALIAS("1[0368A-GIKM-PST]"); +-IBM_BIOS_MODULE_ALIAS("K[UX-Z]"); ++IBM_BIOS_MODULE_ALIAS("I[MU]"); /* 570, 570e */ + + MODULE_AUTHOR("Borislav Deianov "); + MODULE_AUTHOR("Henrique de Moraes Holschuh "); +-- +1.6.2.3 + diff --git a/releases/upstream/2.6.30-rc4/0005-thinkpad-acpi-bump-up-version-to-0.23.patch b/releases/upstream/2.6.30-rc4/0005-thinkpad-acpi-bump-up-version-to-0.23.patch new file mode 100644 index 00000000000..3641bcda237 --- /dev/null +++ b/releases/upstream/2.6.30-rc4/0005-thinkpad-acpi-bump-up-version-to-0.23.patch @@ -0,0 +1,55 @@ +From b57f7e7b836d271902b8b7b1ec8cf9312dc5d228 Mon Sep 17 00:00:00 2001 +From: Henrique de Moraes Holschuh +Date: Tue, 14 Apr 2009 02:44:14 +0000 +Subject: thinkpad-acpi: bump up version to 0.23 + +Plenty of high-profile changes, so it deserves a new version number. + +Features added since 0.22: + * Restrict unsafe LEDs + * New race-less brightness control strategy for IBM ThinkPads + * Disclose TGID of driver access from userspace (debug) + * Warn when deprecated functions are used + +Other changes: + * Better debug messages in some subdrivers + * Removed "hotkey disable" support, since it breaks the driver + * Dropped "ibm-acpi" alias + +Signed-off-by: Henrique de Moraes Holschuh +Signed-off-by: Len Brown +--- + Documentation/laptops/thinkpad-acpi.txt | 4 ++-- + drivers/platform/x86/thinkpad_acpi.c | 2 +- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/Documentation/laptops/thinkpad-acpi.txt b/Documentation/laptops/thinkpad-acpi.txt +index 3d76507..e7e9a69 100644 +--- a/Documentation/laptops/thinkpad-acpi.txt ++++ b/Documentation/laptops/thinkpad-acpi.txt +@@ -1,7 +1,7 @@ + ThinkPad ACPI Extras Driver + +- Version 0.22 +- November 23rd, 2008 ++ Version 0.23 ++ April 10th, 2009 + + Borislav Deianov + Henrique de Moraes Holschuh +diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c +index caa774a..912be65 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.22" ++#define TPACPI_VERSION "0.23" + #define TPACPI_SYSFS_VERSION 0x020300 + + /* +-- +1.6.2.3 + -- 2.11.4.GIT