summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJin Fu <jinf@codeaurora.org>2017-10-10 14:14:55 +0800
committerGerrit - the friendly Code Review server <code-review@localhost>2017-10-11 20:23:17 -0700
commitb4b3c42c899a0e090dda71aa4d0345180af8aa32 (patch)
treef8a8c47a0bcc3e6f68f3ac7e5af081b8cd54c6f3
parent34f1071c18f56ceae77aa761578c639d59e67265 (diff)
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 <jinf@codeaurora.org>
-rw-r--r--drivers/input/touchscreen/st/fts.c28
1 files 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,
};