Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8020e472 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "input: touchscreen: Convert Goodix driver to dev_pm_ops"

parents 91549e30 b86944b2
Loading
Loading
Loading
Loading
+19 −7
Original line number Diff line number Diff line
@@ -1990,9 +1990,10 @@ Input:
Output:
	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);
#if GTP_ESD_PROTECT
@@ -2022,6 +2023,8 @@ static void goodix_ts_suspend(struct goodix_ts_data *ts)
	 */
	msleep(58);
	mutex_unlock(&ts->lock);

	return ret;
}

/*******************************************************
@@ -2032,9 +2035,10 @@ Input:
Output:
	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);
	ret = gtp_wakeup_sleep(ts);
@@ -2057,6 +2061,8 @@ static void goodix_ts_resume(struct goodix_ts_data *ts)
	gtp_esd_switch(ts->client, SWITCH_ON);
#endif
	mutex_unlock(&ts->lock);

	return ret;
}

#if defined(CONFIG_FB)
@@ -2072,9 +2078,9 @@ static int fb_notifier_callback(struct notifier_block *self,
			ts && ts->client) {
		blank = evdata->data;
		if (*blank == FB_BLANK_UNBLANK)
			goodix_ts_resume(ts);
			goodix_ts_resume(&ts->client->dev);
		else if (*blank == FB_BLANK_POWERDOWN)
			goodix_ts_suspend(ts);
			goodix_ts_suspend(&ts->client->dev);
	}

	return 0;
@@ -2093,7 +2099,7 @@ static void goodix_ts_early_suspend(struct early_suspend *h)
	struct goodix_ts_data *ts;

	ts = container_of(h, struct goodix_ts_data, early_suspend);
	goodix_ts_suspend(ts);
	goodix_ts_suspend(&ts->client->dev);
	return;
}

@@ -2247,6 +2253,9 @@ static void gtp_esd_check_func(struct work_struct *work)
}
#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[] = {
	{ GTP_I2C_NAME, 0 },
	{ }
@@ -2269,6 +2278,9 @@ static struct i2c_driver goodix_ts_driver = {
		.name     = GTP_I2C_NAME,
		.owner    = THIS_MODULE,
		.of_match_table = goodix_match_table,
#if CONFIG_PM
		.pm = &goodix_ts_dev_pm_ops,
#endif
	},
};