diff --git a/drivers/input/touchscreen/focaltech_touch/focaltech_core.c b/drivers/input/touchscreen/focaltech_touch/focaltech_core.c index 9eefb3e783f4..823caa4fdc8e 100644 --- a/drivers/input/touchscreen/focaltech_touch/focaltech_core.c +++ b/drivers/input/touchscreen/focaltech_touch/focaltech_core.c @@ -2476,6 +2476,9 @@ static int fts_parse_dt(struct device *dev, struct fts_ts_platform_data *pdata) FTS_INFO("max touch number:%d, irq gpio:%d, reset gpio:%d", pdata->max_touch_number, pdata->irq_gpio, pdata->reset_gpio); + pdata->power_always_on = + of_property_read_bool(np, "focaltech,power-always-on"); + ret = of_property_read_u32(np, "focaltech,ic-type", &temp_val); if (ret < 0) pdata->type = _FT3518; @@ -2903,6 +2906,7 @@ static int fts_ts_suspend(struct device *dev) { int ret = 0; struct fts_ts_data *ts_data = fts_data; + struct fts_ts_platform_data *pdata = ts_data->pdata; FTS_FUNC_ENTER(); if (ts_data->suspended) { @@ -2934,7 +2938,8 @@ static int fts_ts_suspend(struct device *dev) if (ret < 0) FTS_ERROR("set TP to sleep mode fail, ret=%d", ret); - if (!ts_data->ic_info.is_incell) { + if (!ts_data->ic_info.is_incell && !pdata->power_always_on) { + #if FTS_POWER_SOURCE_CUST_EN ret = fts_power_source_suspend(ts_data); if (ret < 0) { @@ -2953,6 +2958,7 @@ static int fts_ts_suspend(struct device *dev) static int fts_ts_resume(struct device *dev) { struct fts_ts_data *ts_data = fts_data; + struct fts_ts_platform_data *pdata = ts_data->pdata; FTS_FUNC_ENTER(); if (!ts_data->suspended) { @@ -2971,7 +2977,8 @@ static int fts_ts_resume(struct device *dev) if (!ts_data->ic_info.is_incell) { #if FTS_POWER_SOURCE_CUST_EN - fts_power_source_resume(ts_data); + if (!pdata->power_always_on) + fts_power_source_resume(ts_data); #endif fts_reset_proc(200); } diff --git a/drivers/input/touchscreen/focaltech_touch/focaltech_core.h b/drivers/input/touchscreen/focaltech_touch/focaltech_core.h index c87cc52e5e47..3c8701f98c62 100644 --- a/drivers/input/touchscreen/focaltech_touch/focaltech_core.h +++ b/drivers/input/touchscreen/focaltech_touch/focaltech_core.h @@ -139,6 +139,7 @@ struct fts_ts_platform_data { u32 x_min; u32 y_min; u32 max_touch_number; + bool power_always_on; }; struct ts_event {