1 Apr 2012 23:45
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)
RSS Feed