linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] platform/x86: intel-vbtn: Ignore extraneous events from tablet mode
@ 2018-06-21 20:12 Matt Delco
  2018-06-21 20:37 ` Dmitry Torokhov
  0 siblings, 1 reply; 3+ messages in thread
From: Matt Delco @ 2018-06-21 20:12 UTC (permalink / raw)
  To: AceLan Kao
  Cc: Darren Hart, Andy Shevchenko, platform-driver-x86, linux-kernel,
	Dmitry Torokhov, Matt Delco

The Dell laptop I have has an ACPI that sends 0xCB and 0xCC on entering
tablet mode.  On exiting tablet mode it sends 0xCA and 0xCD.  This
change has the driver ignore 0xCA and 0xCB.

Signed-off-by: Matt Delco <delco@chromium.org>
---
 drivers/platform/x86/intel-vbtn.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/platform/x86/intel-vbtn.c b/drivers/platform/x86/intel-vbtn.c
index c13780b8dabb..4c6f2bb1d1ac 100644
--- a/drivers/platform/x86/intel-vbtn.c
+++ b/drivers/platform/x86/intel-vbtn.c
@@ -38,8 +38,10 @@ static const struct key_entry intel_vbtn_keymap[] = {
 	{ KE_IGNORE, 0xC7, { KEY_VOLUMEDOWN } },	/* volume-down key release */
 	{ KE_KEY,    0xC8, { KEY_ROTATE_LOCK_TOGGLE } },	/* rotate-lock key press */
 	{ KE_KEY,    0xC9, { KEY_ROTATE_LOCK_TOGGLE } },	/* rotate-lock key release */
-	{ KE_SW,     0xCC, { .sw = { SW_TABLET_MODE, 1 } } },	/* Tablet */
-	{ KE_SW,     0xCD, { .sw = { SW_TABLET_MODE, 0 } } },	/* Laptop */
+	{ KE_IGNORE, 0xCA, { KEY_UNKNOWN } },			/* Laptop key press */
+	{ KE_IGNORE, 0xCB, { KEY_UNKNOWN } },			/* Tablet key press */
+	{ KE_SW,     0xCC, { .sw = { SW_TABLET_MODE, 1 } } },	/* Tablet key release */
+	{ KE_SW,     0xCD, { .sw = { SW_TABLET_MODE, 0 } } },	/* Laptop key release */
 	{ KE_END },
 };
 
-- 
2.18.0.rc2.346.g013aa6912e-goog


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

* Re: [PATCH] platform/x86: intel-vbtn: Ignore extraneous events from tablet mode
  2018-06-21 20:12 [PATCH] platform/x86: intel-vbtn: Ignore extraneous events from tablet mode Matt Delco
@ 2018-06-21 20:37 ` Dmitry Torokhov
  2018-06-25  6:14   ` AceLan Kao
  0 siblings, 1 reply; 3+ messages in thread
From: Dmitry Torokhov @ 2018-06-21 20:37 UTC (permalink / raw)
  To: Matt Delco
  Cc: AceLan Kao, Darren Hart, Andy Shevchenko, platform-driver-x86,
	linux-kernel

On Thu, Jun 21, 2018 at 01:12:07PM -0700, Matt Delco wrote:
> The Dell laptop I have has an ACPI that sends 0xCB and 0xCC on entering
> tablet mode.  On exiting tablet mode it sends 0xCA and 0xCD.  This
> change has the driver ignore 0xCA and 0xCB.
> 
> Signed-off-by: Matt Delco <delco@chromium.org>

This looks good to me.

Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

> ---
>  drivers/platform/x86/intel-vbtn.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/platform/x86/intel-vbtn.c b/drivers/platform/x86/intel-vbtn.c
> index c13780b8dabb..4c6f2bb1d1ac 100644
> --- a/drivers/platform/x86/intel-vbtn.c
> +++ b/drivers/platform/x86/intel-vbtn.c
> @@ -38,8 +38,10 @@ static const struct key_entry intel_vbtn_keymap[] = {
>  	{ KE_IGNORE, 0xC7, { KEY_VOLUMEDOWN } },	/* volume-down key release */
>  	{ KE_KEY,    0xC8, { KEY_ROTATE_LOCK_TOGGLE } },	/* rotate-lock key press */
>  	{ KE_KEY,    0xC9, { KEY_ROTATE_LOCK_TOGGLE } },	/* rotate-lock key release */
> -	{ KE_SW,     0xCC, { .sw = { SW_TABLET_MODE, 1 } } },	/* Tablet */
> -	{ KE_SW,     0xCD, { .sw = { SW_TABLET_MODE, 0 } } },	/* Laptop */
> +	{ KE_IGNORE, 0xCA, { KEY_UNKNOWN } },			/* Laptop key press */
> +	{ KE_IGNORE, 0xCB, { KEY_UNKNOWN } },			/* Tablet key press */
> +	{ KE_SW,     0xCC, { .sw = { SW_TABLET_MODE, 1 } } },	/* Tablet key release */
> +	{ KE_SW,     0xCD, { .sw = { SW_TABLET_MODE, 0 } } },	/* Laptop key release */
>  	{ KE_END },
>  };
>  
> -- 
> 2.18.0.rc2.346.g013aa6912e-goog
> 

-- 
Dmitry

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

* Re: [PATCH] platform/x86: intel-vbtn: Ignore extraneous events from tablet mode
  2018-06-21 20:37 ` Dmitry Torokhov
