]> www.infradead.org Git - users/jedix/linux-maple.git/commit
platform: samsung_laptop: fix samsung brightness min/max calculations
authorJason Stubbs <jasonbstubbs@gmail.com>
Tue, 20 Sep 2011 16:16:11 +0000 (09:16 -0700)
committerMaxim Uvarov <maxim.uvarov@oracle.com>
Thu, 8 Dec 2011 19:17:52 +0000 (11:17 -0800)
commitf587a584c88e42c39a697dea0c1599cfab4d0783
treec46071f21af20eeb29f036bba85789e1689096d9
parentbd727ceb0195767b4fdde588e452ab0136c09b7a
platform: samsung_laptop: fix samsung brightness min/max calculations

commit bee460be8c691c544e84ed678280ace6153104c6 upstream.

The min_brightness value of the sabi_config is incorrectly used in brightness
calculations. For the config where min_brightness = 1 and max_brightness = 8,
the user visible range should be 0 to 7 with hardware being set in the range
of 1 to 8. What is actually happening is that the user visible range is 0 to
8 with hardware being set in the range of -1 to 7.

This patch fixes the above issue as well as a miscalculation that would occur
in the case of min_brightness > 1.

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