Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 154187
b: refs/heads/master
c: d7880f1
h: refs/heads/master
i:
  154185: 488767f
  154183: 9c33d6d
v: v3
  • Loading branch information
Henrique de Moraes Holschuh authored and Len Brown committed Jun 18, 2009
1 parent 0ef1977 commit f829958
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8bf3d4c535c2b9689c2979b281c24e9f59c2f4ad
refs/heads/master: d7880f10c5d42ba182a97c1fd41d41d0b8837097
14 changes: 8 additions & 6 deletions trunk/Documentation/laptops/thinkpad-acpi.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1169,17 +1169,19 @@ may not be distinct. Later Lenovo models that implement the ACPI
display backlight brightness control methods have 16 levels, ranging
from 0 to 15.

There are two interfaces to the firmware for direct brightness control,
EC and UCMS (or CMOS). To select which one should be used, use the
brightness_mode module parameter: brightness_mode=1 selects EC mode,
brightness_mode=2 selects UCMS mode, brightness_mode=3 selects EC
mode with NVRAM backing (so that brightness changes are remembered
across shutdown/reboot).
For IBM ThinkPads, there are two interfaces to the firmware for direct
brightness control, EC and UCMS (or CMOS). To select which one should be
used, use the brightness_mode module parameter: brightness_mode=1 selects
EC mode, brightness_mode=2 selects UCMS mode, brightness_mode=3 selects EC
mode with NVRAM backing (so that brightness changes are remembered across
shutdown/reboot).

The driver tries to select which interface to use from a table of
defaults for each ThinkPad model. If it makes a wrong choice, please
report this as a bug, so that we can fix it.

Lenovo ThinkPads only support brightness_mode=2 (UCMS).

When display backlight brightness controls are available through the
standard ACPI interface, it is best to use it instead of this direct
ThinkPad-specific interface. The driver will disable its native
Expand Down
10 changes: 10 additions & 0 deletions trunk/drivers/platform/x86/thinkpad_acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit f829958

Please sign in to comment.