platform/x86: dell-laptop: Filter out spurious keyboard backlight change events
authorHans de Goede <hdegoede@redhat.com>
Thu, 11 Jan 2018 14:14:39 +0000 (15:14 +0100)
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Tue, 16 Jan 2018 15:24:15 +0000 (17:24 +0200)
commit4d6bde512a86c32df3a1f289d2b4cd04b17758d1
tree55b02eb707f6ea51c7287ac584ce8cecbde3504b
parentc4abf92d4fac7dcac0717410e9242714c35a27f2
platform/x86: dell-laptop: Filter out spurious keyboard backlight change events

On some Dell XPS models WMI events of type 0x0000 reporting a keycode of
0xe00c get reported when the brightness of the LCD panel changes.

This leads to us reporting false-positive kbd_led change events to
userspace which in turn leads to the kbd backlight OSD showing when it
should not.

We already read the current keyboard backlight brightness value when
reporting events because the led_classdev_notify_brightness_hw_changed
API requires this. Compare this value to the last known value and filter
out duplicate events, fixing this.

Note the fixed issue is esp. a problem on XPS models with an ambient light
sensor and automatic brightness adjustments turned on, this causes the kbd
backlight OSD to show all the time there.

BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1514969
Fixes: 9c656b0799 ("platform/x86: dell-*: Call new led hw_changed API ...")
Acked-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
drivers/platform/x86/dell-laptop.c