mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-09 05:39:54 -04:00
synaptics_mmi_class: fix suspend/resume callbacks
Touchscreen class driver suspend/resume callbacks updated to properly enter enter/exit suspend mode. NO_PROP_NEEDED: this driver only used in Smith Change-Id: I12e786077bebd08f3011e128b8df665d5ec9d53b Signed-off-by: Konstantin Makariev <hcv867@motorola.com> Reviewed-on: https://gerrit.mot.com/1596492 Tested-by: Jira Key Reviewed-by: Konstantin Makariev <kmakariev@motorola.com> SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Submit-Approved: Jira Key
This commit is contained in:
parent
26f1197d84
commit
e895977efc
3 changed files with 22 additions and 12 deletions
|
|
@ -1662,10 +1662,6 @@ static void synaptics_dsx_release_all(struct synaptics_rmi4_data *rmi4_data);
|
|||
extern bool dsi_display_is_panel_enable(int id, int *probe_status, char **pname);
|
||||
#endif
|
||||
|
||||
static int synaptics_rmi4_suspend(struct device *dev);
|
||||
|
||||
static int synaptics_rmi4_resume(struct device *dev);
|
||||
|
||||
static ssize_t synaptics_rmi4_ud_show(struct device *dev,
|
||||
struct device_attribute *attr, char *buf);
|
||||
|
||||
|
|
@ -6888,7 +6884,7 @@ static int synaptics_rmi4_remove(struct i2c_client *client)
|
|||
* This function stops finger data acquisition and puts the sensor to
|
||||
* sleep, disables the interrupt, and turns off the power to the sensor.
|
||||
*/
|
||||
static int synaptics_rmi4_suspend(struct device *dev)
|
||||
int synaptics_rmi4_suspend(struct device *dev)
|
||||
{
|
||||
struct pinctrl *pinctrl;
|
||||
struct synaptics_rmi4_data *rmi4_data =
|
||||
|
|
@ -6951,7 +6947,7 @@ static int synaptics_rmi4_suspend(struct device *dev)
|
|||
* from sleep, enables the interrupt, and starts finger data
|
||||
* acquisition.
|
||||
*/
|
||||
static int synaptics_rmi4_resume(struct device *dev)
|
||||
int synaptics_rmi4_resume(struct device *dev)
|
||||
{
|
||||
int retval;
|
||||
int reset = RMI4_HW_RESET;
|
||||
|
|
|
|||
|
|
@ -1025,6 +1025,10 @@ void synaptics_dsx_sensor_state(struct synaptics_rmi4_data *rmi4_data,
|
|||
int synaptics_dsx_ic_reset(struct synaptics_rmi4_data *rmi4_data, int reset);
|
||||
int synaptics_dsx_charger_mode(struct synaptics_rmi4_data *rmi4_data, int state);
|
||||
|
||||
/* suspend resume */
|
||||
int synaptics_rmi4_suspend(struct device *dev);
|
||||
int synaptics_rmi4_resume(struct device *dev);
|
||||
|
||||
/* end of class */
|
||||
|
||||
struct synaptics_rmi4_exp_fn_ptr {
|
||||
|
|
|
|||
|
|
@ -146,12 +146,23 @@ static int synaptics_mmi_reset(struct device *dev, int type)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int synaptics_mmi_pre_suspend(struct device *dev)
|
||||
static int synaptics_mmi_panel_state(struct device *dev,
|
||||
enum ts_mmi_pm_mode from, enum ts_mmi_pm_mode to)
|
||||
{
|
||||
struct synaptics_rmi4_data *ts = dev_get_drvdata(dev);
|
||||
ASSERT_PTR(ts);
|
||||
dev_dbg(dev, "%s\n", __func__);
|
||||
synaptics_dsx_sensor_state(ts, STATE_SUSPEND);
|
||||
dev_dbg(dev, "%s: panel state change: %d->%d\n", __func__, from, to);
|
||||
switch (to) {
|
||||
case TS_MMI_PM_GESTURE:
|
||||
case TS_MMI_PM_DEEPSLEEP:
|
||||
synaptics_rmi4_suspend(dev);
|
||||
break;
|
||||
case TS_MMI_PM_ACTIVE:
|
||||
break;
|
||||
default:
|
||||
dev_warn(dev, "invalid panel state %d\n", to);
|
||||
return -EINVAL;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -160,8 +171,7 @@ static int synaptics_mmi_post_resume(struct device *dev)
|
|||
struct synaptics_rmi4_data *ts = dev_get_drvdata(dev);
|
||||
ASSERT_PTR(ts);
|
||||
dev_dbg(dev, "%s\n", __func__);
|
||||
synaptics_dsx_sensor_ready_state(ts, false);
|
||||
ts->flash_enabled = true;
|
||||
synaptics_rmi4_resume(dev);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -215,8 +225,8 @@ static struct ts_mmi_methods synaptics_mmi_methods = {
|
|||
.firmware_erase = synaptics_mmi_fw_erase,
|
||||
/* vendor specific attribute group */
|
||||
/* PM callback */
|
||||
.panel_state = synaptics_mmi_panel_state,
|
||||
.post_resume = synaptics_mmi_post_resume,
|
||||
.pre_suspend = synaptics_mmi_pre_suspend,
|
||||
};
|
||||
|
||||
int synaptics_mmi_data_init(struct synaptics_rmi4_data *ts, bool enable)
|
||||
|
|
|
|||
Loading…
Reference in a new issue