Skip to content

Commit e3ab18d

Browse files
committed
platform/x86: intel: hid: Always call BTNL ACPI method
On a HP Elite Dragonfly G2 the 0xcc and 0xcd events for SW_TABLET_MODE are only send after the BTNL ACPI method has been called. Likely more devices need this, so make the BTNL ACPI method unconditional instead of only doing it on devices with a 5 button array. Note this also makes the intel_button_array_enable() call in probe() unconditional, that function does its own priv->array check. This makes the intel_button_array_enable() call in probe() consistent with the calls done on suspend/resume which also rely on the priv->array check inside the function. Reported-by: Maxim Mikityanskiy <maxtram95@gmail.com> Closes: https://lore.kernel.org/platform-driver-x86/20230712175023.31651-1-maxtram95@gmail.com/ Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20230715181516.5173-1-hdegoede@redhat.com
1 parent 33c9ab5 commit e3ab18d

File tree

1 file changed

+9
-12
lines changed
  • drivers/platform/x86/intel

1 file changed

+9
-12
lines changed

drivers/platform/x86/intel/hid.c

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,7 @@ static bool button_array_present(struct platform_device *device)
620620
static int intel_hid_probe(struct platform_device *device)
621621
{
622622
acpi_handle handle = ACPI_HANDLE(&device->dev);
623-
unsigned long long mode;
623+
unsigned long long mode, dummy;
624624
struct intel_hid_priv *priv;
625625
acpi_status status;
626626
int err;
@@ -692,18 +692,15 @@ static int intel_hid_probe(struct platform_device *device)
692692
if (err)
693693
goto err_remove_notify;
694694

695-
if (priv->array) {
696-
unsigned long long dummy;
695+
intel_button_array_enable(&device->dev, true);
697696

698-
intel_button_array_enable(&device->dev, true);
699-
700-
/* Call button load method to enable HID power button */
701-
if (!intel_hid_evaluate_method(handle, INTEL_HID_DSM_BTNL_FN,
702-
&dummy)) {
703-
dev_warn(&device->dev,
704-
"failed to enable HID power button\n");
705-
}
706-
}
697+
/*
698+
* Call button load method to enable HID power button
699+
* Always do this since it activates events on some devices without
700+
* a button array too.
701+
*/
702+
if (!intel_hid_evaluate_method(handle, INTEL_HID_DSM_BTNL_FN, &dummy))
703+
dev_warn(&device->dev, "failed to enable HID power button\n");
707704

708705
device_init_wakeup(&device->dev, true);
709706
/*

0 commit comments

Comments
 (0)