From e1dcbeffdfbbbee79975570d951e27e8f1bcaaf0 Mon Sep 17 00:00:00 2001 From: haojl2 Date: Thu, 9 Aug 2018 15:23:33 +0800 Subject: [PATCH] himax_mmi: suspend IC when EARLY_EVENT_BLANK triggered LCD driver will turn off VDD power after EARLY_EVENT_BLANK event sent. So TP driver need suspend IC when got this event. Otherwise, I2C transfer timeout will happen. Change-Id: I181377fc88a00ffed2e7fefd305ff2e2e4e04ade Signed-off-by: haojl2 Reviewed-on: https://gerrit.mot.com/1223414 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Wei Deng Reviewed-by: Jianqi Yang Submit-Approved: Jira Key --- .../touchscreen/himax_mmi/himax_platform.c | 32 +++++++++++-------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/drivers/input/touchscreen/himax_mmi/himax_platform.c b/drivers/input/touchscreen/himax_mmi/himax_platform.c index e1dcce37ac8e..e9fcd5f223b0 100644 --- a/drivers/input/touchscreen/himax_mmi/himax_platform.c +++ b/drivers/input/touchscreen/himax_mmi/himax_platform.c @@ -683,20 +683,26 @@ int fb_notifier_callback(struct notifier_block *self, container_of(self, struct himax_ts_data, fb_notif); I(" %s\n", __func__); - if (evdata && evdata->data && event == FB_EVENT_BLANK && ts && - ts->client) { + if (evdata && evdata->data && ts && ts->client) { blank = evdata->data; - - switch (*blank) { - case FB_BLANK_UNBLANK: - himax_common_resume(&ts->client->dev); - break; - case FB_BLANK_POWERDOWN: - case FB_BLANK_HSYNC_SUSPEND: - case FB_BLANK_VSYNC_SUSPEND: - case FB_BLANK_NORMAL: - himax_common_suspend(&ts->client->dev); - break; + if (event == FB_EARLY_EVENT_BLANK) { + switch (*blank) { + case FB_BLANK_POWERDOWN: + himax_common_suspend(&ts->client->dev); + break; + } + } else if (event == FB_EVENT_BLANK) { + switch (*blank) { + case FB_BLANK_UNBLANK: + himax_common_resume(&ts->client->dev); + break; + case FB_BLANK_POWERDOWN: + case FB_BLANK_HSYNC_SUSPEND: + case FB_BLANK_VSYNC_SUSPEND: + case FB_BLANK_NORMAL: + himax_common_suspend(&ts->client->dev); + break; + } } }