]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
ARM: sun8i: h3: enable USB OTG on Orange Pi One
authorIcenowy Zheng <icenowy@aosc.xyz>
Sat, 25 Mar 2017 14:50:13 +0000 (22:50 +0800)
committerMaxime Ripard <maxime.ripard@free-electrons.com>
Mon, 27 Mar 2017 11:45:30 +0000 (13:45 +0200)
Orange Pi One features a MicroUSB port that can work in both host mode
and peripheral mode.

When in host mode, its VBUS is controlled via a GPIO; when in peripheral
mode, its VBUS cannot be used to power up the board.

Add support for this port.

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/arm/boot/dts/sun8i-h3-orangepi-one.dts

index 34da853ee0372b6b284b72c371eb25c4a2ecb28e..b87778d742395a3cac3505fea5ca1ddf29fed767 100644 (file)
        };
 };
 
+&ehci0 {
+       status = "okay";
+};
+
 &ehci1 {
        status = "okay";
 };
        status = "okay";
 };
 
+&ohci0 {
+       status = "okay";
+};
+
 &ohci1 {
        status = "okay";
 };
        };
 };
 
+&reg_usb0_vbus {
+       gpio = <&r_pio 0 2 GPIO_ACTIVE_HIGH>; /* PL2 */
+       status = "okay";
+};
+
 &uart0 {
        pinctrl-names = "default";
        pinctrl-0 = <&uart0_pins_a>;
        status = "disabled";
 };
 
+&usb_otg {
+       dr_mode = "otg";
+       status = "okay";
+};
+
 &usbphy {
-       /* USB VBUS is always on */
+       /* USB Type-A port's VBUS is always on */
+       usb0_id_det-gpios = <&pio 6 12 GPIO_ACTIVE_HIGH>; /* PG12 */
+       usb0_vbus-supply = <&reg_usb0_vbus>;
        status = "okay";
 };