From 8f0b9dedfad0f52279f91ff2a69ca61fc5227066 Mon Sep 17 00:00:00 2001 From: Tim Zimmermann Date: Sat, 25 Sep 2021 17:30:12 +0200 Subject: [PATCH] drivers: input: wacom: disable touchscreen input when spen is in use Change-Id: Icb71fbf9d10d9c74f313f7fec01c8aa5f858dfc2 --- drivers/input/touchscreen/himax/himax_83102E/himax_common.c | 5 +++++ drivers/input/wacom/wacom.h | 5 +++++ drivers/input/wacom/wacom_i2c.c | 4 ++++ 3 files changed, 14 insertions(+) diff --git a/drivers/input/touchscreen/himax/himax_83102E/himax_common.c b/drivers/input/touchscreen/himax/himax_83102E/himax_common.c index 514de7944b8a..09009ed75ff4 100644 --- a/drivers/input/touchscreen/himax/himax_83102E/himax_common.c +++ b/drivers/input/touchscreen/himax/himax_83102E/himax_common.c @@ -239,6 +239,9 @@ bool FAKE_POWER_KEY_SEND = true; struct proc_dir_entry *himax_proc_HSEN_file = NULL; #endif +bool himax_epen_mode = false; +EXPORT_SYMBOL(himax_epen_mode); + #if defined(HX_PALM_REPORT) static int himax_palm_detect(uint8_t *buf) { @@ -2384,6 +2387,8 @@ static void himax_finger_report(struct himax_ts_data *ts) int i = 0; bool valid = false; + if (himax_epen_mode) + return; if (g_ts_dbg != 0) { I("%s:start\n", __func__); diff --git a/drivers/input/wacom/wacom.h b/drivers/input/wacom/wacom.h index 47a36b084ccd..6acd7f525994 100644 --- a/drivers/input/wacom/wacom.h +++ b/drivers/input/wacom/wacom.h @@ -397,4 +397,9 @@ extern int set_spen_mode(int mode); #ifdef CONFIG_SEC_FACTORY bool wacom_check_ub(struct wacom_i2c *wac_i2c); #endif + +#ifdef CONFIG_TOUCHSCREEN_HIMAX_SPI +extern bool himax_epen_mode; +#endif + #endif /* _LINUX_WACOM_H_ */ diff --git a/drivers/input/wacom/wacom_i2c.c b/drivers/input/wacom/wacom_i2c.c index 7fa71e84afa8..0a03800e1c3a 100644 --- a/drivers/input/wacom/wacom_i2c.c +++ b/drivers/input/wacom/wacom_i2c.c @@ -1271,6 +1271,10 @@ int wacom_i2c_coord(struct wacom_i2c *wac_i2c) wac_i2c->localscan_mode = false; } +#ifdef CONFIG_TOUCHSCREEN_HIMAX_SPI + himax_epen_mode = wac_i2c->pen_prox || wac_i2c->pen_pressed; +#endif + return 0; }