linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] platform/x86: intel-hid: Missing power button release on some Dell models
@ 2019-01-06 17:56 Jérôme de Bretagne
  2019-01-07 15:36 ` Mario.Limonciello
  0 siblings, 1 reply; 3+ messages in thread
From: Jérôme de Bretagne @ 2019-01-06 17:56 UTC (permalink / raw)
  To: Alex Hung
  Cc: platform-driver-x86, Andy Shevchenko, Darren Hart,
	Mario Limonciello, Rafael J. Wysocki, Chih-Wei Huang,
	Tristian Celestin, linux-kernel

Power button suspend for some Dell models was added in:

commit 821b85366284 (intel-hid: Power button suspend on Dell Latitude 7275)

by checking against the power button press notification (0xCE) to report
the power button press event. The corresponding power button release
notification (0xCF) was caught and ignored to stop it from being reported
as an "unknown event" in the logs.

The missing button release event is creating issues on Android-x86, as
reported on the project mailing list for a Dell Latitude 5175 model, since
the events are expected in down/up pairs.

Report the power button release event to fix this issue.

Link: https://groups.google.com/forum/#!topic/android-x86/aSwZK9Nf9Ro
Tested-by: Tristian Celestin <tristian.celestin@outlook.com>
Tested-by: Jérôme de Bretagne <jerome.debretagne@gmail.com>
Signed-off-by: Jérôme de Bretagne <jerome.debretagne@gmail.com>
---
 drivers/platform/x86/intel-hid.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/platform/x86/intel-hid.c b/drivers/platform/x86/intel-hid.c
index e28bcf61b126..bc0d55a59015 100644
--- a/drivers/platform/x86/intel-hid.c
+++ b/drivers/platform/x86/intel-hid.c
@@ -363,7 +363,7 @@ static void notify_handler(acpi_handle handle, u32 event, void *context)
 	 * the 5-button array, but still send notifies with power button
 	 * event code to this device object on power button actions.
 	 *
-	 * Report the power button press; catch and ignore the button release.
+	 * Report the power button press and release.
 	 */
 	if (!priv->array) {
 		if (event == 0xce) {
@@ -372,8 +372,11 @@ static void notify_handler(acpi_handle handle, u32 event, void *context)
 			return;
 		}
 
-		if (event == 0xcf)
+		if (event == 0xcf) {
+			input_report_key(priv->input_dev, KEY_POWER, 0);
+			input_sync(priv->input_dev);
 			return;
+		}
 	}
 
 	/* 0xC0 is for HID events, other values are for 5 button array */
-- 
2.11.0


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

* RE: [PATCH] platform/x86: intel-hid: Missing power button release on some Dell models
  2019-01-06 17:56 [PATCH] platform/x86: intel-hid: Missing power button release on some Dell models Jérôme de Bretagne
@ 2019-01-07 15:36 ` Mario.Limonciello
  2019-01-13  4:15   ` Darren Hart
  0 siblings, 1 reply; 3+ messages in thread
From: Mario.Limonciello @ 2019-01-07 15:36 UTC (permalink / raw)
  To: jerome.debretagne, alex.hung
  Cc: platform-driver-x86, andy, dvhart, rjw, cwhuang,
	tristian.celestin, linux-kernel



> -----Original Message-----
> From: platform-driver-x86-owner@vger.kernel.org <platform-driver-x86-
> owner@vger.kernel.org> On Behalf Of Jérôme de Bretagne
> Sent: Sunday, January 6, 2019 11:57 AM
> To: Alex Hung
> Cc: platform-driver-x86@vger.kernel.org; Andy Shevchenko; Darren Hart;
> Limonciello, Mario; Rafael J. Wysocki; Chih-Wei Huang; Tristian Celestin; linux-
> kernel@vger.kernel.org
> Subject: [PATCH] platform/x86: intel-hid: Missing power button release on some
> Dell models
> 
> 
> [EXTERNAL EMAIL]
> 
> Power button suspend for some Dell models was added in:
> 
> commit 821b85366284 (intel-hid: Power button suspend on Dell Latitude 7275)
> 
> by checking against the power button press notification (0xCE) to report
> the power button press event. The corresponding power button release
> notification (0xCF) was caught and ignored to stop it from being reported
> as an "unknown event" in the logs.
> 
> The missing button release event is creating issues on Android-x86, as
> reported on the project mailing list for a Dell Latitude 5175 model, since
> the events are expected in down/up pairs.
> 
> Report the power button release event to fix this issue.
> 
> Link: https://groups.google.com/forum/#!topic/android-x86/aSwZK9Nf9Ro
> Tested-by: Tristian Celestin <tristian.celestin@outlook.com>
> Tested-by: Jérôme de Bretagne <jerome.debretagne@gmail.com>
> Signed-off-by: Jérôme de Bretagne <jerome.debretagne@gmail.com>
> ---
>  drivers/platform/x86/intel-hid.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/platform/x86/intel-hid.c b/drivers/platform/x86/intel-hid.c
> index e28bcf61b126..bc0d55a59015 100644
> --- a/drivers/platform/x86/intel-hid.c
> +++ b/drivers/platform/x86/intel-hid.c
> @@ -363,7 +363,7 @@ static void notify_handler(acpi_handle handle, u32 event,
> void *context)
>  	 * the 5-button array, but still send notifies with power button
>  	 * event code to this device object on power button actions.
>  	 *
> -	 * Report the power button press; catch and ignore the button release.
> +	 * Report the power button press and release.
>  	 */
>  	if (!priv->array) {
>  		if (event == 0xce) {
> @@ -372,8 +372,11 @@ static void notify_handler(acpi_handle handle, u32 event,
> void *context)
>  			return;
>  		}
> 
> -		if (event == 0xcf)
> +		if (event == 0xcf) {
> +			input_report_key(priv->input_dev, KEY_POWER, 0);
> +			input_sync(priv->input_dev);
>  			return;
> +		}
>  	}
> 
>  	/* 0xC0 is for HID events, other values are for 5 button array */
> --
> 2.11.0

Reviewed-by: Mario Limonciello <mario.limonciello@dell.com>

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

* Re: [PATCH] platform/x86: intel-hid: Missing power button release on some Dell models
  2019-01-07 15:36 ` Mario.Limonciello
