[PATCH 14/24] platform/x86: ideapad-laptop: check for Fn-lock support in HALS

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx>

diff --git a/drivers/platform/x86/ideapad-laptop.c b/drivers/platform/x86/ideapad-laptop.c
index d61710ad8803..8a654ac0546c 100644
--- a/drivers/platform/x86/ideapad-laptop.c
+++ b/drivers/platform/x86/ideapad-laptop.c
@@ -55,7 +55,9 @@ enum {
 };
 
 enum {
-	HALS_FNLOCK_STATE_BIT = 10,
+	HALS_FNLOCK_SUPPORT_BIT  = 9,
+	HALS_FNLOCK_STATE_BIT    = 10,
+	HALS_HOTKEYS_PRIMARY_BIT = 11,
 };
 
 enum {
@@ -1013,8 +1015,11 @@ static void ideapad_check_features(struct ideapad_private *priv)
 	if (acpi_has_method(handle, "GBMD") && acpi_has_method(handle, "SBMC"))
 		priv->features.conservation_mode = 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)
-- 
2.29.2






[Index of Archives]     [Linux Kernel Development]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux