Merge "input: touchscreen: Convert Goodix driver to dev_pm_ops"
This commit is contained in:
commit
003e367e36
1 changed files with 20 additions and 7 deletions
|
@ -1975,9 +1975,10 @@ Input:
|
||||||
Output:
|
Output:
|
||||||
None.
|
None.
|
||||||
*******************************************************/
|
*******************************************************/
|
||||||
static void goodix_ts_suspend(struct goodix_ts_data *ts)
|
static int goodix_ts_suspend(struct device *dev)
|
||||||
{
|
{
|
||||||
int ret = -1, i;
|
struct goodix_ts_data *ts = dev_get_drvdata(dev);
|
||||||
|
int ret = 0, i;
|
||||||
|
|
||||||
mutex_lock(&ts->lock);
|
mutex_lock(&ts->lock);
|
||||||
#if GTP_ESD_PROTECT
|
#if GTP_ESD_PROTECT
|
||||||
|
@ -2007,6 +2008,8 @@ static void goodix_ts_suspend(struct goodix_ts_data *ts)
|
||||||
*/
|
*/
|
||||||
msleep(58);
|
msleep(58);
|
||||||
mutex_unlock(&ts->lock);
|
mutex_unlock(&ts->lock);
|
||||||
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*******************************************************
|
/*******************************************************
|
||||||
|
@ -2017,9 +2020,10 @@ Input:
|
||||||
Output:
|
Output:
|
||||||
None.
|
None.
|
||||||
*******************************************************/
|
*******************************************************/
|
||||||
static void goodix_ts_resume(struct goodix_ts_data *ts)
|
static int goodix_ts_resume(struct device *dev)
|
||||||
{
|
{
|
||||||
int ret = -1;
|
struct goodix_ts_data *ts = dev_get_drvdata(dev);
|
||||||
|
int ret = 0;
|
||||||
|
|
||||||
mutex_lock(&ts->lock);
|
mutex_lock(&ts->lock);
|
||||||
ret = gtp_wakeup_sleep(ts);
|
ret = gtp_wakeup_sleep(ts);
|
||||||
|
@ -2042,6 +2046,8 @@ static void goodix_ts_resume(struct goodix_ts_data *ts)
|
||||||
gtp_esd_switch(ts->client, SWITCH_ON);
|
gtp_esd_switch(ts->client, SWITCH_ON);
|
||||||
#endif
|
#endif
|
||||||
mutex_unlock(&ts->lock);
|
mutex_unlock(&ts->lock);
|
||||||
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(CONFIG_FB)
|
#if defined(CONFIG_FB)
|
||||||
|
@ -2057,9 +2063,9 @@ static int fb_notifier_callback(struct notifier_block *self,
|
||||||
ts && ts->client) {
|
ts && ts->client) {
|
||||||
blank = evdata->data;
|
blank = evdata->data;
|
||||||
if (*blank == FB_BLANK_UNBLANK)
|
if (*blank == FB_BLANK_UNBLANK)
|
||||||
goodix_ts_resume(ts);
|
goodix_ts_resume(&ts->client->dev);
|
||||||
else if (*blank == FB_BLANK_POWERDOWN)
|
else if (*blank == FB_BLANK_POWERDOWN)
|
||||||
goodix_ts_suspend(ts);
|
goodix_ts_suspend(&ts->client->dev);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -2078,7 +2084,8 @@ static void goodix_ts_early_suspend(struct early_suspend *h)
|
||||||
struct goodix_ts_data *ts;
|
struct goodix_ts_data *ts;
|
||||||
|
|
||||||
ts = container_of(h, struct goodix_ts_data, early_suspend);
|
ts = container_of(h, struct goodix_ts_data, early_suspend);
|
||||||
goodix_ts_suspend(ts);
|
goodix_ts_suspend(&ts->client->dev);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -2229,6 +2236,9 @@ static void gtp_esd_check_func(struct work_struct *work)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static SIMPLE_DEV_PM_OPS(goodix_ts_dev_pm_ops, goodix_ts_suspend,
|
||||||
|
goodix_ts_resume);
|
||||||
|
|
||||||
static const struct i2c_device_id goodix_ts_id[] = {
|
static const struct i2c_device_id goodix_ts_id[] = {
|
||||||
{ GTP_I2C_NAME, 0 },
|
{ GTP_I2C_NAME, 0 },
|
||||||
{ }
|
{ }
|
||||||
|
@ -2251,6 +2261,9 @@ static struct i2c_driver goodix_ts_driver = {
|
||||||
.name = GTP_I2C_NAME,
|
.name = GTP_I2C_NAME,
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
.of_match_table = goodix_match_table,
|
.of_match_table = goodix_match_table,
|
||||||
|
#if CONFIG_PM
|
||||||
|
.pm = &goodix_ts_dev_pm_ops,
|
||||||
|
#endif
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue