Commit 2f0300a6 authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Bjorn Andersson
Browse files

arm64: dts: qcom: sc7180: align TLMM pin configuration with DT schema



DT schema expects TLMM pin configuration nodes to be named with
'-state' suffix and their optional children with '-pins' suffix.

Merge subnodes named 'pinconf' and 'pinmux' into one entry, add function
where missing (required by bindings for GPIOs) and reorganize overriding
pins by boards.

Split the SPI and UART configuration into separate nodes
1. SPI (MOSI, MISO, SCLK), SPI chip-select, SPI chip-select via GPIO,
2. UART per each pin: TX, RX and optional CTS/RTS.

This allows each board to customize them easily without adding any new
nodes.

Signed-off-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: default avatarDouglas Anderson <dianders@chromium.org>
Tested-by: default avatarDouglas Anderson <dianders@chromium.org>
Reviewed-by: default avatarStephen Boyd <swboyd@chromium.org>
Signed-off-by: default avatarBjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20221020225135.31750-4-krzysztof.kozlowski@linaro.org
parent 8ddfa04d
Loading
Loading
Loading
Loading
+105 −131
Original line number Diff line number Diff line
@@ -481,160 +481,129 @@ pinconf {
};

&qspi_clk {
	pinconf {
		pins = "gpio63";
	bias-disable;
};
};

&qspi_cs0 {
	pinconf {
		pins = "gpio68";
	bias-disable;
};
};

&qspi_data01 {
	pinconf {
		pins = "gpio64", "gpio65";

	/* High-Z when no transfers; nice to park the lines */
	bias-pull-up;
};
};

&qup_i2c2_default {
	pinconf {
		pins = "gpio15", "gpio16";
	drive-strength = <2>;

	/* Has external pullup */
	bias-disable;
};
};

&qup_i2c4_default {
	pinconf {
		pins = "gpio115", "gpio116";
	drive-strength = <2>;

	/* Has external pullup */
	bias-disable;
};
};

&qup_i2c7_default {
	pinconf {
		pins = "gpio6", "gpio7";
	drive-strength = <2>;

	/* Has external pullup */
	bias-disable;
};
};

&qup_i2c9_default {
	pinconf {
		pins = "gpio46", "gpio47";
	drive-strength = <2>;

	/* Has external pullup */
	bias-disable;
};
};

&qup_uart3_default {
	pinconf-cts {
&qup_uart3_cts {
	/*
	 * Configure a pull-down on CTS to match the pull of
	 * the Bluetooth module.
	 */
		pins = "gpio38";
	bias-pull-down;
};

	pinconf-rts {
&qup_uart3_rts {
	/* We'll drive RTS, so no pull */
		pins = "gpio39";
	drive-strength = <2>;
	bias-disable;
};

	pinconf-tx {
&qup_uart3_tx {
	/* We'll drive TX, so no pull */
		pins = "gpio40";
	drive-strength = <2>;
	bias-disable;
};

	pinconf-rx {
&qup_uart3_rx {
	/*
	 * Configure a pull-up on RX. This is needed to avoid
	 * garbage data when the TX pin of the Bluetooth module is
	 * in tri-state (module powered off or not driving the
	 * signal yet).
	 */
		pins = "gpio41";
	bias-pull-up;
};
};

&qup_uart8_default {
	pinconf-tx {
		pins = "gpio44";
&qup_uart8_tx {
	drive-strength = <2>;
	bias-disable;
};

	pinconf-rx {
		pins = "gpio45";
&qup_uart8_rx {
	drive-strength = <2>;
	bias-pull-up;
};
};

&qup_spi0_default {
	pinconf {
		pins = "gpio34", "gpio35", "gpio36", "gpio37";
&qup_spi0_spi {
	drive-strength = <2>;
	bias-disable;
};
};

&qup_spi6_default {
	pinconf {
		pins = "gpio59", "gpio60", "gpio61", "gpio62";
&qup_spi0_cs {
	drive-strength = <2>;
	bias-disable;
};

&qup_spi6_spi {
	drive-strength = <2>;
	bias-disable;
};

&qup_spi10_default {
	pinconf {
		pins = "gpio86", "gpio87", "gpio88", "gpio89";
&qup_spi6_cs {
	drive-strength = <2>;
	bias-disable;
};

&qup_spi10_spi {
	drive-strength = <2>;
	bias-disable;
};

&tlmm {
	qup_uart3_sleep: qup-uart3-sleep {
		pinmux {
			pins = "gpio38", "gpio39",
			       "gpio40", "gpio41";
			function = "gpio";
&qup_spi10_cs {
	drive-strength = <2>;
	bias-disable;
};

		pinconf-cts {
&tlmm {
	qup_uart3_sleep: qup-uart3-sleep-state {
		cts-pins {
			/*
			 * Configure a pull-down on CTS to match the pull of
			 * the Bluetooth module.
			 */
			pins = "gpio38";
			function = "gpio";
			bias-pull-down;
		};

		pinconf-rts {
		rts-pins {
			/*
			 * Configure pull-down on RTS. As RTS is active low
			 * signal, pull it low to indicate the BT SoC that it
@@ -642,126 +611,131 @@ pinconf-rts {
			 * pulling RX low (by sending wakeup bytes).
			 */
			pins = "gpio39";
			function = "gpio";
			bias-pull-down;
		};

		pinconf-tx {
		tx-pins {
			/*
			 * Configure pull-up on TX when it isn't actively driven
			 * to prevent BT SoC from receiving garbage during sleep.
			 */
			pins = "gpio40";
			function = "gpio";
			bias-pull-up;
		};

		pinconf-rx {
		rx-pins {
			/*
			 * Configure a pull-up on RX. This is needed to avoid
			 * garbage data when the TX pin of the Bluetooth module
			 * is floating which may cause spurious wakeups.
			 */
			pins = "gpio41";
			function = "gpio";
			bias-pull-up;
		};
	};

	sdc1_on: sdc1-on {
		pinconf-clk {
	sdc1_on: sdc1-on-state {
		clk-pins {
			pins = "sdc1_clk";
			bias-disable;
			drive-strength = <16>;
		};

		pinconf-cmd {
		cmd-pins {
			pins = "sdc1_cmd";
			bias-pull-up;
			drive-strength = <10>;
		};

		pinconf-data {
		data-pins {
			pins = "sdc1_data";
			bias-pull-up;
			drive-strength = <10>;
		};

		pinconf-rclk {
		rclk-pins {
			pins = "sdc1_rclk";
			bias-pull-down;
		};
	};

	sdc1_off: sdc1-off {
		pinconf-clk {
	sdc1_off: sdc1-off-state {
		clk-pins {
			pins = "sdc1_clk";
			bias-disable;
			drive-strength = <2>;
		};

		pinconf-cmd {
		cmd-pins {
			pins = "sdc1_cmd";
			bias-pull-up;
			drive-strength = <2>;
		};

		pinconf-data {
		data-pins {
			pins = "sdc1_data";
			bias-pull-up;
			drive-strength = <2>;
		};

		pinconf-rclk {
		rclk-pins {
			pins = "sdc1_rclk";
			bias-pull-down;
		};
	};

	sdc2_on: sdc2-on {
		pinconf-clk {
	sdc2_on: sdc2-on-state {
		clk-pins {
			pins = "sdc2_clk";
			bias-disable;
			drive-strength = <16>;
		};

		pinconf-cmd {
		cmd-pins {
			pins = "sdc2_cmd";
			bias-pull-up;
			drive-strength = <10>;
		};

		pinconf-data {
		data-pins {
			pins = "sdc2_data";
			bias-pull-up;
			drive-strength = <10>;
		};

		pinconf-sd-cd {
		sd-cd-pins {
			pins = "gpio69";
			function = "gpio";
			bias-pull-up;
			drive-strength = <2>;
		};
	};

	sdc2_off: sdc2-off {
		pinconf-clk {
	sdc2_off: sdc2-off-state {
		clk-pins {
			pins = "sdc2_clk";
			bias-disable;
			drive-strength = <2>;
		};

		pinconf-cmd {
		cmd-pins {
			pins = "sdc2_cmd";
			bias-pull-up;
			drive-strength = <2>;
		};

		pinconf-data {
		data-pins {
			pins = "sdc2_data";
			bias-pull-up;
			drive-strength = <2>;
		};

		pinconf-sd-cd {
		sd-cd-pins {
			pins = "gpio69";
			function = "gpio";
			bias-pull-up;
			drive-strength = <2>;
		};
+11 −25
Original line number Diff line number Diff line
@@ -181,24 +181,16 @@ &sound_multimedia0_codec {
/* PINCTRL - modifications to sc7180-trogdor.dtsi */

&en_pp3300_dx_edp {
	pinmux {
	pins = "gpio67";
};

	pinconf {
		pins = "gpio67";
	};
};

&ts_reset_l {
	pinconf {
	/*
	 * We want reset state by default and it will be up to the
	 * driver to disable this when it's ready.
	 */
	output-low;
};
};

/* PINCTRL - board-specific pinctrl */

@@ -327,16 +319,10 @@ &tlmm {
			  "DP_HOT_PLUG_DET",
			  "EC_IN_RW_ODL";

	dmic_clk_en: dmic_clk_en {
		pinmux {
	dmic_clk_en: dmic-clk-en-state {
		pins = "gpio83";
		function = "gpio";
		};

		pinconf {
			pins = "gpio83";
		drive-strength = <8>;
		bias-pull-up;
	};
};
};
+12 −35
Original line number Diff line number Diff line
@@ -180,37 +180,20 @@ &wifi {
/* PINCTRL - modifications to sc7180-trogdor.dtsi */

&en_pp3300_dx_edp {
	pinmux {
	pins = "gpio67";
};

	pinconf {
		pins = "gpio67";
	};
};

&sec_mi2s_active {
	pinmux {
		pins = "gpio49", "gpio50", "gpio51", "gpio52";
		function = "mi2s_1";
	};

	pinconf {
	pins = "gpio49", "gpio50", "gpio51", "gpio52";
		drive-strength = <2>;
		bias-pull-down;
	};
};

&ts_reset_l {
	pinconf {
	/*
	 * We want reset state by default and it will be up to the
	 * driver to disable this when it's ready.
	 */
	output-low;
};
};

/* PINCTRL - board-specific pinctrl */

@@ -339,16 +322,10 @@ &tlmm {
			  "DP_HOT_PLUG_DET",
			  "EC_IN_RW_ODL";

	en_pp3300_touch: en-pp3300-touch {
		pinmux {
	en_pp3300_touch: en-pp3300-touch-state {
		pins = "gpio87";
		function = "gpio";
		};

		pinconf {
			pins = "gpio87";
		drive-strength = <2>;
		bias-disable;
	};
};
};
+5 −11
Original line number Diff line number Diff line
@@ -29,16 +29,10 @@ &pp3300_fp_tp {
};

&tlmm {
	en_fp_rails: en-fp-rails {
		pinmux {
	en_fp_rails: en-fp-rails-state {
		pins = "gpio74";
		function = "gpio";
		};

		pinconf {
			pins = "gpio74";
		drive-strength = <2>;
		bias-disable;
	};
};
};
+1 −7
Original line number Diff line number Diff line
@@ -87,15 +87,9 @@ &wifi {
/* PINCTRL - modifications to sc7180-trogdor.dtsi */

&en_pp3300_dx_edp {
	pinmux {
	pins = "gpio67";
};

	pinconf {
		pins = "gpio67";
	};
};

/* PINCTRL - board-specific pinctrl */

&tlmm {
Loading