This is a note to let you know that I've just added the patch titled platform: samsung_laptop: fix samsung brightness min/max calculations
to my gregkh-2.6 tree which can be found in directory form at: http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/ and in git form at: git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/patches.git The filename of this patch is: platform-samsung_laptop-fix-samsung-brightness-min-max-calculations.patch The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.) If this patch meets the merge guidelines for a bugfix, it should be merged into Linus's tree before the next major kernel release. If not, it will be merged into Linus's tree during the next merge window. Either way, you will probably be copied on the patch when it gets sent to Linus for merging so that others can see what is happening in kernel development. If you have any questions about this process, please let me know. >From jasonbstu...@gmail.com Wed Aug 24 16:08:19 2011 From: Jason Stubbs <jasonbstu...@gmail.com> To: Greg KH <g...@kroah.com> Subject: platform: samsung_laptop: fix samsung brightness min/max calculations Date: Mon, 20 Jun 2011 07:23:19 +1000 Cc: Greg KH <gre...@suse.de>, linux-ker...@vger.kernel.org Message-Id: <201106200723.20173.jasonbstu...@gmail.com> From: Jason Stubbs <jasonbstu...@gmail.com> 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 <jasonbstu...@gmail.com> Cc: stable <sta...@kernel.org> Signed-off-by: Greg Kroah-Hartman <gre...@suse.de> --- drivers/platform/x86/samsung-laptop.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) --- a/drivers/platform/x86/samsung-laptop.c +++ b/drivers/platform/x86/samsung-laptop.c @@ -371,15 +371,17 @@ static u8 read_brightness(void) &sretval); if (!retval) { user_brightness = sretval.retval[0]; - if (user_brightness != 0) + if (user_brightness > sabi_config->min_brightness) user_brightness -= sabi_config->min_brightness; + else + user_brightness = 0; } return user_brightness; } static void set_brightness(u8 user_brightness) { - u8 user_level = user_brightness - sabi_config->min_brightness; + u8 user_level = user_brightness + sabi_config->min_brightness; if (has_stepping_quirk && user_level != 0) { /* @@ -881,7 +883,8 @@ static int __init samsung_init(void) /* create a backlight device to talk to this one */ memset(&props, 0, sizeof(struct backlight_properties)); props.type = BACKLIGHT_PLATFORM; - props.max_brightness = sabi_config->max_brightness; + props.max_brightness = sabi_config->max_brightness - + sabi_config->min_brightness; backlight_device = backlight_device_register("samsung", &sdev->dev, NULL, &backlight_ops, &props); _______________________________________________ stable mailing list stable@linux.kernel.org http://linux.kernel.org/mailman/listinfo/stable