From b4b3c42c899a0e090dda71aa4d0345180af8aa32 Mon Sep 17 00:00:00 2001 From: Jin Fu Date: Tue, 10 Oct 2017 14:14:55 +0800 Subject: [PATCH] input: touchpanel: fix TP frozen when ST's TP firstly probe up Set TP to display-unblank status when firstly probe up, so that TP can detect interrupt and report touch event without press power key. Change-Id: I6e4ea48551463c6d0f747987d7c255987e3a11df Signed-off-by: Jin Fu --- drivers/input/touchscreen/st/fts.c | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/drivers/input/touchscreen/st/fts.c b/drivers/input/touchscreen/st/fts.c index 08bfb83a9447..06f7f569f417 100644 --- a/drivers/input/touchscreen/st/fts.c +++ b/drivers/input/touchscreen/st/fts.c @@ -105,7 +105,7 @@ static void fts_interrupt_enable(struct fts_ts_info *info); static int fts_init_hw(struct fts_ts_info *info); static int fts_mode_handler(struct fts_ts_info *info, int force); static int fts_command(struct fts_ts_info *info, unsigned char cmd); - +static void fts_unblank(struct fts_ts_info *info); static int fts_chip_initialization(struct fts_ts_info *info); void touch_callback(unsigned int status) @@ -1487,8 +1487,12 @@ static int fts_init(struct fts_ts_info *info) error = fts_interrupt_install(info); - if (error != OK) + if (error != OK) { logError(1, "%s Init (1) error (ERROR = %08X)\n", error); + return error; + } + + fts_unblank(info); return error; } @@ -1773,6 +1777,26 @@ static int fts_fb_state_chg_callback(struct notifier_block *nb, unsigned long va } +static void fts_unblank(struct fts_ts_info *info) +{ + int i; + + for (i = 0; i < TOUCH_ID_MAX; i++) { + input_mt_slot(info->input_dev, i); + input_mt_report_slot_state(info->input_dev, + (i < FINGER_MAX) ? MT_TOOL_FINGER : MT_TOOL_PEN, 0); + } + input_sync(info->input_dev); + + info->resume_bit = 1; + + fts_mode_handler(info, 0); + + info->sensor_sleep = false; + + fts_enableInterrupt(); +} + static struct notifier_block fts_noti_block = { .notifier_call = fts_fb_state_chg_callback, };