Platform: Brightness quirk for samsung laptop driver
authorJason Stubbs <jasonbstubbs@gmail.com>
Tue, 20 Sep 2011 16:16:13 +0000 (09:16 -0700)
committerMatthew Garrett <mjg@redhat.com>
Mon, 24 Oct 2011 14:52:35 +0000 (16:52 +0200)
commitac080523141d5bfa5f60ef2436480f645f915e9c
treeb8900469b14265e22227c7bbaaf1d491ea417e5b
parenta7ea19926ffba86f373f6050a106cd162dbb9a78
Platform: Brightness quirk for samsung laptop driver

On some Samsung laptops the brightness regulation works slightly different.
All SABI commands except for set_brightness work as expected. The behaviour
of set_brightness is as follows:

- Setting a new brightness will only step one level toward the new brightness
  level. For example, setting a level of 5 when the current level is 2 will
  result in a brightness level of 3.
- A spurious KEY_BRIGHTNESS_UP or KEY_BRIGHTNESS_DOWN event is also generated
  along with the change in brightness.
- Neither of the above two issues occur when changing from/to brightness
  level 0.

This patch adds detection and a non-intrusive workaround for the above issues.

Signed-off-by: Jason Stubbs <jasonbstubbs@gmail.com>
Tested-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
drivers/platform/x86/samsung-laptop.c