mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-25 06:03:36 -04:00
himax_v2_mmi: Add suspend resume mutex
TP: Add a mutex to lock suspend and resume function This is used by touch virtual sensor Change-Id: If7cc2dab9a5b1550a46ee4b5679d4451b1d944cd Signed-off-by: haojl2 <haojl2@motorola.com> Reviewed-on: https://gerrit.mot.com/1411821 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Jun Weng <wengjun1@motorola.com> Reviewed-by: Guobin Zhang <zhanggb@motorola.com> Submit-Approved: Jira Key
This commit is contained in:
parent
55ee1068f3
commit
beb3720917
2 changed files with 24 additions and 2 deletions
|
|
@ -3479,6 +3479,7 @@ FW_force_upgrade:
|
|||
pdata->cable_config[1] = 0x00;
|
||||
#endif
|
||||
ts->suspended = false;
|
||||
mutex_init(&ts->suspend_resume_mutex);
|
||||
#if defined(HX_USB_DETECT_CALLBACK) || defined(HX_USB_DETECT_GLOBAL)
|
||||
ts->usb_connected = 0x00;
|
||||
ts->cable_config = pdata->cable_config;
|
||||
|
|
@ -3688,7 +3689,7 @@ void himax_chip_common_deinit(void)
|
|||
I("%s: Common section deinited!\n", __func__);
|
||||
}
|
||||
|
||||
int himax_chip_common_suspend(struct himax_ts_data *ts)
|
||||
int _himax_chip_common_suspend(struct himax_ts_data *ts)
|
||||
{
|
||||
if (ts->suspended) {
|
||||
I("%s: Already suspended. Skipped.\n", __func__);
|
||||
|
|
@ -3764,7 +3765,17 @@ END:
|
|||
return 0;
|
||||
}
|
||||
|
||||
int himax_chip_common_resume(struct himax_ts_data *ts)
|
||||
int himax_chip_common_suspend(struct himax_ts_data *ts)
|
||||
{
|
||||
int ret = 0;
|
||||
mutex_lock(&ts->suspend_resume_mutex);
|
||||
ret = _himax_chip_common_suspend(ts);
|
||||
mutex_unlock(&ts->suspend_resume_mutex);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int _himax_chip_common_resume(struct himax_ts_data *ts)
|
||||
{
|
||||
#if defined(HX_ZERO_FLASH) && defined(HX_RESUME_SET_FW)
|
||||
int result = 0;
|
||||
|
|
@ -3847,3 +3858,13 @@ END:
|
|||
return 0;
|
||||
}
|
||||
|
||||
int himax_chip_common_resume(struct himax_ts_data *ts)
|
||||
{
|
||||
int ret = 0;
|
||||
mutex_lock(&ts->suspend_resume_mutex);
|
||||
ret = _himax_chip_common_resume(ts);
|
||||
mutex_unlock(&ts->suspend_resume_mutex);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -344,6 +344,7 @@ struct himax_ts_data {
|
|||
bool initialized;
|
||||
bool suspended;
|
||||
atomic_t suspend_mode;
|
||||
struct mutex suspend_resume_mutex;
|
||||
uint8_t x_channel;
|
||||
uint8_t y_channel;
|
||||
uint8_t useScreenRes;
|
||||
|
|
|
|||
Loading…
Reference in a new issue