summaryrefslogtreecommitdiffstats
path: root/drivers/platform
diff options
context:
space:
mode:
authorHenrique de Moraes Holschuh2009-06-18 05:40:16 +0200
committerLen Brown2009-06-18 07:30:35 +0200
commitd7880f10c5d42ba182a97c1fd41d41d0b8837097 (patch)
tree56c7b64874b841d925467995dccf915545cde69e /drivers/platform
parentthinkpad-acpi: silence bogus warning when ACPI video is disabled (diff)
downloadkernel-qcow2-linux-d7880f10c5d42ba182a97c1fd41d41d0b8837097.tar.gz
kernel-qcow2-linux-d7880f10c5d42ba182a97c1fd41d41d0b8837097.tar.xz
kernel-qcow2-linux-d7880f10c5d42ba182a97c1fd41d41d0b8837097.zip
thinkpad-acpi: forbid the use of HBRV on Lenovo ThinkPads
Forcing thinkpad-acpi to do EC-based brightness control (HBRV) on a X61 has very... interesting effects, instead of doing nothing (since it doesn't have EC-based backlight control), it causes "weirdness" in the fan tachometer readings, for example. This means the EC register that used to be HBRV has been reused by Lenovo for something else, but they didn't remove it from the DSDT. Make sure the documentation reflects this data, and forbid the user from forcing the driver to access HBRV on Lenovo ThinkPads. Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/x86/thinkpad_acpi.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index 5a22a064222c..c8d74dbacbbd 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -5696,6 +5696,10 @@ static struct ibm_struct ecdump_driver_data = {
* Bit 3-0: backlight brightness level
*
* brightness_get_raw returns status data in the HBRV layout
+ *
+ * WARNING: The X61 has been verified to use HBRV for something else, so
+ * this should be used _only_ on IBM ThinkPads, and maybe with some careful
+ * testing on the very early *60 Lenovo models...
*/
enum {
@@ -5996,6 +6000,12 @@ static int __init brightness_init(struct ibm_init_struct *iibm)
brightness_mode);
}
+ /* Safety */
+ if (thinkpad_id.vendor != PCI_VENDOR_ID_IBM &&
+ (brightness_mode == TPACPI_BRGHT_MODE_ECNVRAM ||
+ brightness_mode == TPACPI_BRGHT_MODE_EC))
+ return -EINVAL;
+
if (tpacpi_brightness_get_raw(&b) < 0)
return 1;