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 <haojl2@motorola.com>
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
litong 2020-04-29 14:21:46 +08:00 • committed by litong20
commit 0fd56bb285
2 changed files with 4 additions and 1 deletions

View file

@ -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;

View file

@ -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;
}