Skip to content

Commit fbe605a

Browse files
committed
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: Huacai Chen <[email protected]>
1 parent bbfddb9 commit fbe605a

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

drivers/platform/loongarch/loongson-laptop.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,13 @@ static int loongson_hotkey_resume(struct device *dev)
199199
struct key_entry ke;
200200
struct backlight_device *bd;
201201

202+
bd = backlight_device_get_by_type(BACKLIGHT_PLATFORM);
203+
if (bd) {
204+
loongson_laptop_backlight_update(bd) ?
205+
pr_warn("Loongson_backlight: resume brightness failed") :
206+
pr_info("Loongson_backlight: resume brightness %d\n", bd->props.brightness);
207+
}
208+
202209
/*
203210
* Only if the firmware supports SW_LID event model, we can handle the
204211
* event. This is for the consideration of development board without EC.
@@ -228,13 +235,6 @@ static int loongson_hotkey_resume(struct device *dev)
228235
}
229236
}
230237

231-
bd = backlight_device_get_by_type(BACKLIGHT_PLATFORM);
232-
if (bd) {
233-
loongson_laptop_backlight_update(bd) ?
234-
pr_warn("Loongson_backlight: resume brightness failed") :
235-
pr_info("Loongson_backlight: resume brightness %d\n", bd->props.brightness);
236-
}
237-
238238
return 0;
239239
}
240240

0 commit comments

Comments
 (0)