ARM: dts: exynos: Enable DWC2 dual-role support on OdroidU3+ boards
authorMarek Szyprowski <m.szyprowski@samsung.com>
Tue, 3 Nov 2020 14:02:14 +0000 (15:02 +0100)
committerKrzysztof Kozlowski <krzk@kernel.org>
Thu, 5 Nov 2020 19:10:18 +0000 (20:10 +0100)
MicroUSB port on OdroidU3+ boards can operate both as peripheral or as
host port. Till now it was configured as pheriperal only port, but it
turned out that the DWC2 driver code already handles everything needed to
support USB role-switch, so switch it to dual-role (OTG) mode. This has
no effect on OdroidU3 (without 'plus') and OdroidX2, which doesn't have
USB needed ID pin and VBUS wiring. Those will still operate correctly in
pheriperal mode only.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Tested-by: Anand Moon <linux.amoon@gmail.com>
Link: https://lore.kernel.org/r/20201103140214.21690-1-m.szyprowski@samsung.com
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
arch/arm/boot/dts/exynos4412-odroid-common.dtsi
arch/arm/boot/dts/exynos4412-odroidu3.dts
arch/arm/boot/dts/exynos4412-odroidx.dts

index 1ca9d8b..4a67390 100644 (file)
 };
 
 &hsotg {
-       dr_mode = "peripheral";
        status = "okay";
        vusb_d-supply = <&ldo15_reg>;
        vusb_a-supply = <&ldo12_reg>;
index b8549d8..3bc83d6 100644 (file)
                reg = <0x40000000 0x7FF00000>;
        };
 
+       vbus_otg_reg: regulator-1 {
+               compatible = "regulator-fixed";
+               regulator-name = "VBUS_VDD_5.0V";
+               regulator-min-microvolt = <5000000>;
+               regulator-max-microvolt = <5000000>;
+               gpio = <&gpl2 0 GPIO_ACTIVE_HIGH>;
+               enable-active-high;
+       };
+
        leds {
                compatible = "gpio-leds";
                led1 {
        phy-names = "hsic0", "hsic1";
 };
 
+&hsotg {
+       dr_mode = "otg";
+       vbus-supply = <&vbus_otg_reg>;
+};
+
 &sound {
        model = "Odroid-U3";
        samsung,audio-widgets =
index 46381e9..d6ee62b 100644 (file)
        };
 };
 
+&hsotg {
+       dr_mode = "peripheral";
+};
+
 &mshc_0 {
        vqmmc-supply = <&buck8_reg>;
 };