8d419f
From c064473f6993a04ad126770a3218da623316c543 Mon Sep 17 00:00:00 2001
8d419f
From: Hans de Goede <hdegoede@redhat.com>
8d419f
Date: Sat, 25 Dec 2021 11:19:03 +0100
8d419f
Subject: [PATCH] hwdb: 60-keyboard: Fix volume-button mapping on Asus TF103C
8d419f
8d419f
The Asus TF103C misses the home button in its PNP0C40 GPIO resources
8d419f
causing the button mappings for the volume buttons to be off by one,
8d419f
leading to the volume-up button sending home button presses and the
8d419f
volume-down button sending volume-up button presses.
8d419f
8d419f
Add a 60-keyboard hwdb entry to correct the mappings. Note this is
8d419f
split over 2 input devices because the soc_button_array driver
8d419f
creates separate input devices for power + home and vol up/down.
8d419f
This is done because power/home act as wakeup buttons where as
8d419f
the volume buttons do not.
8d419f
8d419f
This means that after this fixup the home -> volume-up button
8d419f
still acts as a wakeup button, there is nothing which can be done
8d419f
about this without adding a kludge to the kernel which is not
8d419f
worth the trouble (IMHO).
8d419f
8d419f
(cherry picked from commit 04b457d8ef9c93be3b2048c6f545cdbcf1b893a1)
8d419f
8d419f
Related: #2087778
8d419f
---
8d419f
 hwdb.d/60-keyboard.hwdb | 8 ++++++++
8d419f
 1 file changed, 8 insertions(+)
8d419f
8d419f
diff --git a/hwdb.d/60-keyboard.hwdb b/hwdb.d/60-keyboard.hwdb
8d419f
index b614a22c8c..3d6e56983b 100644
8d419f
--- a/hwdb.d/60-keyboard.hwdb
8d419f
+++ b/hwdb.d/60-keyboard.hwdb
8d419f
@@ -231,6 +231,14 @@ evdev:name:Asus Laptop extra buttons:dmi:bvn*:bvr*:bd*:svnASUS*:pn*:*
8d419f
 evdev:input:b0003v0B05p1869*
8d419f
  KEYBOARD_KEY_ff31007c=f20                              # Remap micmute to f20
8d419f
 
8d419f
+# Asus TF103C misses the home button in its PNP0C40 GPIO resources
8d419f
+# causing the volume-button mappings to be off by one, correct this
8d419f
+evdev:name:gpio-keys:phys:gpio-keys/input0:ev:3:dmi:*:svnASUSTeKCOMPUTERINC.:pnTF103C*:*
8d419f
+ KEYBOARD_KEY_1=volumeup
8d419f
+
8d419f
+evdev:name:gpio-keys:phys:gpio-keys/input0:ev:100003:dmi:*:svnASUSTeKCOMPUTERINC.:pnTF103C*:*
8d419f
+ KEYBOARD_KEY_0=volumedown
8d419f
+
8d419f
 ###########################################################
8d419f
 # BenQ
8d419f
 ###########################################################