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

Commit bf0b314d authored by Mitul Golani's avatar Mitul Golani Committed by Gerrit - the friendly Code Review server
Browse files

serial: msm_geni_serial: Add support for active pinctrl state



This change helps configuring GPIO to non UART function which makes
them to stay low when not in use. Kernel framework considers default
state to configure GPIOs during probe.

Adding active pinctrl node for the active configuration set and current
default configuration will be used during the probe time.

Change-Id: I082a1b4c3e42ca5b6005fd038a011e6b054b25b5
Signed-off-by: default avatarMitul Golani <mgolani@codeaurora.org>
parent 93b0e95e
Loading
Loading
Loading
Loading
+14 −5
Original line number Diff line number Diff line
@@ -2567,6 +2567,15 @@ static int msm_geni_serial_probe(struct platform_device *pdev)
		ret = PTR_ERR(dev_port->serial_rsc.geni_pinctrl);
		goto exit_geni_serial_probe;
	}
	dev_port->serial_rsc.geni_gpio_active =
		pinctrl_lookup_state(dev_port->serial_rsc.geni_pinctrl,
							PINCTRL_ACTIVE);

	if (IS_ERR_OR_NULL(dev_port->serial_rsc.geni_gpio_active)) {
		/*
		 * Backward compatible : In case few chips doesn't have ACTIVE
		 * state defined.
		 */
		dev_port->serial_rsc.geni_gpio_active =
		pinctrl_lookup_state(dev_port->serial_rsc.geni_pinctrl,
							PINCTRL_DEFAULT);
@@ -2575,7 +2584,7 @@ static int msm_geni_serial_probe(struct platform_device *pdev)
			ret = PTR_ERR(dev_port->serial_rsc.geni_gpio_active);
			goto exit_geni_serial_probe;
		}

	}
	/*
	 * For clients who setup an Inband wakeup, leave the GPIO pins
	 * always connected to the core, else move the pins to their
+1 −0
Original line number Diff line number Diff line
@@ -72,6 +72,7 @@ struct se_geni_rsc {
};

#define PINCTRL_DEFAULT	"default"
#define PINCTRL_ACTIVE	"active"
#define PINCTRL_SLEEP	"sleep"

#define KHz(freq) (1000 * (freq))