Skip to contentSkip to conversation

platform/x86: thinkpad_acpi: Send tablet mode switch at wakeup time

PATCH In review Benjamin Berg 3 participants 3 messages Nov 23, 2020 – Nov 24, 2020 x86 platform drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 platform/x86: thinkpad_acpi: Send tablet mode switch at wakeup time

From: Benjamin Berg <[email protected]>

The lid state may change while the machine is suspended. As such, we may need to re-check the state at wake-up time (at least when waking up from hibernation).
Add the appropriate call to the resume handler in order to sync the SW_TABLET_MODE switch state with the hardware state.

Fixes dda3ec0aa631 ("platform/x86: thinkpad_acpi: Implement tablet mode using GMMS method")
---
 drivers/platform/x86/thinkpad_acpi.c | 1 +
 1 file changed, 1 insertion(+)
drivers/platform/x86/thinkpad_acpi.c +1 -0
index e3810675090a..9104e0ee37cd 100644
@@ -4228,6 +4228,7 @@ static void hotkey_resume(void)
 		pr_err("error while attempting to reset the event firmware interface\n");
 
 	tpacpi_send_radiosw_update();
+	tpacpi_input_send_tabletsw();
 	hotkey_tablet_mode_notify_change();
 	hotkey_wakeup_reason_notify_change();
 	hotkey_wakeup_hotunplug_complete_notify_change();
Signature · 1 line
2.26.2
Acked-by Henrique de Moraes Holschuh on v1 1/1
#1 lore raw
Quoted 34 lines · Benjamin Berg

From: Benjamin Berg <[email protected]>

The lid state may change while the machine is suspended. As such, we may need to re-check the state at wake-up time (at least when waking up from hibernation).
Add the appropriate call to the resume handler in order to sync the SW_TABLET_MODE switch state with the hardware state.

Fixes dda3ec0aa631 ("platform/x86: thinkpad_acpi: Implement tablet

mode using GMMS method")

---
 drivers/platform/x86/thinkpad_acpi.c | 1 +
 1 file changed, 1 insertion(+)
drivers/platform/x86/thinkpad_acpi.c +1 -0
index e3810675090a..9104e0ee37cd 100644
@@ -4228,6 +4228,7 @@ static void hotkey_resume(void)
 		pr_err("error while attempting to reset the event firmware 
 interface\n");
 
 	tpacpi_send_radiosw_update();
+	tpacpi_input_send_tabletsw();
 	hotkey_tablet_mode_notify_change();
 	hotkey_wakeup_reason_notify_change();

hotkey_wakeup_hotunplug_complete_notify_change();

Signature · 1 line
2.26.2
#2 lore raw
In reply to Benjamin Berg

Hi,

Quoted 11 lines · Benjamin Berg

From: Benjamin Berg <[email protected]>

The lid state may change while the machine is suspended. As such, we may need to re-check the state at wake-up time (at least when waking up from hibernation).
Add the appropriate call to the resume handler in order to sync the SW_TABLET_MODE switch state with the hardware state.

Fixes dda3ec0aa631 ("platform/x86: thinkpad_acpi: Implement tablet mode using GMMS method")

Thank you for your patch, I've applied this patch to my review-hans branch:
https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=review-hans

Note it will show up in my review-hans branch once I've pushed my local branch there, which might take a while.

Once I've run some tests on this branch the patches there will be added to the platform-drivers-x86/for-next branch and eventually will be included in the pdx86 pull-request to Linus for the next merge-window.

Regards,

Hans

Quoted 17 lines
---
 drivers/platform/x86/thinkpad_acpi.c | 1 +
 1 file changed, 1 insertion(+)
drivers/platform/x86/thinkpad_acpi.c +1 -0
index e3810675090a..9104e0ee37cd 100644
@@ -4228,6 +4228,7 @@ static void hotkey_resume(void)
 		pr_err("error while attempting to reset the event firmware interface\n");
 
 	tpacpi_send_radiosw_update();
+	tpacpi_input_send_tabletsw();
 	hotkey_tablet_mode_notify_change();
 	hotkey_wakeup_reason_notify_change();
 	hotkey_wakeup_hotunplug_complete_notify_change();