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

Commit 80fa7e98 authored by Himanshu Aggarwal's avatar Himanshu Aggarwal Committed by Abinaya P
Browse files

input: touchscreen: Fix issues in suspend path



Fix issues in suspend path in Goodix driver.

Change-Id: I280f2201c69838ad4da8eb94e9f10768f54ed457
Signed-off-by: default avatarHimanshu Aggarwal <haggarwa@codeaurora.org&gt;4>
Signed-off-by: default avatarSudhakar Manapati <smanap@codeaurora.org>
parent 12e637fc
Loading
Loading
Loading
Loading
+11 −14
Original line number Diff line number Diff line
@@ -712,16 +712,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;
@@ -743,16 +740,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);
	}
@@ -2039,7 +2036,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