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

Commit 84ae3f83 authored by Himanshu Aggarwal's avatar Himanshu Aggarwal Committed by Sudhakar Manapati
Browse files

input: touchscreen: Fix issues in suspend path



Fix issues in suspend path in Goodix driver.

This patch is propagated from msm-3.10 kernel
(commit: 48db0b151c7048c59ac833dfd00e6ba0f159a804
input: touchscreen: Fix issues in suspend path)
Also cleaned checkpatch warning on msm-3.18 kernel.

Change-Id: I280f2201c69838ad4da8eb94e9f10768f54ed457
Signed-off-by: default avatarHimanshu Aggarwal <haggarwa@codeaurora.org&gt;4>
Signed-off-by: default avatarSudhakar Manapati <smanap@codeaurora.org>
parent 4e7f326a
Loading
Loading
Loading
Loading
+11 −14
Original line number Diff line number Diff line
@@ -718,16 +718,13 @@ static s8 gtp_enter_doze(struct goodix_ts_data *ts)
	return ret;
}
#else
/*******************************************************
Function:
	Enter sleep mode.
Input:
	ts: private data.
Output:
	Executive outcomes.
	>0: succeed, otherwise failed.
*******************************************************/
static s8 gtp_enter_sleep(struct goodix_ts_data  *ts)
/**
 * gtp_enter_sleep - Enter sleep mode
 * @ts: driver private data
 *
 * Returns zero on success, else an error.
 */
static u8 gtp_enter_sleep(struct goodix_ts_data *ts)
{
	int ret = -1;
	s8 retry = 0;
@@ -749,16 +746,16 @@ static s8 gtp_enter_sleep(struct goodix_ts_data *ts)
		ret = goodix_power_off(ts);
		if (ret) {
			dev_err(&ts->client->dev, "GTP power off failed.\n");
			return 0;
			return ret;
		}
		return 1;
		return 0;
	}
	usleep(5000);
	while (retry++ < GTP_I2C_RETRY_5) {
		ret = gtp_i2c_write(ts->client, i2c_control_buf, 3);
		if (ret == 1) {
			dev_dbg(&ts->client->dev, "GTP enter sleep!");
			return ret;
			return 0;
		}
		msleep(20);
	}
@@ -2046,7 +2043,7 @@ static int goodix_ts_suspend(struct device *dev)

	ret = gtp_enter_sleep(ts);
#endif
	if (ret <= 0)
	if (ret < 0)
		dev_err(&ts->client->dev, "GTP early suspend failed.\n");
	/* to avoid waking up while not sleeping,
	 * delay 48 + 10ms to ensure reliability