diff mbox

[v2,1/2] dt-bindings: usb: add DT binding for s3c2410 USB device controller

Message ID 1484172150-32075-2-git-send-email-sergio.prado@e-labworks.com
State Changes Requested, archived
Headers show

Commit Message

Sergio Prado Jan. 11, 2017, 10:02 p.m. UTC
Adds the device tree bindings description for Samsung S3C2410 and
compatible USB device controller.

Signed-off-by: Sergio Prado <sergio.prado@e-labworks.com>
---
 .../devicetree/bindings/usb/s3c2410-usb.txt        | 28 ++++++++++++++++++++++
 1 file changed, 28 insertions(+)

Comments

Felipe Balbi Jan. 16, 2017, 10:34 a.m. UTC | #1
Hi,

Sergio Prado <sergio.prado@e-labworks.com> writes:
> Adds the device tree bindings description for Samsung S3C2410 and
> compatible USB device controller.
>
> Signed-off-by: Sergio Prado <sergio.prado@e-labworks.com>

without Ack from DT folks, I can't take this.
Rob Herring Jan. 18, 2017, 8:08 p.m. UTC | #2
On Wed, Jan 11, 2017 at 08:02:29PM -0200, Sergio Prado wrote:
> Adds the device tree bindings description for Samsung S3C2410 and
> compatible USB device controller.
> 
> Signed-off-by: Sergio Prado <sergio.prado@e-labworks.com>
> ---
>  .../devicetree/bindings/usb/s3c2410-usb.txt        | 28 ++++++++++++++++++++++
>  1 file changed, 28 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/usb/s3c2410-usb.txt b/Documentation/devicetree/bindings/usb/s3c2410-usb.txt
> index e45b38ce2986..28353eea31fd 100644
> --- a/Documentation/devicetree/bindings/usb/s3c2410-usb.txt
> +++ b/Documentation/devicetree/bindings/usb/s3c2410-usb.txt
> @@ -20,3 +20,31 @@ usb0: ohci@49000000 {
>  	clocks = <&clocks UCLK>, <&clocks HCLK_USBH>;
>  	clock-names = "usb-bus-host", "usb-host";
>  };
> +
> +Samsung S3C2410 and compatible USB device controller
> +
> +Required properties:
> + - compatible: Should be one of the following
> +	       "samsung,s3c2410-udc"
> +	       "samsung,s3c2440-udc"
> + - reg: address and length of the controller memory mapped region
> + - interrupts: interrupt number for the USB device controller
> + - clocks: Should reference the bus and host clocks
> + - clock-names: Should contain two strings
> +		"uclk" for the USB bus clock
> +		"usb-device" for the USB device clock

Perhaps just "bus" and "device".

> +
> +Optional properties:
> + - samsung,vbus-gpio: specifies a gpio that allows to detect whether
> +   vbus is present - USB is connected (active high, input).
> + - samsung,pullup-gpio: If present, specifies a gpio to control the
> +   USB D+ pullup (active high, output).

"-gpios", not "-gpio" is preferred.

These should be common property names if we're going to have them. The 
problem with just "vbus-gpios" is does that mean an enable control or 
status as you have. I guess in the former case, that should always be 
modeled as a regulator.

Also, these should all be part of a connector node as these controls are 
more related to the USB connector than the controller. And I don't mean 
extcon here because those bindings are a mess.

Rob
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Sergio Prado Jan. 24, 2017, 6:21 p.m. UTC | #3
On Wed, Jan 18, 2017 at 02:08:45PM -0600, Rob Herring wrote:
> On Wed, Jan 11, 2017 at 08:02:29PM -0200, Sergio Prado wrote:
> > + - clocks: Should reference the bus and host clocks
> > + - clock-names: Should contain two strings
> > +		"uclk" for the USB bus clock
> > +		"usb-device" for the USB device clock
> 
> Perhaps just "bus" and "device".

OK, I'll rename.

> > +
> > +Optional properties:
> > + - samsung,vbus-gpio: specifies a gpio that allows to detect whether
> > +   vbus is present - USB is connected (active high, input).
> > + - samsung,pullup-gpio: If present, specifies a gpio to control the
> > +   USB D+ pullup (active high, output).
> 
> "-gpios", not "-gpio" is preferred.
> 
> These should be common property names if we're going to have them. The 
> problem with just "vbus-gpios" is does that mean an enable control or 
> status as you have. I guess in the former case, that should always be 
> modeled as a regulator.
> 
> Also, these should all be part of a connector node as these controls are 
> more related to the USB connector than the controller. And I don't mean 
> extcon here because those bindings are a mess.

There are other bindings that are doing the same thing I did, like the
property "atmel,vbus-gpio" in atmel-usb.txt and "samsung,vbus-gpio" in
exynos-usb.txt. Also, I did not find any example of a connector node doing
this. Can you point me out to an example, or should I just rename to
"-gpios" in this case?

> 
> Rob
diff mbox

Patch

diff --git a/Documentation/devicetree/bindings/usb/s3c2410-usb.txt b/Documentation/devicetree/bindings/usb/s3c2410-usb.txt
index e45b38ce2986..28353eea31fd 100644
--- a/Documentation/devicetree/bindings/usb/s3c2410-usb.txt
+++ b/Documentation/devicetree/bindings/usb/s3c2410-usb.txt
@@ -20,3 +20,31 @@  usb0: ohci@49000000 {
 	clocks = <&clocks UCLK>, <&clocks HCLK_USBH>;
 	clock-names = "usb-bus-host", "usb-host";
 };
+
+Samsung S3C2410 and compatible USB device controller
+
+Required properties:
+ - compatible: Should be one of the following
+	       "samsung,s3c2410-udc"
+	       "samsung,s3c2440-udc"
+ - reg: address and length of the controller memory mapped region
+ - interrupts: interrupt number for the USB device controller
+ - clocks: Should reference the bus and host clocks
+ - clock-names: Should contain two strings
+		"uclk" for the USB bus clock
+		"usb-device" for the USB device clock
+
+Optional properties:
+ - samsung,vbus-gpio: specifies a gpio that allows to detect whether
+   vbus is present - USB is connected (active high, input).
+ - samsung,pullup-gpio: If present, specifies a gpio to control the
+   USB D+ pullup (active high, output).
+
+usb1: udc@52000000 {
+	compatible = "samsung,s3c2440-udc";
+	reg = <0x52000000 0x100000>;
+	interrupts = <0 0 25 3>;
+	clocks = <&clocks UCLK>, <&clocks HCLK_USBD>;
+	clock-names = "usb-bus-gadget", "usb-device";
+	samsung,pullup-gpio = <&gpc 5 GPIO_ACTIVE_HIGH>;
+};