diff options
author | Henrique de Moraes Holschuh <hmh@hmh.eng.br> | 2009-06-17 23:40:16 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2009-06-18 01:30:35 -0400 |
commit | d7880f10c5d42ba182a97c1fd41d41d0b8837097 (patch) | |
tree | 56c7b64874b841d925467995dccf915545cde69e | |
parent | 8bf3d4c535c2b9689c2979b281c24e9f59c2f4ad (diff) |
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>
-rw-r--r-- | Documentation/laptops/thinkpad-acpi.txt | 14 | ||||
-rw-r--r-- | drivers/platform/x86/thinkpad_acpi.c | 10 |
2 files changed, 18 insertions, 6 deletions
diff --git a/Documentation/laptops/thinkpad-acpi.txt b/Documentation/laptops/thinkpad-acpi.txt index 88fc0661de56..f2ff638cce8d 100644 --- a/Documentation/laptops/thinkpad-acpi.txt +++ b/Documentation/laptops/thinkpad-acpi.txt | |||
@@ -1169,17 +1169,19 @@ may not be distinct. Later Lenovo models that implement the ACPI | |||
1169 | display backlight brightness control methods have 16 levels, ranging | 1169 | display backlight brightness control methods have 16 levels, ranging |
1170 | from 0 to 15. | 1170 | from 0 to 15. |
1171 | 1171 | ||
1172 | There are two interfaces to the firmware for direct brightness control, | 1172 | For IBM ThinkPads, there are two interfaces to the firmware for direct |
1173 | EC and UCMS (or CMOS). To select which one should be used, use the | 1173 | brightness control, EC and UCMS (or CMOS). To select which one should be |
1174 | brightness_mode module parameter: brightness_mode=1 selects EC mode, | 1174 | used, use the brightness_mode module parameter: brightness_mode=1 selects |
1175 | brightness_mode=2 selects UCMS mode, brightness_mode=3 selects EC | 1175 | EC mode, brightness_mode=2 selects UCMS mode, brightness_mode=3 selects EC |
1176 | mode with NVRAM backing (so that brightness changes are remembered | 1176 | mode with NVRAM backing (so that brightness changes are remembered across |
1177 | across shutdown/reboot). | 1177 | shutdown/reboot). |
1178 | 1178 | ||
1179 | The driver tries to select which interface to use from a table of | 1179 | The driver tries to select which interface to use from a table of |
1180 | defaults for each ThinkPad model. If it makes a wrong choice, please | 1180 | defaults for each ThinkPad model. If it makes a wrong choice, please |
1181 | report this as a bug, so that we can fix it. | 1181 | report this as a bug, so that we can fix it. |
1182 | 1182 | ||
1183 | Lenovo ThinkPads only support brightness_mode=2 (UCMS). | ||
1184 | |||
1183 | When display backlight brightness controls are available through the | 1185 | When display backlight brightness controls are available through the |
1184 | standard ACPI interface, it is best to use it instead of this direct | 1186 | standard ACPI interface, it is best to use it instead of this direct |
1185 | ThinkPad-specific interface. The driver will disable its native | 1187 | ThinkPad-specific interface. The driver will disable its native |
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 = { | |||
5696 | * Bit 3-0: backlight brightness level | 5696 | * Bit 3-0: backlight brightness level |
5697 | * | 5697 | * |
5698 | * brightness_get_raw returns status data in the HBRV layout | 5698 | * brightness_get_raw returns status data in the HBRV layout |
5699 | * | ||
5700 | * WARNING: The X61 has been verified to use HBRV for something else, so | ||
5701 | * this should be used _only_ on IBM ThinkPads, and maybe with some careful | ||
5702 | * testing on the very early *60 Lenovo models... | ||
5699 | */ | 5703 | */ |
5700 | 5704 | ||
5701 | enum { | 5705 | enum { |
@@ -5996,6 +6000,12 @@ static int __init brightness_init(struct ibm_init_struct *iibm) | |||
5996 | brightness_mode); | 6000 | brightness_mode); |
5997 | } | 6001 | } |
5998 | 6002 | ||
6003 | /* Safety */ | ||
6004 | if (thinkpad_id.vendor != PCI_VENDOR_ID_IBM && | ||
6005 | (brightness_mode == TPACPI_BRGHT_MODE_ECNVRAM || | ||
6006 | brightness_mode == TPACPI_BRGHT_MODE_EC)) | ||
6007 | return -EINVAL; | ||
6008 | |||
5999 | if (tpacpi_brightness_get_raw(&b) < 0) | 6009 | if (tpacpi_brightness_get_raw(&b) < 0) |
6000 | return 1; | 6010 | return 1; |
6001 | 6011 | ||