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

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

Merge "input: synaptics_i2c_rmi4: amend error handling in wake and sleep"

parents 34c0f619 ec69cce7
Loading
Loading
Loading
Loading
+30 −5
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@
 *
 * Copyright (C) 2012 Alexandra Chin <alexandra.chin@tw.synaptics.com>
 * Copyright (C) 2012 Scott Lin <scott.lin@tw.synaptics.com>
 * Copyright (c) 2013, The Linux Foundation. All rights reserved.
 * Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
@@ -3569,7 +3569,7 @@ static int synaptics_rmi4_suspend(struct device *dev)
		retval = synaptics_rmi4_regulator_lpm(rmi4_data, true);
		if (retval < 0) {
			dev_err(dev, "failed to enter low power mode\n");
			return retval;
			goto err_lpm_regulator;
		}
	} else {
		dev_err(dev,
@@ -3581,12 +3581,24 @@ static int synaptics_rmi4_suspend(struct device *dev)
		retval = synaptics_rmi4_gpio_configure(rmi4_data, false);
		if (retval < 0) {
			dev_err(dev, "failed to put gpios in suspend state\n");
			return retval;
			goto err_gpio_configure;
		}
	}
	rmi4_data->suspended = true;

	return 0;

err_gpio_configure:
	synaptics_rmi4_regulator_lpm(rmi4_data, false);

err_lpm_regulator:
	if (rmi4_data->sensor_sleep) {
		synaptics_rmi4_sensor_wake(rmi4_data);
		synaptics_rmi4_irq_enable(rmi4_data, true);
		rmi4_data->touch_stopped = false;
	}

	return retval;
}

 /**
@@ -3622,7 +3634,7 @@ static int synaptics_rmi4_resume(struct device *dev)
		retval = synaptics_rmi4_gpio_configure(rmi4_data, true);
		if (retval < 0) {
			dev_err(dev, "Failed to put gpios in active state\n");
			return retval;
			goto err_gpio_configure;
		}
	}

@@ -3633,11 +3645,24 @@ static int synaptics_rmi4_resume(struct device *dev)
	retval = synaptics_rmi4_check_configuration(rmi4_data);
	if (retval < 0) {
		dev_err(dev, "Failed to check configuration\n");
		return retval;
		goto err_check_configuration;
	}
	rmi4_data->suspended = false;

	return 0;

err_check_configuration:
	synaptics_rmi4_irq_enable(rmi4_data, false);
	rmi4_data->touch_stopped = true;
	synaptics_rmi4_sensor_sleep(rmi4_data);

	if (rmi4_data->board->disable_gpios)
		synaptics_rmi4_gpio_configure(rmi4_data, false);
err_gpio_configure:
	synaptics_rmi4_regulator_lpm(rmi4_data, true);
	wake_up(&rmi4_data->wait);

	return retval;
}

#if (!defined(CONFIG_FB) && !defined(CONFIG_HAS_EARLYSUSPEND))