diff mbox

[v3,08/12] Documentation: bindings: add doc for the USB2 ChipIdea USB driver

Message ID 1405499166-6726-9-git-send-email-antoine.tenart@free-electrons.com
State New
Headers show

Commit Message

Antoine Tenart July 16, 2014, 8:26 a.m. UTC
Document the USB2 ChipIdea driver (ci13xxx) bindings.

Signed-off-by: Antoine Ténart <antoine.tenart@free-electrons.com>
---
 .../devicetree/bindings/usb/ci-hdrc-usb2.txt       | 23 ++++++++++++++++++++++
 1 file changed, 23 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt

Comments

Arnd Bergmann July 16, 2014, 8:39 a.m. UTC | #1
On Wednesday 16 July 2014 10:26:02 Antoine Ténart wrote:
> +
> +Required properties:
> +- compatible: should be "chipidea,usb2"
> +- reg: base address and length of the registers
> +- interrupts: interrupt for the USB controller
> +
> +Optional properties:
> +- clocks: reference to the USB clock
> +- usb-phy: reference to the USB PHY

I think the phy reference should use the standard phy binding, using
"phys" property to refer to a node that has a "#phy-cells" property.

It seems the code gets this right, but just the documentation is wrong.

> +- vbus-supply: reference to the VBUS regulator
> +- dma-mask: DMA bit mask

No. Do not use "dma-mask" as a property, that is a pure Linux specific
concept. The DT way to express this is to use the 'dma-ranges' property
in the device's parent to describe any bus-related restrictions, and
for the driver to ask for a mask that matches what the hardware is
capable of (which may be smaller or larger than what the bus supports).

	Arnd
Antoine Tenart July 16, 2014, 8:59 a.m. UTC | #2
Hi Arnd,

On Wed, Jul 16, 2014 at 10:39:36AM +0200, Arnd Bergmann wrote:
> On Wednesday 16 July 2014 10:26:02 Antoine Ténart wrote:
> > +
> > +Required properties:
> > +- compatible: should be "chipidea,usb2"
> > +- reg: base address and length of the registers
> > +- interrupts: interrupt for the USB controller
> > +
> > +Optional properties:
> > +- clocks: reference to the USB clock
> > +- usb-phy: reference to the USB PHY
> 
> I think the phy reference should use the standard phy binding, using
> "phys" property to refer to a node that has a "#phy-cells" property.
> 
> It seems the code gets this right, but just the documentation is wrong.

I moved this PHY driver from usb/phy/ to phy/ and forgot to update this
property. I'll fix it.

> 
> > +- vbus-supply: reference to the VBUS regulator
> > +- dma-mask: DMA bit mask
> 
> No. Do not use "dma-mask" as a property, that is a pure Linux specific
> concept. The DT way to express this is to use the 'dma-ranges' property
> in the device's parent to describe any bus-related restrictions, and
> for the driver to ask for a mask that matches what the hardware is
> capable of (which may be smaller or larger than what the bus supports).

Ok. I'll answer in the CI driver's thread.

Thanks!

Antoine
diff mbox

Patch

diff --git a/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt b/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt
new file mode 100644
index 000000000000..fb3157183e6a
--- /dev/null
+++ b/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt
@@ -0,0 +1,23 @@ 
+* USB2 ChipIdea USB controller for ci13xxx
+
+Required properties:
+- compatible: should be "chipidea,usb2"
+- reg: base address and length of the registers
+- interrupts: interrupt for the USB controller
+
+Optional properties:
+- clocks: reference to the USB clock
+- usb-phy: reference to the USB PHY
+- vbus-supply: reference to the VBUS regulator
+- dma-mask: DMA bit mask
+
+Example:
+
+	usb@f7ed0000 {
+		compatible = "chipidea,usb2";
+		reg = <0xf7ed0000 0x10000>;
+		interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&chip CLKID_USB0>;
+		usb-phy = <&usb_phy0>;
+		vbus-supply = <&reg_usb0_vbus>;
+	};