Commit 3ae86d2d authored by Meng Dong's avatar Meng Dong Committed by Hans de Goede

platform/x86: ideapad-laptop: Fix Legion 5 Fn lock LED

This patch fixes the bug 212671.
Althrough the Fn lock (Fn + Esc) works on Legion 5 (R7000P), its LED
light does not change with the state. This modification sets the Fn lock
state to its current value on receiving the wmi event
8FC0DE0C-B4E4-43FD-B0F3-8871711C1294 to update the LED state.
Signed-off-by: default avatarMeng Dong <whenov@gmail.com>
Link: https://lore.kernel.org/r/20210817171203.12855-1-whenov@gmail.comReviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
parent 30f64e20
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
static const char *const ideapad_wmi_fnesc_events[] = { static const char *const ideapad_wmi_fnesc_events[] = {
"26CAB2E5-5CF1-46AE-AAC3-4A12B6BA50E6", /* Yoga 3 */ "26CAB2E5-5CF1-46AE-AAC3-4A12B6BA50E6", /* Yoga 3 */
"56322276-8493-4CE8-A783-98C991274F5E", /* Yoga 700 */ "56322276-8493-4CE8-A783-98C991274F5E", /* Yoga 700 */
"8FC0DE0C-B4E4-43FD-B0F3-8871711C1294", /* Legion 5 */
}; };
#endif #endif
...@@ -1459,11 +1460,19 @@ static void ideapad_acpi_notify(acpi_handle handle, u32 event, void *data) ...@@ -1459,11 +1460,19 @@ static void ideapad_acpi_notify(acpi_handle handle, u32 event, void *data)
static void ideapad_wmi_notify(u32 value, void *context) static void ideapad_wmi_notify(u32 value, void *context)
{ {
struct ideapad_private *priv = context; struct ideapad_private *priv = context;
unsigned long result;
switch (value) { switch (value) {
case 128: case 128:
ideapad_input_report(priv, value); ideapad_input_report(priv, value);
break; break;
case 208:
if (!eval_hals(priv->adev->handle, &result)) {
bool state = test_bit(HALS_FNLOCK_STATE_BIT, &result);
exec_sals(priv->adev->handle, state ? SALS_FNLOCK_ON : SALS_FNLOCK_OFF);
}
break;
default: default:
dev_info(&priv->platform_device->dev, dev_info(&priv->platform_device->dev,
"Unknown WMI event: %u\n", value); "Unknown WMI event: %u\n", value);
......
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