diff mbox series

[v13,09/10] arm64: dts: qcom: sa8295p: Enable tertiary controller and its 4 USB ports

Message ID 20231007154806.605-10-quic_kriskura@quicinc.com
State New
Headers show
Series Add multiport support for DWC3 controllers | expand

Commit Message

Krishna Kurapati PSSNV Oct. 7, 2023, 3:48 p.m. UTC
Enable tertiary controller for SA8295P (based on SC8280XP).
Add pinctrl support for usb ports to provide VBUS to connected peripherals.

Signed-off-by: Krishna Kurapati <quic_kriskura@quicinc.com>
---
 arch/arm64/boot/dts/qcom/sa8295p-adp.dts | 49 ++++++++++++++++++++++++
 1 file changed, 49 insertions(+)

Comments

Johan Hovold Oct. 23, 2023, 4:23 p.m. UTC | #1
On Sat, Oct 07, 2023 at 09:18:05PM +0530, Krishna Kurapati wrote:
> Enable tertiary controller for SA8295P (based on SC8280XP).
> Add pinctrl support for usb ports to provide VBUS to connected peripherals.
> 
> Signed-off-by: Krishna Kurapati <quic_kriskura@quicinc.com>
> ---
>  arch/arm64/boot/dts/qcom/sa8295p-adp.dts | 49 ++++++++++++++++++++++++
>  1 file changed, 49 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/qcom/sa8295p-adp.dts b/arch/arm64/boot/dts/qcom/sa8295p-adp.dts
> index fd253942e5e5..271000163823 100644
> --- a/arch/arm64/boot/dts/qcom/sa8295p-adp.dts
> +++ b/arch/arm64/boot/dts/qcom/sa8295p-adp.dts
> @@ -9,6 +9,7 @@
>  #include <dt-bindings/gpio/gpio.h>
>  #include <dt-bindings/regulator/qcom,rpmh-regulator.h>
>  #include <dt-bindings/spmi/spmi.h>
> +#include <dt-bindings/pinctrl/qcom,pmic-gpio.h>

Sort order ('p' < 'r').

