Commit fbe605ab authored by Huacai Chen's avatar Huacai Chen

platform/loongarch: laptop: Adjust resume order for loongson_hotkey_resume()

Some laptops don't support SW_LID, but still have backlight control,
move backlight resuming before SW_LID event handling so as to avoid
backlight mistake due to early return.
Signed-off-by: default avatarHuacai Chen <chenhuacai@loongson.cn>
parent bbfddb90
...@@ -199,6 +199,13 @@ static int loongson_hotkey_resume(struct device *dev) ...@@ -199,6 +199,13 @@ static int loongson_hotkey_resume(struct device *dev)
struct key_entry ke; struct key_entry ke;
struct backlight_device *bd; struct backlight_device *bd;
bd = backlight_device_get_by_type(BACKLIGHT_PLATFORM);
if (bd) {
loongson_laptop_backlight_update(bd) ?
pr_warn("Loongson_backlight: resume brightness failed") :
pr_info("Loongson_backlight: resume brightness %d\n", bd->props.brightness);
}
/* /*
* Only if the firmware supports SW_LID event model, we can handle the * Only if the firmware supports SW_LID event model, we can handle the
* event. This is for the consideration of development board without EC. * event. This is for the consideration of development board without EC.
...@@ -228,13 +235,6 @@ static int loongson_hotkey_resume(struct device *dev) ...@@ -228,13 +235,6 @@ static int loongson_hotkey_resume(struct device *dev)
} }
} }
bd = backlight_device_get_by_type(BACKLIGHT_PLATFORM);
if (bd) {
loongson_laptop_backlight_update(bd) ?
pr_warn("Loongson_backlight: resume brightness failed") :
pr_info("Loongson_backlight: resume brightness %d\n", bd->props.brightness);
}
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment