]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
arm64: dts: qcom: sa8295p-adp: Enable the four USB Type-A ports
authorKrishna Kurapati <quic_kriskura@quicinc.com>
Sun, 7 Jul 2024 08:56:24 +0000 (14:26 +0530)
committerBjorn Andersson <andersson@kernel.org>
Thu, 15 Aug 2024 02:22:14 +0000 (21:22 -0500)
The multiport USB controller in the SA8295P ADP is connected to four USB
Type-A ports. VBUS for each of these ports are provided by a
TPS2559QWDRCTQ1 regulator, controlled from PMIC GPIOs.

Add the necessary regulators and GPIO configuration to power these.

It seems reasonable that these regulators should be referenced as vbus
supply of usb-a-connector nodes and controlled by e.g. dwc3, but as this
is not supported in Linux today the regulators are left always-on for
now.

Signed-off-by: Krishna Kurapati <quic_kriskura@quicinc.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://lore.kernel.org/r/20240707085624.3411961-1-quic_kriskura@quicinc.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
arch/arm64/boot/dts/qcom/sa8295p-adp.dts

index 78e933c42c3144324da581687fd712f39fb796ec..2fd1dafe63ce7a4f409d19946b9f10ffe324fba3 100644 (file)
@@ -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"
                };
        };
 
+       regulator-usb2-vbus {
+               compatible = "regulator-fixed";
+               regulator-name = "USB2_VBUS";
+               gpio = <&pmm8540c_gpios 9 GPIO_ACTIVE_HIGH>;
+               pinctrl-0 = <&usb2_en>;
+               pinctrl-names = "default";
+               enable-active-high;
+               regulator-always-on;
+       };
+
+       regulator-usb3-vbus {
+               compatible = "regulator-fixed";
+               regulator-name = "USB3_VBUS";
+               gpio = <&pmm8540e_gpios 5 GPIO_ACTIVE_HIGH>;
+               pinctrl-0 = <&usb3_en>;
+               pinctrl-names = "default";
+               enable-active-high;
+               regulator-always-on;
+       };
+
+       regulator-usb4-vbus {
+               compatible = "regulator-fixed";
+               regulator-name = "USB4_VBUS";
+               gpio = <&pmm8540g_gpios 5 GPIO_ACTIVE_HIGH>;
+               pinctrl-0 = <&usb4_en>;
+               pinctrl-names = "default";
+               enable-active-high;
+               regulator-always-on;
+       };
+
+       regulator-usb5-vbus {
+               compatible = "regulator-fixed";
+               regulator-name = "USB5_VBUS";
+               gpio = <&pmm8540g_gpios 9 GPIO_ACTIVE_HIGH>;
+               pinctrl-0 = <&usb5_en>;
+               pinctrl-names = "default";
+               enable-active-high;
+               regulator-always-on;
+       };
+
        reserved-memory {
                gpu_mem: gpu-mem@8bf00000 {
                        reg = <0 0x8bf00000 0 0x2000>;
        status = "okay";
 };
 
+&usb_2 {
+       status = "okay";
+};
+
 &usb_2_hsphy0 {
        vdda-pll-supply = <&vreg_l5a>;
        vdda18-supply = <&vreg_l7g>;
        };
 };
 
+&pmm8540c_gpios {
+       usb2_en: usb2-en-state {
+               pins = "gpio9";
+               function = "normal";
+               qcom,drive-strength = <PMIC_GPIO_STRENGTH_HIGH>;
+               output-enable;
+               power-source = <0>;
+       };
+};
+
+&pmm8540e_gpios {
+       usb3_en: usb3-en-state {
+               pins = "gpio5";
+               function = "normal";
+               qcom,drive-strength = <PMIC_GPIO_STRENGTH_HIGH>;
+               output-enable;
+               power-source = <0>;
+       };
+};
+
+&pmm8540g_gpios {
+       usb4_en: usb4-en-state {
+               pins = "gpio5";
+               function = "normal";
+               qcom,drive-strength = <PMIC_GPIO_STRENGTH_HIGH>;
+               output-enable;
+               power-source = <0>;
+       };
+
+       usb5_en: usb5-en-state {
+               pins = "gpio9";
+               function = "normal";
+               qcom,drive-strength = <PMIC_GPIO_STRENGTH_HIGH>;
+               output-enable;
+               power-source = <0>;
+       };
+};
+
 &tlmm {
        pcie2a_default: pcie2a-default-state {
                clkreq-n-pins {