From a3f104c02ab842574e699186cf953551aafe2ca9 Mon Sep 17 00:00:00 2001 From: Henrique de Moraes Holschuh Date: Tue, 30 Oct 2007 17:46:20 -0200 Subject: ACPI: thinkpad-acpi: support 16 levels of brightness (v3) Lenovo ThinkPads often have 16 brightness levels in EC, and not just eight levels like older ThinkPads. They also have standard ACPI backlight brightness control. We detect the number of brightness levels by the presence of a BCLL package with 16 entries. If BCLL is not there, we assume eight levels (Z6*). If it is there, but it doesn't have 16 entries, we assume eight levels (T60). Otherwise we assume sixteen levels (T61, X61, etc). We don't use _BCL because it can have side-effects in thinkpads. Thanks to Thomas Renninger for notifying me of this potential problem. Using the standard ACPI backlight brightness control *instead* of the native thinkpad backlight control is a better idea, though. A different patch will take care of this. Signed-off-by: Henrique de Moraes Holschuh Cc: Thomas Renninger Signed-off-by: Len Brown --- Documentation/thinkpad-acpi.txt | 61 +++++++++++++++++++++++------------------ 1 file changed, 35 insertions(+), 26 deletions(-) (limited to 'Documentation') diff --git a/Documentation/thinkpad-acpi.txt b/Documentation/thinkpad-acpi.txt index ec499265dec..a743bfa62b9 100644 --- a/Documentation/thinkpad-acpi.txt +++ b/Documentation/thinkpad-acpi.txt @@ -923,19 +923,26 @@ sysfs backlight device "thinkpad_screen" This feature allows software control of the LCD brightness on ThinkPad models which don't have a hardware brightness slider. -It has some limitations: the LCD backlight cannot be actually turned on or off -by this interface, and in many ThinkPad models, the "dim while on battery" -functionality will be enabled by the BIOS when this interface is used, and -cannot be controlled. - -The backlight control has eight levels, ranging from 0 to 7. Some of the -levels may not be distinct. - -There are two interfaces to the firmware for brightness control, EC and CMOS. -To select which one should be used, use the brightness_mode module parameter: -brightness_mode=1 selects EC mode, brightness_mode=2 selects CMOS mode, -brightness_mode=3 selects both EC and CMOS. The driver tries to autodetect -which interface to use. +It has some limitations: the LCD backlight cannot be actually turned on or +off by this interface, and in many ThinkPad models, the "dim while on +battery" functionality will be enabled by the BIOS when this interface is +used, and cannot be controlled. + +On IBM (and some of the earlier Lenovo) ThinkPads, the backlight control +has eight brightness levels, ranging from 0 to 7. Some of the levels +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 CMOS. To select which one should be used, use the +brightness_mode module parameter: brightness_mode=1 selects EC mode, +brightness_mode=2 selects CMOS mode, brightness_mode=3 selects both EC +and CMOS. The driver tries to autodetect which interface to use. + +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. Procfs notes: @@ -947,11 +954,11 @@ Procfs notes: Sysfs notes: -The interface is implemented through the backlight sysfs class, which is poorly -documented at this time. +The interface is implemented through the backlight sysfs class, which is +poorly documented at this time. -Locate the thinkpad_screen device under /sys/class/backlight, and inside it -there will be the following attributes: +Locate the thinkpad_screen device under /sys/class/backlight, and inside +it there will be the following attributes: max_brightness: Reads the maximum brightness the hardware can be set to. @@ -961,17 +968,19 @@ there will be the following attributes: Reads what brightness the screen is set to at this instant. brightness: - Writes request the driver to change brightness to the given - value. Reads will tell you what brightness the driver is trying - to set the display to when "power" is set to zero and the display - has not been dimmed by a kernel power management event. + Writes request the driver to change brightness to the + given value. Reads will tell you what brightness the + driver is trying to set the display to when "power" is set + to zero and the display has not been dimmed by a kernel + power management event. power: - power management mode, where 0 is "display on", and 1 to 3 will - dim the display backlight to brightness level 0 because - thinkpad-acpi cannot really turn the backlight off. Kernel - power management events can temporarily increase the current - power management level, i.e. they can dim the display. + power management mode, where 0 is "display on", and 1 to 3 + will dim the display backlight to brightness level 0 + because thinkpad-acpi cannot really turn the backlight + off. Kernel power management events can temporarily + increase the current power management level, i.e. they can + dim the display. Volume control -- /proc/acpi/ibm/volume -- cgit v1.2.3 From 87cc537a54fc017d998cf603f5fab9ca4a85d668 Mon Sep 17 00:00:00 2001 From: Henrique de Moraes Holschuh Date: Tue, 30 Oct 2007 18:02:07 -0200 Subject: ACPI: thinkpad-acpi: add brightness_force parameter Add a "brightness_enable" module parameter that allows the local admin to force the backlight support to not be enabled. It can also be used to force the backlight support to be enabled, but that is currently a no-op as the backlight support is enabled by default when available. This will be changed by a different patch. Signed-off-by: Henrique de Moraes Holschuh Signed-off-by: Len Brown --- Documentation/thinkpad-acpi.txt | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Documentation') diff --git a/Documentation/thinkpad-acpi.txt b/Documentation/thinkpad-acpi.txt index a743bfa62b9..f877c13c5ef 100644 --- a/Documentation/thinkpad-acpi.txt +++ b/Documentation/thinkpad-acpi.txt @@ -944,6 +944,10 @@ 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 brightness_enable module parameter can be used to control whether +the LCD brightness control feature will be enabled when available. +brightness_enable=0 forces it to be disabled. + Procfs notes: The available commands are: -- cgit v1.2.3 From e11e211a0b21bbb625fac2056bdb54dd02020556 Mon Sep 17 00:00:00 2001 From: Henrique de Moraes Holschuh Date: Tue, 30 Oct 2007 17:46:22 -0200 Subject: ACPI: thinkpad-acpi: prefer standard ACPI backlight level control Newer Lenovo BIOSes support the standard ACPI backlight brightness interface (_BCM, _BQC, _BCL). It should be used instead of the native thinkpad backlight brightness control interface when possible. This patch disables the native brightness support in the driver by default when we detect that the standard ACPI interface is available. The local admin can still enable it using the module parameter "brightness_enable". Note that we need to detect the standard ACPI backlight interface only in boxes for which we would load the native backlight interface in the first place, and that no ThinkPad BIOS has _BCL but misses the other methods, so the detection routines can be really simple. Signed-off-by: Henrique de Moraes Holschuh Signed-off-by: Len Brown --- Documentation/thinkpad-acpi.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'Documentation') diff --git a/Documentation/thinkpad-acpi.txt b/Documentation/thinkpad-acpi.txt index f877c13c5ef..bb1c7a60b9b 100644 --- a/Documentation/thinkpad-acpi.txt +++ b/Documentation/thinkpad-acpi.txt @@ -942,11 +942,15 @@ and CMOS. The driver tries to autodetect which interface to use. 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. +ThinkPad-specific interface. The driver will disable its native +backlight brightness control interface if it detects that the standard +ACPI interface is available in the ThinkPad. The brightness_enable module parameter can be used to control whether the LCD brightness control feature will be enabled when available. -brightness_enable=0 forces it to be disabled. +brightness_enable=0 forces it to be disabled. brightness_enable=1 +forces it to be enabled when available, even if the standard ACPI +interface is also available. Procfs notes: -- cgit v1.2.3 From b856f5b8c022b75bb0504a8c1ce16a5f1656e08b Mon Sep 17 00:00:00 2001 From: Henrique de Moraes Holschuh Date: Tue, 30 Oct 2007 17:46:23 -0200 Subject: ACPI: thinkpad-acpi: bump up version to 0.17 The lm-sensors 3.0.0/libsensors4 compatibility changes are reason enough to bump up the version string. Do it. Signed-off-by: Henrique de Moraes Holschuh Signed-off-by: Len Brown --- Documentation/thinkpad-acpi.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Documentation') diff --git a/Documentation/thinkpad-acpi.txt b/Documentation/thinkpad-acpi.txt index bb1c7a60b9b..10c041ca13c 100644 --- a/Documentation/thinkpad-acpi.txt +++ b/Documentation/thinkpad-acpi.txt @@ -1,7 +1,7 @@ ThinkPad ACPI Extras Driver - Version 0.16 - August 2nd, 2007 + Version 0.17 + October 04th, 2007 Borislav Deianov Henrique de Moraes Holschuh -- cgit v1.2.3