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

Commit d202fda0 authored by Fei Mao's avatar Fei Mao
Browse files

input: touchscreen: st: set device pm state



Keep device to be awake when "aoi_wake_on_suspend" is enabled. This flag is
disabled by default, so it will not impact normal scenes.

Change-Id: I6cc35191d7c4ff7bda2cd2f5d355eacbee49b09a
Signed-off-by: default avatarFei Mao <feim1@codeaurora.org>
parent b318a6e0
Loading
Loading
Loading
Loading
+10 −3
Original line number Diff line number Diff line
@@ -4223,7 +4223,7 @@ static int fts_fb_state_chg_callback(struct notifier_block *nb,

		switch (blank) {
		case DRM_PANEL_BLANK_POWERDOWN:
			if (info->sensor_sleep)
			if (info->sensor_sleep && info->aoi_notify_enabled)
				break;

			if (info->aoi_notify_enabled)
@@ -4231,13 +4231,18 @@ static int fts_fb_state_chg_callback(struct notifier_block *nb,
			else
				info->aoi_wake_on_suspend = false;

			if (info->aoi_wake_on_suspend)
			if (info->aoi_wake_on_suspend) {
				info->sensor_sleep = true;
			else
				__pm_stay_awake(&info->wakeup_source);
			} else {
				queue_work(info->event_wq, &info->suspend_work);
			}
			break;

		case DRM_PANEL_BLANK_UNBLANK:
			if (info->aoi_wake_on_suspend)
				__pm_relax(&info->wakeup_source);

			if (!info->sensor_sleep)
				break;

@@ -4968,6 +4973,7 @@ static int fts_probe(struct i2c_client *client, const struct i2c_device_id *idp)
		return error;
	}

	device_init_wakeup(&client->dev, true);
	return fts_probe_internal(client, idp);
}

@@ -5036,6 +5042,7 @@ static int fts_remove(struct i2c_client *client)
	kfree(info->i2c_data);
	kfree(info);

	device_init_wakeup(&client->dev, false);
	return OK;
}

+6 −8
Original line number Diff line number Diff line
@@ -53,17 +53,15 @@ ssize_t aoi_set_store(struct device *dev, struct device_attribute *attr,
	if (bottom > Y_AXIS_MAX)
		bottom = Y_AXIS_MAX;

	if (left < 0 || left > X_AXIS_MAX || right < 0) {
		info->aoi_notify_enabled = false;
		return -EINVAL;
	}

	if (top < 0 || top > Y_AXIS_MAX || bottom < 0) {
		info->aoi_notify_enabled = false;
	if (left < 0 || left > X_AXIS_MAX || right < 0 ||
		top > Y_AXIS_MAX || bottom < 0)
		return -EINVAL;
	}

	if (left >= right || top >= bottom) {
		info->aoi_left = 0;
		info->aoi_top = 0;
		info->aoi_right = 0;
		info->aoi_bottom = 0;
		info->aoi_notify_enabled = false;
		return count;
	}