Commit 392cbf0a authored by Barnabás Pőcze's avatar Barnabás Pőcze Committed by Hans de Goede
Browse files

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: default avatarBarnabás Pőcze <pobrn@protonmail.com>
Reviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
Reviewed-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20210203215403.290792-20-pobrn@protonmail.com


Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
parent 1c59de4a
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -57,7 +57,9 @@ enum {
};

enum {
	HALS_FNLOCK_SUPPORT_BIT  = 9,
	HALS_FNLOCK_STATE_BIT    = 10,
	HALS_HOTKEYS_PRIMARY_BIT = 11,
};

enum {
@@ -1290,9 +1292,13 @@ 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"))
	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)
{