Skip to contentSkip to conversation

platform/x86: intel-vbtn: Ignore extraneous events from tablet mode

PATCH In review Matt Delco 3 participants 3 messages Jun 21, 2018 – Jun 25, 2018 x86 platform drivers

lore
Share & tools
lore

Matt Delco

author
#0 lore raw

PATCH 1/1 platform/x86: intel-vbtn: Ignore extraneous events from tablet mode

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.

---
 drivers/platform/x86/intel-vbtn.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/platform/x86/intel-vbtn.c +4 -2
index c13780b8dabb..4c6f2bb1d1ac 100644
@@ -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 },
 };
 
Signature · 1 line
2.18.0.rc2.346.g013aa6912e-goog
Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · 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.

This looks good to me.

Quoted 24 lines
---
 drivers/platform/x86/intel-vbtn.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/platform/x86/intel-vbtn.c +4 -2
index c13780b8dabb..4c6f2bb1d1ac 100644
@@ -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 },
 };
 
Signature · 1 line
2.18.0.rc2.346.g013aa6912e-goog
Signature · 1 line
Dmitry
#2 lore raw

There is a v2 patch.
Please ignore this one.

2018-06-22 4:37 GMT+08:00 Dmitry Torokhov <[email protected]>:

Quoted 38 lines · Matt Delco
Quoted 5 lines

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.

This looks good to me.

Quoted 22 lines
---
 drivers/platform/x86/intel-vbtn.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/platform/x86/intel-vbtn.c +4 -3
index c13780b8dabb..4c6f2bb1d1ac 100644
@@ -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 },
 };
 
--
Quoted 2 lines

2.18.0.rc2.346.g013aa6912e-goog

--
Dmitry