Marien Zwart | 1 Apr 2012 23:45
Picon

brightness key handling on lenovo thinkpad edge E325 (and possibly others)

Hi,

Running Debian testing (linux 3.2) on my new thinkpad edge e325 I
noticed the brightness Fn keys being a bit overresponsive: every time I
hit one the brightness changes several levels. I think some of this is
my desktop environment misbehaving, but part of it seems to be
thinkpad_acpi, assuming the documentation's explanation
KEY_BRIGHTNESSDOWN/UP should not be sent if the firmware is handling
brightness is still accurate. Here's what seems to be happening:

On module load we reach tpacpi_check_std_acpi_brightness_support, which
calls tpacpi_acpi_handle_locate with VIDEO_HID (aka LNXVIDEO) to find a
video device. tpacpi_acpi_handle_locate calls acpi_get_devices.
acpi_get_devices returns success, but it never actually calls its
callback function (verified by adding logging to that function). This
exposes a slight bug in tpacpi_acpi_handle_locate: it logs "Found ACPI
handle for video", but at that point device_found is null.
tpacpi_check_std_acpi_brightness_support therefore does not call
tpacpi_query_bcl_levels, leaving bcl_levels at its default value of 0.
This means tp_features.bright_acpimode gets set to 0, while I believe it
should be 1 for this laptop, as that would cause the redundant
thinkpad-acpi brightness events to be disabled.
tpacpi_check_std_acpi_brightness_support then returns 0, which causes
tpacpi_detect_brightness_capabilities to log "detected a 8-level
brightness capable ThinkPad" while the laptop actually supports 16
levels of brightness. That part seems to be purely cosmetic, though.

I have attached a patch (against debian's 3.2 kernel, but it looks like
there has been very little churn in the module recently so I hope this
suffices) that might be a starting point for fixing this. It adds a
(Continue reading)

Janne Paalijarvi | 17 Apr 2012 18:48
Picon

Report event from X120e

Hello,

I'm reporting the event described below. I just started a rsync
transfer of data to my encrypted backup drive. After some time I guess
(cannot remember for sure) I pressed space. The system seemed to be
frozen for a while. Then I got the dmesg below. And cursor bursted
extra spaces forward.

[14659.344992] atkbd serio0: Unknown key pressed (translated set 2,
code 0xf1 on isa0060/serio0).
[14659.345002] atkbd serio0: Use 'setkeycodes e071 <keycode>' to make it known.
[14659.355605] atkbd serio0: Unknown key released (translated set 2,
code 0xf1 on isa0060/serio0).
[14659.355615] atkbd serio0: Use 'setkeycodes e071 <keycode>' to make it known.
[14659.831651] thinkpad_acpi: THERMAL ALERT: unknown thermal alarm received
[14659.836811] thinkpad_acpi: temperatures (Celsius): 74 0 74 0 0 0 27 0
[14659.836825] thinkpad_acpi: unhandled HKEY event 0x6040
[14659.836829] thinkpad_acpi: please report the conditions when this
event happened to ibm-acpi-devel@...
[14665.041201] EXT4-fs (dm-0): re-mounted. Opts: errors=remount-ro,commit=0
[14665.082483] EXT4-fs (sda5): re-mounted. Opts: commit=0

------------------------------------------------------------------------------
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second 
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
Alex Hung | 24 Apr 2012 10:44
Favicon

Re: [PATCH] thinkpad-acpi: fix issuing duplicated key events for brightness up/down

On 04/24/2012 04:40 PM, Alex Hung wrote:
> The tp_features.bright_acpimode will not be set correctly for brightness
> control because ACPI_VIDEO_HID will not be located in ACPI. As a result,
> a duplicated key event will always be sent. acpi_video_backlight_support()
> is sufficient to detect standard ACPI brightness control.
>
> Signed-off-by: Alex Hung<alex.hung@...>
> ---
>   drivers/platform/x86/thinkpad_acpi.c |    2 +-
>   1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
> index 7b82868..7d032d5 100644
> --- a/drivers/platform/x86/thinkpad_acpi.c
> +++ b/drivers/platform/x86/thinkpad_acpi.c
>  <at>  <at>  -3405,7 +3405,7  <at>  <at>  static int __init hotkey_init(struct ibm_init_struct *iibm)
>   	/* Do not issue duplicate brightness change events to
>   	 * userspace. tpacpi_detect_brightness_capabilities() must have
>   	 * been called before this point  */
> -	if (tp_features.bright_acpimode&&  acpi_video_backlight_support()) {
> +	if (acpi_video_backlight_support()) {
>   		pr_info("This ThinkPad has standard ACPI backlight "
>   			"brightness control, supported by the ACPI "
>   			"video driver\n");

Hi,
I tested the patch on thinkpad x200 and x220, and the brightness up/down 
key presses will no longer generate a duplicated event, i.e. output from 
"sudo showkey".

(Continue reading)


Gmane