diff mbox series

[5/6] arm64: dts: qcom: msm8976: Declare and use SDC2 pins

Message ID 20221214232049.703484-6-marijn.suijten@somainline.org
State Superseded
Headers show
Series [1/6] arm64: dts: qcom: pmi8950: Add USB vbus and id sensing nodes | expand

Commit Message

Marijn Suijten Dec. 14, 2022, 11:20 p.m. UTC
Add the pinctrl states for SDC2 and use them on sdhc_2 to support SD
Cards on the currently mainlined Sony Loire platform.

Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
---
 .../qcom/msm8956-sony-xperia-loire-kugo.dts   |  6 +++
 .../dts/qcom/msm8956-sony-xperia-loire.dtsi   |  6 +++
 arch/arm64/boot/dts/qcom/msm8976.dtsi         | 45 +++++++++++++++++++
 3 files changed, 57 insertions(+)

Comments

Marijn Suijten Dec. 15, 2022, 9:05 p.m. UTC | #1
On 2022-12-15 14:20:30, Konrad Dybcio wrote:
> 
> 
> On 15.12.2022 00:20, Marijn Suijten wrote:
> > Add the pinctrl states for SDC2 and use them on sdhc_2 to support SD
> > Cards on the currently mainlined Sony Loire platform.
> > 
> > Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
> > ---
> >  .../qcom/msm8956-sony-xperia-loire-kugo.dts   |  6 +++
> >  .../dts/qcom/msm8956-sony-xperia-loire.dtsi   |  6 +++
> >  arch/arm64/boot/dts/qcom/msm8976.dtsi         | 45 +++++++++++++++++++
> >  3 files changed, 57 insertions(+)
> > 
> > diff --git a/arch/arm64/boot/dts/qcom/msm8956-sony-xperia-loire-kugo.dts b/arch/arm64/boot/dts/qcom/msm8956-sony-xperia-loire-kugo.dts
> > index 3fb8e23e4330..9178943e2ee1 100644
> > --- a/arch/arm64/boot/dts/qcom/msm8956-sony-xperia-loire-kugo.dts
> > +++ b/arch/arm64/boot/dts/qcom/msm8956-sony-xperia-loire-kugo.dts
> > @@ -33,3 +33,9 @@ &pm8950_l1 {
> >  	regulator-min-microvolt = <1100000>;
> >  	regulator-max-microvolt = <1300000>;
> >  };
> > +
> > +&sdc2_on_state {
> > +	data-pins {
> > +		drive-strength = <8>;
> > +	};
> > +};
> You can add a label to the data-pins subnode.

I prefer this simplicity as the sdc2_*_state labels are already
available and will be extended later with sd-cd-pins regardless. I'll
change this if others share the same opinion.

However, you're also right this way of writing makes it unclear to the
reader whether data-pins already exists or has to exist; that would not
be the case when a label is explicitly assigned to data-pins.

- Marijn
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/qcom/msm8956-sony-xperia-loire-kugo.dts b/arch/arm64/boot/dts/qcom/msm8956-sony-xperia-loire-kugo.dts
index 3fb8e23e4330..9178943e2ee1 100644
--- a/arch/arm64/boot/dts/qcom/msm8956-sony-xperia-loire-kugo.dts
+++ b/arch/arm64/boot/dts/qcom/msm8956-sony-xperia-loire-kugo.dts
@@ -33,3 +33,9 @@  &pm8950_l1 {
 	regulator-min-microvolt = <1100000>;
 	regulator-max-microvolt = <1300000>;
 };
+
+&sdc2_on_state {
+	data-pins {
+		drive-strength = <8>;
+	};
+};
diff --git a/arch/arm64/boot/dts/qcom/msm8956-sony-xperia-loire.dtsi b/arch/arm64/boot/dts/qcom/msm8956-sony-xperia-loire.dtsi
index 700583a56a0e..2253fb05f1c9 100644
--- a/arch/arm64/boot/dts/qcom/msm8956-sony-xperia-loire.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8956-sony-xperia-loire.dtsi
@@ -264,6 +264,12 @@  &sdhc_1 {
 	status = "okay";
 };
 
+&sdc2_on_state {
+	clk-pins {
+		drive-strength = <10>;
+	};
+};
+
 &sdhc_2 {
 	bus-width = <4>;
 	cd-gpios = <&tlmm 100 GPIO_ACTIVE_HIGH>;
diff --git a/arch/arm64/boot/dts/qcom/msm8976.dtsi b/arch/arm64/boot/dts/qcom/msm8976.dtsi
index 7d4c7548882c..f3371eaa2940 100644
--- a/arch/arm64/boot/dts/qcom/msm8976.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8976.dtsi
@@ -558,6 +558,46 @@  rclk-pins {
 				};
 			};
 
+			sdc2_off_state: sdc2-off-state {
+				clk-pins {
+					pins = "sdc2_clk";
+					drive-strength = <2>;
+					bias-disable;
+				};
+
+				cmd-pins {
+					pins = "sdc2_cmd";
+					drive-strength = <2>;
+					bias-pull-up;
+				};
+
+				data-pins {
+					pins = "sdc2_data";
+					drive-strength = <2>;
+					bias-pull-up;
+				};
+			};
+
+			sdc2_on_state: sdc2-on-state {
+				clk-pins {
+					pins = "sdc2_clk";
+					drive-strength = <16>;
+					bias-disable;
+				};
+
+				cmd-pins {
+					pins = "sdc2_cmd";
+					drive-strength = <10>;
+					bias-pull-up;
+				};
+
+				data-pins {
+					pins = "sdc2_data";
+					drive-strength = <10>;
+					bias-pull-up;
+				};
+			};
+
 			spi1_default: spi0-default-state {
 				spi-pins {
 					pins = "gpio0", "gpio1", "gpio3";
@@ -751,6 +791,11 @@  sdhc_2: mmc@7864000 {
 				 <&gcc GCC_SDCC2_APPS_CLK>,
 				 <&rpmcc RPM_SMD_XO_CLK_SRC>;
 			clock-names = "iface", "core", "xo";
+
+			pinctrl-0 = <&sdc2_on_state>;
+			pinctrl-1 = <&sdc2_off_state>;
+			pinctrl-names = "default", "sleep";
+
 			status = "disabled";
 		};