From: Alexandre Pereira da Silva <hidden> Date: 2012-06-26 14:27:30
This patch series adds support to set basic usb gadget properties via
devicetree.
I takes into account the sugestions from Rob Herring and Mitch Bradley.
This was only tested on ARM LPC32XX SOC. I'm including patches to other soc's as
an reference.
Alexandre Pereira da Silva (5):
usb: gadget: lpc32xx_udc: Propagate devicetree to gadget drivers
usb: gadget: s3c-hsotg: Propagate devicetree to gadget drivers
usb: gadget: fsl_udc: Propagate devicetree to gadget drivers
usb: gadget: at91_udc: Propagate devicetree to gadget drivers
usb: gadget: composite: parse dt overrides
Documentation/devicetree/bindings/usb/gadget.txt | 20 +++++++++++
drivers/usb/gadget/at91_udc.c | 1 +
drivers/usb/gadget/composite.c | 39 ++++++++++++++++++++++
drivers/usb/gadget/fsl_udc_core.c | 1 +
drivers/usb/gadget/lpc32xx_udc.c | 1 +
drivers/usb/gadget/s3c-hsotg.c | 1 +
6 files changed, 63 insertions(+)
create mode 100644 Documentation/devicetree/bindings/usb/gadget.txt
--
1.7.10
From: Alexandre Pereira da Silva <hidden> Date: 2012-06-26 14:27:33
Fill dev.of_node of gadget drivers, so they can use devicetree
Signed-off-by: Alexandre Pereira da Silva <redacted>
---
drivers/usb/gadget/lpc32xx_udc.c | 1 +
1 file changed, 1 insertion(+)
From: Alexandre Pereira da Silva <hidden> Date: 2012-06-26 14:27:36
Fill dev.of_node of gadget drivers, so they can use devicetree
Signed-off-by: Alexandre Pereira da Silva <redacted>
---
drivers/usb/gadget/s3c-hsotg.c | 1 +
1 file changed, 1 insertion(+)
From: Alexandre Pereira da Silva <hidden> Date: 2012-06-26 14:27:40
Fill dev.of_node of gadget drivers, so they can use devicetree
Signed-off-by: Alexandre Pereira da Silva <redacted>
---
drivers/usb/gadget/fsl_udc_core.c | 1 +
1 file changed, 1 insertion(+)
From: Alexandre Pereira da Silva <hidden> Date: 2012-06-26 14:27:42
Fill dev.of_node of gadget drivers, so they can use devicetree
Signed-off-by: Alexandre Pereira da Silva <redacted>
---
drivers/usb/gadget/at91_udc.c | 1 +
1 file changed, 1 insertion(+)
@@ -0,0 +1,20 @@+Usb Gadget DeviceTree bindings++These optional properties inside the usb device controller node are used to+change some of the gadget drivers configuration:+- vendor-id: Usb vendor id+- product-id: Usb product id+- release: Version of this device+- vendor: Textual description of the vendor+- device: Textual description of this device+- serial: Textual representation of the device's serial number++Binding Example:+ usbd@31020000 {+ vendor-id = <0x0525>;+ product-id = <0xa4a6>;+ release = <1>;+ vendor = "Some Corp";+ device = "Test Device";+ serial = "12345";+ };
@@ -1470,6 +1505,10 @@ static int composite_bind(struct usb_gadget *gadget)cdev->desc=*composite->dev;+/* grab overrides from devicetree */+if(np)+composite_parse_dt(cdev,np);+/* standardized runtime overrides for device ID data */if(idVendor)cdev->desc.idVendor=cpu_to_le16(idVendor);
From: Rob Herring <hidden> Date: 2012-06-26 18:43:13
On 06/26/2012 09:27 AM, Alexandre Pereira da Silva wrote:
Grab the devicetree node properties to override VendorId, ProductId,
bcdDevice, Manucacturer, Product and SerialNumber
I'm still confused about what is the order of priority for the 2
possible sources of these values. The way it is written, the DT value is
a default, not an override.
Rob
@@ -0,0 +1,20 @@+Usb Gadget DeviceTree bindings++These optional properties inside the usb device controller node are used to+change some of the gadget drivers configuration:+- vendor-id: Usb vendor id+- product-id: Usb product id+- release: Version of this device+- vendor: Textual description of the vendor+- device: Textual description of this device+- serial: Textual representation of the device's serial number++Binding Example:+ usbd@31020000 {+ vendor-id = <0x0525>;+ product-id = <0xa4a6>;+ release = <1>;+ vendor = "Some Corp";+ device = "Test Device";+ serial = "12345";+ };
@@ -1470,6 +1505,10 @@ static int composite_bind(struct usb_gadget *gadget)cdev->desc=*composite->dev;+/* grab overrides from devicetree */+if(np)+composite_parse_dt(cdev,np);+/* standardized runtime overrides for device ID data */if(idVendor)cdev->desc.idVendor=cpu_to_le16(idVendor);
From: Michal Nazarewicz <hidden> Date: 2012-06-26 19:18:54
On 06/26/2012 09:27 AM, Alexandre Pereira da Silva wrote:
quoted
Grab the devicetree node properties to override VendorId, ProductId,
bcdDevice, Manucacturer, Product and SerialNumber
Like before, the code looks good to me:
Acked-by: Michal Nazarewicz <redacted>
Not commenting on the other aspects of the business logic though.
On Tue, 26 Jun 2012 20:43:03 +0200, Rob Herring [off-list ref] wrote:
I'm still confused about what is the order of priority for the 2
possible sources of these values. The way it is written, the DT value is
a default, not an override.
They are overwritten by module parameter but they are overwriting anything that
composite gadget might be providing.
--
Best regards, _ _
.o. | Liege of Serenely Enlightened Majesty of o' \,=./ `o
..o | Computer Science, Michał “mina86” Nazarewicz (o o)
ooo +----<email/xmpp: mpn@google.com>--------------ooO--(_)--Ooo--
From: Felipe Balbi <hidden> Date: 2012-07-02 07:37:59
Hi,
On Tue, Jun 26, 2012 at 11:27:13AM -0300, Alexandre Pereira da Silva wrote:
Grab the devicetree node properties to override VendorId, ProductId,
bcdDevice, Manucacturer, Product and SerialNumber
Signed-off-by: Alexandre Pereira da Silva <redacted>
I need Grant's acked-by to queue this one.
--
balbi
From: Rob Herring <hidden> Date: 2012-07-02 22:46:57
On 07/02/2012 02:35 AM, Felipe Balbi wrote:
Hi,
On Tue, Jun 26, 2012 at 11:27:13AM -0300, Alexandre Pereira da Silva wrote:
quoted
Grab the devicetree node properties to override VendorId, ProductId,
bcdDevice, Manucacturer, Product and SerialNumber
Signed-off-by: Alexandre Pereira da Silva <redacted>
I need Grant's acked-by to queue this one.
Grant is pretty much offline for the next 2 months, so:
Acked-by: Rob Herring <redacted>
Rob