@ 2018-06-25  6:14   ` AceLan Kao
  0 siblings, 0 replies; 3+ messages in thread
From: AceLan Kao @ 2018-06-25  6:14 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Matt Delco, Darren Hart, Andy Shevchenko, Platform Driver,
	Linux-Kernel@Vger. Kernel. Org

There is a v2 patch.
Please ignore this one.

2018-06-22 4:37 GMT+08:00 Dmitry Torokhov <dmitry.torokhov@gmail.com>:
> On Thu, Jun 21, 2018 at 01:12:07PM -0700, Matt Delco wrote:
>> The Dell laptop I have has an ACPI that sends 0xCB and 0xCC on entering
>> tablet mode.  On exiting tablet mode it sends 0xCA and 0xCD.  This
>> change has the driver ignore 0xCA and 0xCB.
>>
>> Signed-off-by: Matt Delco <delco@chromium.org>
>
> This looks good to me.
>
> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
>
>> ---
>>  drivers/platform/x86/intel-vbtn.c | 6 ++++--
>>  1 file changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/platform/x86/intel-vbtn.c b/drivers/platform/x86/intel-vbtn.c
>> index c13780b8dabb..4c6f2bb1d1ac 100644
>> --- a/drivers/platform/x86/intel-vbtn.c
>> +++ b/drivers/platform/x86/intel-vbtn.c
>> @@ -38,8 +38,10 @@ static const struct key_entry intel_vbtn_keymap[] = {
>>       { KE_IGNORE, 0xC7, { KEY_VOLUMEDOWN } },        /* volume-down key release */
>>       { KE_KEY,    0xC8, { KEY_ROTATE_LOCK_TOGGLE } },        /* rotate-lock key press */
>>       { KE_KEY,    0xC9, { KEY_ROTATE_LOCK_TOGGLE } },        /* rotate-lock key release */
>> -     { KE_SW,     0xCC, { .sw = { SW_TABLET_MODE, 1 } } },   /* Tablet */
>> -     { KE_SW,     0xCD, { .sw = { SW_TABLET_MODE, 0 } } },   /* Laptop */
>> +     { KE_IGNORE, 0xCA, { KEY_UNKNOWN } },                   /* Laptop key press */
>> +     { KE_IGNORE, 0xCB, { KEY_UNKNOWN } },                   /* Tablet key press */
>> +     { KE_SW,     0xCC, { .sw = { SW_TABLET_MODE, 1 } } },   /* Tablet key release */
>> +     { KE_SW,     0xCD, { .sw = { SW_TABLET_MODE, 0 } } },   /* Laptop key release */
>>       { KE_END },
>>  };
>>
>> --
>> 2.18.0.rc2.346.g013aa6912e-goog
>>
>
> --
> Dmitry

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

end of thread, other threads:[~2018-06-25  6:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-21 20:12 [PATCH] platform/x86: intel-vbtn: Ignore extraneous events from tablet mode Matt Delco
2018-06-21 20:37 ` Dmitry Torokhov
2018-06-25  6:14   ` AceLan Kao

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