> +&usb_2 {
> +	pinctrl-0 = <&usb2_en_state>,
> +		    <&usb3_en_state>,
> +		    <&usb4_en_state>,
> +		    <&usb5_en_state>;
> +	pinctrl-names = "default";
> +
> +	status = "okay";
> +};
> +
>  &usb_2_hsphy0 {
>  	vdda-pll-supply = <&vreg_l5a>;
>  	vdda18-supply = <&vreg_l7g>;
> @@ -729,3 +740,41 @@ wake-n-pins {
>  		};
>  	};
>  };
> +
> +&pmm8540c_gpios {

Sort order here too ('p' < 't' in "&tlmm").

> +	usb2_en_state: usb2-en-state {

No need to include '_state' in the labels.

Johan
Krishna Kurapati PSSNV Oct. 23, 2023, 5:42 p.m. UTC | #2
On 10/23/2023 9:53 PM, Johan Hovold wrote:
> On Sat, Oct 07, 2023 at 09:18:05PM +0530, Krishna Kurapati wrote:
>> Enable tertiary controller for SA8295P (based on SC8280XP).
>> Add pinctrl support for usb ports to provide VBUS to connected peripherals.
>>
>> Signed-off-by: Krishna Kurapati <quic_kriskura@quicinc.com>
>> ---
>>   arch/arm64/boot/dts/qcom/sa8295p-adp.dts | 49 ++++++++++++++++++++++++
>>   1 file changed, 49 insertions(+)
>>
>> diff --git a/arch/arm64/boot/dts/qcom/sa8295p-adp.dts b/arch/arm64/boot/dts/qcom/sa8295p-adp.dts
>> index fd253942e5e5..271000163823 100644
>> --- a/arch/arm64/boot/dts/qcom/sa8295p-adp.dts
>> +++ b/arch/arm64/boot/dts/qcom/sa8295p-adp.dts
>> @@ -9,6 +9,7 @@
>>   #include <dt-bindings/gpio/gpio.h>
>>   #include <dt-bindings/regulator/qcom,rpmh-regulator.h>
>>   #include <dt-bindings/spmi/spmi.h>
>> +#include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
> 
> Sort order ('p' < 'r').

ACK

> 
>> +&usb_2 {
>> +	pinctrl-0 = <&usb2_en_state>,
>> +		    <&usb3_en_state>,
>> +		    <&usb4_en_state>,
>> +		    <&usb5_en_state>;
>> +	pinctrl-names = "default";
>> +
>> +	status = "okay";
>> +};
>> +
>>   &usb_2_hsphy0 {
>>   	vdda-pll-supply = <&vreg_l5a>;
>>   	vdda18-supply = <&vreg_l7g>;
>> @@ -729,3 +740,41 @@ wake-n-pins {
>>   		};
>>   	};
>>   };
>> +
>> +&pmm8540c_gpios {
> 
> Sort order here too ('p' < 't' in "&tlmm").
> 

ACK.

>> +	usb2_en_state: usb2-en-state {
> 
> No need to include '_state' in the labels.
> 
Any specific reason ? I have no problem if removing the suffix but just 
wanted to know the reason.

Regards,
Krishna,
Johan Hovold Oct. 24, 2023, 7:20 a.m. UTC | #3
On Mon, Oct 23, 2023 at 11:12:40PM +0530, Krishna Kurapati PSSNV wrote:
> On 10/23/2023 9:53 PM, Johan Hovold wrote:
> > On Sat, Oct 07, 2023 at 09:18:05PM +0530, Krishna Kurapati wrote:

> >> +	usb2_en_state: usb2-en-state {
> > 
> > No need to include '_state' in the labels.
> > 
> Any specific reason ? I have no problem if removing the suffix but just 
> wanted to know the reason.

For consistency with the rest of the sc8280xp devicetree sources
(including this file) where we've used that pattern (e.g. as reproducing
"state" in the label is mostly redundant). For example:

	pcie2a_default: pcie2a-default-state {}

and

	nvme_reg_en: nvme-reg-en-state {}

Johan
Krishna Kurapati PSSNV Oct. 24, 2023, 8:26 a.m. UTC | #4
On 10/24/2023 12:50 PM, Johan Hovold wrote:
> On Mon, Oct 23, 2023 at 11:12:40PM +0530, Krishna Kurapati PSSNV wrote:
>> On 10/23/2023 9:53 PM, Johan Hovold wrote:
>>> On Sat, Oct 07, 2023 at 09:18:05PM +0530, Krishna Kurapati wrote:
> 
>>>> +	usb2_en_state: usb2-en-state {
>>>
>>> No need to include '_state' in the labels.
>>>
>> Any specific reason ? I have no problem if removing the suffix but just
>> wanted to know the reason.
> 
> For consistency with the rest of the sc8280xp devicetree sources
> (including this file) where we've used that pattern (e.g. as reproducing
> "state" in the label is mostly redundant). For example:
> 
> 	pcie2a_default: pcie2a-default-state {}
> 
> and
> 
> 	nvme_reg_en: nvme-reg-en-state {}
> 

Thanks for the reference.

Regards,
Krishna,
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/qcom/sa8295p-adp.dts b/arch/arm64/boot/dts/qcom/sa8295p-adp.dts
index fd253942e5e5..271000163823 100644
--- a/arch/arm64/boot/dts/qcom/sa8295p-adp.dts
+++ b/arch/arm64/boot/dts/qcom/sa8295p-adp.dts
@@ -9,6 +9,7 @@ 
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/regulator/qcom,rpmh-regulator.h>
 #include <dt-bindings/spmi/spmi.h>
+#include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
 
 #include "sa8540p.dtsi"
 #include "sa8540p-pmics.dtsi"
@@ -584,6 +585,16 @@  &usb_1_qmpphy {
 	status = "okay";
 };
 
+&usb_2 {
+	pinctrl-0 = <&usb2_en_state>,
+		    <&usb3_en_state>,
+		    <&usb4_en_state>,
+		    <&usb5_en_state>;
+	pinctrl-names = "default";
+
+	status = "okay";
+};
+
 &usb_2_hsphy0 {
 	vdda-pll-supply = <&vreg_l5a>;
 	vdda18-supply = <&vreg_l7g>;
@@ -729,3 +740,41 @@  wake-n-pins {
 		};
 	};
 };
+
+&pmm8540c_gpios {
+	usb2_en_state: usb2-en-state {
+		pins = "gpio9";
+		function = "normal";
+		qcom,drive-strength = <PMIC_GPIO_STRENGTH_HIGH>;
+		output-high;
+		power-source = <0>;
+	};
+};
+
+&pmm8540e_gpios {
+	usb3_en_state: usb3-en-state {
+		pins = "gpio5";
+		function = "normal";
+		qcom,drive-strength = <PMIC_GPIO_STRENGTH_HIGH>;
+		output-high;
+		power-source = <0>;
+	};
+};
+
+&pmm8540g_gpios {
+	usb4_en_state: usb4-en-state {
+		pins = "gpio5";
+		function = "normal";
+		qcom,drive-strength = <PMIC_GPIO_STRENGTH_HIGH>;
+		output-high;
+		power-source = <0>;
+	};
+
+	usb5_en_state: usb5-en-state {
+		pins = "gpio9";
+		function = "normal";
+		qcom,drive-strength = <PMIC_GPIO_STRENGTH_HIGH>;
+		output-high;
+		power-source = <0>;
+	};
+};