Skip to content

Commit dd2a5d6

Browse files
ziyao233MingcongBai
authored andcommitted
BACKPORT: FROMLIST: platform/loongarch: laptop: Get brightness setting from EC on probe
Previously 1 is unconditionally taken as current brightness value. This causes problems since it's required to restore brightness settings on resumption, and a value that doesn't match EC's state before suspension will cause surprising changes of screen brightness. Let's get brightness from EC and take it as the current brightness on probe of the laptop driver to avoid the surprising behavior. Tested on TongFang L860-T2 3A5000 laptop. Cc: [email protected] Fixes: 6246ed0 ("LoongArch: Add ACPI-based generic laptop driver") Signed-off-by: Yao Zi <[email protected]> Link: https://lore.kernel.org/loongarch/[email protected]/ Signed-off-by: Mingcong Bai <[email protected]>
1 parent 9ed52fb commit dd2a5d6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/platform/loongarch/loongson-laptop.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ static int laptop_backlight_register(void)
392392
if (!acpi_evalf(hotkey_handle, &status, "ECLL", "d"))
393393
return -EIO;
394394

395-
props.brightness = 1;
395+
props.brightness = ec_get_brightness();
396396
props.max_brightness = status;
397397
props.type = BACKLIGHT_PLATFORM;
398398

0 commit comments

Comments
 (0)