From ce773471418fa41be09ea0b18a8c59f40c85e04a Mon Sep 17 00:00:00 2001 From: wengjun1 Date: Wed, 25 Sep 2019 18:14:54 +0800 Subject: [PATCH] DLKM: Sync focaltech_0flash_mmi code with bq-sh2019 - (CR): focaltech_0flash_mmi: set deep sleep when predict failed - (CR): focaltech_0flash_mmi: set reset pin to 0 if vio is close - Release all fingers when resume Change-Id: Ia6b8169d560951c3407a8c2b28b2d21d071bf710 Signed-off-by: wengjun1 Reviewed-on: https://gerrit.mot.com/1427799 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Yeqing Wang Reviewed-by: Hujun Liao Submit-Approved: Jira Key --- .../focaltech_0flash_mmi/focaltech_core.c | 22 +++++++++++++++++++ .../focaltech_0flash_mmi/focaltech_core.h | 1 + 2 files changed, 23 insertions(+) diff --git a/drivers/input/touchscreen/focaltech_0flash_mmi/focaltech_core.c b/drivers/input/touchscreen/focaltech_0flash_mmi/focaltech_core.c index a53718f9d638..1b39bbab3516 100755 --- a/drivers/input/touchscreen/focaltech_0flash_mmi/focaltech_core.c +++ b/drivers/input/touchscreen/focaltech_0flash_mmi/focaltech_core.c @@ -1520,6 +1520,10 @@ static int fts_parse_dt(struct device *dev, struct fts_ts_platform_data *pdata) if (pdata->share_reset_gpio) FTS_INFO("TP reset pin is shared with LCD"); + pdata->always_on_vio = of_property_read_bool(np, "focaltech,always_on_vio"); + if (pdata->always_on_vio) + FTS_INFO("TP VIO always on."); + pdata->irq_gpio = of_get_named_gpio_flags(np, "focaltech,irq-gpio", 0, &pdata->irq_gpio_flags); if (pdata->irq_gpio < 0) @@ -1600,6 +1604,12 @@ int drm_notifier_callback(struct notifier_block *self, FTS_INFO("palm detection is enabled"); return 1; } +#endif +#ifdef FOCALTECH_SENSOR_EN + if (fts_data->should_enable_gesture) { + FTS_INFO("double tap gesture suspend\n"); + return 1; + } #endif } else if (MSM_DRM_EVENT_BLANK == event) { FTS_INFO("suspend: event = %lu, not care\n", event); @@ -2077,6 +2087,11 @@ static int _fts_ts_suspend(struct device *dev) #endif } + if (!ts_data->pdata->always_on_vio) { + FTS_INFO("Set reset pin to 0 in suspend."); + gpio_direction_output(ts_data->pdata->reset_gpio, 0); + } + fts_release_all_finger(); ts_data->suspended = true; FTS_FUNC_EXIT(); @@ -2114,6 +2129,8 @@ static int _fts_ts_resume(struct device *dev) return 0; } + fts_release_all_finger(); + if (!ts_data->ic_info.is_incell) { #if FTS_POWER_SOURCE_CUST_EN fts_power_source_resume(ts_data); @@ -2121,6 +2138,11 @@ static int _fts_ts_resume(struct device *dev) //fts_reset_proc(200); } + if (!ts_data->pdata->always_on_vio) { + FTS_INFO("Reset IC in resume"); + fts_reset_proc(200); + } + fts_tp_state_recovery(ts_data); #if FTS_ESDCHECK_EN diff --git a/drivers/input/touchscreen/focaltech_0flash_mmi/focaltech_core.h b/drivers/input/touchscreen/focaltech_0flash_mmi/focaltech_core.h index ca0f0360b226..447555bfd85c 100755 --- a/drivers/input/touchscreen/focaltech_0flash_mmi/focaltech_core.h +++ b/drivers/input/touchscreen/focaltech_0flash_mmi/focaltech_core.h @@ -135,6 +135,7 @@ struct fts_ts_platform_data { u32 irq_gpio_flags; u32 reset_gpio; u32 reset_gpio_flags; + bool always_on_vio; bool share_reset_gpio; bool have_key; u32 key_number;