From 208c70a45624400fafd7511b96bc426bf01f8f5e Mon Sep 17 00:00:00 2001 From: Alexey Starikovskiy Date: Thu, 14 Feb 2008 15:58:47 -0500 Subject: ACPI: EC: Use proper handle for boot EC Fall back to ACPI_ROOT_HANDLE only in case of error. ACPI: EC: EC description table is found, configuring boot EC ACPI Error (evregion-0316): No handler for Region [ECOR] (ffff81007a651620) [EmbeddedControl] [20070126] ACPI Error (exfldio-0289): Region EmbeddedControl(3) has no handler [20070126] http://bugzilla.kernel.org/show_bug.cgi?id=9916 Signed-off-by: Alexey Starikovskiy Signed-off-by: Len Brown --- drivers/acpi/ec.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c index 7222a18a031..caf873c14bf 100644 --- a/drivers/acpi/ec.c +++ b/drivers/acpi/ec.c @@ -943,7 +943,11 @@ int __init acpi_ec_ecdt_probe(void) boot_ec->command_addr = ecdt_ptr->control.address; boot_ec->data_addr = ecdt_ptr->data.address; boot_ec->gpe = ecdt_ptr->gpe; - boot_ec->handle = ACPI_ROOT_OBJECT; + if (ACPI_FAILURE(acpi_get_handle(NULL, ecdt_ptr->id, + &boot_ec->handle))) { + pr_info("Failed to locate handle for boot EC\n"); + boot_ec->handle = ACPI_ROOT_OBJECT; + } } else { /* This workaround is needed only on some broken machines, * which require early EC, but fail to provide ECDT */ -- cgit v1.2.3 From 5958f1a4da39581074bab50cabd0a582e651b90f Mon Sep 17 00:00:00 2001 From: Randy Dunlap Date: Sun, 3 Feb 2008 15:06:25 -0800 Subject: kernel-doc: fix pci-acpi warning Fix PCI kernel-doc warning: Warning(linux-2.6.24-git12//drivers/pci/pci-acpi.c:166): No description found for parameter 'hid' Signed-off-by: Randy Dunlap Signed-off-by: Len Brown --- drivers/pci/pci-acpi.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers') diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c index e569645d59e..2f2d308c9aa 100644 --- a/drivers/pci/pci-acpi.c +++ b/drivers/pci/pci-acpi.c @@ -158,6 +158,7 @@ run_osc_out: /** * __pci_osc_support_set - register OS support to Firmware * @flags: OS support bits + * @hid: hardware ID * * Update OS support fields and doing a _OSC Query to obtain an update * from Firmware on supported control bits. -- cgit v1.2.3 From c751670902c3dd9abbed279170a832e6a1e6cf94 Mon Sep 17 00:00:00 2001 From: Thomas Sujith Date: Fri, 15 Feb 2008 00:58:50 -0500 Subject: thermal: validate input parameters Added sanity check to make sure that thermal zone and cooling device exists. Signed-off-by: Thomas Sujith Signed-off-by: Len Brown --- drivers/thermal/thermal.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/thermal/thermal.c b/drivers/thermal/thermal.c index e782b3e7fcd..5f1d318f057 100644 --- a/drivers/thermal/thermal.c +++ b/drivers/thermal/thermal.c @@ -306,12 +306,23 @@ int thermal_zone_bind_cooling_device(struct thermal_zone_device *tz, { struct thermal_cooling_device_instance *dev; struct thermal_cooling_device_instance *pos; + struct thermal_zone_device *pos1; + struct thermal_cooling_device *pos2; int result; if (trip >= tz->trips || (trip < 0 && trip != THERMAL_TRIPS_NONE)) return -EINVAL; - if (!tz || !cdev) + list_for_each_entry(pos1, &thermal_tz_list, node) { + if (pos1 == tz) + break; + } + list_for_each_entry(pos2, &thermal_cdev_list, node) { + if (pos2 == cdev) + break; + } + + if (tz != pos1 || cdev != pos2) return -EINVAL; dev = -- cgit v1.2.3 From 3e6fda5c1159823fc02463eceb564c8bfc0e7a0e Mon Sep 17 00:00:00 2001 From: Thomas Sujith Date: Fri, 15 Feb 2008 00:59:50 -0500 Subject: thermal: use ERR_PTR for returning error Need to return using ERR_PTR instead of NULL in case of errors. Signed-off-by: Thomas Sujith Signed-off-by: Len Brown --- drivers/thermal/thermal.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'drivers') diff --git a/drivers/thermal/thermal.c b/drivers/thermal/thermal.c index 5f1d318f057..8b86e53ccf7 100644 --- a/drivers/thermal/thermal.c +++ b/drivers/thermal/thermal.c @@ -448,20 +448,20 @@ struct thermal_cooling_device *thermal_cooling_device_register(char *type, int result; if (strlen(type) >= THERMAL_NAME_LENGTH) - return NULL; + return ERR_PTR(-EINVAL); if (!ops || !ops->get_max_state || !ops->get_cur_state || !ops->set_cur_state) - return NULL; + return ERR_PTR(-EINVAL); cdev = kzalloc(sizeof(struct thermal_cooling_device), GFP_KERNEL); if (!cdev) - return NULL; + return ERR_PTR(-ENOMEM); result = get_idr(&thermal_cdev_idr, &thermal_idr_lock, &cdev->id); if (result) { kfree(cdev); - return NULL; + return ERR_PTR(result); } strcpy(cdev->type, type); @@ -473,7 +473,7 @@ struct thermal_cooling_device *thermal_cooling_device_register(char *type, if (result) { release_idr(&thermal_cdev_idr, &thermal_idr_lock, cdev->id); kfree(cdev); - return NULL; + return ERR_PTR(result); } /* sys I/F */ @@ -509,7 +509,7 @@ struct thermal_cooling_device *thermal_cooling_device_register(char *type, unregister: release_idr(&thermal_cdev_idr, &thermal_idr_lock, cdev->id); device_unregister(&cdev->device); - return NULL; + return ERR_PTR(result); } EXPORT_SYMBOL(thermal_cooling_device_register); @@ -581,17 +581,17 @@ struct thermal_zone_device *thermal_zone_device_register(char *type, int count; if (strlen(type) >= THERMAL_NAME_LENGTH) - return NULL; + return ERR_PTR(-EINVAL); if (trips > THERMAL_MAX_TRIPS || trips < 0) - return NULL; + return ERR_PTR(-EINVAL); if (!ops || !ops->get_temp) - return NULL; + return ERR_PTR(-EINVAL); tz = kzalloc(sizeof(struct thermal_zone_device), GFP_KERNEL); if (!tz) - return NULL; + return ERR_PTR(-ENOMEM); INIT_LIST_HEAD(&tz->cooling_devices); idr_init(&tz->idr); @@ -599,7 +599,7 @@ struct thermal_zone_device *thermal_zone_device_register(char *type, result = get_idr(&thermal_tz_idr, &thermal_idr_lock, &tz->id); if (result) { kfree(tz); - return NULL; + return ERR_PTR(result); } strcpy(tz->type, type); @@ -612,7 +612,7 @@ struct thermal_zone_device *thermal_zone_device_register(char *type, if (result) { release_idr(&thermal_tz_idr, &thermal_idr_lock, tz->id); kfree(tz); - return NULL; + return ERR_PTR(result); } /* sys I/F */ @@ -654,7 +654,7 @@ struct thermal_zone_device *thermal_zone_device_register(char *type, unregister: release_idr(&thermal_tz_idr, &thermal_idr_lock, tz->id); device_unregister(&tz->device); - return NULL; + return ERR_PTR(result); } EXPORT_SYMBOL(thermal_zone_device_register); -- cgit v1.2.3 From 19b36780ee7ddeb5080e3f1f858a83c4824f1fdc Mon Sep 17 00:00:00 2001 From: Thomas Sujith Date: Fri, 15 Feb 2008 01:01:52 -0500 Subject: ACPI fan: extract return values using PTR_ERR Need to extract errors using PTR_ERR macro and process accordingly. thermal_cooling_device_register returning NULL means that CONFIG_THERMAL=n and in that case no need to create symbolic links. Signed-off-by: Thomas Sujith Signed-off-by: Len Brown --- drivers/acpi/fan.c | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) (limited to 'drivers') diff --git a/drivers/acpi/fan.c b/drivers/acpi/fan.c index 48cb705b274..c8e3cba423e 100644 --- a/drivers/acpi/fan.c +++ b/drivers/acpi/fan.c @@ -256,22 +256,28 @@ static int acpi_fan_add(struct acpi_device *device) cdev = thermal_cooling_device_register("Fan", device, &fan_cooling_ops); - if (cdev) + if (IS_ERR(cdev)) { + result = PTR_ERR(cdev); + goto end; + } + if (cdev) { printk(KERN_INFO PREFIX "%s is registered as cooling_device%d\n", device->dev.bus_id, cdev->id); - else - goto end; - acpi_driver_data(device) = cdev; - result = sysfs_create_link(&device->dev.kobj, &cdev->device.kobj, - "thermal_cooling"); - if (result) - return result; - result = sysfs_create_link(&cdev->device.kobj, &device->dev.kobj, - "device"); - if (result) - return result; + acpi_driver_data(device) = cdev; + result = sysfs_create_link(&device->dev.kobj, + &cdev->device.kobj, + "thermal_cooling"); + if (result) + return result; + + result = sysfs_create_link(&cdev->device.kobj, + &device->dev.kobj, + "device"); + if (result) + return result; + } result = acpi_fan_add_fs(device); if (result) -- cgit v1.2.3 From f28bb45e2863173a7464d98907677e903f42c68b Mon Sep 17 00:00:00 2001 From: Zhao Yakui Date: Fri, 15 Feb 2008 08:34:37 +0800 Subject: ACPI: thermal: Check whether cooling device exists before unregistering OS should check whether the cooling device exists before it is unregistered. If it doesn't exists, it is unnecessary to remove the sysfs link and call the function of thermal_cooling_device_unregister. http://bugzilla.kernel.org/show_bug.cgi?id=9982 Signed-off-by: Zhao Yakui Tested-by : Dhaval Giani Signed-off-by: Len Brown --- drivers/acpi/processor_core.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'drivers') diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c index 75ccf5d18bf..697335c8423 100644 --- a/drivers/acpi/processor_core.c +++ b/drivers/acpi/processor_core.c @@ -809,10 +809,12 @@ static int acpi_processor_remove(struct acpi_device *device, int type) acpi_processor_remove_fs(device); - sysfs_remove_link(&device->dev.kobj, "thermal_cooling"); - sysfs_remove_link(&pr->cdev->device.kobj, "device"); - thermal_cooling_device_unregister(pr->cdev); - pr->cdev = NULL; + if (pr->cdev) { + sysfs_remove_link(&device->dev.kobj, "thermal_cooling"); + sysfs_remove_link(&pr->cdev->device.kobj, "device"); + thermal_cooling_device_unregister(pr->cdev); + pr->cdev = NULL; + } processors[pr->id] = NULL; -- cgit v1.2.3 From d76628c67cdeebf84766a19c67c821c2e518baa4 Mon Sep 17 00:00:00 2001 From: Thomas Sujith Date: Fri, 15 Feb 2008 18:26:54 -0500 Subject: ACPI thermal: extract return values using PTR_ERR Need to extract errors using PTR_ERR macro and process accordingly.thermal_cooling_device_register returning NULL means that CONFIG_THERMAL=n and in that case no need to create symbolic links. Signed-off-by: Thomas Sujith Signed-off-by: Len Brown --- drivers/acpi/processor_core.c | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) (limited to 'drivers') diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c index 75ccf5d18bf..b02006951cd 100644 --- a/drivers/acpi/processor_core.c +++ b/drivers/acpi/processor_core.c @@ -670,21 +670,26 @@ static int __cpuinit acpi_processor_start(struct acpi_device *device) pr->cdev = thermal_cooling_device_register("Processor", device, &processor_cooling_ops); - if (pr->cdev) + if (IS_ERR(pr->cdev)) { + result = PTR_ERR(pr->cdev); + goto end; + } + if (pr->cdev) { printk(KERN_INFO PREFIX "%s is registered as cooling_device%d\n", device->dev.bus_id, pr->cdev->id); - else - goto end; - result = sysfs_create_link(&device->dev.kobj, &pr->cdev->device.kobj, - "thermal_cooling"); - if (result) - return result; - result = sysfs_create_link(&pr->cdev->device.kobj, &device->dev.kobj, - "device"); - if (result) - return result; + result = sysfs_create_link(&device->dev.kobj, + &pr->cdev->device.kobj, + "thermal_cooling"); + if (result) + return result; + result = sysfs_create_link(&pr->cdev->device.kobj, + &device->dev.kobj, + "device"); + if (result) + return result; + } if (pr->flags.throttling) { printk(KERN_INFO PREFIX "%s [%s] (supports", @@ -809,10 +814,12 @@ static int acpi_processor_remove(struct acpi_device *device, int type) acpi_processor_remove_fs(device); - sysfs_remove_link(&device->dev.kobj, "thermal_cooling"); - sysfs_remove_link(&pr->cdev->device.kobj, "device"); - thermal_cooling_device_unregister(pr->cdev); - pr->cdev = NULL; + if (pr->cdev) { + sysfs_remove_link(&device->dev.kobj, "thermal_cooling"); + sysfs_remove_link(&pr->cdev->device.kobj, "device"); + thermal_cooling_device_unregister(pr->cdev); + pr->cdev = NULL; + } processors[pr->id] = NULL; -- cgit v1.2.3 From 43ff39f2f6450fa2e9a566f8bf007a26d76f2c9d Mon Sep 17 00:00:00 2001 From: Thomas Sujith Date: Fri, 15 Feb 2008 18:29:18 -0500 Subject: ACPI video: check for error from thermal_cooling_device_register Need to check whether thermal_cooling_device_register returned ERROR or not. Signed-off-by: Thomas Sujith Signed-off-by: Len Brown --- drivers/acpi/video.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'drivers') diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c index 7f714fa2a45..12cce69b544 100644 --- a/drivers/acpi/video.c +++ b/drivers/acpi/video.c @@ -731,6 +731,9 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device) device->cdev = thermal_cooling_device_register("LCD", device->dev, &video_cooling_ops); + if (IS_ERR(device->cdev)) + return; + if (device->cdev) { printk(KERN_INFO PREFIX "%s is registered as cooling_device%d\n", -- cgit v1.2.3 From 69f6b8dd6b94ac594b6920b4530a3390fb1d3fd6 Mon Sep 17 00:00:00 2001 From: Thomas Sujith Date: Fri, 15 Feb 2008 01:05:23 -0500 Subject: intel_menlo: extract return values using PTR_ERR Need to extract errors using PTR_ERR macro and process accordingly.thermal_cooling_device_register returning NULL means that CONFIG_THERMAL=n and in that case no need to create symbolic links. Signed-off-by: Thomas Sujith Signed-off-by: Len Brown --- drivers/misc/intel_menlow.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'drivers') diff --git a/drivers/misc/intel_menlow.c b/drivers/misc/intel_menlow.c index f70984ab1e1..de16e88eb8d 100644 --- a/drivers/misc/intel_menlow.c +++ b/drivers/misc/intel_menlow.c @@ -170,10 +170,13 @@ static int intel_menlow_memory_add(struct acpi_device *device) cdev = thermal_cooling_device_register("Memory controller", device, &memory_cooling_ops); - acpi_driver_data(device) = cdev; - if (!cdev) - result = -ENODEV; - else { + if (IS_ERR(cdev)) { + result = PTR_ERR(cdev); + goto end; + } + + if (cdev) { + acpi_driver_data(device) = cdev; result = sysfs_create_link(&device->dev.kobj, &cdev->device.kobj, "thermal_cooling"); if (result) -- cgit v1.2.3 From cbb14842137ff78df10038da8ca8a97917a5a926 Mon Sep 17 00:00:00 2001 From: Henrique de Moraes Holschuh Date: Sat, 16 Feb 2008 02:17:50 -0200 Subject: ACPI: thinkpad-acpi: trivial fix to module_desc typo Thanks to Damjan for noticing this one. Signed-off-by: Henrique de Moraes Holschuh Signed-off-by: Len Brown --- drivers/misc/thinkpad_acpi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c index e2c7edd206a..723d37b9e6a 100644 --- a/drivers/misc/thinkpad_acpi.c +++ b/drivers/misc/thinkpad_acpi.c @@ -5918,7 +5918,7 @@ MODULE_PARM_DESC(hotkey_report_mode, #define TPACPI_PARAM(feature) \ module_param_call(feature, set_ibm_param, NULL, NULL, 0); \ - MODULE_PARM_DESC(feature, "Simulates thinkpad-aci procfs command " \ + MODULE_PARM_DESC(feature, "Simulates thinkpad-acpi procfs command " \ "at module load, see documentation") TPACPI_PARAM(hotkey); -- cgit v1.2.3 From 1bc6b9cdd5e608f0b7e6160a823c9dcd51820410 Mon Sep 17 00:00:00 2001 From: Henrique de Moraes Holschuh Date: Sat, 16 Feb 2008 02:17:52 -0200 Subject: ACPI: thinkpad-acpi: always track input device open/close The open() and close() hooks for the input device are useful even when hotkey NVRAM polling support is not in use, so it is better to always have them around. Signed-off-by: Henrique de Moraes Holschuh Signed-off-by: Len Brown --- drivers/misc/thinkpad_acpi.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'drivers') diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c index 723d37b9e6a..6da3f40ac9f 100644 --- a/drivers/misc/thinkpad_acpi.c +++ b/drivers/misc/thinkpad_acpi.c @@ -1417,6 +1417,14 @@ static void hotkey_poll_setup_safe(int may_warn) mutex_unlock(&hotkey_mutex); } +#else /* CONFIG_THINKPAD_ACPI_HOTKEY_POLL */ + +static void hotkey_poll_setup_safe(int __unused) +{ +} + +#endif /* CONFIG_THINKPAD_ACPI_HOTKEY_POLL */ + static int hotkey_inputdev_open(struct input_dev *dev) { switch (tpacpi_lifecycle) { @@ -1444,7 +1452,6 @@ static void hotkey_inputdev_close(struct input_dev *dev) if (tpacpi_lifecycle == TPACPI_LIFE_RUNNING) hotkey_poll_setup_safe(0); } -#endif /* CONFIG_THINKPAD_ACPI_HOTKEY_POLL */ /* sysfs hotkey enable ------------------------------------------------- */ static ssize_t hotkey_enable_show(struct device *dev, @@ -2023,12 +2030,10 @@ static int __init hotkey_init(struct ibm_init_struct *iibm) (hotkey_report_mode < 2) ? "enabled" : "disabled"); -#ifdef CONFIG_THINKPAD_ACPI_HOTKEY_POLL tpacpi_inputdev->open = &hotkey_inputdev_open; tpacpi_inputdev->close = &hotkey_inputdev_close; hotkey_poll_setup_safe(1); -#endif } return (tp_features.hotkey)? 0 : 1; @@ -2221,9 +2226,7 @@ static void hotkey_resume(void) hotkey_radio_sw_notify_change(); hotkey_wakeup_reason_notify_change(); hotkey_wakeup_hotunplug_complete_notify_change(); -#ifdef CONFIG_THINKPAD_ACPI_HOTKEY_POLL hotkey_poll_setup_safe(0); -#endif } /* procfs -------------------------------------------------------------- */ -- cgit v1.2.3 From 7526696a013f33d4926fdc080c26fe6af07ba30f Mon Sep 17 00:00:00 2001 From: Henrique de Moraes Holschuh Date: Sat, 16 Feb 2008 02:17:53 -0200 Subject: ACPI: thinkpad-acpi: synchronize input device switches Issue EV_SW events at module init time to synchronize the input device with the current state of the switch, otherwise we might lose the first event. Signed-off-by: Henrique de Moraes Holschuh Signed-off-by: Len Brown --- drivers/misc/thinkpad_acpi.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers') diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c index 6da3f40ac9f..02f94651658 100644 --- a/drivers/misc/thinkpad_acpi.c +++ b/drivers/misc/thinkpad_acpi.c @@ -2034,6 +2034,7 @@ static int __init hotkey_init(struct ibm_init_struct *iibm) tpacpi_inputdev->close = &hotkey_inputdev_close; hotkey_poll_setup_safe(1); + tpacpi_input_send_radiosw(); } return (tp_features.hotkey)? 0 : 1; -- cgit v1.2.3 From d7c1d17dfed996e84212fc1ce617b2586dd70ec2 Mon Sep 17 00:00:00 2001 From: Henrique de Moraes Holschuh Date: Sat, 16 Feb 2008 02:17:54 -0200 Subject: ACPI: thinkpad-acpi: make the video output feature optional The video output port control feature is not very useful on many ThinkPads (especially when a X server is running), and lately userspace is getting better and better at it, so it makes sense to allow users to stripe out the thinkpad-acpi video feature from their kernels and save at least 2KB. Signed-off-by: Henrique de Moraes Holschuh Signed-off-by: Len Brown --- drivers/misc/Kconfig | 17 +++++++++++++++++ drivers/misc/thinkpad_acpi.c | 20 +++++++++++++------- 2 files changed, 30 insertions(+), 7 deletions(-) (limited to 'drivers') diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig index 1abc95ca9df..982e27b86d1 100644 --- a/drivers/misc/Kconfig +++ b/drivers/misc/Kconfig @@ -258,6 +258,23 @@ config THINKPAD_ACPI_BAY 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 "Suport NVRAM polling for hot keys" depends on THINKPAD_ACPI diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c index 02f94651658..4ea3866ddf9 100644 --- a/drivers/misc/thinkpad_acpi.c +++ b/drivers/misc/thinkpad_acpi.c @@ -301,6 +301,13 @@ TPACPI_HANDLE(hkey, ec, "\\_SB.HKEY", /* 600e/x, 770e, 770x */ "HKEY", /* all others */ ); /* 570 */ +TPACPI_HANDLE(vid, root, "\\_SB.PCI.AGP.VGA", /* 570 */ + "\\_SB.PCI0.AGP0.VID0", /* 600e/x, 770x */ + "\\_SB.PCI0.VID0", /* 770e */ + "\\_SB.PCI0.VID", /* A21e, G4x, R50e, X30, X40 */ + "\\_SB.PCI0.AGP.VID", /* all others */ + ); /* R30, R31 */ + /************************************************************************* * ACPI helpers @@ -2680,6 +2687,8 @@ static struct ibm_struct wan_driver_data = { * Video subdriver */ +#ifdef CONFIG_THINKPAD_ACPI_VIDEO + enum video_access_mode { TPACPI_VIDEO_NONE = 0, TPACPI_VIDEO_570, /* 570 */ @@ -2707,13 +2716,6 @@ static int video_orig_autosw; static int video_autosw_get(void); static int video_autosw_set(int enable); -TPACPI_HANDLE(vid, root, "\\_SB.PCI.AGP.VGA", /* 570 */ - "\\_SB.PCI0.AGP0.VID0", /* 600e/x, 770x */ - "\\_SB.PCI0.VID0", /* 770e */ - "\\_SB.PCI0.VID", /* A21e, G4x, R50e, X30, X40 */ - "\\_SB.PCI0.AGP.VID", /* all others */ - ); /* R30, R31 */ - TPACPI_HANDLE(vid2, root, "\\_SB.PCI0.AGPB.VID"); /* G41 */ static int __init video_init(struct ibm_init_struct *iibm) @@ -3023,6 +3025,8 @@ static struct ibm_struct video_driver_data = { .exit = video_exit, }; +#endif /* CONFIG_THINKPAD_ACPI_VIDEO */ + /************************************************************************* * Light (thinklight) subdriver */ @@ -5807,10 +5811,12 @@ static struct ibm_init_struct ibms_init[] __initdata = { .init = wan_init, .data = &wan_driver_data, }, +#ifdef CONFIG_THINKPAD_ACPI_VIDEO { .init = video_init, .data = &video_driver_data, }, +#endif { .init = light_init, .data = &light_driver_data, -- cgit v1.2.3 From b3ec6f911a681f38e4630ef8bf20b3d3cb0f63c2 Mon Sep 17 00:00:00 2001 From: Henrique de Moraes Holschuh Date: Sat, 16 Feb 2008 02:17:55 -0200 Subject: ACPI: thinkpad-acpi: issue input events for tablet swivel events Issue EV_SW SW_TABLET_MODE events for HKEY events 0x5009 and 0x500A on the X41t/X60t/X61t. As usual, we suppress the HKEY events on the netlink interface to avoid sending duplicate events to userspace. Signed-off-by: Henrique de Moraes Holschuh Signed-off-by: Len Brown --- drivers/misc/thinkpad_acpi.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c index 4ea3866ddf9..35483502a11 100644 --- a/drivers/misc/thinkpad_acpi.c +++ b/drivers/misc/thinkpad_acpi.c @@ -1172,6 +1172,17 @@ static void tpacpi_input_send_radiosw(void) mutex_unlock(&tpacpi_inputdev_send_mutex); } +static void tpacpi_input_send_tabletsw(unsigned int state) +{ + mutex_lock(&tpacpi_inputdev_send_mutex); + + input_report_switch(tpacpi_inputdev, + SW_TABLET_MODE, !!state); + input_sync(tpacpi_inputdev); + + mutex_unlock(&tpacpi_inputdev_send_mutex); +} + static void tpacpi_input_send_key(unsigned int scancode) { unsigned int keycode; @@ -2020,6 +2031,10 @@ static int __init hotkey_init(struct ibm_init_struct *iibm) set_bit(EV_SW, tpacpi_inputdev->evbit); set_bit(SW_RADIO, tpacpi_inputdev->swbit); } + if (thinkpad_id.vendor == PCI_VENDOR_ID_LENOVO) { + set_bit(EV_SW, tpacpi_inputdev->evbit); + set_bit(SW_TABLET_MODE, tpacpi_inputdev->swbit); + } dbg_printk(TPACPI_DBG_INIT, "enabling hot key handling\n"); @@ -2169,11 +2184,14 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event) /* 0x5000-0x5FFF: human interface helpers */ switch (hkey) { case 0x5010: /* Lenovo new BIOS: brightness changed */ - case 0x5009: /* X61t: swivel up (tablet mode) */ - case 0x500a: /* X61t: swivel down (normal mode) */ case 0x500b: /* X61t: tablet pen inserted into bay */ case 0x500c: /* X61t: tablet pen removed from bay */ break; + case 0x5009: /* X61t: swivel up (tablet mode) */ + case 0x500a: /* X61t: swivel down (normal mode) */ + tpacpi_input_send_tabletsw((hkey == 0x5009)); + send_acpi_ev = 0; + break; case 0x5001: case 0x5002: /* LID switch events. Do not propagate */ -- cgit v1.2.3 From d147da73c9a3f617e4685c6a7762961fe19833e7 Mon Sep 17 00:00:00 2001 From: Henrique de Moraes Holschuh Date: Sat, 16 Feb 2008 02:17:57 -0200 Subject: ACPI: thinkpad-acpi: minor hotkey_radio_sw fixes Fixes some minor points in the radio switch code and docs. Signed-off-by: Henrique de Moraes Holschuh Signed-off-by: Len Brown --- drivers/misc/thinkpad_acpi.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers') diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c index 35483502a11..c119cf23e1f 100644 --- a/drivers/misc/thinkpad_acpi.c +++ b/drivers/misc/thinkpad_acpi.c @@ -1161,15 +1161,15 @@ static void tpacpi_input_send_radiosw(void) { int wlsw; - mutex_lock(&tpacpi_inputdev_send_mutex); - if (tp_features.hotkey_wlsw && !hotkey_get_wlsw(&wlsw)) { + mutex_lock(&tpacpi_inputdev_send_mutex); + input_report_switch(tpacpi_inputdev, SW_RADIO, !!wlsw); input_sync(tpacpi_inputdev); - } - mutex_unlock(&tpacpi_inputdev_send_mutex); + mutex_unlock(&tpacpi_inputdev_send_mutex); + } } static void tpacpi_input_send_tabletsw(unsigned int state) -- cgit v1.2.3 From 6c231bd5eb07ce546517019f334652b9ecfc329a Mon Sep 17 00:00:00 2001 From: Henrique de Moraes Holschuh Date: Sat, 16 Feb 2008 02:17:58 -0200 Subject: ACPI: thinkpad-acpi: add tablet-mode reporting A quick study of the 0x5009/0x500A HKEY event on the X61t DSDT revealed the existence of the EC HTAB register (EC 0x0f, bit 7), and a compare with the X41t DSDT shows that HKEY.MHKG can be used to verify if the ThinkPad is tablet-capable (MHKG present), and in tablet mode (bit 3 of MHKG return is set). Add an attribute to report this information, "hotkey_tablet_mode". This attribute has poll()/select() support, and can be used along with EV_SW SW_TABLET_MODE to hook userspace to tablet events. Signed-off-by: Henrique de Moraes Holschuh Signed-off-by: Len Brown --- drivers/misc/thinkpad_acpi.c | 79 ++++++++++++++++++++++++++++++++++++++------ 1 file changed, 68 insertions(+), 11 deletions(-) (limited to 'drivers') diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c index c119cf23e1f..bb269d0c677 100644 --- a/drivers/misc/thinkpad_acpi.c +++ b/drivers/misc/thinkpad_acpi.c @@ -221,6 +221,7 @@ static struct { u32 hotkey:1; u32 hotkey_mask:1; u32 hotkey_wlsw:1; + u32 hotkey_tablet:1; u32 light:1; u32 light_status:1; u32 bright_16levels:1; @@ -1060,6 +1061,9 @@ static struct attribute_set *hotkey_dev_attributes; #define HOTKEY_CONFIG_CRITICAL_END #endif /* CONFIG_THINKPAD_ACPI_HOTKEY_POLL */ +/* HKEY.MHKG() return bits */ +#define TP_HOTKEY_TABLET_MASK (1 << 3) + static int hotkey_get_wlsw(int *status) { if (!acpi_evalf(hkey_handle, status, "WLSW", "d")) @@ -1067,6 +1071,16 @@ static int hotkey_get_wlsw(int *status) return 0; } +static int hotkey_get_tablet_mode(int *status) +{ + int s; + + if (!acpi_evalf(hkey_handle, &s, "MHKG", "d")) + return -EIO; + + return ((s & TP_HOTKEY_TABLET_MASK) != 0); +} + /* * Call with hotkey_mutex held */ @@ -1172,15 +1186,20 @@ static void tpacpi_input_send_radiosw(void) } } -static void tpacpi_input_send_tabletsw(unsigned int state) +static void tpacpi_input_send_tabletsw(void) { - mutex_lock(&tpacpi_inputdev_send_mutex); + int state; - input_report_switch(tpacpi_inputdev, - SW_TABLET_MODE, !!state); - input_sync(tpacpi_inputdev); + if (tp_features.hotkey_tablet && + !hotkey_get_tablet_mode(&state)) { + mutex_lock(&tpacpi_inputdev_send_mutex); - mutex_unlock(&tpacpi_inputdev_send_mutex); + input_report_switch(tpacpi_inputdev, + SW_TABLET_MODE, !!state); + input_sync(tpacpi_inputdev); + + mutex_unlock(&tpacpi_inputdev_send_mutex); + } } static void tpacpi_input_send_key(unsigned int scancode) @@ -1691,6 +1710,29 @@ static void hotkey_radio_sw_notify_change(void) "hotkey_radio_sw"); } +/* sysfs hotkey tablet mode (pollable) --------------------------------- */ +static ssize_t hotkey_tablet_mode_show(struct device *dev, + struct device_attribute *attr, + char *buf) +{ + int res, s; + res = hotkey_get_tablet_mode(&s); + if (res < 0) + return res; + + return snprintf(buf, PAGE_SIZE, "%d\n", !!s); +} + +static struct device_attribute dev_attr_hotkey_tablet_mode = + __ATTR(hotkey_tablet_mode, S_IRUGO, hotkey_tablet_mode_show, NULL); + +static void hotkey_tablet_mode_notify_change(void) +{ + if (tp_features.hotkey_tablet) + sysfs_notify(&tpacpi_pdev->dev.kobj, NULL, + "hotkey_tablet_mode"); +} + /* sysfs hotkey report_mode -------------------------------------------- */ static ssize_t hotkey_report_mode_show(struct device *dev, struct device_attribute *attr, @@ -1903,7 +1945,7 @@ static int __init hotkey_init(struct ibm_init_struct *iibm) str_supported(tp_features.hotkey)); if (tp_features.hotkey) { - hotkey_dev_attributes = create_attr_set(12, NULL); + hotkey_dev_attributes = create_attr_set(13, NULL); if (!hotkey_dev_attributes) return -ENOMEM; res = add_many_to_attr_set(hotkey_dev_attributes, @@ -1982,6 +2024,18 @@ static int __init hotkey_init(struct ibm_init_struct *iibm) &dev_attr_hotkey_radio_sw.attr); } + /* For X41t, X60t, X61t Tablets... */ + if (!res && acpi_evalf(hkey_handle, &status, "MHKG", "qd")) { + tp_features.hotkey_tablet = 1; + printk(TPACPI_INFO + "possible tablet mode switch found; " + "ThinkPad in %s mode\n", + (status & TP_HOTKEY_TABLET_MASK)? + "tablet" : "laptop"); + res = add_to_attr_set(hotkey_dev_attributes, + &dev_attr_hotkey_tablet_mode.attr); + } + if (!res) res = register_attr_set_with_sysfs( hotkey_dev_attributes, @@ -2031,7 +2085,7 @@ static int __init hotkey_init(struct ibm_init_struct *iibm) set_bit(EV_SW, tpacpi_inputdev->evbit); set_bit(SW_RADIO, tpacpi_inputdev->swbit); } - if (thinkpad_id.vendor == PCI_VENDOR_ID_LENOVO) { + if (tp_features.hotkey_tablet) { set_bit(EV_SW, tpacpi_inputdev->evbit); set_bit(SW_TABLET_MODE, tpacpi_inputdev->swbit); } @@ -2057,6 +2111,7 @@ static int __init hotkey_init(struct ibm_init_struct *iibm) hotkey_poll_setup_safe(1); tpacpi_input_send_radiosw(); + tpacpi_input_send_tabletsw(); } return (tp_features.hotkey)? 0 : 1; @@ -2187,9 +2242,10 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event) case 0x500b: /* X61t: tablet pen inserted into bay */ case 0x500c: /* X61t: tablet pen removed from bay */ break; - case 0x5009: /* X61t: swivel up (tablet mode) */ - case 0x500a: /* X61t: swivel down (normal mode) */ - tpacpi_input_send_tabletsw((hkey == 0x5009)); + 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: @@ -2250,6 +2306,7 @@ static void hotkey_resume(void) "from firmware\n"); tpacpi_input_send_radiosw(); hotkey_radio_sw_notify_change(); + hotkey_tablet_mode_notify_change(); hotkey_wakeup_reason_notify_change(); hotkey_wakeup_hotunplug_complete_notify_change(); hotkey_poll_setup_safe(0); -- cgit v1.2.3 From 4fd7f5188c377c1e9aa8f224f6edf96d170a7d32 Mon Sep 17 00:00:00 2001 From: Harvey Harrison Date: Fri, 15 Feb 2008 17:07:19 -0800 Subject: ACPI: sparse fix, replace macro with static function replace acpi_util_eval_error macro with static function. Avoid these sparse warnings due to using buffer within the macro. drivers/acpi/utils.c:273:3: warning: symbol 'buffer' shadows an earlier one drivers/acpi/utils.c:259:21: originally declared here drivers/acpi/utils.c:279:3: warning: symbol 'buffer' shadows an earlier one drivers/acpi/utils.c:259:21: originally declared here drivers/acpi/utils.c:368:3: warning: symbol 'buffer' shadows an earlier one drivers/acpi/utils.c:348:21: originally declared here drivers/acpi/utils.c:375:3: warning: symbol 'buffer' shadows an earlier one drivers/acpi/utils.c:348:21: originally declared here drivers/acpi/utils.c:382:3: warning: symbol 'buffer' shadows an earlier one drivers/acpi/utils.c:348:21: originally declared here drivers/acpi/utils.c:402:4: warning: symbol 'buffer' shadows an earlier one drivers/acpi/utils.c:348:21: originally declared here Signed-off-by: Harvey Harrison Signed-off-by: Len Brown --- drivers/acpi/utils.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'drivers') diff --git a/drivers/acpi/utils.c b/drivers/acpi/utils.c index 34f15757108..eba55b7d6c9 100644 --- a/drivers/acpi/utils.c +++ b/drivers/acpi/utils.c @@ -36,16 +36,20 @@ ACPI_MODULE_NAME("utils"); /* -------------------------------------------------------------------------- Object Evaluation Helpers -------------------------------------------------------------------------- */ +static void +acpi_util_eval_error(acpi_handle h, acpi_string p, acpi_status s) +{ #ifdef ACPI_DEBUG_OUTPUT -#define acpi_util_eval_error(h,p,s) {\ - char prefix[80] = {'\0'};\ - struct acpi_buffer buffer = {sizeof(prefix), prefix};\ - acpi_get_name(h, ACPI_FULL_PATHNAME, &buffer);\ - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Evaluate [%s.%s]: %s\n",\ - (char *) prefix, p, acpi_format_exception(s))); } + char prefix[80] = {'\0'}; + struct acpi_buffer buffer = {sizeof(prefix), prefix}; + acpi_get_name(h, ACPI_FULL_PATHNAME, &buffer); + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Evaluate [%s.%s]: %s\n", + (char *) prefix, p, acpi_format_exception(s))); #else -#define acpi_util_eval_error(h,p,s) + return; #endif +} + acpi_status acpi_extract_package(union acpi_object *package, struct acpi_buffer *format, struct acpi_buffer *buffer) -- cgit v1.2.3 From 262ee35be6a3aae9b4a7aafafc2dba901fc36620 Mon Sep 17 00:00:00 2001 From: Carlos Corbacho Date: Sat, 16 Feb 2008 00:02:56 +0000 Subject: acer-wmi: Add DMI match for mail LED on Acer TravelMate 4200 series The TM4200 series use the same method as the TM2490 series to control the mail LED, so add a DMI based quirk for these laptops. Signed-off-by: Carlos Corbacho Signed-off-by: Len Brown --- drivers/misc/acer-wmi.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'drivers') diff --git a/drivers/misc/acer-wmi.c b/drivers/misc/acer-wmi.c index d7aea93081f..74d12b4a3ab 100644 --- a/drivers/misc/acer-wmi.c +++ b/drivers/misc/acer-wmi.c @@ -271,6 +271,15 @@ static struct dmi_system_id acer_quirks[] = { }, .driver_data = &quirk_acer_travelmate_2490, }, + { + .callback = dmi_matched, + .ident = "Acer TravelMate 4200", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Acer"), + DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 4200"), + }, + .driver_data = &quirk_acer_travelmate_2490, + }, { .callback = dmi_matched, .ident = "Medion MD 98300", -- cgit v1.2.3 From e85ff4b53eb4252d967922bd75cb6d10863955f3 Mon Sep 17 00:00:00 2001 From: Glauber Costa Date: Sat, 16 Feb 2008 01:01:13 -0500 Subject: ACPI: remove is_processor_present prototype The function itself is defined just below, so this prototype is not really useful. Signed-off-by: Glauber Costa Signed-off-by: Andrew Morton Signed-off-by: Len Brown --- drivers/acpi/processor_core.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'drivers') diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c index 75ccf5d18bf..923fddb2caa 100644 --- a/drivers/acpi/processor_core.c +++ b/drivers/acpi/processor_core.c @@ -826,8 +826,6 @@ static int acpi_processor_remove(struct acpi_device *device, int type) * Acpi processor hotplug support * ****************************************************************************/ -static int is_processor_present(acpi_handle handle); - static int is_processor_present(acpi_handle handle) { acpi_status status; -- cgit v1.2.3 From 6133116849219f4e657ead39c7ac3922583f5a6e Mon Sep 17 00:00:00 2001 From: Pavel Machek Date: Tue, 19 Feb 2008 11:00:29 +0100 Subject: ACPI: TSC breaks atkbd suspend TSC is used even on machines when CONFIG_X86_TSC is not set (X86_TSC means _require_ TSC), but it is not properly disabled when it is unusable, because ACPI code understood the config switch as "may use TSC". This actually fixes suspend problems on my x60. Signed-off-by: Pavel Machek Signed-off-by: Len Brown --- drivers/acpi/processor_idle.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'drivers') diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 980e1c33e6c..6f3b217699e 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@ -364,7 +364,7 @@ int acpi_processor_resume(struct acpi_device * device) return 0; } -#if defined (CONFIG_GENERIC_TIME) && defined (CONFIG_X86_TSC) +#if defined (CONFIG_GENERIC_TIME) && defined (CONFIG_X86) static int tsc_halts_in_c(int state) { switch (boot_cpu_data.x86_vendor) { @@ -544,7 +544,7 @@ static void acpi_processor_idle(void) /* Get end time (ticks) */ t2 = inl(acpi_gbl_FADT.xpm_timer_block.address); -#if defined (CONFIG_GENERIC_TIME) && defined (CONFIG_X86_TSC) +#if defined (CONFIG_GENERIC_TIME) && defined (CONFIG_X86) /* TSC halts in C2, so notify users */ if (tsc_halts_in_c(ACPI_STATE_C2)) mark_tsc_unstable("possible TSC halt in C2"); @@ -609,7 +609,7 @@ static void acpi_processor_idle(void) acpi_set_register(ACPI_BITREG_ARB_DISABLE, 0); } -#if defined (CONFIG_GENERIC_TIME) && defined (CONFIG_X86_TSC) +#if defined (CONFIG_GENERIC_TIME) && defined (CONFIG_X86) /* TSC halts in C3, so notify users */ if (tsc_halts_in_c(ACPI_STATE_C3)) mark_tsc_unstable("TSC halts in C3"); @@ -1500,7 +1500,7 @@ static int acpi_idle_enter_simple(struct cpuidle_device *dev, acpi_idle_do_entry(cx); t2 = inl(acpi_gbl_FADT.xpm_timer_block.address); -#if defined (CONFIG_GENERIC_TIME) && defined (CONFIG_X86_TSC) +#if defined (CONFIG_GENERIC_TIME) && defined (CONFIG_X86) /* TSC could halt in idle, so notify users */ if (tsc_halts_in_c(cx->type)) mark_tsc_unstable("TSC halts in idle");; @@ -1614,7 +1614,7 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev, spin_unlock(&c3_lock); } -#if defined (CONFIG_GENERIC_TIME) && defined (CONFIG_X86_TSC) +#if defined (CONFIG_GENERIC_TIME) && defined (CONFIG_X86) /* TSC could halt in idle, so notify users */ if (tsc_halts_in_c(ACPI_STATE_C3)) mark_tsc_unstable("TSC halts in idle"); -- cgit v1.2.3 From 1186974f3ffe3c1796e5efce7afffefcfda9a6f0 Mon Sep 17 00:00:00 2001 From: Ming Lin Date: Thu, 21 Feb 2008 02:01:30 -0500 Subject: ACPI: fix build warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CC drivers/acpi/executer/exregion.o drivers/acpi/executer/exregion.c: In function ‘acpi_ex_pci_config_space_handler’: drivers/acpi/executer/exregion.c:369: attention : passing argument 3 of ‘acpi_os_read_pci_configuration’ from incompatible pointer type exposed by 10270d4838bdc493781f5a1cf2e90e9c34c9142f http://bugzilla.kernel.org/show_bug.cgi?id=9989 Signed-off-by: Ming Lin Signed-off-by: Len Brown --- drivers/acpi/executer/exregion.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/acpi/executer/exregion.c b/drivers/acpi/executer/exregion.c index 2e9ce94798c..3f51b7e84a1 100644 --- a/drivers/acpi/executer/exregion.c +++ b/drivers/acpi/executer/exregion.c @@ -338,6 +338,7 @@ acpi_ex_pci_config_space_handler(u32 function, acpi_status status = AE_OK; struct acpi_pci_id *pci_id; u16 pci_register; + u32 value32; ACPI_FUNCTION_TRACE(ex_pci_config_space_handler); @@ -364,9 +365,9 @@ acpi_ex_pci_config_space_handler(u32 function, switch (function) { case ACPI_READ: - *value = 0; status = acpi_os_read_pci_configuration(pci_id, pci_register, - value, bit_width); + &value32, bit_width); + *value = value32; break; case ACPI_WRITE: -- cgit v1.2.3 From c6868ea00bdebe5762fa59e54b74b4cd4e3b4e6e Mon Sep 17 00:00:00 2001 From: "Rafael J. Wysocki" Date: Sun, 3 Feb 2008 22:53:31 +0100 Subject: PCI ACPI: Fix comment describing acpi_pci_choose_state The last line of the comment preceding the definition of acpi_pci_choose_state() is incorrect. Remove it. Signed-off-by: Rafael J. Wysocki Acked-by: Pavel Machek Signed-off-by: Len Brown --- drivers/pci/pci-acpi.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'drivers') diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c index e569645d59e..e818e52dc39 100644 --- a/drivers/pci/pci-acpi.c +++ b/drivers/pci/pci-acpi.c @@ -241,8 +241,6 @@ EXPORT_SYMBOL(pci_osc_control_set); * choose from highest power _SxD to lowest power _SxW * else // no _PRW at S-state x * choose highest power _SxD or any lower power - * - * currently we simply return _SxD, if present. */ static pci_power_t acpi_pci_choose_state(struct pci_dev *pdev, -- cgit v1.2.3 From 19e20c913bae2dd458b9fc42afab0c53f16562d1 Mon Sep 17 00:00:00 2001 From: Adrian Bunk Date: Sun, 3 Feb 2008 22:55:18 +0100 Subject: PM: Make suspend_device() static suspend_device() can become static. Signed-off-by: Adrian Bunk Signed-off-by: Rafael J. Wysocki Acked-by: Pavel Machek Signed-off-by: Len Brown --- drivers/base/power/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c index bdc03f7e842..a96ca86a7b4 100644 --- a/drivers/base/power/main.c +++ b/drivers/base/power/main.c @@ -415,7 +415,7 @@ EXPORT_SYMBOL_GPL(device_power_down); * @dev: Device. * @state: Power state device is entering. */ -int suspend_device(struct device *dev, pm_message_t state) +static int suspend_device(struct device *dev, pm_message_t state) { int error = 0; -- cgit v1.2.3