Skip to content

Commit

Permalink
drivers: input: wacom: disable touchscreen input when spen is in use
Browse files Browse the repository at this point in the history
Change-Id: Icb71fbf9d10d9c74f313f7fec01c8aa5f858dfc2
  • Loading branch information
Linux4 committed Oct 6, 2021
1 parent 5af6aef commit 8f0b9de
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/input/touchscreen/himax/himax_83102E/himax_common.c
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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__);
Expand Down
5 changes: 5 additions & 0 deletions drivers/input/wacom/wacom.h
Expand Up @@ -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_ */
4 changes: 4 additions & 0 deletions drivers/input/wacom/wacom_i2c.c
Expand Up @@ -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;
}

Expand Down

0 comments on commit 8f0b9de

Please sign in to comment.