mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-11 15:11:48 -04:00
Fix enable gesture mode error on panel off state
When on panel off state,enable or disable gesture mode will cause suspend and resume error,recording touch IC power state to correct. Change-Id: I71283abc65386b3a448782c1d122bcbb33c584cd Signed-off-by: zhuwg1 <zhuwg1@motorola.com> Reviewed-on: https://gerrit.mot.com/2236143 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: litong <litong20@motorola.com> Reviewed-by: Jichao Zou <zoujc@motorola.com> Submit-Approved: Jira Key
This commit is contained in:
parent
21eb62de55
commit
0c587df2a6
2 changed files with 47 additions and 2 deletions
|
|
@ -3873,6 +3873,10 @@ static int cyttsp5_put_device_into_easy_wakeup_(struct cyttsp5_core_data *cd)
|
|||
if (rc || status == 0)
|
||||
return -EBUSY;
|
||||
|
||||
mutex_lock(&cd->system_lock);
|
||||
cd->pm_mode = CYTTSP5_PM_EASY_WAKEUP;
|
||||
mutex_unlock(&cd->system_lock);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
|
@ -3883,6 +3887,12 @@ static int cyttsp5_put_device_into_deep_sleep_(struct cyttsp5_core_data *cd)
|
|||
rc = cyttsp5_hid_cmd_set_power_(cd, HID_POWER_SLEEP);
|
||||
if (rc)
|
||||
rc = -EBUSY;
|
||||
else {
|
||||
mutex_lock(&cd->system_lock);
|
||||
cd->pm_mode = CYTTSP5_PM_DEEPSLEEP;
|
||||
mutex_unlock(&cd->system_lock);
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
|
@ -3911,6 +3921,12 @@ static int cyttsp5_core_poweroff_device_(struct cyttsp5_core_data *cd)
|
|||
if (rc < 0)
|
||||
dev_err(cd->dev, "%s: HW Power down fails r=%d\n",
|
||||
__func__, rc);
|
||||
else {
|
||||
mutex_lock(&cd->system_lock);
|
||||
cd->pm_mode = CYTTSP5_PM_POWEROFF;
|
||||
mutex_unlock(&cd->system_lock);
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
|
@ -4697,15 +4713,19 @@ static int cyttsp5_core_wake_(struct cyttsp5_core_data *cd)
|
|||
mutex_unlock(&cd->system_lock);
|
||||
|
||||
if (!IS_DEEP_SLEEP_CONFIGURED(cd->easy_wakeup_gesture) &&
|
||||
(cd->should_enable_gesture ==1)) {
|
||||
(cd->should_enable_gesture ==1) &&
|
||||
(cd->pm_mode == CYTTSP5_PM_DEEPSLEEP ||
|
||||
cd->pm_mode == CYTTSP5_PM_EASY_WAKEUP)) {
|
||||
rc = cyttsp5_core_wake_device_(cd);
|
||||
} else if (cd->cpdata->flags & CY_CORE_FLAG_POWEROFF_ON_SLEEP)
|
||||
} else if ((cd->cpdata->flags & CY_CORE_FLAG_POWEROFF_ON_SLEEP) &&
|
||||
(cd->pm_mode == CYTTSP5_PM_POWEROFF))
|
||||
rc = cyttsp5_core_poweron_device_(cd);
|
||||
else
|
||||
rc = cyttsp5_core_wake_device_(cd);
|
||||
|
||||
mutex_lock(&cd->system_lock);
|
||||
cd->sleep_state = SS_SLEEP_OFF;
|
||||
cd->pm_mode = CYTTSP5_PM_ACTIVE;
|
||||
mutex_unlock(&cd->system_lock);
|
||||
|
||||
cyttsp5_start_wd_timer(cd);
|
||||
|
|
@ -5110,6 +5130,12 @@ int cyttsp5_core_suspend(struct device *dev)
|
|||
}
|
||||
}
|
||||
|
||||
dev_info(dev, "%s: suspend power state %s \n", __func__,
|
||||
cd->pm_mode == CYTTSP5_PM_POWEROFF ? "CYTTSP5_PM_POWEROFF" :
|
||||
(cd->pm_mode == CYTTSP5_PM_DEEPSLEEP ? "CYTTSP5_PM_DEEPSLEEP" :
|
||||
(cd->pm_mode == CYTTSP5_PM_EASY_WAKEUP ? "CYTTSP5_PM_EASY_WAKEUP" :
|
||||
(cd->pm_mode == CYTTSP5_PM_ACTIVE ? "CYTTSP5_PM_ACTIVE" : "Unknown"))));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -5145,6 +5171,12 @@ int cyttsp5_core_resume(struct device *dev)
|
|||
exit:
|
||||
cyttsp5_core_wake(cd);
|
||||
|
||||
dev_info(dev, "%s: resume power state %s \n", __func__,
|
||||
cd->pm_mode == CYTTSP5_PM_POWEROFF ? "CYTTSP5_PM_POWEROFF" :
|
||||
(cd->pm_mode == CYTTSP5_PM_DEEPSLEEP ? "CYTTSP5_PM_DEEPSLEEP" :
|
||||
(cd->pm_mode == CYTTSP5_PM_EASY_WAKEUP ? "CYTTSP5_PM_EASY_WAKEUP" :
|
||||
(cd->pm_mode == CYTTSP5_PM_ACTIVE ? "CYTTSP5_PM_ACTIVE" : "Unknown"))));
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
|
@ -6808,6 +6840,11 @@ int cyttsp5_probe(const struct cyttsp5_bus_ops *ops, struct device *dev,
|
|||
}
|
||||
if (rc < 0)
|
||||
dev_err(cd->dev, "%s: HW Init fail r=%d\n", __func__, rc);
|
||||
else {
|
||||
mutex_lock(&cd->system_lock);
|
||||
cd->pm_mode = CYTTSP5_PM_ACTIVE;
|
||||
mutex_unlock(&cd->system_lock);
|
||||
}
|
||||
|
||||
/* Call platform detect function */
|
||||
if (cd->cpdata->detect) {
|
||||
|
|
|
|||
|
|
@ -956,6 +956,13 @@ struct cyttsp5_sensor_platform_data {
|
|||
};
|
||||
#endif
|
||||
|
||||
enum cyttsp5_pm_mode {
|
||||
CYTTSP5_PM_POWEROFF = 0,
|
||||
CYTTSP5_PM_DEEPSLEEP,
|
||||
CYTTSP5_PM_EASY_WAKEUP,
|
||||
CYTTSP5_PM_ACTIVE,
|
||||
};
|
||||
|
||||
struct cyttsp5_core_data {
|
||||
struct list_head node;
|
||||
struct list_head module_list; /* List of probed modules */
|
||||
|
|
@ -1036,6 +1043,7 @@ struct cyttsp5_core_data {
|
|||
struct mutex tthe_lock;
|
||||
u8 tthe_exit;
|
||||
#endif
|
||||
enum cyttsp5_pm_mode pm_mode;
|
||||
bool should_enable_gesture;
|
||||
#ifdef CYTTSP5_SENSOR_EN
|
||||
struct mutex state_mutex;
|
||||
|
|
|
|||
Loading…
Reference in a new issue