* [PATCH 1/6] usb: dwc3-omap: use of_platform API to create dwc3 core pdev
2012-09-28 12:53 [PATCH 0/6] usb: dwc3-omap: add dt support Kishon Vijay Abraham I
@ 2012-09-28 12:53 ` Kishon Vijay Abraham I
2012-09-28 12:57 ` Felipe Balbi
2012-09-28 12:53 ` [PATCH 2/6] usb: dwc3-omap: use runtime API's to enable clocks Kishon Vijay Abraham I
` (4 subsequent siblings)
5 siblings, 1 reply; 18+ messages in thread
From: Kishon Vijay Abraham I @ 2012-09-28 12:53 UTC (permalink / raw)
To: linux-arm-kernel
Used of_platform_populate() to populate dwc3 core platform_device
from device tree data. Since now the allocation of unique device id is
handled be of_*, removed the call to dwc3_get_device_id.
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
---
drivers/usb/dwc3/dwc3-omap.c | 63 +++++++++++++++---------------------------
1 file changed, 22 insertions(+), 41 deletions(-)
diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c
index 479dc04..34578de 100644
--- a/drivers/usb/dwc3/dwc3-omap.c
+++ b/drivers/usb/dwc3/dwc3-omap.c
@@ -47,6 +47,7 @@
#include <linux/ioport.h>
#include <linux/io.h>
#include <linux/of.h>
+#include <linux/of_platform.h>
#include "core.h"
@@ -130,7 +131,6 @@ struct dwc3_omap {
/* device lock */
spinlock_t lock;
- struct platform_device *dwc3;
struct device *dev;
int irq;
@@ -204,17 +204,24 @@ static irqreturn_t dwc3_omap_interrupt(int irq, void *_omap)
return IRQ_HANDLED;
}
+static int dwc3_remove_core(struct device *dev, void *c)
+{
+ struct platform_device *pdev = to_platform_device(dev);
+
+ platform_device_unregister(pdev);
+
+ return 0;
+}
+
static int __devinit dwc3_omap_probe(struct platform_device *pdev)
{
struct dwc3_omap_data *pdata = pdev->dev.platform_data;
struct device_node *node = pdev->dev.of_node;
- struct platform_device *dwc3;
struct dwc3_omap *omap;
struct resource *res;
struct device *dev = &pdev->dev;
- int devid;
int size;
int ret = -ENOMEM;
int irq;
@@ -239,7 +246,7 @@ static int __devinit dwc3_omap_probe(struct platform_device *pdev)
return -EINVAL;
}
- res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) {
dev_err(dev, "missing memory base resource\n");
return -EINVAL;
@@ -251,34 +258,28 @@ static int __devinit dwc3_omap_probe(struct platform_device *pdev)
return -ENOMEM;
}
- devid = dwc3_get_device_id();
- if (devid < 0)
- return -ENODEV;
-
- dwc3 = platform_device_alloc("dwc3", devid);
- if (!dwc3) {
- dev_err(dev, "couldn't allocate dwc3 device\n");
- goto err1;
+ if (node) {
+ ret = of_platform_populate(node, NULL, NULL, dev);
+ if (ret) {
+ dev_err(&pdev->dev,
+ "failed to add create dwc3 core\n");
+ return ret;
+ }
}
context = devm_kzalloc(dev, resource_size(res), GFP_KERNEL);
if (!context) {
dev_err(dev, "couldn't allocate dwc3 context memory\n");
- goto err2;
+ goto err1;
}
spin_lock_init(&omap->lock);
- dma_set_coherent_mask(&dwc3->dev, dev->coherent_dma_mask);
- dwc3->dev.parent = dev;
- dwc3->dev.dma_mask = dev->dma_mask;
- dwc3->dev.dma_parms = dev->dma_parms;
omap->resource_size = resource_size(res);
omap->context = context;
omap->dev = dev;
omap->irq = irq;
omap->base = base;
- omap->dwc3 = dwc3;
reg = dwc3_omap_readl(omap->base, USBOTGSS_UTMI_OTG_STATUS);
@@ -323,7 +324,7 @@ static int __devinit dwc3_omap_probe(struct platform_device *pdev)
if (ret) {
dev_err(dev, "failed to request IRQ #%d --> %d\n",
omap->irq, ret);
- goto err2;
+ goto err1;
}
/* enable all IRQs */
@@ -342,37 +343,17 @@ static int __devinit dwc3_omap_probe(struct platform_device *pdev)
dwc3_omap_writel(omap->base, USBOTGSS_IRQENABLE_SET_1, reg);
- ret = platform_device_add_resources(dwc3, pdev->resource,
- pdev->num_resources);
- if (ret) {
- dev_err(dev, "couldn't add resources to dwc3 device\n");
- goto err2;
- }
-
- ret = platform_device_add(dwc3);
- if (ret) {
- dev_err(dev, "failed to register dwc3 device\n");
- goto err2;
- }
-
return 0;
-err2:
- platform_device_put(dwc3);
-
err1:
- dwc3_put_device_id(devid);
+ device_for_each_child(&pdev->dev, NULL, dwc3_remove_core);
return ret;
}
static int __devexit dwc3_omap_remove(struct platform_device *pdev)
{
- struct dwc3_omap *omap = platform_get_drvdata(pdev);
-
- platform_device_unregister(omap->dwc3);
-
- dwc3_put_device_id(omap->dwc3->id);
+ device_for_each_child(&pdev->dev, NULL, dwc3_remove_core);
return 0;
}
--
1.7.10.4
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH 1/6] usb: dwc3-omap: use of_platform API to create dwc3 core pdev
2012-09-28 12:53 ` [PATCH 1/6] usb: dwc3-omap: use of_platform API to create dwc3 core pdev Kishon Vijay Abraham I
@ 2012-09-28 12:57 ` Felipe Balbi
2012-09-28 13:31 ` ABRAHAM, KISHON VIJAY
0 siblings, 1 reply; 18+ messages in thread
From: Felipe Balbi @ 2012-09-28 12:57 UTC (permalink / raw)
To: linux-arm-kernel
Hi,
On Fri, Sep 28, 2012 at 06:23:10PM +0530, Kishon Vijay Abraham I wrote:
> Used of_platform_populate() to populate dwc3 core platform_device
> from device tree data. Since now the allocation of unique device id is
> handled be of_*, removed the call to dwc3_get_device_id.
>
> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
I think it's best if you split the use of device_for_each_child() from
this patch. So first do the device_for_each_child() part, then later use
of_platform_populate().
--
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120928/1d7513b6/attachment.sig>
^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH 1/6] usb: dwc3-omap: use of_platform API to create dwc3 core pdev
2012-09-28 12:57 ` Felipe Balbi
@ 2012-09-28 13:31 ` ABRAHAM, KISHON VIJAY
2012-10-01 8:50 ` Felipe Balbi
0 siblings, 1 reply; 18+ messages in thread
From: ABRAHAM, KISHON VIJAY @ 2012-09-28 13:31 UTC (permalink / raw)
To: linux-arm-kernel
Hi,
On Fri, Sep 28, 2012 at 6:27 PM, Felipe Balbi <balbi@ti.com> wrote:
> Hi,
>
> On Fri, Sep 28, 2012 at 06:23:10PM +0530, Kishon Vijay Abraham I wrote:
>> Used of_platform_populate() to populate dwc3 core platform_device
>> from device tree data. Since now the allocation of unique device id is
>> handled be of_*, removed the call to dwc3_get_device_id.
>>
>> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
>
> I think it's best if you split the use of device_for_each_child() from
> this patch. So first do the device_for_each_child() part, then later use
> of_platform_populate().
I think it's better to have it both together as of_platform_populate
will create the device and the device_for_each_child() part will
delete it on error conditions and during driver removal.
In this patch the first device_for_each_child() comes in error
condition and it is not needed if we have not created the device using
of_platform_populate.
Thanks
Kishon
^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH 1/6] usb: dwc3-omap: use of_platform API to create dwc3 core pdev
2012-09-28 13:31 ` ABRAHAM, KISHON VIJAY
@ 2012-10-01 8:50 ` Felipe Balbi
0 siblings, 0 replies; 18+ messages in thread
From: Felipe Balbi @ 2012-10-01 8:50 UTC (permalink / raw)
To: linux-arm-kernel
Hi,
On Fri, Sep 28, 2012 at 07:01:04PM +0530, ABRAHAM, KISHON VIJAY wrote:
> Hi,
>
> On Fri, Sep 28, 2012 at 6:27 PM, Felipe Balbi <balbi@ti.com> wrote:
> > Hi,
> >
> > On Fri, Sep 28, 2012 at 06:23:10PM +0530, Kishon Vijay Abraham I wrote:
> >> Used of_platform_populate() to populate dwc3 core platform_device
> >> from device tree data. Since now the allocation of unique device id is
> >> handled be of_*, removed the call to dwc3_get_device_id.
> >>
> >> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
> >
> > I think it's best if you split the use of device_for_each_child() from
> > this patch. So first do the device_for_each_child() part, then later use
> > of_platform_populate().
>
> I think it's better to have it both together as of_platform_populate
> will create the device and the device_for_each_child() part will
> delete it on error conditions and during driver removal.
> In this patch the first device_for_each_child() comes in error
> condition and it is not needed if we have not created the device using
> of_platform_populate.
We are already parent of a device and we already handle child removal
manually. You can change the current implementation to use
device_for_each_child() and on a later patch introduce
of_platform_populate().
--
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20121001/947d0b43/attachment.sig>
^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH 2/6] usb: dwc3-omap: use runtime API's to enable clocks
2012-09-28 12:53 [PATCH 0/6] usb: dwc3-omap: add dt support Kishon Vijay Abraham I
2012-09-28 12:53 ` [PATCH 1/6] usb: dwc3-omap: use of_platform API to create dwc3 core pdev Kishon Vijay Abraham I
@ 2012-09-28 12:53 ` Kishon Vijay Abraham I
2012-09-28 12:58 ` Felipe Balbi
2012-09-28 12:53 ` [PATCH 3/6] usb: dwc3-omap: Remove explicit writes to SYSCONFIG register Kishon Vijay Abraham I
` (3 subsequent siblings)
5 siblings, 1 reply; 18+ messages in thread
From: Kishon Vijay Abraham I @ 2012-09-28 12:53 UTC (permalink / raw)
To: linux-arm-kernel
Before accessing any register, runtime API's should be invoked to enable
the clocks. runtime API's are added here to prevent abort during register
access.
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
---
drivers/usb/dwc3/dwc3-omap.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c
index 34578de..6a0e17f 100644
--- a/drivers/usb/dwc3/dwc3-omap.c
+++ b/drivers/usb/dwc3/dwc3-omap.c
@@ -43,6 +43,7 @@
#include <linux/spinlock.h>
#include <linux/platform_device.h>
#include <linux/platform_data/dwc3-omap.h>
+#include <linux/pm_runtime.h>
#include <linux/dma-mapping.h>
#include <linux/ioport.h>
#include <linux/io.h>
@@ -281,6 +282,13 @@ static int __devinit dwc3_omap_probe(struct platform_device *pdev)
omap->irq = irq;
omap->base = base;
+ pm_runtime_enable(dev);
+ ret = pm_runtime_get_sync(dev);
+ if (ret < 0) {
+ dev_err(dev, "get_sync failed with err %d\n", ret);
+ goto err1;
+ }
+
reg = dwc3_omap_readl(omap->base, USBOTGSS_UTMI_OTG_STATUS);
utmi_mode = of_get_property(node, "utmi-mode", &size);
@@ -354,6 +362,8 @@ err1:
static int __devexit dwc3_omap_remove(struct platform_device *pdev)
{
device_for_each_child(&pdev->dev, NULL, dwc3_remove_core);
+ pm_runtime_put(&pdev->dev);
+ pm_runtime_disable(&pdev->dev);
return 0;
}
--
1.7.10.4
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH 2/6] usb: dwc3-omap: use runtime API's to enable clocks
2012-09-28 12:53 ` [PATCH 2/6] usb: dwc3-omap: use runtime API's to enable clocks Kishon Vijay Abraham I
@ 2012-09-28 12:58 ` Felipe Balbi
2012-09-28 13:31 ` ABRAHAM, KISHON VIJAY
0 siblings, 1 reply; 18+ messages in thread
From: Felipe Balbi @ 2012-09-28 12:58 UTC (permalink / raw)
To: linux-arm-kernel
Hi,
On Fri, Sep 28, 2012 at 06:23:11PM +0530, Kishon Vijay Abraham I wrote:
> Before accessing any register, runtime API's should be invoked to enable
> the clocks. runtime API's are added here to prevent abort during register
> access.
>
> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
> ---
> drivers/usb/dwc3/dwc3-omap.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c
> index 34578de..6a0e17f 100644
> --- a/drivers/usb/dwc3/dwc3-omap.c
> +++ b/drivers/usb/dwc3/dwc3-omap.c
> @@ -43,6 +43,7 @@
> #include <linux/spinlock.h>
> #include <linux/platform_device.h>
> #include <linux/platform_data/dwc3-omap.h>
> +#include <linux/pm_runtime.h>
> #include <linux/dma-mapping.h>
> #include <linux/ioport.h>
> #include <linux/io.h>
> @@ -281,6 +282,13 @@ static int __devinit dwc3_omap_probe(struct platform_device *pdev)
> omap->irq = irq;
> omap->base = base;
>
> + pm_runtime_enable(dev);
> + ret = pm_runtime_get_sync(dev);
> + if (ret < 0) {
> + dev_err(dev, "get_sync failed with err %d\n", ret);
> + goto err1;
> + }
> +
> reg = dwc3_omap_readl(omap->base, USBOTGSS_UTMI_OTG_STATUS);
>
> utmi_mode = of_get_property(node, "utmi-mode", &size);
> @@ -354,6 +362,8 @@ err1:
> static int __devexit dwc3_omap_remove(struct platform_device *pdev)
> {
> device_for_each_child(&pdev->dev, NULL, dwc3_remove_core);
> + pm_runtime_put(&pdev->dev);
> + pm_runtime_disable(&pdev->dev);
You're going to disable pm_runtime here, so it's better to use
pm_runtime_put_sync(), I guess ??
--
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120928/b821abd0/attachment.sig>
^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH 2/6] usb: dwc3-omap: use runtime API's to enable clocks
2012-09-28 12:58 ` Felipe Balbi
@ 2012-09-28 13:31 ` ABRAHAM, KISHON VIJAY
0 siblings, 0 replies; 18+ messages in thread
From: ABRAHAM, KISHON VIJAY @ 2012-09-28 13:31 UTC (permalink / raw)
To: linux-arm-kernel
Hi,
On Fri, Sep 28, 2012 at 6:28 PM, Felipe Balbi <balbi@ti.com> wrote:
> Hi,
>
> On Fri, Sep 28, 2012 at 06:23:11PM +0530, Kishon Vijay Abraham I wrote:
>> Before accessing any register, runtime API's should be invoked to enable
>> the clocks. runtime API's are added here to prevent abort during register
>> access.
>>
>> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
>> ---
>> drivers/usb/dwc3/dwc3-omap.c | 10 ++++++++++
>> 1 file changed, 10 insertions(+)
>>
>> diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c
>> index 34578de..6a0e17f 100644
>> --- a/drivers/usb/dwc3/dwc3-omap.c
>> +++ b/drivers/usb/dwc3/dwc3-omap.c
>> @@ -43,6 +43,7 @@
>> #include <linux/spinlock.h>
>> #include <linux/platform_device.h>
>> #include <linux/platform_data/dwc3-omap.h>
>> +#include <linux/pm_runtime.h>
>> #include <linux/dma-mapping.h>
>> #include <linux/ioport.h>
>> #include <linux/io.h>
>> @@ -281,6 +282,13 @@ static int __devinit dwc3_omap_probe(struct platform_device *pdev)
>> omap->irq = irq;
>> omap->base = base;
>>
>> + pm_runtime_enable(dev);
>> + ret = pm_runtime_get_sync(dev);
>> + if (ret < 0) {
>> + dev_err(dev, "get_sync failed with err %d\n", ret);
>> + goto err1;
>> + }
>> +
>> reg = dwc3_omap_readl(omap->base, USBOTGSS_UTMI_OTG_STATUS);
>>
>> utmi_mode = of_get_property(node, "utmi-mode", &size);
>> @@ -354,6 +362,8 @@ err1:
>> static int __devexit dwc3_omap_remove(struct platform_device *pdev)
>> {
>> device_for_each_child(&pdev->dev, NULL, dwc3_remove_core);
>> + pm_runtime_put(&pdev->dev);
>> + pm_runtime_disable(&pdev->dev);
>
> You're going to disable pm_runtime here, so it's better to use
> pm_runtime_put_sync(), I guess ??
sure. Will post a patch fixing it.
Thanks
Kishon
^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH 3/6] usb: dwc3-omap: Remove explicit writes to SYSCONFIG register
2012-09-28 12:53 [PATCH 0/6] usb: dwc3-omap: add dt support Kishon Vijay Abraham I
2012-09-28 12:53 ` [PATCH 1/6] usb: dwc3-omap: use of_platform API to create dwc3 core pdev Kishon Vijay Abraham I
2012-09-28 12:53 ` [PATCH 2/6] usb: dwc3-omap: use runtime API's to enable clocks Kishon Vijay Abraham I
@ 2012-09-28 12:53 ` Kishon Vijay Abraham I
2012-09-28 12:53 ` [PATCH 4/6] usb: dwc3-omap: Add an API to write to dwc mailbox Kishon Vijay Abraham I
` (2 subsequent siblings)
5 siblings, 0 replies; 18+ messages in thread
From: Kishon Vijay Abraham I @ 2012-09-28 12:53 UTC (permalink / raw)
To: linux-arm-kernel
The runtime API's takes care of setting the SYSCONFIG register with
appropriate values. Hence explicit writes to SYSCONFIG register is
removed.
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
---
drivers/usb/dwc3/dwc3-omap.c | 26 --------------------------
1 file changed, 26 deletions(-)
diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c
index 6a0e17f..a1704c6 100644
--- a/drivers/usb/dwc3/dwc3-omap.c
+++ b/drivers/usb/dwc3/dwc3-omap.c
@@ -77,23 +77,6 @@
/* SYSCONFIG REGISTER */
#define USBOTGSS_SYSCONFIG_DMADISABLE (1 << 16)
-#define USBOTGSS_SYSCONFIG_STANDBYMODE(x) ((x) << 4)
-
-#define USBOTGSS_STANDBYMODE_FORCE_STANDBY 0
-#define USBOTGSS_STANDBYMODE_NO_STANDBY 1
-#define USBOTGSS_STANDBYMODE_SMART_STANDBY 2
-#define USBOTGSS_STANDBYMODE_SMART_WAKEUP 3
-
-#define USBOTGSS_STANDBYMODE_MASK (0x03 << 4)
-
-#define USBOTGSS_SYSCONFIG_IDLEMODE(x) ((x) << 2)
-
-#define USBOTGSS_IDLEMODE_FORCE_IDLE 0
-#define USBOTGSS_IDLEMODE_NO_IDLE 1
-#define USBOTGSS_IDLEMODE_SMART_IDLE 2
-#define USBOTGSS_IDLEMODE_SMART_WAKEUP 3
-
-#define USBOTGSS_IDLEMODE_MASK (0x03 << 2)
/* IRQ_EOI REGISTER */
#define USBOTGSS_IRQ_EOI_LINE_NUMBER (1 << 0)
@@ -318,15 +301,6 @@ static int __devinit dwc3_omap_probe(struct platform_device *pdev)
reg = dwc3_omap_readl(omap->base, USBOTGSS_SYSCONFIG);
omap->dma_status = !!(reg & USBOTGSS_SYSCONFIG_DMADISABLE);
- /* Set No-Idle and No-Standby */
- reg &= ~(USBOTGSS_STANDBYMODE_MASK
- | USBOTGSS_IDLEMODE_MASK);
-
- reg |= (USBOTGSS_SYSCONFIG_STANDBYMODE(USBOTGSS_STANDBYMODE_NO_STANDBY)
- | USBOTGSS_SYSCONFIG_IDLEMODE(USBOTGSS_IDLEMODE_NO_IDLE));
-
- dwc3_omap_writel(omap->base, USBOTGSS_SYSCONFIG, reg);
-
ret = devm_request_irq(dev, omap->irq, dwc3_omap_interrupt, 0,
"dwc3-omap", omap);
if (ret) {
--
1.7.10.4
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH 4/6] usb: dwc3-omap: Add an API to write to dwc mailbox
2012-09-28 12:53 [PATCH 0/6] usb: dwc3-omap: add dt support Kishon Vijay Abraham I
` (2 preceding siblings ...)
2012-09-28 12:53 ` [PATCH 3/6] usb: dwc3-omap: Remove explicit writes to SYSCONFIG register Kishon Vijay Abraham I
@ 2012-09-28 12:53 ` Kishon Vijay Abraham I
2012-09-28 12:59 ` Felipe Balbi
2012-09-28 12:53 ` [PATCH 5/6] usb: dwc3-omap: Minor fixes to get dt working Kishon Vijay Abraham I
2012-09-28 12:53 ` [PATCH 6/6] usb: dwc3: core: add dt support for dwc3 core Kishon Vijay Abraham I
5 siblings, 1 reply; 18+ messages in thread
From: Kishon Vijay Abraham I @ 2012-09-28 12:53 UTC (permalink / raw)
To: linux-arm-kernel
Add an API in the omap glue layer to write to the mailbox register which
can be used by comparator driver(twl). To pass the detection of the attached
device (signified by VBUS, ID) to the dwc3 core, dwc3 core has to write
to the mailbox regiter.
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
---
drivers/usb/dwc3/dwc3-omap.c | 59 +++++++++++++++++++++++++++++++++++++++++
include/linux/usb/dwc3-omap.h | 30 +++++++++++++++++++++
2 files changed, 89 insertions(+)
create mode 100644 include/linux/usb/dwc3-omap.h
diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c
index a1704c6..7ae4d73 100644
--- a/drivers/usb/dwc3/dwc3-omap.c
+++ b/drivers/usb/dwc3/dwc3-omap.c
@@ -43,6 +43,7 @@
#include <linux/spinlock.h>
#include <linux/platform_device.h>
#include <linux/platform_data/dwc3-omap.h>
+#include <linux/usb/dwc3-omap.h>
#include <linux/pm_runtime.h>
#include <linux/dma-mapping.h>
#include <linux/ioport.h>
@@ -126,6 +127,8 @@ struct dwc3_omap {
u32 dma_status:1;
};
+struct dwc3_omap *_omap;
+
static inline u32 dwc3_omap_readl(void __iomem *base, u32 offset)
{
return readl(base + offset);
@@ -136,6 +139,56 @@ static inline void dwc3_omap_writel(void __iomem *base, u32 offset, u32 value)
writel(value, base + offset);
}
+void omap_dwc3_mailbox(enum omap_dwc3_vbus_id_status status)
+{
+ u32 val;
+ struct dwc3_omap *omap = _omap;
+
+ switch (status) {
+ case OMAP_DWC3_ID_GROUND:
+ dev_dbg(omap->dev, "ID GND\n");
+
+ val = dwc3_omap_readl(omap->base, USBOTGSS_UTMI_OTG_STATUS);
+ val &= ~(USBOTGSS_UTMI_OTG_STATUS_IDDIG
+ | USBOTGSS_UTMI_OTG_STATUS_VBUSVALID
+ | USBOTGSS_UTMI_OTG_STATUS_SESSEND);
+ val |= USBOTGSS_UTMI_OTG_STATUS_SESSVALID
+ | USBOTGSS_UTMI_OTG_STATUS_POWERPRESENT;
+ dwc3_omap_writel(omap->base, USBOTGSS_UTMI_OTG_STATUS, val);
+ break;
+
+ case OMAP_DWC3_VBUS_VALID:
+ dev_dbg(omap->dev, "VBUS Connect\n");
+
+ val = dwc3_omap_readl(omap->base, USBOTGSS_UTMI_OTG_STATUS);
+ val &= ~USBOTGSS_UTMI_OTG_STATUS_SESSEND;
+ val |= USBOTGSS_UTMI_OTG_STATUS_IDDIG
+ | USBOTGSS_UTMI_OTG_STATUS_VBUSVALID
+ | USBOTGSS_UTMI_OTG_STATUS_SESSVALID
+ | USBOTGSS_UTMI_OTG_STATUS_POWERPRESENT;
+ dwc3_omap_writel(omap->base, USBOTGSS_UTMI_OTG_STATUS, val);
+ break;
+
+ case OMAP_DWC3_ID_FLOAT:
+ case OMAP_DWC3_VBUS_OFF:
+ dev_dbg(omap->dev, "VBUS Disconnect\n");
+
+ val = dwc3_omap_readl(omap->base, USBOTGSS_UTMI_OTG_STATUS);
+ val &= ~(USBOTGSS_UTMI_OTG_STATUS_SESSVALID
+ | USBOTGSS_UTMI_OTG_STATUS_VBUSVALID
+ | USBOTGSS_UTMI_OTG_STATUS_POWERPRESENT);
+ val |= USBOTGSS_UTMI_OTG_STATUS_SESSEND
+ | USBOTGSS_UTMI_OTG_STATUS_IDDIG;
+ dwc3_omap_writel(omap->base, USBOTGSS_UTMI_OTG_STATUS, val);
+ break;
+
+ default:
+ dev_dbg(omap->dev, "ID float\n");
+ }
+
+ return;
+}
+EXPORT_SYMBOL_GPL(omap_dwc3_mailbox);
static irqreturn_t dwc3_omap_interrupt(int irq, void *_omap)
{
@@ -265,6 +318,12 @@ static int __devinit dwc3_omap_probe(struct platform_device *pdev)
omap->irq = irq;
omap->base = base;
+ /*
+ * REVISIT if we ever have two instances of the wrapper, we will be
+ * in big trouble
+ */
+ _omap = omap;
+
pm_runtime_enable(dev);
ret = pm_runtime_get_sync(dev);
if (ret < 0) {
diff --git a/include/linux/usb/dwc3-omap.h b/include/linux/usb/dwc3-omap.h
new file mode 100644
index 0000000..db367f3
--- /dev/null
+++ b/include/linux/usb/dwc3-omap.h
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2011-2012 by Texas Instruments
+ *
+ * The Inventra Controller Driver for Linux is free software; you
+ * can redistribute it and/or modify it under the terms of the GNU
+ * General Public License version 2 as published by the Free Software
+ * Foundation.
+ */
+
+#ifndef __DWC3_OMAP_H__
+#define __DWC3_OMAP_H__
+
+enum omap_dwc3_vbus_id_status {
+ OMAP_DWC3_UNKNOWN = 0,
+ OMAP_DWC3_ID_GROUND,
+ OMAP_DWC3_ID_FLOAT,
+ OMAP_DWC3_VBUS_VALID,
+ OMAP_DWC3_VBUS_OFF,
+};
+
+#if (defined(CONFIG_USB_DWC3) || defined(CONFIG_USB_DWC3_MODULE))
+extern void omap_dwc3_mailbox(enum omap_dwc3_vbus_id_status status);
+#else
+static inline void omap_dwc3_mailbox(enum omap_dwc3_vbus_id_status status)
+{
+ return;
+}
+#endif
+
+#endif /* __DWC3_OMAP_H__ */
--
1.7.10.4
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH 4/6] usb: dwc3-omap: Add an API to write to dwc mailbox
2012-09-28 12:53 ` [PATCH 4/6] usb: dwc3-omap: Add an API to write to dwc mailbox Kishon Vijay Abraham I
@ 2012-09-28 12:59 ` Felipe Balbi
2012-09-28 13:31 ` ABRAHAM, KISHON VIJAY
0 siblings, 1 reply; 18+ messages in thread
From: Felipe Balbi @ 2012-09-28 12:59 UTC (permalink / raw)
To: linux-arm-kernel
Hi,
On Fri, Sep 28, 2012 at 06:23:13PM +0530, Kishon Vijay Abraham I wrote:
> Add an API in the omap glue layer to write to the mailbox register which
> can be used by comparator driver(twl). To pass the detection of the attached
> device (signified by VBUS, ID) to the dwc3 core, dwc3 core has to write
> to the mailbox regiter.
>
> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
> ---
> drivers/usb/dwc3/dwc3-omap.c | 59 +++++++++++++++++++++++++++++++++++++++++
> include/linux/usb/dwc3-omap.h | 30 +++++++++++++++++++++
> 2 files changed, 89 insertions(+)
> create mode 100644 include/linux/usb/dwc3-omap.h
>
> diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c
> index a1704c6..7ae4d73 100644
> --- a/drivers/usb/dwc3/dwc3-omap.c
> +++ b/drivers/usb/dwc3/dwc3-omap.c
> @@ -43,6 +43,7 @@
> #include <linux/spinlock.h>
> #include <linux/platform_device.h>
> #include <linux/platform_data/dwc3-omap.h>
> +#include <linux/usb/dwc3-omap.h>
> #include <linux/pm_runtime.h>
> #include <linux/dma-mapping.h>
> #include <linux/ioport.h>
> @@ -126,6 +127,8 @@ struct dwc3_omap {
> u32 dma_status:1;
> };
>
> +struct dwc3_omap *_omap;
> +
> static inline u32 dwc3_omap_readl(void __iomem *base, u32 offset)
> {
> return readl(base + offset);
> @@ -136,6 +139,56 @@ static inline void dwc3_omap_writel(void __iomem *base, u32 offset, u32 value)
> writel(value, base + offset);
> }
>
> +void omap_dwc3_mailbox(enum omap_dwc3_vbus_id_status status)
all other functions are "dwc3_omap_", let's keep it consistent.
--
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120928/f88dff54/attachment.sig>
^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH 4/6] usb: dwc3-omap: Add an API to write to dwc mailbox
2012-09-28 12:59 ` Felipe Balbi
@ 2012-09-28 13:31 ` ABRAHAM, KISHON VIJAY
0 siblings, 0 replies; 18+ messages in thread
From: ABRAHAM, KISHON VIJAY @ 2012-09-28 13:31 UTC (permalink / raw)
To: linux-arm-kernel
Hi,
On Fri, Sep 28, 2012 at 6:29 PM, Felipe Balbi <balbi@ti.com> wrote:
> Hi,
>
> On Fri, Sep 28, 2012 at 06:23:13PM +0530, Kishon Vijay Abraham I wrote:
>> Add an API in the omap glue layer to write to the mailbox register which
>> can be used by comparator driver(twl). To pass the detection of the attached
>> device (signified by VBUS, ID) to the dwc3 core, dwc3 core has to write
>> to the mailbox regiter.
>>
>> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
>> ---
>> drivers/usb/dwc3/dwc3-omap.c | 59 +++++++++++++++++++++++++++++++++++++++++
>> include/linux/usb/dwc3-omap.h | 30 +++++++++++++++++++++
>> 2 files changed, 89 insertions(+)
>> create mode 100644 include/linux/usb/dwc3-omap.h
>>
>> diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c
>> index a1704c6..7ae4d73 100644
>> --- a/drivers/usb/dwc3/dwc3-omap.c
>> +++ b/drivers/usb/dwc3/dwc3-omap.c
>> @@ -43,6 +43,7 @@
>> #include <linux/spinlock.h>
>> #include <linux/platform_device.h>
>> #include <linux/platform_data/dwc3-omap.h>
>> +#include <linux/usb/dwc3-omap.h>
>> #include <linux/pm_runtime.h>
>> #include <linux/dma-mapping.h>
>> #include <linux/ioport.h>
>> @@ -126,6 +127,8 @@ struct dwc3_omap {
>> u32 dma_status:1;
>> };
>>
>> +struct dwc3_omap *_omap;
>> +
>> static inline u32 dwc3_omap_readl(void __iomem *base, u32 offset)
>> {
>> return readl(base + offset);
>> @@ -136,6 +139,56 @@ static inline void dwc3_omap_writel(void __iomem *base, u32 offset, u32 value)
>> writel(value, base + offset);
>> }
>>
>> +void omap_dwc3_mailbox(enum omap_dwc3_vbus_id_status status)
>
> all other functions are "dwc3_omap_", let's keep it consistent.
Sure.
Thanks
Kishon
^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH 5/6] usb: dwc3-omap: Minor fixes to get dt working
2012-09-28 12:53 [PATCH 0/6] usb: dwc3-omap: add dt support Kishon Vijay Abraham I
` (3 preceding siblings ...)
2012-09-28 12:53 ` [PATCH 4/6] usb: dwc3-omap: Add an API to write to dwc mailbox Kishon Vijay Abraham I
@ 2012-09-28 12:53 ` Kishon Vijay Abraham I
2012-09-28 12:53 ` [PATCH 6/6] usb: dwc3: core: add dt support for dwc3 core Kishon Vijay Abraham I
5 siblings, 0 replies; 18+ messages in thread
From: Kishon Vijay Abraham I @ 2012-09-28 12:53 UTC (permalink / raw)
To: linux-arm-kernel
Includes few minor fixes in dwc3-omap like populating the compatible
string in a correct way, extracting the utmi-mode property properly and
changing the index of get_irq since irq of core is removed from hwmod
entry.
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
---
drivers/usb/dwc3/dwc3-omap.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c
index 7ae4d73..e3d9a5f 100644
--- a/drivers/usb/dwc3/dwc3-omap.c
+++ b/drivers/usb/dwc3/dwc3-omap.c
@@ -277,7 +277,7 @@ static int __devinit dwc3_omap_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, omap);
- irq = platform_get_irq(pdev, 1);
+ irq = platform_get_irq(pdev, 0);
if (irq < 0) {
dev_err(dev, "missing IRQ resource\n");
return -EINVAL;
@@ -335,7 +335,7 @@ static int __devinit dwc3_omap_probe(struct platform_device *pdev)
utmi_mode = of_get_property(node, "utmi-mode", &size);
if (utmi_mode && size == sizeof(*utmi_mode)) {
- reg |= *utmi_mode;
+ reg |= be32_to_cpup(utmi_mode);
} else {
if (!pdata) {
dev_dbg(dev, "missing platform data\n");
@@ -403,7 +403,7 @@ static int __devexit dwc3_omap_remove(struct platform_device *pdev)
static const struct of_device_id of_dwc3_matach[] = {
{
- "ti,dwc3",
+ .compatible = "ti,dwc3"
},
{ },
};
--
1.7.10.4
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH 6/6] usb: dwc3: core: add dt support for dwc3 core
2012-09-28 12:53 [PATCH 0/6] usb: dwc3-omap: add dt support Kishon Vijay Abraham I
` (4 preceding siblings ...)
2012-09-28 12:53 ` [PATCH 5/6] usb: dwc3-omap: Minor fixes to get dt working Kishon Vijay Abraham I
@ 2012-09-28 12:53 ` Kishon Vijay Abraham I
2012-09-28 13:02 ` Felipe Balbi
2012-09-30 16:47 ` Sergei Shtylyov
5 siblings, 2 replies; 18+ messages in thread
From: Kishon Vijay Abraham I @ 2012-09-28 12:53 UTC (permalink / raw)
To: linux-arm-kernel
Added dwc3 support for dwc3 core and update the documentation with
device tree binding information.
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
---
Documentation/devicetree/bindings/usb/dwc3.txt | 24 ++++++++++++++++++++++++
drivers/usb/dwc3/core.c | 14 ++++++++++++--
2 files changed, 36 insertions(+), 2 deletions(-)
create mode 100644 Documentation/devicetree/bindings/usb/dwc3.txt
diff --git a/Documentation/devicetree/bindings/usb/dwc3.txt b/Documentation/devicetree/bindings/usb/dwc3.txt
new file mode 100644
index 0000000..87d5eeb
--- /dev/null
+++ b/Documentation/devicetree/bindings/usb/dwc3.txt
@@ -0,0 +1,24 @@
+SYNOPSIS DWC3 CORE
+
+DWC3- USB3 CONTROLLER
+
+Required properties:
+ - compatible: Should be "synopsis,dwc3"
+ - reg : Address and length of the register set for the device
+ - interrupts: Interrupts used by the dwc3 controller.
+ - interrupt-parent: the phandle for the interrupt controller that
+ services interrupts for this device.
+
+Optional properties:
+ - tx-fifo-resize: determines if the fifo spaces can be reallocated according
+ to use-cases.
+
+This is usually a subnode to DWC3 glue to which it is connected.
+
+dwc3 at 4a030000 {
+ compatible = "synopsis,dwc3";
+ reg = <0x4a030000 0xcfff>;
+ interrupts = <0 92 4>
+ interrupt-parent = <&gic>
+ tx-fifo-resize;
+};
diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
index 08a5738..0c17a7a 100644
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -484,8 +484,7 @@ static int __devinit dwc3_probe(struct platform_device *pdev)
else
dwc->maximum_speed = DWC3_DCFG_SUPERSPEED;
- if (of_get_property(node, "tx-fifo-resize", NULL))
- dwc->needs_fifo_resize = true;
+ dwc->needs_fifo_resize = of_property_read_bool(node, "tx-fifo-resize");
pm_runtime_enable(dev);
pm_runtime_get_sync(dev);
@@ -602,11 +601,22 @@ static int __devexit dwc3_remove(struct platform_device *pdev)
return 0;
}
+#ifdef CONFIG_OF
+static const struct of_device_id of_dwc3_matach[] = {
+ {
+ .compatible = "synopsis,dwc3"
+ },
+ { },
+};
+MODULE_DEVICE_TABLE(of, of_dwc3_matach);
+#endif
+
static struct platform_driver dwc3_driver = {
.probe = dwc3_probe,
.remove = __devexit_p(dwc3_remove),
.driver = {
.name = "dwc3",
+ .of_match_table = of_match_ptr(of_dwc3_matach),
},
};
--
1.7.10.4
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH 6/6] usb: dwc3: core: add dt support for dwc3 core
2012-09-28 12:53 ` [PATCH 6/6] usb: dwc3: core: add dt support for dwc3 core Kishon Vijay Abraham I
@ 2012-09-28 13:02 ` Felipe Balbi
2012-09-28 13:32 ` ABRAHAM, KISHON VIJAY
2012-09-30 16:47 ` Sergei Shtylyov
1 sibling, 1 reply; 18+ messages in thread
From: Felipe Balbi @ 2012-09-28 13:02 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, Sep 28, 2012 at 06:23:15PM +0530, Kishon Vijay Abraham I wrote:
> Added dwc3 support for dwc3 core and update the documentation with
> device tree binding information.
>
> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
> ---
> Documentation/devicetree/bindings/usb/dwc3.txt | 24 ++++++++++++++++++++++++
> drivers/usb/dwc3/core.c | 14 ++++++++++++--
> 2 files changed, 36 insertions(+), 2 deletions(-)
> create mode 100644 Documentation/devicetree/bindings/usb/dwc3.txt
>
> diff --git a/Documentation/devicetree/bindings/usb/dwc3.txt b/Documentation/devicetree/bindings/usb/dwc3.txt
> new file mode 100644
> index 0000000..87d5eeb
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/usb/dwc3.txt
> @@ -0,0 +1,24 @@
> +SYNOPSIS DWC3 CORE
> +
> +DWC3- USB3 CONTROLLER
> +
> +Required properties:
> + - compatible: Should be "synopsis,dwc3"
"synopsys" and I think:
- compatible: Must be "synopsys,dwc3" reads a bit better.
> + - reg : Address and length of the register set for the device
> + - interrupts: Interrupts used by the dwc3 controller.
> + - interrupt-parent: the phandle for the interrupt controller that
> + services interrupts for this device.
> +
> +Optional properties:
> + - tx-fifo-resize: determines if the fifo spaces can be reallocated according
> + to use-cases.
actually, this should read: "determines if the FIFO *has* to be
reallocated.
On OMAP5 ES1 the default value is not good enough and we _must_
reallocate FIFO sizes.
> +This is usually a subnode to DWC3 glue to which it is connected.
> +
> +dwc3 at 4a030000 {
> + compatible = "synopsis,dwc3";
"synopsys"
> + reg = <0x4a030000 0xcfff>;
> + interrupts = <0 92 4>
> + interrupt-parent = <&gic>
> + tx-fifo-resize;
> +};
> diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
> index 08a5738..0c17a7a 100644
> --- a/drivers/usb/dwc3/core.c
> +++ b/drivers/usb/dwc3/core.c
> @@ -484,8 +484,7 @@ static int __devinit dwc3_probe(struct platform_device *pdev)
> else
> dwc->maximum_speed = DWC3_DCFG_SUPERSPEED;
>
> - if (of_get_property(node, "tx-fifo-resize", NULL))
> - dwc->needs_fifo_resize = true;
> + dwc->needs_fifo_resize = of_property_read_bool(node, "tx-fifo-resize");
>
> pm_runtime_enable(dev);
> pm_runtime_get_sync(dev);
> @@ -602,11 +601,22 @@ static int __devexit dwc3_remove(struct platform_device *pdev)
> return 0;
> }
>
> +#ifdef CONFIG_OF
> +static const struct of_device_id of_dwc3_matach[] = {
> + {
> + .compatible = "synopsis,dwc3"
"synopsys"
> + },
> + { },
> +};
> +MODULE_DEVICE_TABLE(of, of_dwc3_matach);
> +#endif
> +
> static struct platform_driver dwc3_driver = {
> .probe = dwc3_probe,
> .remove = __devexit_p(dwc3_remove),
> .driver = {
> .name = "dwc3",
> + .of_match_table = of_match_ptr(of_dwc3_matach),
> },
> };
>
> --
> 1.7.10.4
>
--
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120928/464e635c/attachment-0001.sig>
^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH 6/6] usb: dwc3: core: add dt support for dwc3 core
2012-09-28 13:02 ` Felipe Balbi
@ 2012-09-28 13:32 ` ABRAHAM, KISHON VIJAY
0 siblings, 0 replies; 18+ messages in thread
From: ABRAHAM, KISHON VIJAY @ 2012-09-28 13:32 UTC (permalink / raw)
To: linux-arm-kernel
Hi,
On Fri, Sep 28, 2012 at 6:32 PM, Felipe Balbi <balbi@ti.com> wrote:
> On Fri, Sep 28, 2012 at 06:23:15PM +0530, Kishon Vijay Abraham I wrote:
>> Added dwc3 support for dwc3 core and update the documentation with
>> device tree binding information.
>>
>> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
>> ---
>> Documentation/devicetree/bindings/usb/dwc3.txt | 24 ++++++++++++++++++++++++
>> drivers/usb/dwc3/core.c | 14 ++++++++++++--
>> 2 files changed, 36 insertions(+), 2 deletions(-)
>> create mode 100644 Documentation/devicetree/bindings/usb/dwc3.txt
>>
>> diff --git a/Documentation/devicetree/bindings/usb/dwc3.txt b/Documentation/devicetree/bindings/usb/dwc3.txt
>> new file mode 100644
>> index 0000000..87d5eeb
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/usb/dwc3.txt
>> @@ -0,0 +1,24 @@
>> +SYNOPSIS DWC3 CORE
>> +
>> +DWC3- USB3 CONTROLLER
>> +
>> +Required properties:
>> + - compatible: Should be "synopsis,dwc3"
>
> "synopsys" and I think:
>
> - compatible: Must be "synopsys,dwc3" reads a bit better.
Will re-post this patch.
Thanks
Kishon
^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH 6/6] usb: dwc3: core: add dt support for dwc3 core
2012-09-28 12:53 ` [PATCH 6/6] usb: dwc3: core: add dt support for dwc3 core Kishon Vijay Abraham I
2012-09-28 13:02 ` Felipe Balbi
@ 2012-09-30 16:47 ` Sergei Shtylyov
2012-10-01 5:10 ` ABRAHAM, KISHON VIJAY
1 sibling, 1 reply; 18+ messages in thread
From: Sergei Shtylyov @ 2012-09-30 16:47 UTC (permalink / raw)
To: linux-arm-kernel
Hello.
On 28-09-2012 14:53, Kishon Vijay Abraham I wrote:
> Added dwc3 support for dwc3 core and update the documentation with
> device tree binding information.
>
> Signed-off-by: Kishon Vijay Abraham I<kishon@ti.com>
[...]
> diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
> index 08a5738..0c17a7a 100644
> --- a/drivers/usb/dwc3/core.c
> +++ b/drivers/usb/dwc3/core.c
[...]
> @@ -602,11 +601,22 @@ static int __devexit dwc3_remove(struct platform_device *pdev)
> return 0;
> }
>
> +#ifdef CONFIG_OF
> +static const struct of_device_id of_dwc3_matach[] = {
I guess you meant 'of_dwc3_match' here and below?
> + {
> + .compatible = "synopsis,dwc3"
> + },
> + { },
> +};
> +MODULE_DEVICE_TABLE(of, of_dwc3_matach);
> +#endif
> +
> static struct platform_driver dwc3_driver = {
> .probe = dwc3_probe,
> .remove = __devexit_p(dwc3_remove),
> .driver = {
> .name = "dwc3",
> + .of_match_table = of_match_ptr(of_dwc3_matach),
> },
> };
>
WBR, Sergei
^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH 6/6] usb: dwc3: core: add dt support for dwc3 core
2012-09-30 16:47 ` Sergei Shtylyov
@ 2012-10-01 5:10 ` ABRAHAM, KISHON VIJAY
0 siblings, 0 replies; 18+ messages in thread
From: ABRAHAM, KISHON VIJAY @ 2012-10-01 5:10 UTC (permalink / raw)
To: linux-arm-kernel
Hi,
On Sun, Sep 30, 2012 at 10:17 PM, Sergei Shtylyov <sshtylyov@mvista.com> wrote:
> Hello.
>
>
> On 28-09-2012 14:53, Kishon Vijay Abraham I wrote:
>
>> Added dwc3 support for dwc3 core and update the documentation with
>> device tree binding information.
>>
>> Signed-off-by: Kishon Vijay Abraham I<kishon@ti.com>
>
> [...]
>
>
>> diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
>> index 08a5738..0c17a7a 100644
>> --- a/drivers/usb/dwc3/core.c
>> +++ b/drivers/usb/dwc3/core.c
>
> [...]
>
>> @@ -602,11 +601,22 @@ static int __devexit dwc3_remove(struct
>> platform_device *pdev)
>> return 0;
>> }
>>
>> +#ifdef CONFIG_OF
>> +static const struct of_device_id of_dwc3_matach[] = {
>
>
> I guess you meant 'of_dwc3_match' here and below?
indeed.. will re-post the patch..
Thanks
Kishon
^ permalink raw reply [flat|nested] 18+ messages in thread