platform-driver-x86.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] platform/x86: thinkpad_acpi: Send tablet mode switch at wakeup time
@ 2020-11-23 13:21 Benjamin Berg
  2020-11-23 22:43 ` ibm-acpi
  2020-11-24 12:10 ` Hans de Goede
  0 siblings, 2 replies; 3+ messages in thread
From: Benjamin Berg @ 2020-11-23 13:21 UTC (permalink / raw)
  To: Hans de Goede, Henrique de Moraes Holschuh
  Cc: ibm-acpi-devel, platform-driver-x86, Benjamin Berg

From: Benjamin Berg <bberg@redhat.com>

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")
BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=210269
Signed-off-by: Benjamin Berg <bberg@redhat.com>
---
 drivers/platform/x86/thinkpad_acpi.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index e3810675090a..9104e0ee37cd 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -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();
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] platform/x86: thinkpad_acpi: Send tablet mode switch at wakeup time
  2020-11-23 13:21 [PATCH] platform/x86: thinkpad_acpi: Send tablet mode switch at wakeup time Benjamin Berg
@ 2020-11-23 22:43 ` ibm-acpi
  2020-11-24 12:10 ` Hans de Goede
  1 sibling, 0 replies; 3+ messages in thread
From: ibm-acpi @ 2020-11-23 22:43 UTC (permalink / raw)
  To: Benjamin Berg, Hans de Goede
  Cc: Thinkpad-acpi devel ML, platform-driver-x86, Benjamin Berg


Acked-by: Henrique de Moraes Holschuh <hnh@hmh.eng.br>

On Mon, Nov 23, 2020, at 10:21, Benjamin Berg wrote:
> From: Benjamin Berg <bberg@redhat.com>
> 
> 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")
> BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=210269
> Signed-off-by: Benjamin Berg <bberg@redhat.com>
> ---
>  drivers/platform/x86/thinkpad_acpi.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/platform/x86/thinkpad_acpi.c 
> b/drivers/platform/x86/thinkpad_acpi.c
> index e3810675090a..9104e0ee37cd 100644
> --- a/drivers/platform/x86/thinkpad_acpi.c
> +++ b/drivers/platform/x86/thinkpad_acpi.c
> @@ -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();
> -- 
> 2.26.2
> 
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] platform/x86: thinkpad_acpi: Send tablet mode switch at wakeup time
  2020-11-23 13:21 [PATCH] platform/x86: thinkpad_acpi: Send tablet mode switch at wakeup time Benjamin Berg
  2020-11-23 22:43 ` ibm-acpi
@ 2020-11-24 12:10 ` Hans de Goede
  1 sibling, 0 replies; 3+ messages in thread
From: Hans de Goede @ 2020-11-24 12:10 UTC (permalink / raw)
  To: Benjamin Berg, Henrique de Moraes Holschuh
  Cc: ibm-acpi-devel, platform-driver-x86, Benjamin Berg

Hi,

On 11/23/20 2:21 PM, Benjamin Berg wrote:
> From: Benjamin Berg <bberg@redhat.com>
> 
> 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")
> BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=210269
> Signed-off-by: Benjamin Berg <bberg@redhat.com>

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

> ---
>  drivers/platform/x86/thinkpad_acpi.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
> index e3810675090a..9104e0ee37cd 100644
> --- a/drivers/platform/x86/thinkpad_acpi.c
> +++ b/drivers/platform/x86/thinkpad_acpi.c
> @@ -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();
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-11-24 12:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-23 13:21 [PATCH] platform/x86: thinkpad_acpi: Send tablet mode switch at wakeup time Benjamin Berg
2020-11-23 22:43 ` ibm-acpi
2020-11-24 12:10 ` Hans de Goede

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).