From 0fd56bb285516dcadf374250142febbeaad4e49e Mon Sep 17 00:00:00 2001 From: litong Date: Wed, 29 Apr 2020 14:21:46 +0800 Subject: [PATCH] Add power flag to indicate power status. TP: Add power status flag to indicate whether it is powered on or powered off. Set power state when power on and power off. Change-Id: I9f8677278a2bc358233e7221ee564b69e4b75dcc Reviewed-on: https://gerrit.mot.com/1538895 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Jialei Hao Reviewed-by: Jianqi Yang Submit-Approved: Jira Key --- .../input/touchscreen/synaptics_tcm_mmi_v2/synaptics_core.h | 1 + .../input/touchscreen/synaptics_tcm_mmi_v2/synaptics_ts_mmi.c | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/input/touchscreen/synaptics_tcm_mmi_v2/synaptics_core.h b/drivers/input/touchscreen/synaptics_tcm_mmi_v2/synaptics_core.h index 3a8c7ef4d4bb..2d5fd5374244 100644 --- a/drivers/input/touchscreen/synaptics_tcm_mmi_v2/synaptics_core.h +++ b/drivers/input/touchscreen/synaptics_tcm_mmi_v2/synaptics_core.h @@ -457,6 +457,7 @@ struct syna_tcm_hcd { wait_queue_head_t hdl_wq; wait_queue_head_t reflash_wq; int irq; + bool power_status; bool do_polling; bool in_suspend; bool irq_enabled; diff --git a/drivers/input/touchscreen/synaptics_tcm_mmi_v2/synaptics_ts_mmi.c b/drivers/input/touchscreen/synaptics_tcm_mmi_v2/synaptics_ts_mmi.c index 180a80b448a2..ee6dfcbee556 100644 --- a/drivers/input/touchscreen/synaptics_tcm_mmi_v2/synaptics_ts_mmi.c +++ b/drivers/input/touchscreen/synaptics_tcm_mmi_v2/synaptics_ts_mmi.c @@ -457,7 +457,7 @@ static int syna_ts_mmi_methods_get_poweron(struct device *dev, void *idata) struct platform_device *pdev; GET_SYNA_DATA(dev); - TO_INT(idata) = tcm_hcd->in_suspend == 0 ? 1 : 0; + TO_INT(idata) = tcm_hcd->power_status == 0 ? 1 : 0; return 0; } @@ -576,6 +576,7 @@ static int syna_ts_mmi_methods_power(struct device *dev, int on) } msleep(bdata->power_delay_ms); } + tcm_hcd->power_status = true; return 0; disable_pwr_reg: @@ -585,6 +586,7 @@ disable_bus_reg: if (tcm_hcd->bus_reg) regulator_disable(tcm_hcd->bus_reg); exit: + tcm_hcd->power_status = false; return retval; }