diff options
author | Barnabás Pőcze <pobrn@protonmail.com> | 2021-02-03 21:56:16 +0000 |
---|---|---|
committer | Hans de Goede <hdegoede@redhat.com> | 2021-02-04 10:21:17 +0100 |
commit | 392cbf0a42777bb08153c76dfd0cb8c575bd6f10 (patch) | |
tree | 6712e7860a606fbf666ec23ca6bc35db1d6022b1 /drivers/platform/x86/ideapad-laptop.c | |
parent | 1c59de4ad24b6024b5d5b78d25486848f2d96c5d (diff) | |
download | linux-392cbf0a42777bb08153c76dfd0cb8c575bd6f10.tar.bz2 |
platform/x86: ideapad-laptop: check for Fn-lock support in HALS
Bit 9 in the return value of the HALS ACPI method is set if
Fn-lock is supported. Change ideapad_check_features() to check it.
Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20210203215403.290792-20-pobrn@protonmail.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'drivers/platform/x86/ideapad-laptop.c')
-rw-r--r-- | drivers/platform/x86/ideapad-laptop.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/platform/x86/ideapad-laptop.c b/drivers/platform/x86/ideapad-laptop.c index 509f2528e1af..d63c19fb5569 100644 --- a/drivers/platform/x86/ideapad-laptop.c +++ b/drivers/platform/x86/ideapad-laptop.c @@ -57,7 +57,9 @@ enum { }; enum { - HALS_FNLOCK_STATE_BIT = 10, + HALS_FNLOCK_SUPPORT_BIT = 9, + HALS_FNLOCK_STATE_BIT = 10, + HALS_HOTKEYS_PRIMARY_BIT = 11, }; enum { @@ -1290,8 +1292,12 @@ static void ideapad_check_features(struct ideapad_private *priv) if (acpi_has_method(handle, "DYTC")) priv->features.dytc = true; - if (acpi_has_method(handle, "HALS") && acpi_has_method(handle, "SALS")) - priv->features.fn_lock = true; + if (acpi_has_method(handle, "HALS") && acpi_has_method(handle, "SALS")) { + if (!eval_hals(handle, &val)) { + if (test_bit(HALS_FNLOCK_SUPPORT_BIT, &val)) + priv->features.fn_lock = true; + } + } } static int ideapad_acpi_add(struct platform_device *pdev) |