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

Commit 1efbcd74 authored by Himanshu Aggarwal's avatar Himanshu Aggarwal Committed by Gerrit - the friendly Code Review server
Browse files

input: synaptics: make pinctrl support optional



Amend Synaptics touch driver to optionally take a pinctrl
handle and set the state of pins during boot. Some platforms
do not support pinctrl and making pinctrl support an optional
feature of the driver, allows this driver to be used on
those platforms as well.

This patch is propagated from msm-3.10 kernel
(commit: 3304a5c8eb470395e6b4f3b8262536b79eed50f4
input: synaptics: make pinctrl support optional)

Change-Id: I3c6c39c56161da9b6fa10302865d6ff8728683e9
Signed-off-by: default avatarHimanshu Aggarwal <haggarwa@codeaurora.org>
parent 28b7a0ed
Loading
Loading
Loading
Loading
+10 −8
Original line number Diff line number Diff line
@@ -3407,12 +3407,16 @@ static int synaptics_rmi4_probe(struct i2c_client *client,

	retval = synaptics_rmi4_pinctrl_init(rmi4_data);
	if (!retval && rmi4_data->ts_pinctrl) {
		retval = pinctrl_select_state(rmi4_data->ts_pinctrl,
					rmi4_data->pinctrl_state_active);
		if (retval < 0)
			goto err_pinctrl_select;
	} else {
		goto err_pinctrl_init;
		/*
		* Pinctrl handle is optional. If pinctrl handle is found
		* let pins to be configured in active state. If not found
		* continue further without error
		*/
		if (pinctrl_select_state(rmi4_data->ts_pinctrl,
					rmi4_data->pinctrl_state_active))
			dev_err(&rmi4_data->i2c_client->dev,
				"Can not select %s pinstate\n",
				PINCTRL_STATE_ACTIVE);
	}

	retval = synaptics_rmi4_gpio_configure(rmi4_data, true);
@@ -3632,7 +3636,6 @@ err_free_gpios:
	if (gpio_is_valid(rmi4_data->board->irq_gpio))
		gpio_free(rmi4_data->board->irq_gpio);
err_gpio_config:
err_pinctrl_select:
	if (rmi4_data->ts_pinctrl) {
		if (IS_ERR_OR_NULL(rmi4_data->pinctrl_state_release)) {
			devm_pinctrl_put(rmi4_data->ts_pinctrl);
@@ -3644,7 +3647,6 @@ err_pinctrl_select:
				pr_err("failed to select release pinctrl state\n");
		}
	}
err_pinctrl_init:
	synaptics_rmi4_power_on(rmi4_data, false);
err_power_device:
	synaptics_rmi4_regulator_configure(rmi4_data, false);