Skip to contentSkip to conversation

ARM: dts: sun6i-a31s-colorfly-e708-q1: Add full otg support

PATCH New Hans de Goede 2 participants 3 messages Jul 15, 2016 – Jul 18, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover ARM: dts: sun6i-a31s-colorfly-e708-q1: Add full otg support

Hi Maxime and Chen-Yu,

The phy patches for doing full otg on A31 are in usb-next now, so this one can be merged now.

Regards,

Hans

#1 lore raw

PATCH 1/1 ARM: dts: sun6i-a31s-colorfly-e708-q1: Add full otg support

Now that we've all the necessary bits in place we can enable full otg support on these tablets.

---
 arch/arm/boot/dts/sun6i-a31s-colorfly-e708-q1.dts | 32 +++++++++++++++++------
 1 file changed, 24 insertions(+), 8 deletions(-)
arch/arm/boot/dts/sun6i-a31s-colorfly-e708-q1.dts +24 -8
index e182eec..9040bb9 100644
@@ -106,6 +106,13 @@
 		allwinner,drive = <SUN4I_PINCTRL_10_MA>;
 		allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
 	};
+
+	usb0_id_detect_pin: usb0_id_detect_pin at 0 {
+		allwinner,pins = "PA15";
+		allwinner,function = "gpio_in";
+		allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+		allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+	};
 };
 
 &p2wi {
@@ -116,6 +123,8 @@
 		reg = <0x68>;
 		interrupt-parent = <&nmi_intc>;
 		interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
+		drivevbus-supply = <&reg_vcc5v0>;
+		x-powers,drive-vbus-en;
 	};
 };
 
@@ -185,24 +194,31 @@
 	regulator-name = "vcc-pg";
 };
 
+&reg_drivevbus {
+	regulator-name = "usb0-vbus";
+	status = "okay";
+};
+
 &simplefb_lcd {
 	vcc-lcd-supply = <&reg_dc1sw>;
 	vcc-pg-supply = <&reg_dldo2>;
 };
 
-/*
- * FIXME for now we only support host mode and rely on u-boot to have
- * turned on Vbus which is controlled by the axp221 pmic on the board.
- *
- * Once we have axp221 power-supply and vbus-usb support we should switch
- * to fully supporting otg.
- */
 &usb_otg {
-	dr_mode = "host";
+	dr_mode = "otg";
+	status = "okay";
+};
+
+&usb_power_supply {
 	status = "okay";
 };
 
 &usbphy {
+	pinctrl-names = "default";
+	pinctrl-0 = <&usb0_id_detect_pin>;
+	usb0_id_det-gpio = <&pio 0 15 GPIO_ACTIVE_HIGH>; /* PA15 */
+	usb0_vbus_power-supply = <&usb_power_supply>;
+	usb0_vbus-supply = <&reg_drivevbus>;
 	usb1_vbus-supply = <&reg_dldo1>;
 	status = "okay";
 };
Signature · 1 line
2.7.4
#2 lore raw

PATCH 1/1 ARM: dts: sun6i-a31s-colorfly-e708-q1: Add full otg support

Quoted 4 lines · Hans de Goede

Now that we've all the necessary bits in place we can enable full otg support on these tablets.

Queued for 4.9, thanks!
Maxime

Signature · 10 lines
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20160718/42aae94c/attachment.sig>