@ 2019-01-13  4:15   ` Darren Hart
  0 siblings, 0 replies; 3+ messages in thread
From: Darren Hart @ 2019-01-13  4:15 UTC (permalink / raw)
  To: Mario.Limonciello
  Cc: jerome.debretagne, alex.hung, platform-driver-x86, andy, rjw,
	cwhuang, tristian.celestin, linux-kernel

On Mon, Jan 07, 2019 at 03:36:48PM +0000, Mario.Limonciello@dell.com wrote:
> 
> 
> > -----Original Message-----
> > From: platform-driver-x86-owner@vger.kernel.org <platform-driver-x86-
> > owner@vger.kernel.org> On Behalf Of Jérôme de Bretagne
> > Sent: Sunday, January 6, 2019 11:57 AM
> > To: Alex Hung
> > Cc: platform-driver-x86@vger.kernel.org; Andy Shevchenko; Darren Hart;
> > Limonciello, Mario; Rafael J. Wysocki; Chih-Wei Huang; Tristian Celestin; linux-
> > kernel@vger.kernel.org
> > Subject: [PATCH] platform/x86: intel-hid: Missing power button release on some
> > Dell models
> > 
> > 
> > [EXTERNAL EMAIL]
> > 
> > Power button suspend for some Dell models was added in:
> > 
> > commit 821b85366284 (intel-hid: Power button suspend on Dell Latitude 7275)

I've addressed this one, but please do run checkpatch and correct reported
errors in the future. It checks commit reference format.

> > 
> > by checking against the power button press notification (0xCE) to report
> > the power button press event. The corresponding power button release
> > notification (0xCF) was caught and ignored to stop it from being reported
> > as an "unknown event" in the logs.
> > 
> > The missing button release event is creating issues on Android-x86, as
> > reported on the project mailing list for a Dell Latitude 5175 model, since
> > the events are expected in down/up pairs.
> > 
> > Report the power button release event to fix this issue.
> > 
> > Link: https://groups.google.com/forum/#!topic/android-x86/aSwZK9Nf9Ro
> > Tested-by: Tristian Celestin <tristian.celestin@outlook.com>
> > Tested-by: Jérôme de Bretagne <jerome.debretagne@gmail.com>
> > Signed-off-by: Jérôme de Bretagne <jerome.debretagne@gmail.com>

Queued for testing, thanks for the patch.

-- 
Darren Hart
VMware Open Source Technology Center

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

end of thread, other threads:[~2019-01-13  4:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-06 17:56 [PATCH] platform/x86: intel-hid: Missing power button release on some Dell models Jérôme de Bretagne
2019-01-07 15:36 ` Mario.Limonciello
2019-01-13  4:15   ` Darren Hart

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).