From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Subject: Re: [PATCH 2/2] Drivers: MUSB: Davinci MUSB: added DT support References: <1453387999-4485-1-git-send-email-petr@barix.com> <20160121230751.GA3991@rob-hp-laptop> From: Petr Kulhavy Message-ID: <56A1EFFE.3070401@barix.com> Date: Fri, 22 Jan 2016 10:01:50 +0100 MIME-Version: 1.0 In-Reply-To: <20160121230751.GA3991@rob-hp-laptop> Content-Type: multipart/alternative; boundary="------------090404060904000200080309" To: Rob Herring Cc: balbi@ti.com, devicetree@vger.kernel.org, linux-usb@vger.kernel.org List-ID: This is a multi-part message in MIME format. --------------090404060904000200080309 Content-Type: text/plain; charset=iso-8859-2; format=flowed Content-Transfer-Encoding: quoted-printable Hi Rob, thanks a lot for your comments. I admit I got inspired by the=20 usb/omap-usb.txt and usb/am33xx-usb.txt bindings which use identical keywords, mode, num-eps, ram-bits, power and=20 multipoint as all these chips use the same or similar MUSB core. From your comments I have the feeling these are not the best bindings=20 to take as an example. What would you recommend as a good example then? Regards Petr On 22.01.2016 00:07, Rob Herring wrote: > On Thu, Jan 21, 2016 at 03:53:19PM +0100, Petr Kulhavy wrote: >> TI DaVinci MUSB driver equipped with DeviceTree support. >> Tested with AM1808 board and USB2.0 (OTG) in host mode. >> >> Signed-off-by: Petr Kulhavy >> --- >> .../devicetree/bindings/usb/da8xx-usb.txt | 52 +++++++ >> drivers/usb/musb/da8xx.c | 166 +++++++++++= ++++++++++ >> include/linux/platform_data/usb-davinci.h | 3 +- >> 3 files changed, 220 insertions(+), 1 deletion(-) >> create mode 100644 Documentation/devicetree/bindings/usb/da8xx-usb.t= xt >> >> diff --git a/Documentation/devicetree/bindings/usb/da8xx-usb.txt b/Doc= umentation/devicetree/bindings/usb/da8xx-usb.txt >> new file mode 100644 >> index 0000000..c81d665 >> --- /dev/null >> +++ b/Documentation/devicetree/bindings/usb/da8xx-usb.txt > Follow the compatible string for the filename (with wildcards is fine).= > >> @@ -0,0 +1,52 @@ >> +TI DaVinci MUSB >> + >> +Required properties: >> + >> + - compatible : Should be "ti,da850-musb" or "ti,da830-musb" >> + >> + - mode : USB mode. "1" signifies HOST, "2" represents PERIPHERAL, >> + "3" represents OTG. > Surely we have a similar property defined already. Don't create > something new. > >> + >> + - power : This signifies the maximum current the controller can >> + supply in host mode. The unit size is 2mA, the maximum value is = 510mA. > You should model this as a regulator. > >> + - num-eps : Specifies the number of endpoints. This is also a >> + MUSB configuration-specific setting. > Just spell out endpoints. > >> + >> + - multipoint : Should be "1" indicating the musb controller supports= >> + multipoint. This is a MUSB configuration-specific setting. > What does multipoint mean? > >> + - ram-bits : Specifies the ram address size. > Needs a better description. Then it probably needs a better name too, > but without a description I can't tell what that would be. > >> + >> + >> +Optional properties: >> + >> + - da8xx,phy20-clkmux-cfg: Integer. Defines the USB 2.0 PHY reference= clock source. >> + Supported values: "0" for external pin, "1" for internal PLL. > How about a boolean property instead. Name it based on the less used > option (external pin I'm guessing). > >> + - da8xx,phy20-refclock-frequency : Integer. Defines the USB 2.0 PHY = reference clock input >> + frequency in Hz in case the clock is generated by the internal P= LL. >> + Supported values are 12MHz, 13MHz, 19.2MHz, 20MHz, 24MHz, 26MHz,= 38.4MHz, 40MHz, 48MHz > da8xx is not a vendor. > > Rob --=20 --=20 Petr Kulhavy, MSc System Architect *BARIX* petr@barix.com | Skype: brain.barix Barix AG, Seefeldstrasse 303 | 8008 Zurich, Switzerland T +41 43 43322 11 | www.barix.com You have received this email because of your relationship Barix AG and=20 its affiliated companies. Barix AG and its affiliated companies do not=20 sell or exchange email addresses, or any other personal contact=20 information provided by you with any third parties. All email=20 distributions are managed and controlled by Barix AG and its affiliated=20 companies. Barix AG, Seefeldstr. 303, 8008 Z=FCrich, Switzerland. Company Reg. No:=20 CH-020.3.023.869-8, VAT Reg. No: CHE-105.687.663. --------------090404060904000200080309 Content-Type: text/html; charset=iso-8859-2 Content-Transfer-Encoding: quoted-printable Hi Rob,

thanks a lot for your comments. I admit I got inspired by the usb/omap-usb.txt=A0 and usb/am33xx-usb.txt bindings
which use identical keywords, mode, num-eps, ram-bits, power and multipoint as all these chips use the same or similar MUSB core.
= From your comments I have the feeling these are not the best bindings to take as an example.
What would you recommend as a good example then?

Regards
Petr

On 22.01.2016 00:07, Rob Herring wrote= :
On Thu, Jan 21, 2016 at 03:53:19PM +0100, Petr Kulha=
vy wrote:
TI DaVinci MUSB driver equipped with DeviceTree su=
pport.
Tested with AM1808 board and USB2.0 (OTG) in host mode.

Signed-off-by: Petr Kulhavy <petr@barix.com>
---
 .../devicetree/bindings/usb/da8xx-usb.txt          |  52 +++++++
 drivers/usb/musb/da8xx.c                           | 166 +++++++++++++++=
++++++
 include/linux/platform_data/usb-davinci.h          |   3 +-
 3 files changed, 220 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/devicetree/bindings/usb/da8xx-usb.txt

diff --git a/Documentation/devicetree/bindings/usb/da8xx-usb.txt b/Docume=
ntation/devicetree/bindings/usb/da8xx-usb.txt
new file mode 100644
index 0000000..c81d665
--- /dev/null
+++ b/Documentation/devicetree/bindings/usb/da8xx-usb.txt
Follow the compatible string for the filename (with wildcards is fine).

@@ -0,0 +1,52 @@
+TI DaVinci MUSB
+
+Required properties:
+
+ - compatible : Should be "ti,da850-musb" or "ti,da830-musb"
+
+ - mode : USB mode. "1" signifies HOST, "2" represents PERIPHERAL,
+     "3" represents OTG.
Surely we have a similar property defined already. Don't create=20
something new.

+
+ - power : This signifies the maximum current the controller can
+     supply in host mode. The unit size is 2mA, the maximum value is 510=
mA.
You should model this as a regulator.

+ - num-eps : Specifies the number of endpoints. T=
his is also a
+     MUSB configuration-specific setting.
Just spell out endpoints.

+
+ - multipoint : Should be "1" indicating the musb controller supports
+     multipoint. This is a MUSB configuration-specific setting.
What does multipoint mean?

+ - ram-bits : Specifies the ram address size.
Needs a better description. Then it probably needs a better name too,=20
but without a description I can't tell what that would be.

+
+
+Optional properties:
+
+ - da8xx,phy20-clkmux-cfg: Integer. Defines the USB 2.0 PHY reference cl=
ock source.
+     Supported values: "0" for external pin, "1" for internal PLL.
How about a boolean property instead. Name it based on the less used=20
option (external pin I'm guessing).

+ - da8xx,phy20-refclock-frequency : Integer. Defi=
nes the USB 2.0 PHY reference clock input
+     frequency in Hz in case the clock is generated by the internal PLL.=

+     Supported values are 12MHz, 13MHz, 19.2MHz, 20MHz, 24MHz, 26MHz, 38=
=2E4MHz, 40MHz, 48MHz
da8xx is not a vendor.

Rob

--


--
Petr Kulhavy, MSc
System Architect

BARIX

petr@barix.co= m | Skype: brain.barix

Barix AG, Seefeldstrasse 303 | 8008 Zurich, Switzerland
T +41 43 43322 11 | www.barix.com

You have received this email because of your relationship Barix AG and its affiliated companies. Barix AG and its affiliated companies do not sell or exchange email addresses, or any other personal contact information provided by you with any third parties. All email distributions are managed and controlled by Barix AG and its affiliated companies.
Barix AG, Seefeldstr. 303, 8008 Z=FCrich, Switzerland. Company Reg. No: CH-020.3.023.869-8, VAT Reg. No: CHE-105.687.663.
--------------090404060904000200080309--