From: b-liu@ti.com (Bin Liu)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 4/4] ARM: dts: sun8i: add OTG function to Lichee Pi Zero
Date: Thu, 12 Jan 2017 08:50:14 -0600 [thread overview]
Message-ID: <20170112145014.GC16865@uda0271908> (raw)
In-Reply-To: <20170111210638.ppdnpzdd2l6x4lyo@lukather>
On Wed, Jan 11, 2017 at 10:06:38PM +0100, Maxime Ripard wrote:
> On Wed, Jan 11, 2017 at 02:08:11PM -0600, Bin Liu wrote:
> > On Thu, Jan 12, 2017 at 03:55:33AM +0800, Icenowy Zheng wrote:
> > >
> > >
> > > 11.01.2017, 04:24, "Bin Liu" <b-liu@ti.com>:
> > > > 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 <icenowy@aosc.xyz>
> > > >> ?---
> > > >> ??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.
>
> Exactly, and this is why it should be done in the board DT.
I am just suggesting based on the common practice. If a .dtsi exists for
a family, the .dtsi describes the device and common properties for all
possible boards, and each board .dts adds or overrides its specific
implementation. Kernel has many devices/boards done in this way - define
the default dr_mode in .dtsi.
In this case, I suggest to set the common dr_mode in .dtsi, then each
board .dts only overrides it if the implementation is different.
>
> The controller in the Allwinner SoCs do not handle directly the ID pin
> and VBUS, but rather rely on a GPIO to do so.
>
> So boards with OTG will need setup anyway, at least to tell which
> GPIOs are used. There's no point in enforcing a default if it doesn't
> work by default.
Then define a default which supposes to work for most boards.
Why I suggest this, is because defining a default dr_mode which works
for most cases in dtsi could prevent a little surprise in MUSB function.
If someone designs a new board but forgets to define dr_mode in the new
board DT, the MUSB driver will default to org mode, which might not be
intended.
Regards,
-Bin.
WARNING: multiple messages have this Message-ID (diff)
From: Bin Liu <b-liu@ti.com>
To: Maxime Ripard <maxime.ripard@free-electrons.com>
Cc: "devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Kishon Vijay Abraham I <kishon@ti.com>,
Chen-Yu Tsai <wens@csie.org>, Icenowy Zheng <icenowy@aosc.xyz>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH 4/4] ARM: dts: sun8i: add OTG function to Lichee Pi Zero
Date: Thu, 12 Jan 2017 08:50:14 -0600 [thread overview]
Message-ID: <20170112145014.GC16865@uda0271908> (raw)
In-Reply-To: <20170111210638.ppdnpzdd2l6x4lyo@lukather>
On Wed, Jan 11, 2017 at 10:06:38PM +0100, Maxime Ripard wrote:
> On Wed, Jan 11, 2017 at 02:08:11PM -0600, Bin Liu wrote:
> > On Thu, Jan 12, 2017 at 03:55:33AM +0800, Icenowy Zheng wrote:
> > >
> > >
> > > 11.01.2017, 04:24, "Bin Liu" <b-liu@ti.com>:
> > > > 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 <icenowy@aosc.xyz>
> > > >> ---
> > > >> 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.
>
> Exactly, and this is why it should be done in the board DT.
I am just suggesting based on the common practice. If a .dtsi exists for
a family, the .dtsi describes the device and common properties for all
possible boards, and each board .dts adds or overrides its specific
implementation. Kernel has many devices/boards done in this way - define
the default dr_mode in .dtsi.
In this case, I suggest to set the common dr_mode in .dtsi, then each
board .dts only overrides it if the implementation is different.
>
> The controller in the Allwinner SoCs do not handle directly the ID pin
> and VBUS, but rather rely on a GPIO to do so.
>
> So boards with OTG will need setup anyway, at least to tell which
> GPIOs are used. There's no point in enforcing a default if it doesn't
> work by default.
Then define a default which supposes to work for most boards.
Why I suggest this, is because defining a default dr_mode which works
for most cases in dtsi could prevent a little surprise in MUSB function.
If someone designs a new board but forgets to define dr_mode in the new
board DT, the MUSB driver will default to org mode, which might not be
intended.
Regards,
-Bin.
WARNING: multiple messages have this Message-ID (diff)
From: Bin Liu <b-liu@ti.com>
To: Maxime Ripard <maxime.ripard@free-electrons.com>
Cc: Icenowy Zheng <icenowy@aosc.xyz>, Chen-Yu Tsai <wens@csie.org>,
Kishon Vijay Abraham I <kishon@ti.com>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>
Subject: Re: [PATCH 4/4] ARM: dts: sun8i: add OTG function to Lichee Pi Zero
Date: Thu, 12 Jan 2017 08:50:14 -0600 [thread overview]
Message-ID: <20170112145014.GC16865@uda0271908> (raw)
In-Reply-To: <20170111210638.ppdnpzdd2l6x4lyo@lukather>
On Wed, Jan 11, 2017 at 10:06:38PM +0100, Maxime Ripard wrote:
> On Wed, Jan 11, 2017 at 02:08:11PM -0600, Bin Liu wrote:
> > On Thu, Jan 12, 2017 at 03:55:33AM +0800, Icenowy Zheng wrote:
> > >
> > >
> > > 11.01.2017, 04:24, "Bin Liu" <b-liu@ti.com>:
> > > > 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 <icenowy@aosc.xyz>
> > > >> ---
> > > >> 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.
>
> Exactly, and this is why it should be done in the board DT.
I am just suggesting based on the common practice. If a .dtsi exists for
a family, the .dtsi describes the device and common properties for all
possible boards, and each board .dts adds or overrides its specific
implementation. Kernel has many devices/boards done in this way - define
the default dr_mode in .dtsi.
In this case, I suggest to set the common dr_mode in .dtsi, then each
board .dts only overrides it if the implementation is different.
>
> The controller in the Allwinner SoCs do not handle directly the ID pin
> and VBUS, but rather rely on a GPIO to do so.
>
> So boards with OTG will need setup anyway, at least to tell which
> GPIOs are used. There's no point in enforcing a default if it doesn't
> work by default.
Then define a default which supposes to work for most boards.
Why I suggest this, is because defining a default dr_mode which works
for most cases in dtsi could prevent a little surprise in MUSB function.
If someone designs a new board but forgets to define dr_mode in the new
board DT, the MUSB driver will default to org mode, which might not be
intended.
Regards,
-Bin.
next prev parent reply other threads:[~2017-01-12 14:50 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-03 15:25 [PATCH 0/4] Add support for the USB OTG function of Allwinner V3s Icenowy Zheng
2017-01-03 15:25 ` Icenowy Zheng
2017-01-03 15:25 ` [PATCH 1/4] phy: sun4i-usb: add support for V3s USB PHY Icenowy Zheng
2017-01-03 15:25 ` Icenowy Zheng
2017-01-06 13:56 ` Maxime Ripard
2017-01-06 13:56 ` Maxime Ripard
2017-01-06 13:56 ` Maxime Ripard
2017-01-16 9:06 ` Kishon Vijay Abraham I
2017-01-16 9:06 ` Kishon Vijay Abraham I
2017-01-16 9:06 ` Kishon Vijay Abraham I
2017-01-03 15:25 ` [PATCH 2/4] musb: sunxi: add support for the variant in H3/V3s SoC Icenowy Zheng
2017-01-03 15:25 ` Icenowy Zheng
2017-01-06 13:57 ` Maxime Ripard
2017-01-06 13:57 ` Maxime Ripard
2017-01-06 13:57 ` Maxime Ripard
2017-01-17 14:38 ` Bin Liu
2017-01-17 14:38 ` Bin Liu
2017-01-17 14:38 ` Bin Liu
2017-01-03 15:25 ` [PATCH 3/4] ARM: dts: sunxi: add usb_otg and usbphy node for V3s SoC Icenowy Zheng
2017-01-03 15:25 ` Icenowy Zheng
2017-01-06 14:19 ` Maxime Ripard
2017-01-06 14:19 ` Maxime Ripard
2017-01-06 14:19 ` Maxime Ripard
2017-01-03 15:25 ` [PATCH 4/4] ARM: dts: sun8i: add OTG function to Lichee Pi Zero Icenowy Zheng
2017-01-03 15:25 ` Icenowy Zheng
2017-01-10 20:24 ` Bin Liu
2017-01-10 20:24 ` Bin Liu
2017-01-10 20:24 ` Bin Liu
2017-01-11 19:55 ` Icenowy Zheng
2017-01-11 19:55 ` Icenowy Zheng
2017-01-11 20:08 ` Bin Liu
2017-01-11 20:08 ` Bin Liu
2017-01-11 20:08 ` Bin Liu
2017-01-11 20:13 ` Icenowy Zheng
2017-01-11 20:13 ` Icenowy Zheng
2017-01-11 20:33 ` Bin Liu
2017-01-11 20:33 ` Bin Liu
2017-01-11 20:33 ` Bin Liu
2017-01-11 21:06 ` Maxime Ripard
2017-01-11 21:06 ` Maxime Ripard
2017-01-11 21:06 ` Maxime Ripard
2017-01-12 14:50 ` Bin Liu [this message]
2017-01-12 14:50 ` Bin Liu
2017-01-12 14:50 ` Bin Liu
2017-01-12 17:39 ` Maxime Ripard
2017-01-12 17:39 ` Maxime Ripard
2017-01-12 17:39 ` Maxime Ripard
2017-01-13 21:00 ` Bin Liu
2017-01-13 21:00 ` Bin Liu
2017-01-13 21:00 ` Bin Liu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170112145014.GC16865@uda0271908 \
--to=b-liu@ti.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.