]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commitdiff
ARM: sun8i: h3: bananapi-m2-plus: Enable USB OTG
authorChen-Yu Tsai <wens@csie.org>
Wed, 19 Apr 2017 05:09:19 +0000 (13:09 +0800)
committerMaxime Ripard <maxime.ripard@free-electrons.com>
Sun, 14 May 2017 06:32:32 +0000 (08:32 +0200)
The Bananapi M2 Plus has a USB OTG port that can be used in both
powered host mode and peripheral mode. When in peripheral mode,
the port does not power the board. There is no VBUS sensing on
the port.

This patch adds the regulator controlling VBUS on the OTG port,
the GPIO for the ID detect pin, and enables the USB OTG and host
controllers.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
arch/arm/boot/dts/sun8i-h3-bananapi-m2-plus.dts

index 52acbe111cade5aa6c81c71d079df731c9f03d8d..17c7c088cdeaa43675d314566944075505a2c14a 100644 (file)
        };
 };
 
+&ehci0 {
+       status = "okay";
+};
+
 &ehci1 {
        status = "okay";
 };
        status = "okay";
 };
 
+&ohci0 {
+       status = "okay";
+};
+
 &ohci1 {
        status = "okay";
 };
        };
 };
 
+&reg_usb0_vbus {
+       gpio = <&pio 3 11 GPIO_ACTIVE_HIGH>; /* PD11 */
+       status = "okay";
+};
+
 &uart0 {
        pinctrl-names = "default";
        pinctrl-0 = <&uart0_pins_a>;
        status = "okay";
 };
 
+&usb_otg {
+       dr_mode = "otg";
+       status = "okay";
+};
+
 &usbphy {
-       /* USB VBUS is on as long as VCC-IO is on */
+       usb0_id_det-gpios = <&r_pio 0 6 GPIO_ACTIVE_HIGH>; /* PL6 */
+       usb0_vbus-supply = <&reg_usb0_vbus>;
+       /* USB host VBUS is on as long as VCC-IO is on */
        status = "okay";
 };