mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-10 14:19:09 -04:00
focaltech_0flash_mmi: Add suspend resume mutex
TP: Add a mutex to lock suspend and resume function This is used by touch virtual sensor Change-Id: I816fa9347299313a392ad9e0b4e4991aac74fef3 Signed-off-by: haojl2 <haojl2@motorola.com> Reviewed-on: https://gerrit.mot.com/1411930 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Guobin Zhang <zhanggb@motorola.com> Submit-Approved: Jira Key
This commit is contained in:
parent
beb3720917
commit
8eb26142f2
2 changed files with 24 additions and 2 deletions
|
|
@ -1712,6 +1712,7 @@ static int fts_ts_probe_entry(struct fts_ts_data *ts_data)
|
|||
spin_lock_init(&ts_data->irq_lock);
|
||||
mutex_init(&ts_data->report_mutex);
|
||||
mutex_init(&ts_data->bus_lock);
|
||||
mutex_init(&ts_data->suspend_resume_mutex);
|
||||
#ifdef FOCALTECH_SENSOR_EN
|
||||
mutex_init(&ts_data->state_mutex);
|
||||
//unknown screen state
|
||||
|
|
@ -1976,7 +1977,7 @@ static int fts_ts_remove_entry(struct fts_ts_data *ts_data)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int fts_ts_suspend(struct device *dev)
|
||||
static int _fts_ts_suspend(struct device *dev)
|
||||
{
|
||||
int ret = 0;
|
||||
struct fts_ts_data *ts_data = fts_data;
|
||||
|
|
@ -2065,7 +2066,17 @@ static int fts_ts_suspend(struct device *dev)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int fts_ts_resume(struct device *dev)
|
||||
static int fts_ts_suspend(struct device *dev)
|
||||
{
|
||||
int ret = 0;
|
||||
mutex_lock(&fts_data->suspend_resume_mutex);
|
||||
ret = _fts_ts_suspend(dev);
|
||||
mutex_unlock(&fts_data->suspend_resume_mutex);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int _fts_ts_resume(struct device *dev)
|
||||
{
|
||||
struct fts_ts_data *ts_data = fts_data;
|
||||
|
||||
|
|
@ -2141,6 +2152,16 @@ static int fts_ts_resume(struct device *dev)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int fts_ts_resume(struct device *dev)
|
||||
{
|
||||
int ret = 0;
|
||||
mutex_lock(&fts_data->suspend_resume_mutex);
|
||||
ret = _fts_ts_resume(dev);
|
||||
mutex_unlock(&fts_data->suspend_resume_mutex);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* TP Driver
|
||||
*****************************************************************************/
|
||||
|
|
|
|||
|
|
@ -179,6 +179,7 @@ struct fts_ts_data {
|
|||
struct delayed_work esdcheck_work;
|
||||
struct delayed_work prc_work;
|
||||
struct work_struct resume_work;
|
||||
struct mutex suspend_resume_mutex;
|
||||
struct ftxxxx_proc proc;
|
||||
spinlock_t irq_lock;
|
||||
struct mutex report_mutex;
|
||||
|
|
|
|||
Loading…
Reference in a new issue