diff options
-rw-r--r-- | drivers/platform/x86/samsung-laptop.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/platform/x86/samsung-laptop.c b/drivers/platform/x86/samsung-laptop.c index 1e436ebdcff..31ddd57e8ca 100644 --- a/drivers/platform/x86/samsung-laptop.c +++ b/drivers/platform/x86/samsung-laptop.c @@ -404,8 +404,9 @@ static int get_brightness(struct backlight_device *bd) static void check_for_stepping_quirk(void) { - u8 initial_level = read_brightness(); + u8 initial_level; u8 check_level; + u8 orig_level = read_brightness(); /* * Some laptops exhibit the strange behaviour of stepping toward @@ -414,6 +415,11 @@ static void check_for_stepping_quirk(void) * around in set_brightness. */ + if (orig_level == 0) + set_brightness(1); + + initial_level = read_brightness(); + if (initial_level <= 2) check_level = initial_level + 2; else @@ -427,7 +433,7 @@ static void check_for_stepping_quirk(void) pr_info("enabled workaround for brightness stepping quirk\n"); } - set_brightness(initial_level); + set_brightness(orig_level); } static int update_status(struct backlight_device *bd) |