arm64: allwinner: h5: enable USB OTG on Orange Pi PC 2 board
authorIcenowy Zheng <icenowy@aosc.xyz>
Sat, 25 Mar 2017 14:50:15 +0000 (22:50 +0800)
committerMaxime Ripard <maxime.ripard@free-electrons.com>
Mon, 27 Mar 2017 11:44:52 +0000 (13:44 +0200)
Orange Pi PC 2 board features a OTG port like the one on older H3 Orange
Pi's, with PG12 pin being the id det pin and PL2 being the vbus driver
pin.

Add support for it.

Signed-off-by: Icenowy Zheng <icenowy@aosc.xyz>
Acked-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-pc2.dts

index 30639729920ddcb79ad788705bdf097cdf08de7c..dfecc17dcc927bea1410f25d8bcfdd4c0512e61d 100644 (file)
                        gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>;
                };
        };
+
+       reg_usb0_vbus: usb0-vbus {
+               compatible = "regulator-fixed";
+               regulator-name = "usb0-vbus";
+               regulator-min-microvolt = <5000000>;
+               regulator-max-microvolt = <5000000>;
+               enable-active-high;
+               gpio = <&r_pio 0 2 GPIO_ACTIVE_HIGH>; /* PL2 */
+               status = "okay";
+       };
 };
 
 &codec {
        status = "okay";
 };
 
+&ehci0 {
+       status = "okay";
+};
+
 &ehci1 {
        status = "okay";
 };
        status = "okay";
 };
 
+&ohci0 {
+       status = "okay";
+};
+
 &ohci1 {
        status = "okay";
 };
        status = "disabled";
 };
 
+&usb_otg {
+       dr_mode = "otg";
+       status = "okay";
+};
+
 &usbphy {
-       /* USB VBUS is always on */
+       /* USB Type-A ports' VBUS is always on */
+       usb0_id_det-gpios = <&pio 6 12 GPIO_ACTIVE_HIGH>; /* PG12 */
+       usb0_vbus-supply = <&reg_usb0_vbus>;
        status = "okay";
 };