platform/x86: intel: hid: Always call BTNL ACPI method
Subsystems (2)
PATCH 1/1 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.
--- drivers/platform/x86/intel/hid.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-)
drivers/platform/x86/intel/hid.c +9 -12
@@ -620,7 +620,7 @@ static bool button_array_present(struct platform_device *device)static int intel_hid_probe (struct platform_device *device) {acpi_handle handle =ACPI_HANDLE (&device->dev); -unsigned long long mode; +unsigned long long mode, dummy;struct intel_hid_priv *priv;acpi_status status;int err;
@@ -692,18 +692,15 @@ static int intel_hid_probe(struct platform_device *device)if (err) goto err_remove_notify; -if (priv->array) { -unsigned long long dummy; +intel_button_array_enable (&device->dev, true); -intel_button_array_enable (&device->dev, true); - -/* Call button load method to enable HID power button */ -if (!intel_hid_evaluate_method (handle,INTEL_HID_DSM_BTNL_FN , - &dummy)) { -dev_warn (&device->dev, -"failed to enable HID power button\n" ); - } - } +/* +* Call button load method to enable HID power button +* Always do this since it activates events on some devices without +* a button array too. +*/ +if (!intel_hid_evaluate_method (handle,INTEL_HID_DSM_BTNL_FN , &dummy)) +dev_warn (&device->dev,"failed to enable HID power button\n" );device_init_wakeup (&device->dev, true);/*
Signature · 1 line
2.41.0
Hi,
Quoted 12 lines · Hans de Goede
On a HP Elite Dragonfly G2 the
0xccand0xcdevents forSW_TABLET_MODEare 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 inprobe()unconditional, that function does its ownpriv->arraycheck. This makes theintel_button_array_enable()call inprobe()consistent with the calls done on suspend/resume which also rely on thepriv->arraycheck inside the function.
Quoted 3 lines
I've added this to the pdx86/fixes branch now.
Regards,
Hans
Quoted 44 lines
--- drivers/platform/x86/intel/hid.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-)drivers/platform/x86/intel/hid.c +9
-12@@ -620,7 +620,7 @@ static bool button_array_present(struct platform_device *device)static int intel_hid_probe (struct platform_device *device) {acpi_handle handle =ACPI_HANDLE (&device->dev); -unsigned long long mode; +unsigned long long mode, dummy;struct intel_hid_priv *priv;acpi_status status;int err;@@ -692,18 +692,15 @@ static int intel_hid_probe(struct platform_device *device)if (err) goto err_remove_notify; -if (priv->array) { -unsigned long long dummy; +intel_button_array_enable (&device->dev, true); -intel_button_array_enable (&device->dev, true); - -/* Call button load method to enable HID power button */ -if (!intel_hid_evaluate_method (handle,INTEL_HID_DSM_BTNL_FN , - &dummy)) { -dev_warn (&device->dev, -"failed to enable HID power button\n" ); - } - } +/* +* Call button load method to enable HID power button +* Always do this since it activates events on some devices without +* a button array too. +*/ +if (!intel_hid_evaluate_method (handle,INTEL_HID_DSM_BTNL_FN , &dummy)) +dev_warn (&device->dev,"failed to enable HID power button\n" );device_init_wakeup (&device->dev, true);/*