summaryrefslogtreecommitdiff
path: root/drivers/hid/wacom_sys.c
diff options
context:
space:
mode:
authorPing Cheng <ping.cheng@wacom.com>2021-07-19 23:55:29 +0300
committerJiri Kosina <jkosina@suse.cz>2021-07-28 12:45:40 +0300
commitdc9dc864f35dd3b87d52fbe9809773576ac77d32 (patch)
tree0b6c6238797d7191b3d05f33ced86987954e50a4 /drivers/hid/wacom_sys.c
parent7cc8524f65ce1a350042836c7cf837046aaa6e21 (diff)
downloadlinux-dc9dc864f35dd3b87d52fbe9809773576ac77d32.tar.xz
HID: wacom: set initial hardware touch switch state to 'off'
Wacom touch devices have two types of touch switches: softkey touch toggle and hardware touch switch. For softkey toggle, we assume touch is on by default in the driver. However the hardware touch switch is controlled by end users. We don't know if it's on or off before getting the status event. This patch sets touch off for devices with a hardware switch until we get the status. This is a bit safer for users who leave the switch "off" and don't want any accidental touches. The tradeoff is a slight delay between device connection and touch becoming enabled for users who leave the switch "on". Signed-off-by: Ping Cheng <ping.cheng@wacom.com> Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com> Tested-by: Jason Gerecke <jason.gerecke@wacom.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/wacom_sys.c')
-rw-r--r--drivers/hid/wacom_sys.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c
index 57bfa0ae9836..713a2504092f 100644
--- a/drivers/hid/wacom_sys.c
+++ b/drivers/hid/wacom_sys.c
@@ -2287,7 +2287,13 @@ static void wacom_set_shared_values(struct wacom_wac *wacom_wac)
if (wacom_wac->has_mute_touch_switch) {
wacom_wac->shared->has_mute_touch_switch = true;
- wacom_wac->shared->is_touch_on = true;
+ /* Hardware touch switch may be off. Wait until
+ * we know the switch state to decide is_touch_on.
+ * Softkey state should be initialized to "on" to
+ * match historic default.
+ */
+ if (wacom_wac->is_soft_touch_switch)
+ wacom_wac->shared->is_touch_on = true;
}
if (wacom_wac->shared->has_mute_touch_switch &&