Subject: [PATCH 4/4] ARM: dts: sun8i: add OTG function to Lichee Pi Zero

From: [email-masked] (Bin Liu)
Date: Wed, 11 Jan 2017 14:33:26 -0600

On Thu, Jan 12, 2017 at 04:13:34AM +0800, Icenowy Zheng wrote:
> 
> 
> 12.01.2017, 04:08, "Bin Liu" <[email-masked]>:
> > On Thu, Jan 12, 2017 at 03:55:33AM +0800, Icenowy Zheng wrote:
> >> ?11.01.2017, 04:24, "Bin Liu" <[email-masked]>:
> >> ?> On Tue, Jan 03, 2017 at 11:25:34PM +0800, Icenowy Zheng wrote:
> >> ?>> ?Lichee Pi Zero features a USB OTG port.
> >> ?>>
> >> ?>> ?Add support for it.
> >> ?>>
> >> ?>> ?Note: in order to use the Host mode, the board must be powered via the
> >> ?>> ?+5V and GND pins.
> >> ?>>
> >> ?>> ?Signed-off-by: Icenowy Zheng <[email-masked]>
> >> ?>> ?---
> >> ?>> ??arch/arm/boot/dts/sun8i-v3s-licheepi-zero.dts | 10 ++++++++++
> >> ?>> ??1 file changed, 10 insertions(+)
> >> ?>>
> >> ?>> ?diff --git a/arch/arm/boot/dts/sun8i-v3s-licheepi-zero.dts b/arch/arm/boot/dts/sun8i-v3s-licheepi-zero.dts
> >> ?>> ?index 0099affc6ce3..3d9168cbaeca 100644
> >> ?>> ?--- a/arch/arm/boot/dts/sun8i-v3s-licheepi-zero.dts
> >> ?>> ?+++ b/arch/arm/boot/dts/sun8i-v3s-licheepi-zero.dts
> >> ?>> ?@@ -71,3 +71,13 @@
> >> ?>> ??????????pinctrl-names = "default";
> >> ?>> ??????????status = "okay";
> >> ?>> ??};
> >> ?>> ?+
> >> ?>> ?+&usb_otg {
> >> ?>> ?+ dr_mode = "otg";
> >> ?>
> >> ?> Why not set this default mode in dtsi instead?
> >> ?>
> >> ?> Regards,
> >> ?> -Bin.
> >>
> >> ?There's possibly boards which do not have OTG functions.
> >
> > That is board specific.
> >
> > You'd better to define the default dr_mode which the musb _controller_
> > supports in the dtsi, and then override it in a specific board dts if
> > necessary.
> 
> Is there MUSB controllers which do not support a certain mode?

I am not aware of any. That is why I recommended to set "otg" in dtsi,
then override it in board dts if a port is specically designed to
host-only or device-only mode.

> 
> (I remembered my omap3-n900 which do not work under OTG mode...)

I belive it is n900 board specific. omap3 itself doesn't have such
limitation, AFAIK.

Regards,
-Bin.

> 
> >
> > Regards,
> > -Bin.
> >
> >> ?Even the official CDR design of V3s uses the USB controller to
> >> ?connect a UVC webcam to make the design a dual-cam design
> >> ?(V3s itself has a CSI).
> >>
> >> ?>
> >> ?>> ?+ status = "okay";
> >> ?>> ?+};
> >> ?>> ?+
> >> ?>> ?+&usbphy {
> >> ?>> ?+ usb0_id_det-gpio = <&pio 5 6 GPIO_ACTIVE_HIGH>;
> >> ?>> ?+ status = "okay";
> >> ?>> ?+};
> >> ?>> ?--
> >> ?>> ?2.11.0