From 0f7178896e25beb162e9dc264ac13ab2511e151e Mon Sep 17 00:00:00 2001 From: Henrique de Moraes Holschuh Date: Sat, 22 Nov 2008 19:16:01 -0200 Subject: [PATCH] Add missing patch that touched many files, including thinkpad-acpi and was shipped in 2.6.28-rc1. To preserve the commit ordering (not that it matters in this case), the other patches were renamed. Signed-off-by: Henrique de Moraes Holschuh --- ...h-calls-of-acpi_driver_data-on-pointer-of.patch | 408 +++++++++++++++++++++ ...kpad-acpi-attempt-to-preserve-fan-state-o.patch | 98 +++++ ...hinkpad-acpi-trivial-fix-of-error-message.patch | 32 ++ ...-ACPI-thinkpad-acpi-Remove-duplicate-line.patch | 27 ++ ...kpad-acpi-Remove-firmware-backlight-delay.patch | 58 +++ 5 files changed, 623 insertions(+) create mode 100644 releases/upstream/2.6.28-rc1/0001-ACPI-catch-calls-of-acpi_driver_data-on-pointer-of.patch create mode 100644 releases/upstream/2.6.28-rc1/0002-ACPI-thinkpad-acpi-attempt-to-preserve-fan-state-o.patch create mode 100644 releases/upstream/2.6.28-rc1/0003-ACPI-thinkpad-acpi-trivial-fix-of-error-message.patch create mode 100644 releases/upstream/2.6.28-rc1/0004-ACPI-thinkpad-acpi-Remove-duplicate-line.patch create mode 100644 releases/upstream/2.6.28-rc1/0005-ACPI-thinkpad-acpi-Remove-firmware-backlight-delay.patch diff --git a/releases/upstream/2.6.28-rc1/0001-ACPI-catch-calls-of-acpi_driver_data-on-pointer-of.patch b/releases/upstream/2.6.28-rc1/0001-ACPI-catch-calls-of-acpi_driver_data-on-pointer-of.patch new file mode 100644 index 00000000000..628dbb6e2db --- /dev/null +++ b/releases/upstream/2.6.28-rc1/0001-ACPI-catch-calls-of-acpi_driver_data-on-pointer-of.patch @@ -0,0 +1,408 @@ +From db89b4f0dbab837d0f3de2c3e9427a8d5393afa3 Mon Sep 17 00:00:00 2001 +From: Pavel Machek +Date: Mon, 22 Sep 2008 14:37:34 -0700 +Subject: [PATCH] ACPI: catch calls of acpi_driver_data on pointer of wrong type + +Catch attempts to use of acpi_driver_data on pointers of wrong type. + +akpm: rewritten to use proper C typechecking and remove the +"function"-used-as-lvalue thing. + +Signed-off-by: Pavel Machek +Signed-off-by: Andrew Morton +Signed-off-by: Len Brown +--- + drivers/acpi/ac.c | 2 +- + drivers/acpi/acpi_memhotplug.c | 2 +- + drivers/acpi/asus_acpi.c | 2 +- + drivers/acpi/battery.c | 2 +- + drivers/acpi/button.c | 2 +- + drivers/acpi/container.c | 2 +- + drivers/acpi/ec.c | 4 ++-- + drivers/acpi/fan.c | 2 +- + drivers/acpi/pci_link.c | 2 +- + drivers/acpi/pci_root.c | 2 +- + drivers/acpi/power.c | 4 ++-- + drivers/acpi/processor_core.c | 2 +- + drivers/acpi/sbs.c | 2 +- + drivers/acpi/sbshc.c | 4 ++-- + drivers/acpi/scan.c | 4 ++-- + drivers/acpi/thermal.c | 2 +- + drivers/acpi/video.c | 6 +++--- + drivers/misc/asus-laptop.c | 2 +- + drivers/misc/eeepc-laptop.c | 2 +- + drivers/misc/fujitsu-laptop.c | 4 ++-- + drivers/misc/intel_menlow.c | 2 +- + drivers/misc/thinkpad_acpi.c | 2 +- + include/acpi/acpi_bus.h | 6 +++++- + 23 files changed, 34 insertions(+), 30 deletions(-) + +diff --git a/drivers/acpi/ac.c b/drivers/acpi/ac.c +index 831883b..8b6a84a 100644 +--- a/drivers/acpi/ac.c ++++ b/drivers/acpi/ac.c +@@ -269,7 +269,7 @@ static int acpi_ac_add(struct acpi_device *device) + ac->device = device; + strcpy(acpi_device_name(device), ACPI_AC_DEVICE_NAME); + strcpy(acpi_device_class(device), ACPI_AC_CLASS); +- acpi_driver_data(device) = ac; ++ device->driver_data = ac; + + result = acpi_ac_get_state(ac); + if (result) +diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi/acpi_memhotplug.c +index 5f1127a..afd955f 100644 +--- a/drivers/acpi/acpi_memhotplug.c ++++ b/drivers/acpi/acpi_memhotplug.c +@@ -403,7 +403,7 @@ static int acpi_memory_device_add(struct acpi_device *device) + mem_device->device = device; + sprintf(acpi_device_name(device), "%s", ACPI_MEMORY_DEVICE_NAME); + sprintf(acpi_device_class(device), "%s", ACPI_MEMORY_DEVICE_CLASS); +- acpi_driver_data(device) = mem_device; ++ device->driver_data = mem_device; + + /* Get the range from the _CRS */ + result = acpi_memory_get_device_resources(mem_device); +diff --git a/drivers/acpi/asus_acpi.c b/drivers/acpi/asus_acpi.c +index d3d0886..91571fc 100644 +--- a/drivers/acpi/asus_acpi.c ++++ b/drivers/acpi/asus_acpi.c +@@ -1321,7 +1321,7 @@ static int asus_hotk_add(struct acpi_device *device) + hotk->handle = device->handle; + strcpy(acpi_device_name(device), ACPI_HOTK_DEVICE_NAME); + strcpy(acpi_device_class(device), ACPI_HOTK_CLASS); +- acpi_driver_data(device) = hotk; ++ device->driver_data = hotk; + hotk->device = device; + + result = asus_hotk_check(); +diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c +index b1c723f..de80469 100644 +--- a/drivers/acpi/battery.c ++++ b/drivers/acpi/battery.c +@@ -804,7 +804,7 @@ static int acpi_battery_add(struct acpi_device *device) + battery->device = device; + strcpy(acpi_device_name(device), ACPI_BATTERY_DEVICE_NAME); + strcpy(acpi_device_class(device), ACPI_BATTERY_CLASS); +- acpi_driver_data(device) = battery; ++ device->driver_data = battery; + mutex_init(&battery->lock); + acpi_battery_update(battery); + #ifdef CONFIG_ACPI_PROCFS_POWER +diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c +index 1dfec41..e22033e 100644 +--- a/drivers/acpi/button.c ++++ b/drivers/acpi/button.c +@@ -384,7 +384,7 @@ static int acpi_button_add(struct acpi_device *device) + return -ENOMEM; + + button->device = device; +- acpi_driver_data(device) = button; ++ device->driver_data = button; + + button->input = input = input_allocate_device(); + if (!input) { +diff --git a/drivers/acpi/container.c b/drivers/acpi/container.c +index 3c25ec7..03ea847 100644 +--- a/drivers/acpi/container.c ++++ b/drivers/acpi/container.c +@@ -108,7 +108,7 @@ static int acpi_container_add(struct acpi_device *device) + container->handle = device->handle; + strcpy(acpi_device_name(device), ACPI_CONTAINER_DEVICE_NAME); + strcpy(acpi_device_class(device), ACPI_CONTAINER_CLASS); +- acpi_driver_data(device) = container; ++ device->driver_data = container; + + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device <%s> bid <%s>\n", + acpi_device_name(device), acpi_device_bid(device))); +diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c +index 13593f9..5741d99 100644 +--- a/drivers/acpi/ec.c ++++ b/drivers/acpi/ec.c +@@ -788,7 +788,7 @@ static int acpi_ec_add(struct acpi_device *device) + + if (!first_ec) + first_ec = ec; +- acpi_driver_data(device) = ec; ++ device->driver_data = ec; + acpi_ec_add_fs(device); + pr_info(PREFIX "GPE = 0x%lx, I/O: command/status = 0x%lx, data = 0x%lx\n", + ec->gpe, ec->command_addr, ec->data_addr); +@@ -813,7 +813,7 @@ static int acpi_ec_remove(struct acpi_device *device, int type) + } + mutex_unlock(&ec->lock); + acpi_ec_remove_fs(device); +- acpi_driver_data(device) = NULL; ++ device->driver_data = NULL; + if (ec == first_ec) + first_ec = NULL; + kfree(ec); +diff --git a/drivers/acpi/fan.c b/drivers/acpi/fan.c +index 2655bc1..e603e40 100644 +--- a/drivers/acpi/fan.c ++++ b/drivers/acpi/fan.c +@@ -265,7 +265,7 @@ static int acpi_fan_add(struct acpi_device *device) + + dev_info(&device->dev, "registered as cooling_device%d\n", cdev->id); + +- acpi_driver_data(device) = cdev; ++ device->driver_data = cdev; + result = sysfs_create_link(&device->dev.kobj, + &cdev->device.kobj, + "thermal_cooling"); +diff --git a/drivers/acpi/pci_link.c b/drivers/acpi/pci_link.c +index cf47805..54cd77a 100644 +--- a/drivers/acpi/pci_link.c ++++ b/drivers/acpi/pci_link.c +@@ -737,7 +737,7 @@ static int acpi_pci_link_add(struct acpi_device *device) + link->device = device; + strcpy(acpi_device_name(device), ACPI_PCI_LINK_DEVICE_NAME); + strcpy(acpi_device_class(device), ACPI_PCI_LINK_CLASS); +- acpi_driver_data(device) = link; ++ device->driver_data = link; + + mutex_lock(&acpi_link_lock); + result = acpi_pci_link_get_possible(link); +diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c +index c3fed31..add1a19 100644 +--- a/drivers/acpi/pci_root.c ++++ b/drivers/acpi/pci_root.c +@@ -206,7 +206,7 @@ static int __devinit acpi_pci_root_add(struct acpi_device *device) + root->device = device; + strcpy(acpi_device_name(device), ACPI_PCI_ROOT_DEVICE_NAME); + strcpy(acpi_device_class(device), ACPI_PCI_ROOT_CLASS); +- acpi_driver_data(device) = root; ++ device->driver_data = root; + + device->ops.bind = acpi_pci_bind; + +diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c +index 4ab21cb..1bef942 100644 +--- a/drivers/acpi/power.c ++++ b/drivers/acpi/power.c +@@ -657,7 +657,7 @@ static int acpi_power_add(struct acpi_device *device) + strcpy(resource->name, device->pnp.bus_id); + strcpy(acpi_device_name(device), ACPI_POWER_DEVICE_NAME); + strcpy(acpi_device_class(device), ACPI_POWER_CLASS); +- acpi_driver_data(device) = resource; ++ device->driver_data = resource; + + /* Evalute the object to get the system level and resource order. */ + status = acpi_evaluate_object(device->handle, NULL, NULL, &buffer); +@@ -733,7 +733,7 @@ static int acpi_power_resume(struct acpi_device *device) + if (!device || !acpi_driver_data(device)) + return -EINVAL; + +- resource = (struct acpi_power_resource *)acpi_driver_data(device); ++ resource = acpi_driver_data(device); + + result = acpi_power_get_state(resource, &state); + if (result) +diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c +index ee68ac5..2894616 100644 +--- a/drivers/acpi/processor_core.c ++++ b/drivers/acpi/processor_core.c +@@ -818,7 +818,7 @@ static int acpi_processor_add(struct acpi_device *device) + pr->handle = device->handle; + strcpy(acpi_device_name(device), ACPI_PROCESSOR_DEVICE_NAME); + strcpy(acpi_device_class(device), ACPI_PROCESSOR_CLASS); +- acpi_driver_data(device) = pr; ++ device->driver_data = pr; + + return 0; + } +diff --git a/drivers/acpi/sbs.c b/drivers/acpi/sbs.c +index 10a3651..d003325 100644 +--- a/drivers/acpi/sbs.c ++++ b/drivers/acpi/sbs.c +@@ -931,7 +931,7 @@ static int acpi_sbs_add(struct acpi_device *device) + sbs->device = device; + strcpy(acpi_device_name(device), ACPI_SBS_DEVICE_NAME); + strcpy(acpi_device_class(device), ACPI_SBS_CLASS); +- acpi_driver_data(device) = sbs; ++ device->driver_data = sbs; + + result = acpi_charger_add(sbs); + if (result) +diff --git a/drivers/acpi/sbshc.c b/drivers/acpi/sbshc.c +index a4e3767..001d914 100644 +--- a/drivers/acpi/sbshc.c ++++ b/drivers/acpi/sbshc.c +@@ -282,7 +282,7 @@ static int acpi_smbus_hc_add(struct acpi_device *device) + hc->ec = acpi_driver_data(device->parent); + hc->offset = (val >> 8) & 0xff; + hc->query_bit = val & 0xff; +- acpi_driver_data(device) = hc; ++ device->driver_data = hc; + + acpi_ec_add_query_handler(hc->ec, hc->query_bit, NULL, smbus_alarm, hc); + printk(KERN_INFO PREFIX "SBS HC: EC = 0x%p, offset = 0x%0x, query_bit = 0x%0x\n", +@@ -303,7 +303,7 @@ static int acpi_smbus_hc_remove(struct acpi_device *device, int type) + hc = acpi_driver_data(device); + acpi_ec_remove_query_handler(hc->ec, hc->query_bit); + kfree(hc); +- acpi_driver_data(device) = NULL; ++ device->driver_data = NULL; + return 0; + } + +diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c +index e7b8853..b88536a 100644 +--- a/drivers/acpi/scan.c ++++ b/drivers/acpi/scan.c +@@ -384,7 +384,7 @@ static int acpi_device_remove(struct device * dev) + acpi_drv->ops.remove(acpi_dev, acpi_dev->removal_type); + } + acpi_dev->driver = NULL; +- acpi_driver_data(acpi_dev) = NULL; ++ acpi_dev->driver_data = NULL; + + put_device(dev); + return 0; +@@ -537,7 +537,7 @@ acpi_bus_driver_init(struct acpi_device *device, struct acpi_driver *driver) + result = driver->ops.add(device); + if (result) { + device->driver = NULL; +- acpi_driver_data(device) = NULL; ++ device->driver_data = NULL; + return result; + } + +diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c +index 9127036..e052a75 100644 +--- a/drivers/acpi/thermal.c ++++ b/drivers/acpi/thermal.c +@@ -1647,7 +1647,7 @@ static int acpi_thermal_add(struct acpi_device *device) + strcpy(tz->name, device->pnp.bus_id); + strcpy(acpi_device_name(device), ACPI_THERMAL_DEVICE_NAME); + strcpy(acpi_device_class(device), ACPI_THERMAL_CLASS); +- acpi_driver_data(device) = tz; ++ device->driver_data = tz; + mutex_init(&tz->lock); + + +diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c +index e8a51a1..85c6554 100644 +--- a/drivers/acpi/video.c ++++ b/drivers/acpi/video.c +@@ -1491,7 +1491,7 @@ acpi_video_bus_get_one_device(struct acpi_device *device, + + strcpy(acpi_device_name(device), ACPI_VIDEO_DEVICE_NAME); + strcpy(acpi_device_class(device), ACPI_VIDEO_CLASS); +- acpi_driver_data(device) = data; ++ device->driver_data = data; + + data->device_id = device_id; + data->video = video; +@@ -1982,7 +1982,7 @@ static int acpi_video_bus_add(struct acpi_device *device) + video->device = device; + strcpy(acpi_device_name(device), ACPI_VIDEO_BUS_NAME); + strcpy(acpi_device_class(device), ACPI_VIDEO_CLASS); +- acpi_driver_data(device) = video; ++ device->driver_data = video; + + acpi_video_bus_find_cap(video); + error = acpi_video_bus_check(video); +@@ -2058,7 +2058,7 @@ static int acpi_video_bus_add(struct acpi_device *device) + acpi_video_bus_remove_fs(device); + err_free_video: + kfree(video); +- acpi_driver_data(device) = NULL; ++ device->driver_data = NULL; + + return error; + } +diff --git a/drivers/misc/asus-laptop.c b/drivers/misc/asus-laptop.c +index 7c6dfd0..de82f2f 100644 +--- a/drivers/misc/asus-laptop.c ++++ b/drivers/misc/asus-laptop.c +@@ -996,7 +996,7 @@ static int asus_hotk_add(struct acpi_device *device) + hotk->handle = device->handle; + strcpy(acpi_device_name(device), ASUS_HOTK_DEVICE_NAME); + strcpy(acpi_device_class(device), ASUS_HOTK_CLASS); +- acpi_driver_data(device) = hotk; ++ device->driver_data = hotk; + hotk->device = device; + + result = asus_hotk_check(); +diff --git a/drivers/misc/eeepc-laptop.c b/drivers/misc/eeepc-laptop.c +index 1ee8501..c124705 100644 +--- a/drivers/misc/eeepc-laptop.c ++++ b/drivers/misc/eeepc-laptop.c +@@ -411,7 +411,7 @@ static int eeepc_hotk_add(struct acpi_device *device) + ehotk->handle = device->handle; + strcpy(acpi_device_name(device), EEEPC_HOTK_DEVICE_NAME); + strcpy(acpi_device_class(device), EEEPC_HOTK_CLASS); +- acpi_driver_data(device) = ehotk; ++ device->driver_data = ehotk; + ehotk->device = device; + result = eeepc_hotk_check(); + if (result) +diff --git a/drivers/misc/fujitsu-laptop.c b/drivers/misc/fujitsu-laptop.c +index 3e56203..7b69cfb 100644 +--- a/drivers/misc/fujitsu-laptop.c ++++ b/drivers/misc/fujitsu-laptop.c +@@ -490,7 +490,7 @@ static int acpi_fujitsu_add(struct acpi_device *device) + fujitsu->acpi_handle = device->handle; + sprintf(acpi_device_name(device), "%s", ACPI_FUJITSU_DEVICE_NAME); + sprintf(acpi_device_class(device), "%s", ACPI_FUJITSU_CLASS); +- acpi_driver_data(device) = fujitsu; ++ device->driver_data = fujitsu; + + status = acpi_install_notify_handler(device->handle, + ACPI_DEVICE_NOTIFY, +@@ -703,7 +703,7 @@ static int acpi_fujitsu_hotkey_add(struct acpi_device *device) + sprintf(acpi_device_name(device), "%s", + ACPI_FUJITSU_HOTKEY_DEVICE_NAME); + sprintf(acpi_device_class(device), "%s", ACPI_FUJITSU_CLASS); +- acpi_driver_data(device) = fujitsu_hotkey; ++ device->driver_data = fujitsu_hotkey; + + status = acpi_install_notify_handler(device->handle, + ACPI_DEVICE_NOTIFY, +diff --git a/drivers/misc/intel_menlow.c b/drivers/misc/intel_menlow.c +index 80a1363..cd3ea7f 100644 +--- a/drivers/misc/intel_menlow.c ++++ b/drivers/misc/intel_menlow.c +@@ -175,7 +175,7 @@ static int intel_menlow_memory_add(struct acpi_device *device) + goto end; + } + +- acpi_driver_data(device) = cdev; ++ device->driver_data = cdev; + result = sysfs_create_link(&device->dev.kobj, + &cdev->device.kobj, "thermal_cooling"); + if (result) +diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c +index 6b93007..62aebaa 100644 +--- a/drivers/misc/thinkpad_acpi.c ++++ b/drivers/misc/thinkpad_acpi.c +@@ -543,7 +543,7 @@ static int __init setup_acpi_notify(struct ibm_struct *ibm) + return -ENODEV; + } + +- acpi_driver_data(ibm->acpi->device) = ibm; ++ ibm->acpi->device->driver_data = ibm; + sprintf(acpi_device_class(ibm->acpi->device), "%s/%s", + TPACPI_ACPI_EVENT_PREFIX, + ibm->name); +diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h +index a5ac0bc..4768246 100644 +--- a/include/acpi/acpi_bus.h ++++ b/include/acpi/acpi_bus.h +@@ -300,7 +300,11 @@ struct acpi_device { + enum acpi_bus_removal_type removal_type; /* indicate for different removal type */ + }; + +-#define acpi_driver_data(d) ((d)->driver_data) ++static inline void *acpi_driver_data(struct acpi_device *d) ++{ ++ return d->driver_data; ++} ++ + #define to_acpi_device(d) container_of(d, struct acpi_device, dev) + #define to_acpi_driver(d) container_of(d, struct acpi_driver, drv) + +-- +1.5.6.5 + diff --git a/releases/upstream/2.6.28-rc1/0002-ACPI-thinkpad-acpi-attempt-to-preserve-fan-state-o.patch b/releases/upstream/2.6.28-rc1/0002-ACPI-thinkpad-acpi-attempt-to-preserve-fan-state-o.patch new file mode 100644 index 00000000000..f26c96b6f0b --- /dev/null +++ b/releases/upstream/2.6.28-rc1/0002-ACPI-thinkpad-acpi-attempt-to-preserve-fan-state-o.patch @@ -0,0 +1,98 @@ +From 75700e53cd14ccc7a5a42547497dff11fe209186 Mon Sep 17 00:00:00 2001 +From: Henrique de Moraes Holschuh +Date: Sat, 18 Oct 2008 14:23:52 -0300 +Subject: ACPI: thinkpad-acpi: attempt to preserve fan state on resume + +Attempt to preserve fan state across sleep and hibernation if the fan +control mode is enabled. + +For safety reasons, only the PWM OFF (fan at 100%) or maximum +closed-loop level (level 7) are preserved. If the fan state was set +to anything else, it will not be restored. + +Also, should the fan be at PWM OFF mode at resume, it will be left at +that state (but this is extremely unlikely, no ThinkPad firmware was +ever reported to do this). + +For reference, the known states used for fan control upon resume by +the firmware are either "auto" or "level 7" depending on whether the +laptop wakes due to normal conditions or a thermal emergency. + +Fixes: http://bugzilla.kernel.org/show_bug.cgi?id=11331 + +Signed-off-by: Henrique de Moraes Holschuh +Cc: Richard Hartmann +Signed-off-by: Len Brown +--- + drivers/misc/thinkpad_acpi.c | 48 ++++++++++++++++++++++++++++++++++++++++++ + 1 files changed, 48 insertions(+), 0 deletions(-) + +diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c +index 6b93007..1dcf066 100644 +--- a/drivers/misc/thinkpad_acpi.c ++++ b/drivers/misc/thinkpad_acpi.c +@@ -5983,6 +5983,52 @@ static void fan_exit(void) + flush_workqueue(tpacpi_wq); + } + ++static void fan_suspend(pm_message_t state) ++{ ++ if (!fan_control_allowed) ++ return; ++ ++ /* Store fan status in cache */ ++ fan_get_status_safe(NULL); ++ if (tp_features.fan_ctrl_status_undef) ++ fan_control_desired_level = TP_EC_FAN_AUTO; ++} ++ ++static void fan_resume(void) ++{ ++ u8 saved_fan_level; ++ u8 current_level = 7; ++ bool do_set = false; ++ ++ /* DSDT *always* updates status on resume */ ++ tp_features.fan_ctrl_status_undef = 0; ++ ++ saved_fan_level = fan_control_desired_level; ++ if (!fan_control_allowed || ++ (fan_get_status_safe(¤t_level) < 0)) ++ return; ++ ++ switch (fan_control_access_mode) { ++ case TPACPI_FAN_WR_ACPI_SFAN: ++ do_set = (saved_fan_level > current_level); ++ break; ++ case TPACPI_FAN_WR_ACPI_FANS: ++ case TPACPI_FAN_WR_TPEC: ++ do_set = ((saved_fan_level & TP_EC_FAN_FULLSPEED) || ++ (saved_fan_level == 7 && ++ !(current_level & TP_EC_FAN_FULLSPEED))); ++ break; ++ default: ++ return; ++ } ++ if (do_set) { ++ printk(TPACPI_NOTICE ++ "restoring fan level to 0x%02x\n", ++ saved_fan_level); ++ fan_set_level_safe(saved_fan_level); ++ } ++} ++ + static int fan_read(char *p) + { + int len = 0; +@@ -6174,6 +6220,8 @@ static struct ibm_struct fan_driver_data = { + .read = fan_read, + .write = fan_write, + .exit = fan_exit, ++ .suspend = fan_suspend, ++ .resume = fan_resume, + }; + + /**************************************************************************** +-- +1.5.6.5 + diff --git a/releases/upstream/2.6.28-rc1/0003-ACPI-thinkpad-acpi-trivial-fix-of-error-message.patch b/releases/upstream/2.6.28-rc1/0003-ACPI-thinkpad-acpi-trivial-fix-of-error-message.patch new file mode 100644 index 00000000000..fee490db247 --- /dev/null +++ b/releases/upstream/2.6.28-rc1/0003-ACPI-thinkpad-acpi-trivial-fix-of-error-message.patch @@ -0,0 +1,32 @@ +From 4f778b92c9d8d87c670fc063c66edf1aa46f6f1c Mon Sep 17 00:00:00 2001 +From: Mariusz Kozlowski +Date: Sat, 18 Oct 2008 14:23:53 -0300 +Subject: ACPI: thinkpad-acpi: trivial fix of error message + +Trivial fix makes the error message match the code before it (ibm->driver +vs ibm->acpi-driver) better. + +Signed-off-by: Mariusz Kozlowski +Acked-by: Henrique de Moraes Holschuh +Signed-off-by: Len Brown +--- + drivers/misc/thinkpad_acpi.c | 3 ++- + 1 files changed, 2 insertions(+), 1 deletions(-) + +diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c +index 1dcf066..6c9b6c8 100644 +--- a/drivers/misc/thinkpad_acpi.c ++++ b/drivers/misc/thinkpad_acpi.c +@@ -582,7 +582,8 @@ static int __init register_tpacpi_subdriver(struct ibm_struct *ibm) + + ibm->acpi->driver = kzalloc(sizeof(struct acpi_driver), GFP_KERNEL); + if (!ibm->acpi->driver) { +- printk(TPACPI_ERR "kzalloc(ibm->driver) failed\n"); ++ printk(TPACPI_ERR ++ "failed to allocate memory for ibm->acpi->driver\n"); + return -ENOMEM; + } + +-- +1.5.6.5 + diff --git a/releases/upstream/2.6.28-rc1/0004-ACPI-thinkpad-acpi-Remove-duplicate-line.patch b/releases/upstream/2.6.28-rc1/0004-ACPI-thinkpad-acpi-Remove-duplicate-line.patch new file mode 100644 index 00000000000..06e9c6f0a6b --- /dev/null +++ b/releases/upstream/2.6.28-rc1/0004-ACPI-thinkpad-acpi-Remove-duplicate-line.patch @@ -0,0 +1,27 @@ +From 396293237cbc964fcedd4208cbc0d0f4880a98bb Mon Sep 17 00:00:00 2001 +From: Pascal Terjan +Date: Sat, 18 Oct 2008 14:23:54 -0300 +Subject: ACPI: thinkpad-acpi: Remove duplicate line + +Signed-off-by: Pascal Terjan +Acked-by: Henrique de Moraes Holschuh +Signed-off-by: Len Brown +--- + drivers/misc/thinkpad_acpi.c | 1 - + 1 files changed, 0 insertions(+), 1 deletions(-) + +diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c +index 6c9b6c8..4c47f9b 100644 +--- a/drivers/misc/thinkpad_acpi.c ++++ b/drivers/misc/thinkpad_acpi.c +@@ -159,7 +159,6 @@ enum { + #define TPACPI_DEBUG KERN_DEBUG TPACPI_LOG + + #define TPACPI_DBG_ALL 0xffff +-#define TPACPI_DBG_ALL 0xffff + #define TPACPI_DBG_INIT 0x0001 + #define TPACPI_DBG_EXIT 0x0002 + #define dbg_printk(a_dbg_level, format, arg...) \ +-- +1.5.6.5 + diff --git a/releases/upstream/2.6.28-rc1/0005-ACPI-thinkpad-acpi-Remove-firmware-backlight-delay.patch b/releases/upstream/2.6.28-rc1/0005-ACPI-thinkpad-acpi-Remove-firmware-backlight-delay.patch new file mode 100644 index 00000000000..fae18c29e16 --- /dev/null +++ b/releases/upstream/2.6.28-rc1/0005-ACPI-thinkpad-acpi-Remove-firmware-backlight-delay.patch @@ -0,0 +1,58 @@ +From d64c81c4cea0a14e88fc76e2c845e4885e491754 Mon Sep 17 00:00:00 2001 +From: Henrique de Moraes Holschuh +Date: Sat, 18 Oct 2008 14:23:55 -0300 +Subject: ACPI: thinkpad-acpi: Remove firmware backlight delays for Intel ACPI IGD OpRegion + +Based on analysis and a patch from Matthew Garrett . + +Instruct the ThinkPad ACPI firmware to remove delays on the processing of +backlight brightness changes. This method is present on ThinkPad +Vista-compatible BIOSes with standard ACPI backlight level control. + +Signed-off-by: Henrique de Moraes Holschuh +Cc: Matthew Garrett +Cc: Yves-Alexis Perez +Signed-off-by: Len Brown +--- + drivers/misc/thinkpad_acpi.c | 11 +++++++++++ + 1 files changed, 11 insertions(+), 0 deletions(-) + +diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c +index 4c47f9b..17b8281 100644 +--- a/drivers/misc/thinkpad_acpi.c ++++ b/drivers/misc/thinkpad_acpi.c +@@ -838,6 +838,13 @@ static int parse_strtoul(const char *buf, + return 0; + } + ++static void tpacpi_disable_brightness_delay(void) ++{ ++ if (acpi_evalf(hkey_handle, NULL, "PWMS", "qvd", 0)) ++ printk(TPACPI_NOTICE ++ "ACPI backlight control delay disabled\n"); ++} ++ + static int __init tpacpi_query_bcl_levels(acpi_handle handle) + { + struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; +@@ -2139,6 +2146,8 @@ static int __init hotkey_init(struct ibm_init_struct *iibm) + if (!tp_features.hotkey) + return 1; + ++ tpacpi_disable_brightness_delay(); ++ + hotkey_dev_attributes = create_attr_set(13, NULL); + if (!hotkey_dev_attributes) + return -ENOMEM; +@@ -2512,6 +2521,8 @@ static void hotkey_suspend(pm_message_t state) + + static void hotkey_resume(void) + { ++ tpacpi_disable_brightness_delay(); ++ + if (hotkey_mask_get()) + printk(TPACPI_ERR + "error while trying to read hot key mask " +-- +1.5.6.5 + -- 2.11.4.GIT