add imx usb driver based on Greg next tree
Subsystems (4)
v7 cover add imx usb driver based on Greg next tree
The work is based on ci13xxx rework done by Alexander Shishkin.
To let Greg pick up, I also added patches Alex queued that I depends on. Patch #1 - #9 : It can also be found at
http://github.com/virtuoso/linux-ci.git ci
This patch series can also be found at:
https://github.com/riczhao/kernel-imx/commits/topics/usb-driver
Status:
- this version only support host
- usbotg controler works at host role
Changes since last version:
- use platform_device_unregister in ci13xxx_remove_device
- fix build error of udc driver
Alexander Shishkin (1):
usb: chipidea: remove unneeded NULL check
Felipe Balbi (3):
usb: chipidea: drop useless arch-check
usb: chipidea: msm: add missing section annotation
usb: chipidea: msm: add remove method
Richard Zhao (10):
USB: Chipidea: rename struct ci13xxx_udc_driver to struct
ci13xxx_platform_data
USB: Chipidea: rename struct ci13xxx variables from udc to ci
USB: Chipidea: add unified ci13xxx_{add,remove}_device for platform
drivers
USB: Chipidea: add ci13xxx device id management
usb: chipidea: select USB_EHCI_ROOT_HUB_TT in USB_CHIPIDEA_HOST of
Kconfig
usb: otg: add notify_connect/notify_disconnect callback
USB: notify phy when root hub port connect change
usb: chipidea: permit driver bindings pass phy pointer
usb: otg: add basic mxs phy driver support
usb: chipidea: add imx platform driver
.../devicetree/bindings/usb/ci13xxx-imx.txt | 20 + Documentation/devicetree/bindings/usb/mxs-phy.txt | 13 + drivers/usb/chipidea/Kconfig | 1 + drivers/usb/chipidea/Makefile | 9 +- drivers/usb/chipidea/ci.h | 32 +- drivers/usb/chipidea/ci13xxx_imx.c | 197 ++++++ drivers/usb/chipidea/ci13xxx_msm.c | 62 +- drivers/usb/chipidea/ci13xxx_pci.c | 52 +- drivers/usb/chipidea/core.c | 70 ++- drivers/usb/chipidea/debug.c | 146 ++--- drivers/usb/chipidea/host.c | 3 +- drivers/usb/chipidea/udc.c | 636 ++++++++++---------- drivers/usb/core/hub.c | 8 + drivers/usb/otg/Kconfig | 9 + drivers/usb/otg/Makefile | 1 + drivers/usb/otg/mxs-phy.c | 197 ++++++ include/linux/usb/chipidea.h | 14 +- include/linux/usb/otg.h | 21 + 18 files changed, 1000 insertions(+), 491 deletions(-) create mode 100644 Documentation/devicetree/bindings/usb/ci13xxx-imx.txt create mode 100644 Documentation/devicetree/bindings/usb/mxs-phy.txt create mode 100644 drivers/usb/chipidea/ci13xxx_imx.c create mode 100644 drivers/usb/otg/mxs-phy.c
Signature · 1 line
1.7.9.5
PATCH v7 1/14 usb: chipidea: remove unneeded NULL check
From: Alexander Shishkin <[email protected]>
As reported by Dan Carpenter, there is a NULL check in udc_start() that follows a dereference of the pointer that's being checked. However, at that point udc pointer shouldn't ever be NULL and if it is, the dereference should cause an oops.
--- drivers/usb/chipidea/udc.c | 3 --- 1 file changed, 3 deletions(-)
drivers/usb/chipidea/udc.c +0 -3
@@ -1647,9 +1647,6 @@ static int udc_start(struct ci13xxx *udc)struct device *dev = udc->dev;int retval =0 ; -if (!udc) -return -EINVAL ; -spin_lock_init (&udc->lock); udc->gadget.ops = &usb_gadget_ops;
Signature · 1 line
1.7.9.5
Greg KH
maintainerPATCH v7 1/14 usb: chipidea: remove unneeded NULL check
Quoted 7 lines · Richard Zhao
From: Alexander Shishkin <[email protected]>
As reported by Dan Carpenter, there is a NULL check in
udc_start()that follows a dereference of the pointer that's being checked. However, at that point udc pointer shouldn't ever be NULL and if it is, the dereference should cause an oops.
Quoted 6 lines
Signed-off-by Alexander Shishkin <[email protected]>Reported-by Dan Carpenter <[email protected]>Acked-by Felipe Balbi <[email protected]>--- drivers/usb/chipidea/udc.c | 3 --- 1 file changed, 3 deletions(-)
First comment, you send a bunch of patches, yet you didn't sign off on some of them, why? If you are forwarding on patches, please sign off showing you have reviewed them (so you can be on the path-of-blame if there is a problem...)
There has been some discussion on some of these patches, so I'm guessing we need a v8 set of this series at the least?
thanks,
greg k-h
PATCH v7 1/14 usb: chipidea: remove unneeded NULL check
Quoted 15 lines · Greg KH
Quoted 7 lines · Richard Zhao
From: Alexander Shishkin <[email protected]>
As reported by Dan Carpenter, there is a NULL check in
udc_start()that follows a dereference of the pointer that's being checked. However, at that point udc pointer shouldn't ever be NULL and if it is, the dereference should cause an oops.Quoted 6 lines
Signed-off-by Alexander Shishkin <[email protected]>Reported-by Dan Carpenter <[email protected]>Acked-by Felipe Balbi <[email protected]>--- drivers/usb/chipidea/udc.c | 3 --- 1 file changed, 3 deletions(-)
Quoted 4 lines
First comment, you send a bunch of patches, yet you didn't sign off on some of them, why? If you are forwarding on patches, please sign off showing you have reviewed them (so you can be on the path-of-blame if there is a problem...)
You're right :)
Quoted 3 lines
There has been some discussion on some of these patches, so I'm guessing we need a v8 set of this series at the least?
Yes.
Thanks
Richard
Quoted 5 lines
thanks,
greg k-h
PATCH v7 1/14 usb: chipidea: remove unneeded NULL check
In reply to Richard ZhaoDear Richard Zhao,
Quoted 10 lines
From: Alexander Shishkin <[email protected]>
As reported by Dan Carpenter, there is a NULL check in
udc_start()that follows a dereference of the pointer that's being checked. However, at that point udc pointer shouldn't ever be NULL and if it is, the dereference should cause an oops.Signed-off-by Alexander Shishkin <[email protected]>Reported-by Dan Carpenter <[email protected]>Acked-by Felipe Balbi <[email protected]>
This seems correct, please add my:
Quoted 9 lines
--- drivers/usb/chipidea/udc.c | 3 --- 1 file changed, 3 deletions(-)drivers/usb/chipidea/udc.c +0
-0
drivers/usb/chipidea/udc.c static int udc_start(struct ci13xxx *udc) · line 1652
Quoted 9 lines
drivers/usb/chipidea/udc.c +0
-3@@ -1647,9 +1647,6 @@ static int udc_start(struct ci13xxx *udc)struct device *dev = udc->dev;int retval =0 ; -if (!udc) -return -EINVAL ; -spin_lock_init (&udc->lock); udc->gadget.ops = &usb_gadget_ops;
Best regards,
Marek Vasut
PATCH v7 2/14 usb: chipidea: drop useless arch-check
In reply to Richard ZhaoFrom: Felipe Balbi <[email protected]>
msm glue layer compiles on all arches just fine. Let's drop the unnecessary ARCH check so we have easier compile tests.
--- drivers/usb/chipidea/Makefile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/usb/chipidea/Makefile +5 -3
@@ -5,10 +5,12 @@ ci_hdrc-$(CONFIG_USB_CHIPIDEA_UDC) += udc.o ci_hdrc-$(CONFIG_USB_CHIPIDEA_HOST) += host.o ci_hdrc-$(CONFIG_USB_CHIPIDEA_DEBUG) += debug.o +# Glue/Bridge layers go here + +obj-$(CONFIG_USB_CHIPIDEA) += ci13xxx_msm.o + +# PCI doesn't provide stubs, need to check ifneq ($(CONFIG_PCI),) obj-$(CONFIG_USB_CHIPIDEA) += ci13xxx_pci.o endif -ifneq ($(CONFIG_ARCH_MSM),) - obj-$(CONFIG_USB_CHIPIDEA) += ci13xxx_msm.o -endif
Signature · 1 line
1.7.9.5
PATCH v7 2/14 usb: chipidea: drop useless arch-check
Dear Richard Zhao,
Quoted 8 lines
From: Felipe Balbi <[email protected]>
msm glue layer compiles on all arches just fine. Let's drop the unnecessary ARCH check so we have easier compile tests.
Signed-off-by Felipe Balbi <[email protected]>Signed-off-by Alexander Shishkin <[email protected]>
Good move
Quoted 14 lines
--- drivers/usb/chipidea/Makefile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)drivers/usb/chipidea/Makefile +2
-0@@ -5,10 +5,12 @@ ci_hdrc-$(CONFIG_USB_CHIPIDEA_UDC) += udc.o ci_hdrc-$(CONFIG_USB_CHIPIDEA_HOST) += host.o ci_hdrc-$(CONFIG_USB_CHIPIDEA_DEBUG) += debug.o +# Glue/Bridge layers go here +
drivers/usb/chipidea/Makefile ci_hdrc-$(CONFIG_USB_CHIPIDEA_UDC) += udc.o · line 14
Quoted 10 lines
drivers/usb/chipidea/Makefile +3
-3+obj-$(CONFIG_USB_CHIPIDEA) += ci13xxx_msm.o + +# PCI doesn't provide stubs, need to check ifneq ($(CONFIG_PCI),) obj-$(CONFIG_USB_CHIPIDEA) += ci13xxx_pci.o endif -ifneq ($(CONFIG_ARCH_MSM),) - obj-$(CONFIG_USB_CHIPIDEA) += ci13xxx_msm.o -endif
Best regards,
Marek Vasut
PATCH v7 3/14 usb: chipidea: msm: add missing section annotation
In reply to Richard ZhaoFrom: Felipe Balbi <[email protected]>
no functional changes, it will just free up some
code if we don't have hotplug.
--- drivers/usb/chipidea/ci13xxx_msm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/chipidea/ci13xxx_msm.c +1 -1
@@ -55,7 +55,7 @@ static struct ci13xxx_udc_driver ci13xxx_msm_udc_driver = { .notify_event = ci13xxx_msm_notify_event, }; -static int ci13xxx_msm_probe (struct platform_device *pdev) +static int __devinit ci13xxx_msm_probe (struct platform_device *pdev) {struct platform_device *plat_ci;int ret;
Signature · 1 line
1.7.9.5
PATCH v7 3/14 usb: chipidea: msm: add missing section annotation
Dear Richard Zhao,
Quoted 4 lines
From: Felipe Balbi <[email protected]>
no functional changes, it will just free up some
code if we don't have hotplug.
Well, start the sentence with a capital letter ;-)
Quoted 12 lines
Signed-off-by Felipe Balbi <[email protected]>Signed-off-by Alexander Shishkin <[email protected]>--- drivers/usb/chipidea/ci13xxx_msm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)(quoted diff) +0
-0
b/drivers/usb/chipidea/ci13xxx_msm.cindex 958069e..8d438b8 100644
drivers/usb/chipidea/ci13xxx_msm.c static struct ci13xxx_udc_driver ci13xxx_msm_udc_driver = · line 61
Quoted 8 lines
drivers/usb/chipidea/ci13xxx_msm.c +1
-1@@ -55,7 +55,7 @@ static struct ci13xxx_udc_driver ci13xxx_msm_udc_driver = { .notify_event = ci13xxx_msm_notify_event, }; -static int ci13xxx_msm_probe (struct platform_device *pdev) +static int __devinit ci13xxx_msm_probe (struct platform_device *pdev) {struct platform_device *plat_ci;int ret;
Best regards,
Marek Vasut
PATCH v7 4/14 usb: chipidea: msm: add remove method
In reply to Richard ZhaoFrom: Felipe Balbi <[email protected]>
allow this driver to be removed too.
--- drivers/usb/chipidea/ci13xxx_msm.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-)
drivers/usb/chipidea/ci13xxx_msm.c +14 -6
@@ -84,6 +84,8 @@ static int __devinit ci13xxx_msm_probe(struct platform_device *pdev)if (ret) goto put_platform; +platform_set_drvdata (pdev, plat_ci); +pm_runtime_no_callbacks (&pdev->dev);pm_runtime_enable (&pdev->dev);
@@ -95,16 +97,22 @@ put_platform:return ret; } +static int __devexit ci13xxx_msm_remove(struct platform_device *pdev) +{ +struct platform_device *plat_ci =platform_get_drvdata (pdev); + +platform_device_unregister (plat_ci); + +return 0 ; +} +static struct platform_driver ci13xxx_msm_driver = { .probe = ci13xxx_msm_probe, + .remove =__devexit_p (ci13xxx_msm_remove), .driver = { .name ="msm_hsusb" , }, }; -MODULE_ALIAS ("platform:msm_hsusb" ); -static int __init ci13xxx_msm_init (void ) -{ -return platform_driver_register (&ci13xxx_msm_driver); -} -module_init (ci13xxx_msm_init); +module_platform_driver (ci13xxx_msm_driver); +MODULE_ALIAS ("platform:msm_hsusb" );MODULE_LICENSE ("GPL v2" );
Signature · 1 line
1.7.9.5
PATCH v7 4/14 usb: chipidea: msm: add remove method
Hi,
Quoted 24 lines · Richard Zhao
From: Felipe Balbi <[email protected]>
allow this driver to be removed too.
Signed-off-by Felipe Balbi <[email protected]>Signed-off-by Alexander Shishkin <[email protected]>---
?drivers/usb/chipidea/ci13xxx_msm.c | ? 20 ++++++++++++++------ ?1 file changed, 14 insertions(+), 6 deletions(-)drivers/usb/chipidea/ci13xxx_msm.c +2
-0@@ -84,6 +84,8 @@ static int __devinit ci13xxx_msm_probe(struct platform_device *pdev) ? ? ? ?if (ret) ? ? ? ? ? ? ? ?goto put_platform; + ? ? ? platform_set_drvdata(pdev, plat_ci); + ? ? ? ?pm_runtime_no_callbacks(&pdev->dev); ? ? ? ?pm_runtime_enable(&pdev->dev);
drivers/usb/chipidea/ci13xxx_msm.c put_platform: · line 102
Quoted 6 lines
drivers/usb/chipidea/ci13xxx_msm.c +3
-0@@ -95,16 +97,22 @@ put_platform: ? ? ? ?return ret; ?} +static int __devexit ci13xxx_msm_remove(struct platform_device *pdev) +{ + ? ? ? struct platform_device *plat_ci = platform_get_drvdata(pdev);
How about a pm_runtime_disable() here?
drivers/usb/chipidea/ci13xxx_msm.c put_platform: · line 107
Quoted 5 lines
drivers/usb/chipidea/ci13xxx_msm.c +5
-0+ + ? ? ? platform_device_unregister(plat_ci); + + ? ? ? return 0; +}
Thanks
Kishon
PATCH v7 4/14 usb: chipidea: msm: add remove method
Dear ABRAHAM, KISHON VIJAY,
Quoted 32 lines
Hi,
On Mon, Jun 25, 2012 at 12:26 PM, Richard Zhao
Quoted 27 lines · <[email protected]> wrote:
From: Felipe Balbi <[email protected]>
allow this driver to be removed too.
Signed-off-by Felipe Balbi <[email protected]>Signed-off-by Alexander Shishkin <[email protected]>--- drivers/usb/chipidea/ci13xxx_msm.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-)(quoted diff) +0
-0
b/drivers/usb/chipidea/ci13xxx_msm.cindex 8d438b8..68512d4 100644drivers/usb/chipidea/ci13xxx_msm.c +2
-0@@ -84,6 +84,8 @@ static int __devinit ci13xxx_msm_probe(struct platform_device *pdev) if (ret) goto put_platform; + platform_set_drvdata(pdev, plat_ci); + pm_runtime_no_callbacks(&pdev->dev); pm_runtime_enable(&pdev->dev);@@ -95,16 +97,22 @@ put_platform:return ret; }
Quoted 5 lines
drivers/usb/chipidea/ci13xxx_msm.c put_platform: · line 102
Quoted 3 lines
drivers/usb/chipidea/ci13xxx_msm.c +3
-0+static int __devexit ci13xxx_msm_remove(struct platform_device *pdev) +{ +struct platform_device *plat_ci =platform_get_drvdata (pdev);How about a
pm_runtime_disable()here?
MX28 doesn't do runtime PM yet. Actually it doesn't do any PM.
Quoted 8 lines
drivers/usb/chipidea/ci13xxx_msm.c put_platform: · line 107
Quoted 5 lines
drivers/usb/chipidea/ci13xxx_msm.c +5
-0+ +platform_device_unregister (plat_ci); + +return 0 ; +}Thanks
Kishon
Best regards,
Marek Vasut
PATCH v7 4/14 usb: chipidea: msm: add remove method
Hi,
Quoted 34 lines · Marek Vasut
Dear ABRAHAM, KISHON VIJAY,
Quoted 32 lines
Hi,
On Mon, Jun 25, 2012 at 12:26 PM, Richard Zhao
Quoted 27 lines · <[email protected]> wrote:
From: Felipe Balbi <[email protected]>
allow this driver to be removed too.
Signed-off-by Felipe Balbi <[email protected]>Signed-off-by Alexander Shishkin <[email protected]>---
?drivers/usb/chipidea/ci13xxx_msm.c | ? 20 ++++++++++++++------ ?1 file changed, 14 insertions(+), 6 deletions(-)(quoted diff) +0
-0
b/drivers/usb/chipidea/ci13xxx_msm.cindex 8d438b8..68512d4 100644drivers/usb/chipidea/ci13xxx_msm.c +2
-0@@ -84,6 +84,8 @@ static int __devinit ci13xxx_msm_probe(struct platform_device *pdev) if (ret) ? ? ? ? ? ? ? ?goto put_platform; + ? ? ? platform_set_drvdata(pdev, plat_ci); + ? ? ? ?pm_runtime_no_callbacks(&pdev->dev); ? ? ? ?pm_runtime_enable(&pdev->dev);@@ -95,16 +97,22 @@ put_platform: ? ? ? ?return ret; ?}
Quoted 7 lines
Quoted 5 lines
drivers/usb/chipidea/ci13xxx_msm.c put_platform:
Quoted 3 lines
drivers/usb/chipidea/ci13xxx_msm.c +3
-0+static int __devexit ci13xxx_msm_remove(struct platform_device *pdev) +{ + ? ? ? struct platform_device *plat_ci = platform_get_drvdata(pdev);How about a
pm_runtime_disable()here?MX28 doesn't do runtime PM yet. Actually it doesn't do any PM.
I was probably misled by the call to pm_runtime_enable in your probe :-( Then can we have it removed from probe as well?
Thanks
Kishon
PATCH v7 4/14 usb: chipidea: msm: add remove method
Dear ABRAHAM, KISHON VIJAY,
Quoted 43 lines
Hi,
Quoted 40 lines · Marek Vasut
Dear ABRAHAM, KISHON VIJAY,
Quoted 37 lines
Hi,
On Mon, Jun 25, 2012 at 12:26 PM, Richard Zhao
Quoted 24 lines · <[email protected]> wrote:
From: Felipe Balbi <[email protected]>
allow this driver to be removed too.
Signed-off-by Felipe Balbi <[email protected]>Signed-off-by Alexander Shishkin <[email protected]>--- drivers/usb/chipidea/ci13xxx_msm.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-)(quoted diff) +0
-0
b/drivers/usb/chipidea/ci13xxx_msm.cindex 8d438b8..68512d4 100644drivers/usb/chipidea/ci13xxx_msm.c +2
-0@@ -84,6 +84,8 @@ static int __devinit ci13xxx_msm_probe(struct platform_device *pdev) if (ret) goto put_platform; + platform_set_drvdata(pdev, plat_ci); + pm_runtime_no_callbacks(&pdev->dev); pm_runtime_enable(&pdev->dev);drivers/usb/chipidea/ci13xxx_msm.c put_platform: · line 102
Quoted 6 lines
drivers/usb/chipidea/ci13xxx_msm.c +3
-0@@ -95,16 +97,22 @@ put_platform:return ret; } +static int __devexit ci13xxx_msm_remove(struct platform_device *pdev) +{ +struct platform_device *plat_ci =platform_get_drvdata (pdev);How about a
pm_runtime_disable()here?
Quoted 5 lines
Quoted 1 line
MX28 doesn't do runtime PM yet. Actually it doesn't do any PM.
I was probably misled by the call to
pm_runtime_enablein your probe:-( Then can we have it removed from probe as well?
Yes, either that or properly add runtime PM support since mxc maybe does support it, I dunno right now.
Quoted 2 lines
Thanks
Kishon
Best regards,
Marek Vasut
PATCH v7 4/14 usb: chipidea: msm: add remove method
Hi,
Quoted 45 lines · Marek Vasut
Dear ABRAHAM, KISHON VIJAY,
Quoted 43 lines
Hi,
Quoted 40 lines · Marek Vasut
Dear ABRAHAM, KISHON VIJAY,
Quoted 37 lines
Hi,
On Mon, Jun 25, 2012 at 12:26 PM, Richard Zhao
Quoted 24 lines · <[email protected]> wrote:
From: Felipe Balbi <[email protected]>
allow this driver to be removed too.
Signed-off-by Felipe Balbi <[email protected]>Signed-off-by Alexander Shishkin <[email protected]>--- drivers/usb/chipidea/ci13xxx_msm.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-)(quoted diff) +0
-0
b/drivers/usb/chipidea/ci13xxx_msm.cindex 8d438b8..68512d4 100644drivers/usb/chipidea/ci13xxx_msm.c +2
-0@@ -84,6 +84,8 @@ static int __devinit ci13xxx_msm_probe(struct platform_device *pdev) if (ret) goto put_platform; + platform_set_drvdata(pdev, plat_ci); + pm_runtime_no_callbacks(&pdev->dev); pm_runtime_enable(&pdev->dev);drivers/usb/chipidea/ci13xxx_msm.c put_platform: · line 102
Quoted 6 lines
drivers/usb/chipidea/ci13xxx_msm.c +3
-0@@ -95,16 +97,22 @@ put_platform:return ret; } +static int __devexit ci13xxx_msm_remove(struct platform_device *pdev) +{ +struct platform_device *plat_ci =platform_get_drvdata (pdev);How about a
pm_runtime_disable()here?
Quoted 8 lines
Quoted 5 lines
Quoted 1 line
MX28 doesn't do runtime PM yet. Actually it doesn't do any PM.
I was probably misled by the call to
pm_runtime_enablein your probe:-( Then can we have it removed from probe as well?
Yes, either that or properly add runtime PM support since mxc maybe does support it, I dunno right now.
I think adding pm_runtime_disable() to the exit path should be the way to go. proper callbacks can be implemented later, but we cannot leave pm enabled for the device.
Signature · 8 lines
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/20120625/1dd6ebc3/attachment.sig>
PATCH v7 4/14 usb: chipidea: msm: add remove method
Dear Felipe Balbi,
Quoted 57 lines
Hi,
Quoted 54 lines · Marek Vasut
Dear ABRAHAM, KISHON VIJAY,
Quoted 52 lines
Hi,
Quoted 38 lines · Marek Vasut
Dear ABRAHAM, KISHON VIJAY,
Quoted 36 lines
Hi,
On Mon, Jun 25, 2012 at 12:26 PM, Richard Zhao
Quoted 31 lines · <[email protected]> wrote:
From: Felipe Balbi <[email protected]>
allow this driver to be removed too.
Signed-off-by Felipe Balbi <[email protected]>Signed-off-by Alexander Shishkin<[email protected]> ---
drivers/usb/chipidea/ci13xxx_msm.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-)(quoted diff) +0
-0
b/drivers/usb/chipidea/ci13xxx_msm.cindex 8d438b8..68512d4 100644drivers/usb/chipidea/ci13xxx_msm.c +2
-0@@ -84,6 +84,8 @@ static int __devinit ci13xxx_msm_probe(struct platform_device *pdev) if (ret) goto put_platform; + platform_set_drvdata(pdev, plat_ci); + pm_runtime_no_callbacks(&pdev->dev);pm_runtime_enable(&pdev->dev);drivers/usb/chipidea/ci13xxx_msm.c +0
-0@@ -95,16 +97,22 @@ put_platform:return ret; }Quoted 8 lines
Quoted 6 lines
drivers/usb/chipidea/ci13xxx_msm.c put_platform: · line 104
Quoted 4 lines
drivers/usb/chipidea/ci13xxx_msm.c +2
-0+static int __devexit ci13xxx_msm_remove(struct platform_device *pdev) +{ +struct platform_device *plat_ci =platform_get_drvdata (pdev);How about a
pm_runtime_disable()here?MX28 doesn't do runtime PM yet. Actually it doesn't do any PM.
I was probably misled by the call to
pm_runtime_enablein your probe
Quoted 8 lines
Quoted 4 lines
Quoted 1 line
:-( Then can we have it removed from probe as well?
Yes, either that or properly add runtime PM support since mxc maybe does support it, I dunno right now.
I think adding
pm_runtime_disable()to the exit path should be the way to go. proper callbacks can be implemented later, but we cannot leave pm enabled for the device.
Agreed
Best regards,
Marek Vasut
PATCH v7 5/14 USB: Chipidea: rename struct ci13xxx_udc_driver to struct ci13xxx_platform_data
In reply to Richard ZhaoThis patch rename struct ci13xxx_udc_driver and var with the type.
ci13xxx_platform_data reflect it's passed from platfrom driver.
--- drivers/usb/chipidea/ci.h | 4 ++-- drivers/usb/chipidea/ci13xxx_msm.c | 6 +++--- drivers/usb/chipidea/ci13xxx_pci.c | 20 ++++++++++---------- drivers/usb/chipidea/core.c | 12 ++++++------ drivers/usb/chipidea/host.c | 2 +- drivers/usb/chipidea/udc.c | 24 ++++++++++++------------ include/linux/usb/chipidea.h | 2 +- 7 files changed, 35 insertions(+), 35 deletions(-)
drivers/usb/chipidea/ci.h +2 -2
@@ -125,7 +125,7 @@ struct hw_bank {* @remote_wakeup: host-enabled remote wakeup * @suspended: suspended by host * @test_mode: the selected test mode -* @udc_driver: platform specific information supplied by parent device +* @platdata: platform specific information supplied by parent device * @vbus_active: is VBUS active * @transceiver: pointer to USB PHY, if any * @hcd: pointer to usb_hcd for ehci host driver
@@ -158,7 +158,7 @@ struct ci13xxx {u8 suspended;u8 test_mode; -struct ci13xxx_udc_driver *udc_driver; +struct ci13xxx_platform_data *platdata;int vbus_active;struct usb_phy *transceiver;struct usb_hcd *hcd;
drivers/usb/chipidea/ci13xxx_msm.c +3 -3
@@ -45,7 +45,7 @@ static void ci13xxx_msm_notify_event(struct ci13xxx *udc, unsigned event) } } -static struct ci13xxx_udc_driver ci13xxx_msm_udc_driver = { +static struct ci13xxx_platform_data ci13xxx_msm_platdata = { .name ="ci13xxx_msm" , .flags =CI13XXX_REGS_SHARED | CI13XXX_REQUIRE_TRANSCEIVER |
@@ -75,8 +75,8 @@ static int __devinit ci13xxx_msm_probe(struct platform_device *pdev) goto put_platform; } - ret =platform_device_add_data (plat_ci, &ci13xxx_msm_udc_driver, -sizeof (ci13xxx_msm_udc_driver)); + ret =platform_device_add_data (plat_ci, &ci13xxx_msm_platdata, +sizeof (ci13xxx_msm_platdata));if (ret) goto put_platform;
drivers/usb/chipidea/ci13xxx_pci.c +10 -10
@@ -23,17 +23,17 @@/****************************************************************************** * PCI block *****************************************************************************/ -struct ci13xxx_udc_driver pci_driver = { +struct ci13xxx_platform_data pci_platdata = { .name =UDC_DRIVER_NAME , .capoffset =DEF_CAPOFFSET , }; -struct ci13xxx_udc_driver langwell_pci_driver = { +struct ci13xxx_platform_data langwell_pci_platdata = { .name =UDC_DRIVER_NAME , .capoffset =0 , }; -struct ci13xxx_udc_driver penwell_pci_driver = { +struct ci13xxx_platform_data penwell_pci_platdata = { .name =UDC_DRIVER_NAME , .capoffset =0 , .power_budget =200 ,
@@ -51,12 +51,12 @@ struct ci13xxx_udc_driver penwell_pci_driver = {static int __devinit ci13xxx_pci_probe (struct pci_dev *pdev,const struct pci_device_id *id) { -struct ci13xxx_udc_driver *driver = (void *)id->driver_data; +struct ci13xxx_platform_data *platdata = (void *)id->driver_data;struct platform_device *plat_ci;struct resource res[3 ];int retval =0 , nres =2 ; -if (!driver) { +if (!platdata) {dev_err (&pdev->dev,"device doesn't provide driver data\n" );return -ENODEV ; }
@@ -95,7 +95,7 @@ static int __devinit ci13xxx_pci_probe(struct pci_dev *pdev, goto put_platform; } - retval =platform_device_add_data (plat_ci, driver,sizeof (*driver)); + retval =platform_device_add_data (plat_ci, platdata,sizeof (*platdata));if (retval) goto put_platform;
@@ -147,19 +147,19 @@ static void __devexit ci13xxx_pci_remove(struct pci_dev *pdev)static DEFINE_PCI_DEVICE_TABLE (ci13xxx_pci_id_table) = { {PCI_DEVICE (0x153F ,0x1004 ), - .driver_data = (kernel_ulong_t)&pci_driver, + .driver_data = (kernel_ulong_t)&pci_platdata, }, {PCI_DEVICE (0x153F ,0x1006 ), - .driver_data = (kernel_ulong_t)&pci_driver, + .driver_data = (kernel_ulong_t)&pci_platdata, }, {PCI_DEVICE (PCI_VENDOR_ID_INTEL ,0x0811 ), - .driver_data = (kernel_ulong_t)&langwell_pci_driver, + .driver_data = (kernel_ulong_t)&langwell_pci_platdata, }, {PCI_DEVICE (PCI_VENDOR_ID_INTEL ,0x0829 ), - .driver_data = (kernel_ulong_t)&penwell_pci_driver, + .driver_data = (kernel_ulong_t)&penwell_pci_platdata, }, {0 ,0 ,0 ,0 ,0 ,0 ,0 /* end: all zeroes */ } };
drivers/usb/chipidea/core.c +6 -6
@@ -179,7 +179,7 @@ static int hw_device_init(struct ci13xxx *ci, void __iomem *base) ci->hw_bank.abs = base; ci->hw_bank.cap = ci->hw_bank.abs; - ci->hw_bank.cap += ci->udc_driver->capoffset; + ci->hw_bank.cap += ci->platdata->capoffset; ci->hw_bank.op = ci->hw_bank.cap +ioread8 (ci->hw_bank.cap);hw_alloc_regmap (ci, false);
@@ -227,11 +227,11 @@ int hw_device_reset(struct ci13xxx *ci, u32 mode)udelay (10 );/* not RTOS friendly */ -if (ci->udc_driver->notify_event) - ci->udc_driver->notify_event (ci, +if (ci->platdata->notify_event) + ci->platdata->notify_event (ci,CI13XXX_CONTROLLER_RESET_EVENT ); -if (ci->udc_driver->flags &CI13XXX_DISABLE_STREAMING ) +if (ci->platdata->flags &CI13XXX_DISABLE_STREAMING )hw_write (ci,OP_USBMODE ,USBMODE_CI_SDIS ,USBMODE_CI_SDIS );/* USBMODE should be configured step by step */
@@ -364,7 +364,7 @@ static int __devinit ci_hdrc_probe(struct platform_device *pdev) } ci->dev = dev; - ci->udc_driver = dev->platform_data; + ci->platdata = dev->platform_data; ret =hw_device_init (ci, base);if (ret <0 ) {
@@ -419,7 +419,7 @@ static int __devinit ci_hdrc_probe(struct platform_device *pdev) }platform_set_drvdata (pdev, ci); - ret =request_irq (ci->irq, ci_irq,IRQF_SHARED , ci->udc_driver->name, + ret =request_irq (ci->irq, ci_irq,IRQF_SHARED , ci->platdata->name, ci);if (ret) goto stop;
drivers/usb/chipidea/host.c +1 -1
@@ -116,7 +116,7 @@ static int host_start(struct ci13xxx *ci) hcd->regs = ci->hw_bank.abs; hcd->has_tt =1 ; - hcd->power_budget = ci->udc_driver->power_budget; + hcd->power_budget = ci->platdata->power_budget; ehci =hcd_to_ehci (hcd); ehci->caps = ci->hw_bank.cap;
drivers/usb/chipidea/udc.c +12 -12
@@ -1362,7 +1362,7 @@ static int ci13xxx_vbus_session(struct usb_gadget *_gadget, int is_active)unsigned long flags;int gadget_ready =0 ; -if (!(udc->udc_driver->flags &CI13XXX_PULLUP_ON_VBUS )) +if (!(udc->platdata->flags &CI13XXX_PULLUP_ON_VBUS ))return -EOPNOTSUPP ;spin_lock_irqsave (&udc->lock, flags);
@@ -1378,8 +1378,8 @@ static int ci13xxx_vbus_session(struct usb_gadget *_gadget, int is_active)hw_device_state (udc, udc->ep0out->qh.dma); }else {hw_device_state (udc,0 ); -if (udc->udc_driver->notify_event) - udc->udc_driver->notify_event (udc, +if (udc->platdata->notify_event) + udc->platdata->notify_event (udc,CI13XXX_CONTROLLER_STOPPED_EVENT );_gadget_stop_activity (&udc->gadget);pm_runtime_put_sync (&_gadget->dev);
@@ -1514,9 +1514,9 @@ static int ci13xxx_start(struct usb_gadget *gadget, udc->driver = driver;pm_runtime_get_sync (&udc->gadget.dev); -if (udc->udc_driver->flags &CI13XXX_PULLUP_ON_VBUS ) { +if (udc->platdata->flags &CI13XXX_PULLUP_ON_VBUS ) {if (udc->vbus_active) { -if (udc->udc_driver->flags &CI13XXX_REGS_SHARED ) +if (udc->platdata->flags &CI13XXX_REGS_SHARED )hw_device_reset (udc,USBMODE_CM_DC ); }else {pm_runtime_put_sync (&udc->gadget.dev);
@@ -1544,11 +1544,11 @@ static int ci13xxx_stop(struct usb_gadget *gadget,spin_lock_irqsave (&udc->lock, flags); -if (!(udc->udc_driver->flags &CI13XXX_PULLUP_ON_VBUS ) || +if (!(udc->platdata->flags &CI13XXX_PULLUP_ON_VBUS ) || udc->vbus_active) {hw_device_state (udc,0 ); -if (udc->udc_driver->notify_event) - udc->udc_driver->notify_event (udc, +if (udc->platdata->notify_event) + udc->platdata->notify_event (udc,CI13XXX_CONTROLLER_STOPPED_EVENT ); udc->driver =NULL ;spin_unlock_irqrestore (&udc->lock, flags);
@@ -1581,7 +1581,7 @@ static irqreturn_t udc_irq(struct ci13xxx *udc)spin_lock (&udc->lock); -if (udc->udc_driver->flags &CI13XXX_REGS_SHARED ) { +if (udc->platdata->flags &CI13XXX_REGS_SHARED ) {if (hw_read (udc,OP_USBMODE ,USBMODE_CM ) !=USBMODE_CM_DC ) {spin_unlock (&udc->lock);
@@ -1653,7 +1653,7 @@ static int udc_start(struct ci13xxx *udc) udc->gadget.speed =USB_SPEED_UNKNOWN ; udc->gadget.max_speed =USB_SPEED_HIGH ; udc->gadget.is_otg =0 ; - udc->gadget.name = udc->udc_driver->name; + udc->gadget.name = udc->platdata->name;INIT_LIST_HEAD (&udc->gadget.ep_list);
@@ -1686,14 +1686,14 @@ static int udc_start(struct ci13xxx *udc) udc->transceiver =usb_get_transceiver (); -if (udc->udc_driver->flags &CI13XXX_REQUIRE_TRANSCEIVER ) { +if (udc->platdata->flags &CI13XXX_REQUIRE_TRANSCEIVER ) {if (udc->transceiver ==NULL ) { retval = -ENODEV ; goto free_pools; } } -if (!(udc->udc_driver->flags &CI13XXX_REGS_SHARED )) { +if (!(udc->platdata->flags &CI13XXX_REGS_SHARED )) { retval =hw_device_reset (udc,USBMODE_CM_DC );if (retval) goto put_transceiver;
include/linux/usb/chipidea.h +1 -1
@@ -6,7 +6,7 @@#define __LINUX_USB_CHIPIDEA_Hstruct ci13xxx ; -struct ci13xxx_udc_driver { +struct ci13xxx_platform_data {const char *name;/* offset of the capability registers */ uintptr_t capoffset;
Signature · 1 line
1.7.9.5
PATCH v7 5/14 USB: Chipidea: rename struct ci13xxx_udc_driver to struct ci13xxx_platform_data
Dear Richard Zhao,
Quoted 3 lines
This patch rename struct
ci13xxx_udc_driverand var with the type.
ci13xxx_platform_datareflect it's passed from platfrom driver.
Maybe rather driver data? As platform_data has certain different conotation to it.
Quoted 292 lines
Signed-off-by Richard Zhao <[email protected]>Reviewed-by Felipe Balbi <[email protected]>Signed-off-by Alexander Shishkin <[email protected]>--- drivers/usb/chipidea/ci.h | 4 ++-- drivers/usb/chipidea/ci13xxx_msm.c | 6 +++--- drivers/usb/chipidea/ci13xxx_pci.c | 20 ++++++++++---------- drivers/usb/chipidea/core.c | 12 ++++++------ drivers/usb/chipidea/host.c | 2 +- drivers/usb/chipidea/udc.c | 24 ++++++++++++------------ include/linux/usb/chipidea.h | 2 +- 7 files changed, 35 insertions(+), 35 deletions(-)drivers/usb/chipidea/ci.h +2
-2@@ -125,7 +125,7 @@ struct hw_bank {* @remote_wakeup: host-enabled remote wakeup * @suspended: suspended by host * @test_mode: the selected test mode -* @udc_driver: platform specific information supplied by parent device +* @platdata: platform specific information supplied by parent device * @vbus_active: is VBUS active * @transceiver: pointer to USB PHY, if any * @hcd: pointer to usb_hcd for ehci host driver @@ -158,7 +158,7 @@ struct ci13xxx {u8 suspended;u8 test_mode; -struct ci13xxx_udc_driver *udc_driver; +struct ci13xxx_platform_data *platdata;int vbus_active;struct usb_phy *transceiver;struct usb_hcd *hcd;(quoted diff) +0
-0
b/drivers/usb/chipidea/ci13xxx_msm.cindex 68512d4..21a7c2e 100644drivers/usb/chipidea/ci13xxx_msm.c +3
-3@@ -45,7 +45,7 @@ static void ci13xxx_msm_notify_event(struct ci13xxx *udc, unsigned event) } } -static struct ci13xxx_udc_driver ci13xxx_msm_udc_driver = { +static struct ci13xxx_platform_data ci13xxx_msm_platdata = { .name ="ci13xxx_msm" , .flags =CI13XXX_REGS_SHARED | CI13XXX_REQUIRE_TRANSCEIVER |@@ -75,8 +75,8 @@ static int __devinit ci13xxx_msm_probe(struct platform_device *pdev) goto put_platform; } - ret =platform_device_add_data (plat_ci, &ci13xxx_msm_udc_driver, -sizeof (ci13xxx_msm_udc_driver)); + ret =platform_device_add_data (plat_ci, &ci13xxx_msm_platdata, +sizeof (ci13xxx_msm_platdata));if (ret) goto put_platform;(quoted diff) +0
-0
b/drivers/usb/chipidea/ci13xxx_pci.cindex e3dab27..cdcac3a 100644drivers/usb/chipidea/ci13xxx_pci.c +10
-9@@ -23,17 +23,17 @@/************************************************************************* ***** * PCI block ************************************************************************** ***/ -struct ci13xxx_udc_driver pci_driver = { +struct ci13xxx_platform_data pci_platdata = { .name =UDC_DRIVER_NAME , .capoffset =DEF_CAPOFFSET , }; -struct ci13xxx_udc_driver langwell_pci_driver = { +struct ci13xxx_platform_data langwell_pci_platdata = { .name =UDC_DRIVER_NAME , .capoffset =0 , }; -struct ci13xxx_udc_driver penwell_pci_driver = { +struct ci13xxx_platform_data penwell_pci_platdata = { .name = UDC_DRIVER_NAME, .capoffset = 0, .power_budget = 200,@@ -51,12 +51,12 @@ struct ci13xxx_udc_driver penwell_pci_driver = {static int __devinit ci13xxx_pci_probe (struct pci_dev *pdev,const struct pci_device_id *id) { -struct ci13xxx_udc_driver *driver = (void *)id->driver_data; +struct ci13xxx_platform_data *platdata = (void *)id->driver_data;struct platform_device *plat_ci;struct resource res[3 ];int retval =0 , nres =2 ; -if (!driver) { +if (!platdata) {dev_err (&pdev->dev,"device doesn't provide driver data\n" );return -ENODEV ; }@@ -95,7 +95,7 @@ static int __devinit ci13xxx_pci_probe(struct pci_dev *pdev, goto put_platform; } - retval =platform_device_add_data (plat_ci, driver,sizeof (*driver)); + retval =platform_device_add_data (plat_ci, platdata,sizeof (*platdata));if (retval) goto put_platform;@@ -147,19 +147,19 @@ static void __devexit ci13xxx_pci_remove(struct pci_dev *pdev) static DEFINE_PCI_DEVICE_TABLE(ci13xxx_pci_id_table) = { {PCI_DEVICE (0x153F ,0x1004 ), - .driver_data = (kernel_ulong_t)&pci_driver, + .driver_data = (kernel_ulong_t)&pci_platdata, }, {PCI_DEVICE (0x153F ,0x1006 ), - .driver_data = (kernel_ulong_t)&pci_driver, + .driver_data = (kernel_ulong_t)&pci_platdata, }, {PCI_DEVICE (PCI_VENDOR_ID_INTEL ,0x0811 ), - .driver_data = (kernel_ulong_t)&langwell_pci_driver, + .driver_data = (kernel_ulong_t)&langwell_pci_platdata, }, {PCI_DEVICE (PCI_VENDOR_ID_INTEL ,0x0829 ), - .driver_data = (kernel_ulong_t)&penwell_pci_driver, + .driver_data = (kernel_ulong_t)&penwell_pci_platdata, }, {0 ,0 ,0 ,0 ,0 ,0 ,0 /* end: all zeroes */ } };drivers/usb/chipidea/core.c +6
-6@@ -179,7 +179,7 @@ static int hw_device_init(struct ci13xxx *ci, void __iomem *base) ci->hw_bank.abs = base; ci->hw_bank.cap = ci->hw_bank.abs; - ci->hw_bank.cap += ci->udc_driver->capoffset; + ci->hw_bank.cap += ci->platdata->capoffset; ci->hw_bank.op = ci->hw_bank.cap +ioread8 (ci->hw_bank.cap);hw_alloc_regmap (ci, false);@@ -227,11 +227,11 @@ int hw_device_reset(struct ci13xxx *ci, u32 mode)udelay (10 );/* not RTOS friendly */ -if (ci->udc_driver->notify_event) - ci->udc_driver->notify_event (ci, +if (ci->platdata->notify_event) + ci->platdata->notify_event (ci,CI13XXX_CONTROLLER_RESET_EVENT ); -if (ci->udc_driver->flags &CI13XXX_DISABLE_STREAMING ) +if (ci->platdata->flags &CI13XXX_DISABLE_STREAMING )hw_write (ci,OP_USBMODE ,USBMODE_CI_SDIS ,USBMODE_CI_SDIS );/* USBMODE should be configured step by step */ @@ -364,7 +364,7 @@ static int __devinit ci_hdrc_probe(struct platform_device *pdev) } ci->dev = dev; - ci->udc_driver = dev->platform_data; + ci->platdata = dev->platform_data; ret =hw_device_init (ci, base);if (ret <0 ) {@@ -419,7 +419,7 @@ static int __devinit ci_hdrc_probe(struct platform_device *pdev) }platform_set_drvdata (pdev, ci); - ret =request_irq (ci->irq, ci_irq,IRQF_SHARED , ci->udc_driver->name, + ret =request_irq (ci->irq, ci_irq,IRQF_SHARED , ci->platdata->name, ci);if (ret) goto stop;drivers/usb/chipidea/host.c +1
-1@@ -116,7 +116,7 @@ static int host_start(struct ci13xxx *ci) hcd->regs = ci->hw_bank.abs; hcd->has_tt =1 ; - hcd->power_budget = ci->udc_driver->power_budget; + hcd->power_budget = ci->platdata->power_budget; ehci =hcd_to_ehci (hcd); ehci->caps = ci->hw_bank.cap;drivers/usb/chipidea/udc.c +12
-12@@ -1362,7 +1362,7 @@ static int ci13xxx_vbus_session(struct usb_gadget *_gadget, int is_active) unsigned long flags;int gadget_ready =0 ; -if (!(udc->udc_driver->flags &CI13XXX_PULLUP_ON_VBUS )) +if (!(udc->platdata->flags &CI13XXX_PULLUP_ON_VBUS ))return -EOPNOTSUPP ;spin_lock_irqsave (&udc->lock, flags);@@ -1378,8 +1378,8 @@ static int ci13xxx_vbus_session(struct usb_gadget *_gadget, int is_active) hw_device_state(udc, udc->ep0out->qh.dma); }else {hw_device_state (udc,0 ); -if (udc->udc_driver->notify_event) - udc->udc_driver->notify_event (udc, +if (udc->platdata->notify_event) + udc->platdata->notify_event (udc,CI13XXX_CONTROLLER_STOPPED_EVENT );_gadget_stop_activity (&udc->gadget);pm_runtime_put_sync (&_gadget->dev);@@ -1514,9 +1514,9 @@ static int ci13xxx_start(struct usb_gadget *gadget, udc->driver = driver;pm_runtime_get_sync (&udc->gadget.dev); -if (udc->udc_driver->flags &CI13XXX_PULLUP_ON_VBUS ) { +if (udc->platdata->flags &CI13XXX_PULLUP_ON_VBUS ) {if (udc->vbus_active) { -if (udc->udc_driver->flags &CI13XXX_REGS_SHARED ) +if (udc->platdata->flags &CI13XXX_REGS_SHARED )hw_device_reset (udc,USBMODE_CM_DC ); }else {pm_runtime_put_sync (&udc->gadget.dev);@@ -1544,11 +1544,11 @@ static int ci13xxx_stop(struct usb_gadget *gadget,spin_lock_irqsave (&udc->lock, flags); -if (!(udc->udc_driver->flags &CI13XXX_PULLUP_ON_VBUS ) || +if (!(udc->platdata->flags &CI13XXX_PULLUP_ON_VBUS ) || udc->vbus_active) {hw_device_state (udc,0 ); -if (udc->udc_driver->notify_event) - udc->udc_driver->notify_event (udc, +if (udc->platdata->notify_event) + udc->platdata->notify_event (udc,CI13XXX_CONTROLLER_STOPPED_EVENT ); udc->driver =NULL ;spin_unlock_irqrestore (&udc->lock, flags);@@ -1581,7 +1581,7 @@ static irqreturn_t udc_irq(struct ci13xxx *udc)spin_lock (&udc->lock); -if (udc->udc_driver->flags &CI13XXX_REGS_SHARED ) { +if (udc->platdata->flags &CI13XXX_REGS_SHARED ) {if (hw_read (udc,OP_USBMODE ,USBMODE_CM ) !=USBMODE_CM_DC ) {spin_unlock (&udc->lock);@@ -1653,7 +1653,7 @@ static int udc_start(struct ci13xxx *udc) udc->gadget.speed =USB_SPEED_UNKNOWN ; udc->gadget.max_speed =USB_SPEED_HIGH ; udc->gadget.is_otg =0 ; - udc->gadget.name = udc->udc_driver->name; + udc->gadget.name = udc->platdata->name;INIT_LIST_HEAD (&udc->gadget.ep_list);@@ -1686,14 +1686,14 @@ static int udc_start(struct ci13xxx *udc) udc->transceiver =usb_get_transceiver (); -if (udc->udc_driver->flags &CI13XXX_REQUIRE_TRANSCEIVER ) { +if (udc->platdata->flags &CI13XXX_REQUIRE_TRANSCEIVER ) {if (udc->transceiver ==NULL ) { retval = -ENODEV ; goto free_pools; } } -if (!(udc->udc_driver->flags &CI13XXX_REGS_SHARED )) { +if (!(udc->platdata->flags &CI13XXX_REGS_SHARED )) { retval =hw_device_reset (udc,USBMODE_CM_DC );if (retval) goto put_transceiver;include/linux/usb/chipidea.h +1
-1@@ -6,7 +6,7 @@#define __LINUX_USB_CHIPIDEA_Hstruct ci13xxx ; -struct ci13xxx_udc_driver { +struct ci13xxx_platform_data {const char *name;/* offset of the capability registers */ uintptr_t capoffset;
PATCH v7 5/14 USB: Chipidea: rename struct ci13xxx_udc_driver to struct ci13xxx_platform_data
Quoted 8 lines · Marek Vasut
Dear Richard Zhao,
Quoted 3 lines
This patch rename struct
ci13xxx_udc_driverand var with the type.
ci13xxx_platform_datareflect it's passed from platfrom driver.Maybe rather driver data? As
platform_datahas certain different conotation to it.
I prefer the current way. driver data is something that is allocated and managed internally by the driver.
Thanks
Richard
PATCH v7 6/14 USB: Chipidea: rename struct ci13xxx variables from udc to ci
In reply to Richard Zhaostruct ci13xxx represent the controller, which may be device or host, so name its variables as ci.
--- drivers/usb/chipidea/ci.h | 26 +- drivers/usb/chipidea/ci13xxx_msm.c | 12 +- drivers/usb/chipidea/debug.c | 146 ++++----- drivers/usb/chipidea/udc.c | 630 ++++++++++++++++++------------------ include/linux/usb/chipidea.h | 2 +- 5 files changed, 408 insertions(+), 408 deletions(-)
drivers/usb/chipidea/ci.h +13 -13
@@ -36,7 +36,7 @@* @name: string description of the endpoint * @qh: queue head for this endpoint * @wedge: is the endpoint wedged -* @udc: pointer to the controller +* @ci: pointer to the controller * @lock: pointer to controller's spinlock * @td_pool: pointer to controller's TD pool */
@@ -54,7 +54,7 @@ struct ci13xxx_ep {int wedge;/* global resources */ -struct ci13xxx *udc; +struct ci13xxx *ci;spinlock_t *lock;struct dma_pool *td_pool; };
@@ -250,9 +250,9 @@ static inline int ffs_nr(u32 x)* * This function returns register contents */ -static inline u32 hw_read (struct ci13xxx *udc,enum ci13xxx_regs reg,u32 mask) +static inline u32 hw_read (struct ci13xxx *ci,enum ci13xxx_regs reg,u32 mask) { -return ioread32 (udc->hw_bank.regmap[reg]) & mask; +return ioread32 (ci->hw_bank.regmap[reg]) & mask; }/**
@@ -261,14 +261,14 @@ static inline u32 hw_read(struct ci13xxx *udc, enum ci13xxx_regs reg, u32 mask)* @mask: bitfield mask * @data: new value */ -static inline void hw_write (struct ci13xxx *udc,enum ci13xxx_regs reg, +static inline void hw_write (struct ci13xxx *ci,enum ci13xxx_regs reg,u32 mask,u32 data) {if (~mask) - data = (ioread32 (udc->hw_bank.regmap[reg]) & ~mask) + data = (ioread32 (ci->hw_bank.regmap[reg]) & ~mask) | (data & mask); -iowrite32 (data, udc->hw_bank.regmap[reg]); +iowrite32 (data, ci->hw_bank.regmap[reg]); }/**
@@ -278,12 +278,12 @@ static inline void hw_write(struct ci13xxx *udc, enum ci13xxx_regs reg,* * This function returns register contents */ -static inline u32 hw_test_and_clear (struct ci13xxx *udc,enum ci13xxx_regs reg, +static inline u32 hw_test_and_clear (struct ci13xxx *ci,enum ci13xxx_regs reg,u32 mask) { -u32 val =ioread32 (udc->hw_bank.regmap[reg]) & mask; +u32 val =ioread32 (ci->hw_bank.regmap[reg]) & mask; -iowrite32 (val, udc->hw_bank.regmap[reg]); +iowrite32 (val, ci->hw_bank.regmap[reg]);return val; }
@@ -295,12 +295,12 @@ static inline u32 hw_test_and_clear(struct ci13xxx *udc, enum ci13xxx_regs reg,* * This function returns register contents */ -static inline u32 hw_test_and_write (struct ci13xxx *udc,enum ci13xxx_regs reg, +static inline u32 hw_test_and_write (struct ci13xxx *ci,enum ci13xxx_regs reg,u32 mask,u32 data) { -u32 val =hw_read (udc, reg, ~0 ); +u32 val =hw_read (ci, reg, ~0 ); -hw_write (udc, reg, mask, data); +hw_write (ci, reg, mask, data);return (val & mask) >>ffs_nr (mask); }
drivers/usb/chipidea/ci13xxx_msm.c +6 -6
@@ -15,11 +15,11 @@#include "ci.h" -#define MSM_USB_BASE (udc->hw_bank.abs) +#define MSM_USB_BASE (ci->hw_bank.abs) -static void ci13xxx_msm_notify_event (struct ci13xxx *udc,unsigned event) +static void ci13xxx_msm_notify_event (struct ci13xxx *ci,unsigned event) { -struct device *dev = udc->gadget.dev.parent; +struct device *dev = ci->gadget.dev.parent;int val;switch (event) {
@@ -34,13 +34,13 @@ static void ci13xxx_msm_notify_event(struct ci13xxx *udc, unsigned event)* Put the transceiver in non-driving mode. Otherwise host * may not detect soft-disconnection. */ - val =usb_phy_io_read (udc->transceiver,ULPI_FUNC_CTRL ); + val =usb_phy_io_read (ci->transceiver,ULPI_FUNC_CTRL ); val &= ~ULPI_FUNC_CTRL_OPMODE_MASK ; val |=ULPI_FUNC_CTRL_OPMODE_NONDRIVING ; -usb_phy_io_write (udc->transceiver, val,ULPI_FUNC_CTRL ); +usb_phy_io_write (ci->transceiver, val,ULPI_FUNC_CTRL );break ;default : -dev_dbg (dev,"unknown ci13xxx_udc event\n" ); +dev_dbg (dev,"unknown ci13xxx event\n" );break ; } }
drivers/usb/chipidea/debug.c +73 -73
366 lines not on this page · raw message
drivers/usb/chipidea/udc.c +315 -315
1,358 lines not on this page · raw message
include/linux/usb/chipidea.h +1 -1
@@ -19,7 +19,7 @@ struct ci13xxx_platform_data {#define CI13XXX_CONTROLLER_RESET_EVENT 0#define CI13XXX_CONTROLLER_STOPPED_EVENT 1 -void (*notify_event) (struct ci13xxx *udc,unsigned event); +void (*notify_event) (struct ci13xxx *ci,unsigned event); };/* Default offset of capability registers */
Signature · 1 line
1.7.9.5
PATCH v7 6/14 USB: Chipidea: rename struct ci13xxx variables from udc to ci
Dear Richard Zhao,
Quoted 7 lines
struct ci13xxx represent the controller, which may be device or host, so name its variables as ci.
Signed-off-by Richard Zhao <[email protected]>Reviewed-by Felipe Balbi <[email protected]>Signed-off-by Alexander Shishkin <[email protected]>---
Add my
[...]
Best regards,
Marek Vasut
PATCH v7 6/14 USB: Chipidea: rename struct ci13xxx variables from udc to ci
In reply to Richard ZhaoQuoted 6 lines · Richard Zhao
struct ci13xxx represent the controller, which may be device or host, so name its variables as ci.
Signed-off-by Richard Zhao <[email protected]>Reviewed-by Felipe Balbi <[email protected]>Signed-off-by Alexander Shishkin <[email protected]>
nitpick: search-replace problem
drivers/usb/chipidea/udc.c line 2
Quoted 6 lines
drivers/usb/chipidea/udc.c +1
-1@@ -1,5 +1,5 @@/* -* udc.c - ChipIdea UDC driver +* ci.c - ChipIdea UDC driver
^^^^
:)
drivers/usb/chipidea/udc.c static inline int hw_ep_bit(int num, int dir) · line 68
Quoted 7 lines
drivers/usb/chipidea/udc.c +0
-0* * Copyright (C) 2008 Chipidea - MIPS Technologies, Inc. All rights reserved. * @@ -66,11 +66,11 @@ static inline int hw_ep_bit(int num, int dir)return num + (dir ?16 :0 ); }
Marc
Signature · 12 lines
Pengutronix e.K. | Marc Kleine-Budde | Industrial Linux Solutions | Phone: +49-231-2826-924 | Vertretung West/Dortmund | Fax: +49-5121-206917-5555 | Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de | -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 262 bytes Desc: OpenPGP digital signature URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120627/ebce7ba8/attachment-0001.sig>
PATCH v7 6/14 USB: Chipidea: rename struct ci13xxx variables from udc to ci
Quoted 10 lines · Marc Kleine-Budde
Quoted 6 lines · Richard Zhao
struct ci13xxx represent the controller, which may be device or host, so name its variables as ci.
Signed-off-by Richard Zhao <[email protected]>Reviewed-by Felipe Balbi <[email protected]>Signed-off-by Alexander Shishkin <[email protected]>nitpick: search-replace problem
Quoted 7 lines
drivers/usb/chipidea/udc.c line 2
Quoted 6 lines
drivers/usb/chipidea/udc.c +1
-1@@ -1,5 +1,5 @@/* -* udc.c - ChipIdea UDC driver +* ci.c - ChipIdea UDC driver ^^^^
Nice catch!
Thanks
Richard
Quoted 19 lines
:)
drivers/usb/chipidea/udc.c static inline int hw_ep_bit(int num, int dir) · line 68
Quoted 7 lines
drivers/usb/chipidea/udc.c +0
-0* * Copyright (C) 2008 Chipidea - MIPS Technologies, Inc. All rights reserved. * @@ -66,11 +66,11 @@ static inline int hw_ep_bit(int num, int dir)return num + (dir ?16 :0 ); }Marc
Signature · 4 lines
Pengutronix e.K. | Marc Kleine-Budde | Industrial Linux Solutions | Phone: +49-231-2826-924 | Vertretung West/Dortmund | Fax: +49-5121-206917-5555 | Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
PATCH v7 7/14 USB: Chipidea: add unified ci13xxx_{add, remove}_device for platform drivers
In reply to Richard ZhaoPlatform drivers do the similar things to add/remove ci13xxx device, so create a unified one.
--- drivers/usb/chipidea/ci13xxx_msm.c | 34 ++++++---------------------- drivers/usb/chipidea/ci13xxx_pci.c | 34 +++++----------------------- drivers/usb/chipidea/core.c | 43 ++++++++++++++++++++++++++++++++++++ include/linux/usb/chipidea.h | 7 ++++++ 4 files changed, 63 insertions(+), 55 deletions(-)
drivers/usb/chipidea/ci13xxx_msm.c +7 -27
@@ -58,50 +58,30 @@ static struct ci13xxx_platform_data ci13xxx_msm_platdata = {static int __devinit ci13xxx_msm_probe (struct platform_device *pdev) {struct platform_device *plat_ci; -int ret;dev_dbg (&pdev->dev,"ci13xxx_msm_probe\n" ); - plat_ci =platform_device_alloc ("ci_hdrc" ,-1 ); -if (!plat_ci) { -dev_err (&pdev->dev,"can't allocate ci_hdrc platform device\n" ); -return -ENOMEM ; + plat_ci =ci13xxx_add_device (&pdev->dev, + pdev->resource, pdev->num_resources, + &ci13xxx_msm_platdata); +if (IS_ERR (plat_ci)) { +dev_err (&pdev->dev,"ci13xxx_add_device failed!\n" ); +return PTR_ERR (plat_ci); } - ret =platform_device_add_resources (plat_ci, pdev->resource, - pdev->num_resources); -if (ret) { -dev_err (&pdev->dev,"can't add resources to platform device\n" ); - goto put_platform; - } - - ret =platform_device_add_data (plat_ci, &ci13xxx_msm_platdata, -sizeof (ci13xxx_msm_platdata)); -if (ret) - goto put_platform; - - ret =platform_device_add (plat_ci); -if (ret) - goto put_platform; -platform_set_drvdata (pdev, plat_ci);pm_runtime_no_callbacks (&pdev->dev);pm_runtime_enable (&pdev->dev);return 0 ; - -put_platform: -platform_device_put (plat_ci); - -return ret; } static int __devexit ci13xxx_msm_remove(struct platform_device *pdev) {struct platform_device *plat_ci =platform_get_drvdata (pdev); -platform_device_unregister (plat_ci); +ci13xxx_remove_device (plat_ci);return 0 ; }
drivers/usb/chipidea/ci13xxx_pci.c +6 -28
@@ -75,13 +75,6 @@ static int __devinit ci13xxx_pci_probe(struct pci_dev *pdev,pci_set_master (pdev);pci_try_set_mwi (pdev); - plat_ci =platform_device_alloc ("ci_hdrc" ,-1 ); -if (!plat_ci) { -dev_err (&pdev->dev,"can't allocate ci_hdrc platform device\n" ); - retval = -ENOMEM ; - goto disable_device; - } -memset (res,0 ,sizeof (res)); res[0 ].start =pci_resource_start (pdev,0 ); res[0 ].end =pci_resource_end (pdev,0 );
@@ -89,32 +82,17 @@ static int __devinit ci13xxx_pci_probe(struct pci_dev *pdev, res[1 ].start = pdev->irq; res[1 ].flags =IORESOURCE_IRQ ; - retval =platform_device_add_resources (plat_ci, res, nres); -if (retval) { -dev_err (&pdev->dev,"can't add resources to platform device\n" ); - goto put_platform; + plat_ci =ci13xxx_add_device (&pdev->dev, res, nres, platdata); +if (IS_ERR (plat_ci)) { +dev_err (&pdev->dev,"ci13xxx_add_device failed!\n" ); + retval =PTR_ERR (plat_ci); + goto disable_device; } - retval =platform_device_add_data (plat_ci, platdata,sizeof (*platdata)); -if (retval) - goto put_platform; - -dma_set_coherent_mask (&plat_ci->dev, pdev->dev.coherent_dma_mask); - plat_ci->dev.dma_mask = pdev->dev.dma_mask; - plat_ci->dev.dma_parms = pdev->dev.dma_parms; - plat_ci->dev.parent = &pdev->dev; -pci_set_drvdata (pdev, plat_ci); - retval =platform_device_add (plat_ci); -if (retval) - goto put_platform; -return 0 ; - put_platform: -pci_set_drvdata (pdev,NULL ); -platform_device_put (plat_ci); disable_device:pci_disable_device (pdev); done:
@@ -133,7 +111,7 @@ static void __devexit ci13xxx_pci_remove(struct pci_dev *pdev) {struct platform_device *plat_ci =pci_get_drvdata (pdev); -platform_device_unregister (plat_ci); +ci13xxx_remove_device (plat_ci);pci_set_drvdata (pdev,NULL );pci_disable_device (pdev); }
drivers/usb/chipidea/core.c +43 -0
49 lines not on this page · raw message
include/linux/usb/chipidea.h +7 -0
@@ -25,4 +25,11 @@ struct ci13xxx_platform_data {/* Default offset of capability registers */ #define DEF_CAPOFFSET 0x100 +/* Add ci13xxx device */ +struct platform_device *ci13xxx_add_device (struct device *dev, +struct resource *res,int nres, +struct ci13xxx_platform_data *platdata); +/* Remove ci13xxx device */ +void ci13xxx_remove_device (struct platform_device *pdev); +#endif
Signature · 1 line
1.7.9.5
PATCH v7 8/14 USB: Chipidea: add ci13xxx device id management
In reply to Richard ZhaoWe use ida_simple_get and ida_simple_remove to manage the ids.
--- drivers/usb/chipidea/core.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-)
drivers/usb/chipidea/core.c +16 -5
@@ -56,6 +56,7 @@#include <linux/init.h> #include <linux/platform_device.h> #include <linux/module.h> +#include <linux/idr.h> #include <linux/interrupt.h> #include <linux/io.h> #include <linux/irq.h>
@@ -332,17 +333,24 @@ static irqreturn_t ci_irq(int irq, void *data)return ci->role ==CI_ROLE_END ? ret :ci_role (ci)->irq (ci); } +static DEFINE_IDA (ci_ida); +struct platform_device *ci13xxx_add_device (struct device *dev,struct resource *res,int nres,struct ci13xxx_platform_data *platdata) {struct platform_device *pdev; -int ret; +int id, ret; -/* FIXME: find a way to choose id */ - pdev =platform_device_alloc ("ci_hdrc" ,-1 ); -if (!pdev) -return ERR_PTR (-ENOMEM ); + id =ida_simple_get (&ci_ida,0 ,0 ,GFP_KERNEL ); +if (id <0 ) +return ERR_PTR (id); + + pdev =platform_device_alloc ("ci_hdrc" , id); +if (!pdev) { + ret = -ENOMEM ; + goto put_id; + } pdev->dev.parent = dev; pdev->dev.dma_mask = dev->dma_mask;
@@ -365,6 +373,8 @@ struct platform_device *ci13xxx_add_device(struct device *dev, err:platform_device_put (pdev); +put_id: +ida_simple_remove (&ci_ida, id);return ERR_PTR (ret); }EXPORT_SYMBOL_GPL (ci13xxx_add_device);
@@ -372,6 +382,7 @@ EXPORT_SYMBOL_GPL(ci13xxx_add_device);void ci13xxx_remove_device (struct platform_device *pdev) {platform_device_unregister (pdev); +ida_simple_remove (&ci_ida, pdev->id); }EXPORT_SYMBOL_GPL (ci13xxx_remove_device);
Signature · 1 line
1.7.9.5
PATCH v7 8/14 USB: Chipidea: add ci13xxx device id management
Quoted 5 lines · Richard Zhao
We use
ida_simple_getandida_simple_removeto manage the ids.Signed-off-by Richard Zhao <[email protected]>Reviewed-by Felipe Balbi <[email protected]>Signed-off-by Alexander Shishkin <[email protected]>
Removing the "ci13xxx_imx" module doesn't work as expected:
ci_hdrc ci_hdrc.0: remove, state 1
usb usb1: USB disconnect, device number 1ci_hdrc ci_hdrc.0: USB bus 1 deregistered
Unable to handle kernel NULL pointer dereference at virtual address 0000006c pgd = c6bb8000 [0000006c] *pgd=46a7e831, *pte=00000000, *ppte=00000000 Internal error: Oops: 17 [#1] PREEMPT ARM Modules linked in: ci13xxx_imx(-) ci_hdrc CPU: 0 Not tainted (3.5.0-rc4-00055-g35d73a8-dirty #80) PC is at ida_remove+0xa0/0x110 LR is at ida_simple_remove+0x30/0x60 pc : [<c0154294>] lr : [<c01544f4>] psr: a0000093
sp : c6be3ed0 ip : 80000000 fp : 0092f008
r10: d9a22647 r9 : c6be2000 r8 : 08421085
r7 : 00000001 r6 : 0000034b r5 : bf00a3a8 r4 : 00000000 r3 : c087d6b0 r2 : 001bb89f r1 : 6b6b6b6b r0 : 00000068
Flags: NzCv IRQs off FIQs on Mode SVC_32 ISA ARM Segment user
Control: 0005317f Table: 46bb8000 DAC: 00000015 Process rmmod (pid: 136, stack limit = 0xc6be2270)
Stack: (0xc6be3ed0 to 0xc6be4000)
3ec0: c6be2000 20000013 6b6b6b6b bf00a3a8
3ee0: c6be2000 c0009408 00000000 c01544f4 c6ad5430 c7865980 bf01562c bf01501c
3f00: bf015000 c7865988 bf01562c c018dad8 c018dac4 c018c5e0 bf01562c c7865988
3f20: c78659bc c018cdbc c6b78040 bf015680 bf01562c c0e670d0 0092f0b8 c018c438
3f40: bf015680 c6be2000 00000000 c004c56c c74ca308 33316963 5f787878 00786d69
3f60: 0092f008 c00a5088 c7812138 c6b5b388 00000000 c6b79860 c6b5b388 c0088648
3f80: 00000003 c6b79860 c6be2000 00088730 00002002 00000001 0092f088 be82fe5c
3fa0: 00000081 c0009260 00000001 0092f088 0092f0b8 00000800 b6eb865c be82fc00
3fc0: 00000001 0092f088 be82fe5c 00000081 0092f088 00000000 00000800 0092f008
3fe0: b6e7cbc0 be82fc04 b6ef65f8 b6e7cbcc 60000010 0092f0b8 00000000 00000000
[<c0154294>] (ida_remove+0xa0/0x110) from [<c01544f4>] (ida_simple_remove+0x30/0x60) [<c01544f4>] (ida_simple_remove+0x30/0x60) from [<bf01501c>] (ci13xxx_imx_remove+0x1c/0x84 [ci13xxx_imx]) [<bf01501c>] (ci13xxx_imx_remove+0x1c/0x84 [ci13xxx_imx]) from [<c018dad8>] (platform_drv_remove+0x14/0x18) [<c018dad8>] (platform_drv_remove+0x14/0x18) from [<c018c5e0>] (__device_release_driver+0x58/0xa8) [<c018c5e0>] (__device_release_driver+0x58/0xa8) from [<c018cdbc>] (driver_detach+0xcc/0xd8) [<c018cdbc>] (driver_detach+0xcc/0xd8) from [<c018c438>] (bus_remove_driver+0x7c/0xc0) [<c018c438>] (bus_remove_driver+0x7c/0xc0) from [<c004c56c>] (sys_delete_module+0x180/0x23c) [<c004c56c>] (sys_delete_module+0x180/0x23c) from [<c0009260>] (ret_fast_syscall+0x0/0x2c)
Code: e0416286 e5904004 e1a002c6 e0840100 (e5908004) ---[ end trace 7d882a2086a6a3d8 ]---
note: rmmod[136] exited with preempt_count 1
Marc
Signature · 12 lines
Pengutronix e.K. | Marc Kleine-Budde | Industrial Linux Solutions | Phone: +49-231-2826-924 | Vertretung West/Dortmund | Fax: +49-5121-206917-5555 | Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de | -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 262 bytes Desc: OpenPGP digital signature URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120625/163b7ba8/attachment.sig>
PATCH v7 8/14 USB: Chipidea: add ci13xxx device id management
Could you use my USB test branch?
Signature · 1 line
Sent from my Android phone with K-9 Mail. Please excuse my brevity.
Marc Kleine-Budde <[email protected]> wrote:
Quoted 5 lines · Richard Zhao
We use
ida_simple_getandida_simple_removeto manage the ids.Signed-off-by Richard Zhao <[email protected]>Reviewed-by Felipe Balbi <[email protected]>Signed-off-by Alexander Shishkin <[email protected]>
Removing the "ci13xxx_imx" module doesn't work as expected:
ci_hdrc ci_hdrc.0: remove, state 1
usb usb1: USB disconnect, device number 1ci_hdrc ci_hdrc.0: USB bus 1 deregistered
Unable to handle kernel NULL pointer dereference at virtual address 0000006c pgd = c6bb8000 [0000006c] *pgd=46a7e831, *pte=00000000, *ppte=00000000 Internal error: Oops: 17 [#1] PREEMPT ARM Modules linked in: ci13xxx_imx(-) ci_hdrc CPU: 0 Not tainted (3.5.0-rc4-00055-g35d73a8-dirty #80) PC is at ida_remove+0xa0/0x110 LR is at ida_simple_remove+0x30/0x60 pc : [<c0154294>] lr : [<c01544f4>] psr: a0000093
sp : c6be3ed0 ip : 80000000 fp : 0092f008
r10: d9a22647 r9 : c6be2000 r8 : 08421085
r7 : 00000001 r6 : 0000034b r5 : bf00a3a8 r4 : 00000000 r3 : c087d6b0 r2 : 001bb89f r1 : 6b6b6b6b r0 : 00000068
Flags: NzCv IRQs off FIQs on Mode SVC_32 ISA ARM Segment user
Control: 0005317f Table: 46bb8000 DAC: 00000015 Process rmmod (pid: 136, stack limit = 0xc6be2270)
Stack: (0xc6be3ed0 to 0xc6be4000)
3ec0: c6be2000 20000013 6b6b6b6b bf00a3a8
3ee0: c6be2000 c0009408 00000000 c01544f4 c6ad5430 c7865980 bf01562c bf01501c
3f00: bf015000 c7865988 bf01562c c018dad8 c018dac4 c018c5e0 bf01562c c7865988
3f20: c78659bc c018cdbc c6b78040 bf015680 bf01562c c0e670d0 0092f0b8 c018c438
3f40: bf015680 c6be2000 00000000 c004c56c c74ca308 33316963 5f787878 00786d69
3f60: 0092f008 c00a5088 c7812138 c6b5b388 00000000 c6b79860 c6b5b388 c0088648
3f80: 00000003 c6b79860 c6be2000 00088730 00002002 00000001 0092f088 be82fe5c
3fa0: 00000081 c0009260 00000001 0092f088 0092f0b8 00000800 b6eb865c be82fc00
3fc0: 00000001 0092f088 be82fe5c 00000081 0092f088 00000000 00000800 0092f008
3fe0: b6e7cbc0 be82fc04 b6ef65f8 b6e7cbcc 60000010 0092f0b8 00000000 00000000
[<c0154294>] (ida_remove+0xa0/0x110) from [<c01544f4>] (ida_simple_remove+0x30/0x60) [<c01544f4>] (ida_simple_remove+0x30/0x60) from [<bf01501c>] (ci13xxx_imx_remove+0x1c/0x84 [ci13xxx_imx]) [<bf01501c>] (ci13xxx_imx_remove+0x1c/0x84 [ci13xxx_imx]) from [<c018dad8>] (platform_drv_remove+0x14/0x18) [<c018dad8>] (platform_drv_remove+0x14/0x18) from [<c018c5e0>] (__device_release_driver+0x58/0xa8) [<c018c5e0>] (__device_release_driver+0x58/0xa8) from [<c018cdbc>] (driver_detach+0xcc/0xd8) [<c018cdbc>] (driver_detach+0xcc/0xd8) from [<c018c438>] (bus_remove_driver+0x7c/0xc0) [<c018c438>] (bus_remove_driver+0x7c/0xc0) from [<c004c56c>] (sys_delete_module+0x180/0x23c) [<c004c56c>] (sys_delete_module+0x180/0x23c) from [<c0009260>] (ret_fast_syscall+0x0/0x2c)
Code: e0416286 e5904004 e1a002c6 e0840100 (e5908004) ---[ end trace 7d882a2086a6a3d8 ]---
note: rmmod[136] exited with preempt_count 1
Marc
Signature · 8 lines
Pengutronix e.K. | Marc Kleine-Budde | Industrial Linux Solutions | Phone: +49-231-2826-924 | Vertretung West/Dortmund | Fax: +49-5121-206917-5555 | Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de | -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120625/8000a16f/attachment-0001.html>
PATCH v7 8/14 USB: Chipidea: add ci13xxx device id management
Quoted 1 line · Richard Zhao
Could you use my USB test branch?
Same result:
ci_hdrc ci_hdrc.0: remove, state 1
usb usb1: USB disconnect, device number 1ci_hdrc ci_hdrc.0: USB bus 1 deregistered
Unable to handle kernel NULL pointer dereference at virtual address 0000006c pgd = c6ba4000 [0000006c] *pgd=46a68831, *pte=00000000, *ppte=00000000 Internal error: Oops: 17 [#1] PREEMPT ARM Modules linked in: ci13xxx_imx(-) ci_hdrc imx_usbmisc CPU: 0 Not tainted (3.5.0-rc4-00058-g01710ef #85) PC is at ida_remove+0xa0/0x110 LR is at ida_simple_remove+0x30/0x60 pc : [<c0154294>] lr : [<c01544f4>] psr: a0000093
sp : c6b9fed0 ip : 80000000 fp : 0023f008
r10: d9a22647 r9 : c6b9e000 r8 : 08421085
r7 : 00000001 r6 : 0000034b r5 : bf00de34 r4 : 00000000 r3 : c6a7f0c0 r2 : 001bb89f r1 : 6b6b6b6b r0 : 00000068
Flags: NzCv IRQs off FIQs on Mode SVC_32 ISA ARM Segment user
Control: 0005317f Table: 46ba4000 DAC: 00000015 Process rmmod (pid: 142, stack limit = 0xc6b9e270)
Stack: (0xc6b9fed0 to 0xc6ba0000)
fec0: c6b9e000 20000013 6b6b6b6b bf00de34
fee0: c6b9e000 c0009408 00000000 c01544f4 c082a3b0 c7865980 bf019634 bf01901c
ff00: bf019000 c7865988 bf019634 c018dad8 c018dac4 c018c5e0 bf019634 c7865988
ff20: c78659bc c018cdbc c6a86360 bf019688 bf019634 c0e690d0 0023f0b8 c018c438
ff40: bf019688 c6b9e000 00000000 c004c56c c75352a8 33316963 5f787878 00786d69
ff60: 0023f008 c00a5088 c7812138 c6a4a388 00000000 c782c908 c6a4a388 c0088648
ff80: 00000003 c782c908 c6b9e000 00088730 00002002 00000001 0023f088 beea3e5c
ffa0: 00000081 c0009260 00000001 0023f088 0023f0b8 00000800 b6f4c65c beea3c00
ffc0: 00000001 0023f088 beea3e5c 00000081 0023f088 00000000 00000800 0023f008
ffe0: b6f10bc0 beea3c04 b6f8a5f8 b6f10bcc 60000010 0023f0b8 00000000 00000000
[<c0154294>] (ida_remove+0xa0/0x110) from [<c01544f4>] (ida_simple_remove+0x30/0x60) [<c01544f4>] (ida_simple_remove+0x30/0x60) from [<bf01901c>] (ci13xxx_imx_remove+0x1c/0x84 [ci13xxx_imx]) [<bf01901c>] (ci13xxx_imx_remove+0x1c/0x84 [ci13xxx_imx]) from [<c018dad8>] (platform_drv_remove+0x14/0x18) [<c018dad8>] (platform_drv_remove+0x14/0x18) from [<c018c5e0>] (__device_release_driver+0x58/0xa8) [<c018c5e0>] (__device_release_driver+0x58/0xa8) from [<c018cdbc>] (driver_detach+0xcc/0xd8) [<c018cdbc>] (driver_detach+0xcc/0xd8) from [<c018c438>] (bus_remove_driver+0x7c/0xc0) [<c018c438>] (bus_remove_driver+0x7c/0xc0) from [<c004c56c>] (sys_delete_module+0x180/0x23c) [<c004c56c>] (sys_delete_module+0x180/0x23c) from [<c0009260>] (ret_fast_syscall+0x0/0x2c)
Code: e0416286 e5904004 e1a002c6 e0840100 (e5908004) ---[ end trace 74ff20eb0c5179ff ]---
note: rmmod[142] exited with preempt_count 1
Segmentation fault
Marc
Signature · 12 lines
Pengutronix e.K. | Marc Kleine-Budde | Industrial Linux Solutions | Phone: +49-231-2826-924 | Vertretung West/Dortmund | Fax: +49-5121-206917-5555 | Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de | -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 262 bytes Desc: OpenPGP digital signature URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120625/3d4a6778/attachment.sig>
PATCH v7 8/14 USB: Chipidea: add ci13xxx device id management
Quoted 43 lines · Marc Kleine-Budde
Quoted 1 line · Richard Zhao
Could you use my USB test branch?
Same result:
ci_hdrcci_hdrc.0: remove, state 1
usb usb1: USB disconnect, device number 1ci_hdrcci_hdrc.0: USB bus 1 deregisteredUnable to handle kernel NULL pointer dereference at virtual address 0000006c pgd = c6ba4000 [0000006c] *pgd=46a68831, *pte=00000000, *ppte=00000000 Internal error: Oops: 17 [#1] PREEMPT ARM Modules linked in: ci13xxx_imx(-) ci_hdrc imx_usbmisc CPU: 0 Not tainted (3.5.0-rc4-00058-g01710ef #85) PC is at ida_remove+0xa0/0x110 LR is at ida_simple_remove+0x30/0x60 pc : [<c0154294>] lr : [<c01544f4>] psr: a0000093sp :
c6b9fed0ip : 80000000 fp :0023f008
r10:d9a22647r9 :c6b9e000r8 : 08421085
r7 : 00000001 r6 :0000034br5 :bf00de34r4 : 00000000 r3 :c6a7f0c0r2 :001bb89fr1 :6b6b6b6br0 : 00000068
Flags: NzCv IRQs off FIQs on ModeSVC_32ISA ARM Segment user
Control:0005317fTable:46ba4000DAC: 00000015 Process rmmod (pid: 142, stack limit =0xc6b9e270)Stack: (0xc6b9fed0 to 0xc6ba0000)fec0:
c6b9e000200000136b6b6b6bbf00de34
fee0:c6b9e000c000940800000000c01544f4c082a3b0c7865980bf019634bf01901c
ff00:bf019000c7865988bf019634c018dad8c018dac4c018c5e0bf019634c7865988
ff20:c78659bcc018cdbcc6a86360bf019688bf019634c0e690d00023f0b8c018c438
ff40:bf019688c6b9e00000000000c004c56cc75352a8333169635f78787800786d69
ff60:0023f008c00a5088c7812138c6a4a38800000000c782c908c6a4a388c0088648
ff80: 00000003c782c908c6b9e00000088730 00002002 000000010023f088beea3e5c
ffa0: 00000081c0009260000000010023f0880023f0b800000800b6f4c65cbeea3c00
ffc0: 000000010023f088beea3e5c000000810023f08800000000 000008000023f008
ffe0:b6f10bc0beea3c04b6f8a5f8b6f10bcc600000100023f0b800000000 00000000
[<c0154294>] (ida_remove+0xa0/0x110) from [<c01544f4>] (ida_simple_remove+0x30/0x60) [<c01544f4>] (ida_simple_remove+0x30/0x60) from [<bf01901c>] (ci13xxx_imx_remove+0x1c/0x84[ci13xxx_imx]) [<bf01901c>] (ci13xxx_imx_remove+0x1c/0x84[ci13xxx_imx]) from [<c018dad8>] (platform_drv_remove+0x14/0x18) [<c018dad8>] (platform_drv_remove+0x14/0x18) from [<c018c5e0>] (__device_release_driver+0x58/0xa8) [<c018c5e0>] (__device_release_driver+0x58/0xa8) from [<c018cdbc>] (driver_detach+0xcc/0xd8) [<c018cdbc>] (driver_detach+0xcc/0xd8) from [<c018c438>] (bus_remove_driver+0x7c/0xc0) [<c018c438>] (bus_remove_driver+0x7c/0xc0) from [<c004c56c>] (sys_delete_module+0x180/0x23c) [<c004c56c>] (sys_delete_module+0x180/0x23c) from [<c0009260>] (ret_fast_syscall+0x0/0x2c)
Quoted 4 lines
Code: e0416286 e5904004 e1a002c6 e0840100 (e5908004) ---[ end trace 74ff20eb0c5179ff ]---note: rmmod[142] exited with
preempt_count1
Segmentation fault
Sorry, I can not reproduce your issue. My defconfig is CONFIG_EXPERIMENTAL=y
# CONFIG_LOCALVERSION_AUTO is not set CONFIG_SYSVIPC=yCONFIG_POSIX_MQUEUE=y CONFIG_BSD_PROCESS_ACCT=yCONFIG_NO_HZ=yCONFIG_HIGH_RES_TIMERS=yCONFIG_IKCONFIG=yCONFIG_IKCONFIG_PROC=yCONFIG_CGROUPS=yCONFIG_CPUSETS=yCONFIG_NAMESPACES=y
# CONFIG_UTS_NS is not set
# CONFIG_IPC_NS is not set
# CONFIG_PID_NS is not set
# CONFIG_NET_NS is not setCONFIG_RELAY=yCONFIG_BLK_DEV_INITRD=yCONFIG_RD_BZIP2=yCONFIG_RD_LZMA=yCONFIG_RD_XZ=yCONFIG_RD_LZO=yCONFIG_CC_OPTIMIZE_FOR_SIZE=yCONFIG_EXPERT=yCONFIG_SYSCTL_SYSCALL=yCONFIG_KALLSYMS_ALL=y
# CONFIG_COMPAT_BRK is not setCONFIG_SLAB=yCONFIG_PROFILING=yCONFIG_OPROFILE=yCONFIG_MODULES=yCONFIG_MODULE_FORCE_LOAD=y CONFIG_MODULE_UNLOAD=y CONFIG_MODULE_FORCE_UNLOAD=y CONFIG_MODVERSIONS=y CONFIG_MODULE_SRCVERSION_ALL=y CONFIG_PARTITION_ADVANCED=yCONFIG_ARCH_MXC=y
# CONFIG_MACH_MX31ADS is not set
# CONFIG_MACH_BUG is not set CONFIG_SOC_IMX6Q=yCONFIG_MXC_PWM=yCONFIG_ARM_THUMBEE=y CONFIG_ARM_ERRATA_720789=yCONFIG_SMP=yCONFIG_SCHED_MC=yCONFIG_SCHED_SMT=yCONFIG_PREEMPT=yCONFIG_AEABI=yCONFIG_HIGHMEM=yCONFIG_COMPACTION=yCONFIG_KSM=y CONFIG_DEFAULT_MMAP_MIN_ADDR=32768 CONFIG_UACCESS_WITH_MEMCPY=yCONFIG_SECCOMP=yCONFIG_CC_STACKPROTECTOR=y CONFIG_ZBOOT_ROM_TEXT=0x0 CONFIG_ZBOOT_ROM_BSS=0x0 CONFIG_ARM_APPENDED_DTB=y CONFIG_ARM_ATAG_DTB_COMPAT=yCONFIG_KEXEC=yCONFIG_CRASH_DUMP=yCONFIG_CPU_IDLE=yCONFIG_VFP=yCONFIG_NEON=yCONFIG_BINFMT_AOUT=mCONFIG_BINFMT_MISC=mCONFIG_PM_RUNTIME=yCONFIG_PM_DEBUG=yCONFIG_PM_ADVANCED_DEBUG=yCONFIG_NET=yCONFIG_PACKET=yCONFIG_UNIX=yCONFIG_XFRM_USER=yCONFIG_NET_KEY=yCONFIG_NET_KEY_MIGRATE=yCONFIG_INET=yCONFIG_IP_MULTICAST=yCONFIG_IP_PNP=yCONFIG_IP_PNP_DHCP=yCONFIG_IP_PNP_BOOTP=yCONFIG_IP_PNP_RARP=yCONFIG_SYN_COOKIES=y
# CONFIG_INET_LRO is not setCONFIG_IPV6=yCONFIG_NETLABEL=yCONFIG_NETFILTER=yCONFIG_CAN=mCONFIG_BT=mCONFIG_BT_HCIUART=mCONFIG_BT_HCIUART_H4=y CONFIG_BT_HCIUART_BCSP=y CONFIG_BT_HCIUART_LL=yCONFIG_BT_HCIBCM203X=mCONFIG_BT_HCIBPA10X=mCONFIG_CFG80211=mCONFIG_WIRELESS_EXT_SYSFS=yCONFIG_MAC80211=mCONFIG_MAC80211_RC_PID=y CONFIG_MAC80211_RC_DEFAULT_PID=y CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" CONFIG_DEVTMPFS=yCONFIG_DEVTMPFS_MOUNT=yCONFIG_CMA=yCONFIG_CONNECTOR=yCONFIG_MTD=yCONFIG_MTD_CHAR=yCONFIG_MTD_BLOCK=yCONFIG_MTD_OOPS=yCONFIG_MTD_CFI=yCONFIG_MTD_CFI_INTELEXT=yCONFIG_MTD_M25P80=yCONFIG_MTD_SST25L=yCONFIG_MTD_NAND=yCONFIG_MTD_ONENAND=y CONFIG_MTD_ONENAND_VERIFY_WRITE=y CONFIG_MTD_UBI=mCONFIG_PROC_DEVICETREE=y CONFIG_BLK_DEV_LOOP=yCONFIG_BLK_DEV_RAM=y CONFIG_BLK_DEV_RAM_SIZE=65536 CONFIG_BLK_DEV_SD=yCONFIG_SCSI_MULTI_LUN=y CONFIG_SCSI_SCAN_ASYNC=yCONFIG_ATA=y
# CONFIG_SATA_PMP is not set CONFIG_SATA_AHCI_PLATFORM=yCONFIG_PATA_IMX=mCONFIG_PATA_PLATFORM=m CONFIG_PATA_OF_PLATFORM=mCONFIG_MD=yCONFIG_BLK_DEV_DM=yCONFIG_NETDEVICES=y
# CONFIG_NET_VENDOR_BROADCOM is not set
# CONFIG_NET_VENDOR_CHELSIO is not set
# CONFIG_NET_VENDOR_FARADAY is not set
# CONFIG_NET_VENDOR_INTEL is not set
# CONFIG_NET_VENDOR_MARVELL is not set
# CONFIG_NET_VENDOR_MICREL is not set
# CONFIG_NET_VENDOR_MICROCHIP is not set
# CONFIG_NET_VENDOR_NATSEMI is not set
# CONFIG_NET_VENDOR_SEEQ is not set
# CONFIG_NET_VENDOR_SMSC is not set
# CONFIG_NET_VENDOR_STMICRO is not set CONFIG_SMSC_PHY=yCONFIG_USB_USBNET=yCONFIG_USB_NET_SMSC95XX=y CONFIG_USB_ALI_M5632=yCONFIG_USB_AN2720=yCONFIG_USB_EPSON2888=yCONFIG_USB_KC2190=y CONFIG_LIBERTAS_THINFIRM=m CONFIG_LIBERTAS_THINFIRM_USB=m CONFIG_AT76C50X_USB=mCONFIG_USB_ZD1201=m CONFIG_USB_NET_RNDIS_WLAN=mCONFIG_RTL8187=mCONFIG_MAC80211_HWSIM=mCONFIG_ATH_COMMON=mCONFIG_CARL9170=mCONFIG_B43=mCONFIG_B43_PHY_N=yCONFIG_B43LEGACY=mCONFIG_HOSTAP=yCONFIG_HOSTAP_FIRMWARE=y CONFIG_HOSTAP_FIRMWARE_NVRAM=y CONFIG_LIBERTAS=mCONFIG_LIBERTAS_USB=mCONFIG_LIBERTAS_SDIO=mCONFIG_LIBERTAS_SPI=mCONFIG_P54_COMMON=mCONFIG_P54_USB=mCONFIG_P54_SPI=mCONFIG_RT2X00=mCONFIG_RT2500USB=mCONFIG_RT73USB=mCONFIG_RT2800USB=mCONFIG_RT2800USB_RT53XX=y CONFIG_RT2800USB_UNKNOWN=yCONFIG_RTL8192CU=mCONFIG_ZD1211RW=mCONFIG_MWIFIEX=mCONFIG_MWIFIEX_SDIO=mCONFIG_INPUT_MOUSEDEV=mCONFIG_INPUT_JOYDEV=yCONFIG_INPUT_EVDEV=yCONFIG_KEYBOARD_GPIO=yCONFIG_MOUSE_PS2=mCONFIG_INPUT_TOUCHSCREEN=y CONFIG_INPUT_MISC=yCONFIG_INPUT_UINPUT=y CONFIG_VT_HW_CONSOLE_BINDING=y
# CONFIG_LEGACY_PTYS is not set
# CONFIG_DEVKMEM is not set CONFIG_SERIAL_8250=m CONFIG_SERIAL_8250_NR_UARTS=32 CONFIG_SERIAL_8250_EXTENDED=y CONFIG_SERIAL_8250_MANY_PORTS=y CONFIG_SERIAL_8250_SHARE_IRQ=y CONFIG_SERIAL_8250_DETECT_IRQ=y CONFIG_SERIAL_8250_RSA=yCONFIG_SERIAL_IMX=y CONFIG_SERIAL_IMX_CONSOLE=yCONFIG_I2C=yCONFIG_I2C_CHARDEV=yCONFIG_I2C_MUX=mCONFIG_I2C_MUX_GPIO=m CONFIG_I2C_MUX_PCA9541=m CONFIG_I2C_MUX_PCA954x=m CONFIG_I2C_DESIGNWARE_PLATFORM=m CONFIG_I2C_GPIO=mCONFIG_I2C_IMX=yCONFIG_I2C_OCORES=mCONFIG_I2C_PCA_PLATFORM=mCONFIG_I2C_SIMTEC=mCONFIG_I2C_XILINX=mCONFIG_I2C_DIOLAN_U2C=m CONFIG_I2C_PARPORT_LIGHT=m CONFIG_I2C_TAOS_EVM=mCONFIG_I2C_TINY_USB=mCONFIG_I2C_STUB=mCONFIG_SPI=yCONFIG_SPI_ALTERA=mCONFIG_SPI_GPIO=mCONFIG_SPI_IMX=yCONFIG_SPI_OC_TINY=mCONFIG_SPI_XILINX=mCONFIG_SPI_DESIGNWARE=mCONFIG_SPI_DW_MMIO=mCONFIG_SPI_SPIDEV=mCONFIG_SPI_TLE62X0=mCONFIG_DEBUG_GPIO=yCONFIG_GPIO_SYSFS=yCONFIG_W1=yCONFIG_W1_MASTER_MXC=yCONFIG_POWER_SUPPLY=yCONFIG_HWMON=mCONFIG_THERMAL=yCONFIG_WATCHDOG=yCONFIG_MFD_ANATOP=yCONFIG_REGULATOR=y CONFIG_REGULATOR_FIXED_VOLTAGE=y CONFIG_REGULATOR_VIRTUAL_CONSUMER=y CONFIG_REGULATOR_GPIO=y CONFIG_REGULATOR_ANATOP=y CONFIG_MEDIA_SUPPORT=yCONFIG_VIDEO_DEV=yCONFIG_RC_CORE=mCONFIG_RC_ATI_REMOTE=mCONFIG_IR_IMON=mCONFIG_IR_MCEUSB=mCONFIG_IR_REDRAT3=mCONFIG_IR_STREAMZAP=mCONFIG_RC_LOOPBACK=mCONFIG_USB_VIDEO_CLASS=mCONFIG_FB=yCONFIG_FB_MODE_HELPERS=y CONFIG_BACKLIGHT_LCD_SUPPORT=y CONFIG_LCD_CLASS_DEVICE=y CONFIG_BACKLIGHT_CLASS_DEVICE=y CONFIG_BACKLIGHT_PWM=y CONFIG_FRAMEBUFFER_CONSOLE=yCONFIG_SOUND=yCONFIG_SND=yCONFIG_SND_MIXER_OSS=mCONFIG_SND_PCM_OSS=m CONFIG_SND_VERBOSE_PRINTK=y CONFIG_SND_DEBUG=y
# CONFIG_SND_DRIVERS is not set
# CONFIG_SND_ARM is not set
# CONFIG_SND_SPI is not set
# CONFIG_SND_USB is not setCONFIG_SND_SOC=yCONFIG_SND_IMX_SOC=y CONFIG_SND_SOC_IMX_SGTL5000=y
# CONFIG_USB_HID is not setCONFIG_USB=yCONFIG_USB_DEBUG=yCONFIG_USB_MON=y
# CONFIG_USB_EHCI_TT_NEWSCHED is not set CONFIG_USB_CHIPIDEA=m CONFIG_USB_CHIPIDEA_HOST=y CONFIG_USB_CHIPIDEA_DEBUG=y CONFIG_USB_STORAGE=yCONFIG_USB_LIBUSUAL=yCONFIG_USB_GADGET=yCONFIG_USB_MXS_PHY=yCONFIG_MMC=yCONFIG_SDIO_UART=yCONFIG_MMC_SDHCI=yCONFIG_MMC_SDHCI_PLTFM=y CONFIG_MMC_SDHCI_ESDHC_IMX=yCONFIG_MMC_MXC=yCONFIG_LEDS_CLASS=yCONFIG_LEDS_GPIO=yCONFIG_LEDS_PWM=mCONFIG_LEDS_REGULATOR=m CONFIG_LEDS_TRIGGER_TIMER=m CONFIG_LEDS_TRIGGER_HEARTBEAT=y CONFIG_LEDS_TRIGGER_BACKLIGHT=m CONFIG_LEDS_TRIGGER_GPIO=m CONFIG_LEDS_TRIGGER_DEFAULT_ON=m CONFIG_RTC_CLASS=yCONFIG_DMADEVICES=yCONFIG_IMX_SDMA=yCONFIG_COMMON_CLK_DEBUG=yCONFIG_PM_DEVFREQ=y CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND=y CONFIG_DEVFREQ_GOV_PERFORMANCE=y CONFIG_DEVFREQ_GOV_POWERSAVE=y CONFIG_DEVFREQ_GOV_USERSPACE=y CONFIG_EXT2_FS=yCONFIG_EXT3_FS=yCONFIG_EXT4_FS=yCONFIG_BTRFS_FS=yCONFIG_ISO9660_FS=mCONFIG_JOLIET=yCONFIG_ZISOFS=yCONFIG_MSDOS_FS=yCONFIG_VFAT_FS=yCONFIG_TMPFS=yCONFIG_TMPFS_POSIX_ACL=yCONFIG_JFFS2_FS=mCONFIG_JFFS2_SUMMARY=y CONFIG_JFFS2_FS_XATTR=y CONFIG_JFFS2_COMPRESSION_OPTIONS=y CONFIG_JFFS2_LZO=yCONFIG_JFFS2_RUBIN=yCONFIG_UBIFS_FS=mCONFIG_CRAMFS=yCONFIG_NFS_FS=yCONFIG_NFS_V3_ACL=yCONFIG_NFS_V4=yCONFIG_ROOT_NFS=yCONFIG_NLS_CODEPAGE_437=y CONFIG_NLS_ISO8859_1=yCONFIG_PRINTK_TIME=yCONFIG_MAGIC_SYSRQ=y CONFIG_DETECT_HUNG_TASK=yCONFIG_SCHEDSTATS=yCONFIG_TIMER_STATS=yCONFIG_DEBUG_INFO=y CONFIG_DEBUG_MEMORY_INIT=y CONFIG_FUNCTION_TRACER=y CONFIG_STRICT_DEVMEM=yCONFIG_DEBUG_USER=yCONFIG_DEBUG_LL=yCONFIG_EARLY_PRINTK=yCONFIG_SECURITY=yCONFIG_LSM_MMAP_MIN_ADDR=0 CONFIG_SECURITY_SELINUX=y CONFIG_SECURITY_SMACK=y CONFIG_SECURITY_APPARMOR=y CONFIG_DEFAULT_SECURITY_APPARMOR=y CONFIG_CRYPTO_CBC=mCONFIG_CRYPTO_SHA256=m CONFIG_CRYPTO_BLOWFISH=m CONFIG_CRYPTO_SERPENT=m CONFIG_CRYPTO_TWOFISH=m CONFIG_CRYPTO_DEFLATE=yCONFIG_CRYPTO_LZO=y
# CONFIG_CRYPTO_ANSI_CPRNG is not set CONFIG_CRC_CCITT=yCONFIG_CRC_T10DIF=yCONFIG_CRC_ITU_T=yCONFIG_CRC7=y
Thanks
Richard
Quoted 9 lines
Marc
Signature · 4 lines
Pengutronix e.K. | Marc Kleine-Budde | Industrial Linux Solutions | Phone: +49-231-2826-924 | Vertretung West/Dortmund | Fax: +49-5121-206917-5555 | Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
PATCH v7 8/14 USB: Chipidea: add ci13xxx device id management
Dear Richard Zhao,
Quoted 6 lines · Marc Kleine-Budde
Quoted 5 lines · Richard Zhao
Quoted 1 line
Could you use my USB test branch?
Same result:
Quoted 9 lines
Quoted 9 lines
ci_hdrcci_hdrc.0: remove, state 1
usb usb1: USB disconnect, device number 1ci_hdrcci_hdrc.0: USB bus 1 deregisteredUnable to handle kernel NULL pointer dereference at virtual address 0000006c pgd = c6ba4000 [0000006c] *pgd=46a68831, *pte=00000000, *ppte=00000000 Internal error: Oops: 17 [#1] PREEMPT ARM Modules linked in: ci13xxx_imx(-) ci_hdrc imx_usbmisc CPU: 0 Not tainted (3.5.0-rc4-00058-g01710ef #85)
Dumb question -- you use the same base revision of kernel, right?
Quoted 5 lines
Thanks
RichardQuoted 1 line
Marc
Best regards,
Marek Vasut
PATCH v7 8/14 USB: Chipidea: add ci13xxx device id management
Quoted 18 lines · Marek Vasut
Dear Richard Zhao,
Quoted 6 lines · Marc Kleine-Budde
Quoted 5 lines · Richard Zhao
Quoted 1 line
Could you use my USB test branch?
Same result:
Quoted 9 lines
Quoted 9 lines
ci_hdrcci_hdrc.0: remove, state 1
usb usb1: USB disconnect, device number 1ci_hdrcci_hdrc.0: USB bus 1 deregisteredUnable to handle kernel NULL pointer dereference at virtual address 0000006c pgd = c6ba4000 [0000006c] *pgd=46a68831, *pte=00000000, *ppte=00000000 Internal error: Oops: 17 [#1] PREEMPT ARM Modules linked in: ci13xxx_imx(-) ci_hdrc imx_usbmisc CPU: 0 Not tainted (3.5.0-rc4-00058-g01710ef #85)
Quoted 1 line
Dumb question -- you use the same base revision of kernel, right?
Yes, I used v3.5-rc4 as baseline, add some mx28 specific patches (nand, etc...), then I merged in Richard's use tree. In the above oops, as the asked, the USB test branch.
In original oops I used
https://github.com/riczhao/kernel-imx/commits/topics/usb-driver
Maybe it's some other part of the system that confuses the ida_* stuff.
Marc
Signature · 12 lines
Pengutronix e.K. | Marc Kleine-Budde | Industrial Linux Solutions | Phone: +49-231-2826-924 | Vertretung West/Dortmund | Fax: +49-5121-206917-5555 | Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de | -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 262 bytes Desc: OpenPGP digital signature URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120627/9bbf9825/attachment.sig>
PATCH v7 9/14 usb: chipidea: select USB_EHCI_ROOT_HUB_TT in USB_CHIPIDEA_HOST of Kconfig
In reply to Richard Zhaoci13xxx host needs Root Hub Transaction Translators.
--- drivers/usb/chipidea/Kconfig | 1 + 1 file changed, 1 insertion(+)
drivers/usb/chipidea/Kconfig +1 -0
@@ -20,6 +20,7 @@ config USB_CHIPIDEA_UDC config USB_CHIPIDEA_HOST bool "ChipIdea host controller" + select USB_EHCI_ROOT_HUB_TT help Say Y here to enable host controller functionality of the ChipIdea driver.
Signature · 1 line
1.7.9.5
PATCH v7 9/14 usb: chipidea: select USB_EHCI_ROOT_HUB_TT in USB_CHIPIDEA_HOST of Kconfig
Dear Richard Zhao,
Quoted 6 lines
ci13xxx host needs Root Hub Transaction Translators.
Reported-by Shawn Guo <[email protected]>Signed-off-by Richard Zhao <[email protected]>Acked-by Felipe Balbi <[email protected]>Signed-off-by Alexander Shishkin <[email protected]>
Quoted 9 lines
--- drivers/usb/chipidea/Kconfig | 1 + 1 file changed, 1 insertion(+)drivers/usb/chipidea/Kconfig +0
-0
drivers/usb/chipidea/Kconfig config USB_CHIPIDEA_UDC · line 26
Quoted 7 lines
drivers/usb/chipidea/Kconfig +1
-0@@ -20,6 +20,7 @@ config USB_CHIPIDEA_UDC config USB_CHIPIDEA_HOST bool "ChipIdea host controller" + select USB_EHCI_ROOT_HUB_TT help Say Y here to enable host controller functionality of the ChipIdea driver.
Best regards,
Marek Vasut
PATCH v7 10/14 usb: otg: add notify_connect/notify_disconnect callback
In reply to Richard ZhaoThis let usb phy driver has a chance to change hw settings when connect status change.
--- include/linux/usb/otg.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+)
include/linux/usb/otg.h +21 -0
@@ -117,6 +117,9 @@ struct usb_phy {int (*set_suspend)(struct usb_phy *x,int suspend); +/* notify phy connect status change */ +int (*notify_connect)(struct usb_phy *x,int port); +int (*notify_disconnect)(struct usb_phy *x,int port); };
@@ -252,6 +255,24 @@ usb_phy_set_suspend(struct usb_phy *x, int suspend) }static inline int +usb_phy_notify_connect (struct usb_phy *x,int port) +{ +if (x->notify_connect) +return x->notify_connect (x, port); +else +return 0 ; +} + +static inline int +usb_phy_notify_disconnect (struct usb_phy *x,int port) +{ +if (x->notify_disconnect) +return x->notify_disconnect (x, port); +else +return 0 ; +} + +static inline int otg_start_srp (struct usb_otg *otg) {if (otg && otg->start_srp)
Signature · 1 line
1.7.9.5
PATCH v7 11/14 USB: notify phy when root hub port connect change
In reply to Richard ZhaoPhy may need to change settings when port connect change.
--- drivers/usb/core/hub.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/usb/core/hub.c +8 -0
@@ -20,6 +20,7 @@#include <linux/usb.h> #include <linux/usbdevice_fs.h> #include <linux/usb/hcd.h> +#include <linux/usb/otg.h> #include <linux/usb/quirks.h> #include <linux/kthread.h> #include <linux/mutex.h>
@@ -4034,6 +4035,13 @@ static void hub_port_connect_change(struct usb_hub *hub, int port1, } } +if (unlikely (hcd->phy && !hdev->parent)) { +if (portstatus &USB_PORT_STAT_CONNECTION ) +usb_phy_notify_connect (hcd->phy, port1); +else +usb_phy_notify_disconnect (hcd->phy, port1); + } +/* Return now if debouncing failed or nothing is connected or * the device was "removed". */
Signature · 1 line
1.7.9.5
PATCH v7 12/14 usb: chipidea: permit driver bindings pass phy pointer
In reply to Richard ZhaoSometimes, the driver bindings may know what phy they use. For example, when using device tree, the usb controller may have a phandler pointing to usb phy.
--- drivers/usb/chipidea/ci.h | 2 ++ drivers/usb/chipidea/core.c | 4 ++++ drivers/usb/chipidea/host.c | 1 + drivers/usb/chipidea/udc.c | 11 +++++++---- include/linux/usb/chipidea.h | 3 +++ 5 files changed, 17 insertions(+), 4 deletions(-)
drivers/usb/chipidea/ci.h +2 -0
@@ -160,6 +160,8 @@ struct ci13xxx {struct ci13xxx_platform_data *platdata;int vbus_active; +/* FIXME: some day, we'll not use global phy */ +bool global_phy;struct usb_phy *transceiver;struct usb_hcd *hcd; };
drivers/usb/chipidea/core.c +4 -0
@@ -419,6 +419,10 @@ static int __devinit ci_hdrc_probe(struct platform_device *pdev) ci->dev = dev; ci->platdata = dev->platform_data; +if (ci->platdata->phy) + ci->transceiver = ci->platdata->phy; +else + ci->global_phy = true; ret =hw_device_init (ci, base);if (ret <0 ) {
drivers/usb/chipidea/host.c +1 -0
@@ -117,6 +117,7 @@ static int host_start(struct ci13xxx *ci) hcd->has_tt =1 ; hcd->power_budget = ci->platdata->power_budget; + hcd->phy = ci->transceiver; ehci =hcd_to_ehci (hcd); ehci->caps = ci->hw_bank.cap;
drivers/usb/chipidea/udc.c +7 -4
@@ -1684,7 +1684,8 @@ static int udc_start(struct ci13xxx *ci) ci->gadget.ep0 = &ci->ep0in->ep; - ci->transceiver =usb_get_transceiver (); +if (ci->global_phy) + ci->transceiver =usb_get_transceiver ();if (ci->platdata->flags &CI13XXX_REQUIRE_TRANSCEIVER ) {if (ci->transceiver ==NULL ) {
@@ -1728,7 +1729,8 @@ static int udc_start(struct ci13xxx *ci) remove_trans:if (ci->transceiver) {otg_set_peripheral (ci->transceiver->otg, &ci->gadget); -usb_put_transceiver (ci->transceiver); +if (ci->global_phy) +usb_put_transceiver (ci->transceiver); }dev_err (dev,"error = %i\n" , retval);
@@ -1737,7 +1739,7 @@ remove_dbg: unreg_device:device_unregister (&ci->gadget.dev); put_transceiver: -if (ci->transceiver) +if (ci->transceiver && ci->global_phy)usb_put_transceiver (ci->transceiver); free_pools:dma_pool_destroy (ci->td_pool);
@@ -1771,7 +1773,8 @@ static void udc_stop(struct ci13xxx *ci)if (ci->transceiver) {otg_set_peripheral (ci->transceiver->otg,NULL ); -usb_put_transceiver (ci->transceiver); +if (ci->global_phy) +usb_put_transceiver (ci->transceiver); }dbg_remove_files (&ci->gadget.dev);device_unregister (&ci->gadget.dev);
include/linux/usb/chipidea.h +3 -0
@@ -5,12 +5,15 @@ #ifndef __LINUX_USB_CHIPIDEA_H #define __LINUX_USB_CHIPIDEA_H +#include <linux/usb/otg.h> + struct ci13xxx; struct ci13xxx_platform_data { const char *name; /* offset of the capability registers */ uintptr_t capoffset; unsigned power_budget; + struct usb_phy *phy; unsigned long flags; #define CI13XXX_REGS_SHARED BIT(0) #define CI13XXX_REQUIRE_TRANSCEIVER BIT(1)
Signature · 1 line
1.7.9.5
PATCH v7 13/14 usb: otg: add basic mxs phy driver support
In reply to Richard Zhaomxs phy is used in Freescale i.MX SoCs, for example imx23, imx28, imx6Q. This patch adds the basic host support.
--- Documentation/devicetree/bindings/usb/mxs-phy.txt | 13 ++ drivers/usb/otg/Kconfig | 9 + drivers/usb/otg/Makefile | 1 + drivers/usb/otg/mxs-phy.c | 197 +++++++++++++++++++++ 4 files changed, 220 insertions(+) create mode 100644 Documentation/devicetree/bindings/usb/mxs-phy.txt create mode 100644 drivers/usb/otg/mxs-phy.c
Documentation/devicetree/bindings/usb/mxs-phy.txt new file +13 -0
@@ -0,0 +1,13 @@ +* Freescale MXS USB Phy Device + +Required properties: +- compatible: Should be "fsl,imx23-usbphy" +- reg: Should contain registers location and length +- interrupts: Should contain phy interrupt + +Example: +usbphy1: usbphy at 020c9000 { + compatible = "fsl,imx6q-usbphy", "fsl,imx23-usbphy"; + reg = <0x020c9000 0x1000>; + interrupts = <0 44 0x04>; +};
drivers/usb/otg/Kconfig +9 -0
@@ -116,6 +116,15 @@ config FSL_USB2_OTG help Enable this to support Freescale USB OTG transceiver. +config USB_MXS_PHY + tristate "Freescale MXS USB PHY support" + select STMP_DEVICE + select USB_OTG_UTILS + help + Enable this to support the Freescale MXS USB PHY. + + MXS Phy is used by some of the i.MX SoCs, for example imx23/28/6x. + config USB_MV_OTG tristate "Marvell USB OTG support" depends on USB_EHCI_MV && USB_MV_UDC && USB_SUSPEND
drivers/usb/otg/Makefile +1 -0
@@ -20,4 +20,5 @@ obj-$(CONFIG_USB_MSM_OTG) += msm_otg.o obj-$(CONFIG_AB8500_USB) += ab8500-usb.o fsl_usb2_otg-objs := fsl_otg.o otg_fsm.o obj-$(CONFIG_FSL_USB2_OTG) += fsl_usb2_otg.o +obj-$(CONFIG_USB_MXS_PHY) += mxs-phy.o obj-$(CONFIG_USB_MV_OTG) += mv_otg.o
drivers/usb/otg/mxs-phy.c new file +197 -0
197 lines not on this page · raw message
Signature · 1 line
1.7.9.5
PATCH v7 13/14 usb: otg: add basic mxs phy driver support
Quoted 150 lines · Richard Zhao
mxs phy is used in Freescale i.MX SoCs, for example imx23, imx28, imx6Q. This patch adds the basic host support.
Signed-off-by Richard Zhao <[email protected]>Signed-off-by Marek Vasut <[email protected]>Cc Peter Chen <[email protected]>Acked-by Felipe Balbi <[email protected]>Tested-by Subodh Nijsure <[email protected]>--- Documentation/devicetree/bindings/usb/mxs-phy.txt | 13 ++ drivers/usb/otg/Kconfig | 9 + drivers/usb/otg/Makefile | 1 + drivers/usb/otg/mxs-phy.c | 197 +++++++++++++++++++++ 4 files changed, 220 insertions(+) create mode 100644 Documentation/devicetree/bindings/usb/mxs-phy.txt create mode 100644 drivers/usb/otg/mxs-phy.cDocumentation/devicetree/bindings/usb/mxs-phy.txt new file +13
-0@@ -0,0 +1,13 @@ +* Freescale MXS USB Phy Device + +Required properties: +- compatible: Should be "fsl,imx23-usbphy" +- reg: Should contain registers location and length +- interrupts: Should contain phy interrupt + +Example: +usbphy1: usbphy at 020c9000 { + compatible = "fsl,imx6q-usbphy", "fsl,imx23-usbphy"; + reg = <0x020c9000 0x1000>; + interrupts = <0 44 0x04>; +};drivers/usb/otg/Kconfig +9
-0@@ -116,6 +116,15 @@ config FSL_USB2_OTG help Enable this to support Freescale USB OTG transceiver. +config USB_MXS_PHY + tristate "Freescale MXS USB PHY support" + select STMP_DEVICE + select USB_OTG_UTILS + help + Enable this to support the Freescale MXS USB PHY. + + MXS Phy is used by some of the i.MX SoCs, for example imx23/28/6x. + config USB_MV_OTG tristate "Marvell USB OTG support" depends on USB_EHCI_MV && USB_MV_UDC && USB_SUSPENDdrivers/usb/otg/Makefile +1
-0@@ -20,4 +20,5 @@ obj-$(CONFIG_USB_MSM_OTG) += msm_otg.o obj-$(CONFIG_AB8500_USB) += ab8500-usb.o fsl_usb2_otg-objs := fsl_otg.o otg_fsm.o obj-$(CONFIG_FSL_USB2_OTG) += fsl_usb2_otg.o +obj-$(CONFIG_USB_MXS_PHY) += mxs-phy.o obj-$(CONFIG_USB_MV_OTG) += mv_otg.odrivers/usb/otg/mxs-phy.c new file +77
-0@@ -0,0 +1,197 @@ +/* +* Copyright 2012 Freescale Semiconductor, Inc. +* Copyright (C) 2012 Marek Vasut <[email protected]> +* on behalf of DENX Software Engineering GmbH +* +* The code contained herein is licensed under the GNU General Public +* License. You may obtain a copy of the GNU General Public License +* Version 2 or later at the following locations: +* +* http://www.opensource.org/licenses/gpl-license.html +* http://www.gnu.org/copyleft/gpl.html +*/ + +#include <linux/module.h> +#include <linux/kernel.h> +#include <linux/platform_device.h> +#include <linux/clk.h> +#include <linux/usb/otg.h> +#include <linux/stmp_device.h> +#include <linux/delay.h> +#include <linux/err.h> +#include <linux/io.h> + +#define DRIVER_NAME "mxs_phy" + +#define HW_USBPHY_PWD 0x00 +#define HW_USBPHY_CTRL 0x30 +#define HW_USBPHY_CTRL_SET 0x34 +#define HW_USBPHY_CTRL_CLR 0x38 + +#define BM_USBPHY_CTRL_SFTRST BIT(31) +#define BM_USBPHY_CTRL_CLKGATE BIT(30) +#define BM_USBPHY_CTRL_ENUTMILEVEL3 BIT(15) +#define BM_USBPHY_CTRL_ENUTMILEVEL2 BIT(14) +#define BM_USBPHY_CTRL_ENHOSTDISCONDETECT BIT(1) + +struct mxs_phy { +struct usb_phy phy; +struct clk *clk; +int connected:1 ; +}; + +#define to_mxs_phy (p) container_of((p), struct mxs_phy, phy) + +static void mxs_phy_hw_init (struct mxs_phy *mxs_phy) +{ +void __iomem *base = mxs_phy->phy.io_priv; + +stmp_reset_block (base +HW_USBPHY_CTRL ); + +/* Power up the PHY */ +writel_relaxed (0 , base +HW_USBPHY_PWD ); + +/* enable FS/LS device */ +writel_relaxed (BM_USBPHY_CTRL_ENUTMILEVEL2 | +BM_USBPHY_CTRL_ENUTMILEVEL3 , + base +HW_USBPHY_CTRL_SET ); +} + +static int mxs_phy_init (struct usb_phy *phy) +{ +struct mxs_phy *mxs_phy =to_mxs_phy (phy); + +clk_prepare_enable (mxs_phy->clk); +mxs_phy_hw_init (mxs_phy); + +return 0 ; +} + +static void mxs_phy_shutdown (struct usb_phy *phy) +{ +struct mxs_phy *mxs_phy =to_mxs_phy (phy); + +writel_relaxed (BM_USBPHY_CTRL_CLKGATE , + phy->io_priv +HW_USBPHY_CTRL_SET ); + +clk_disable_unprepare (mxs_phy->clk);
drivers/usb/otg/mxs-phy.c line 87
Quoted 10 lines
drivers/usb/otg/mxs-phy.c new file +10
-0+} + +static int mxs_phy_on_connect (struct usb_phy *phy,int port) +{ +struct mxs_phy *mxs_phy =to_mxs_phy (phy); + +dev_dbg (phy->dev,"Connect on port %d\n" , port); + +if (mxs_phy->connected) +return 0 ;
I'll have to remove all connected checking. When hcd driver is removed, it won't call notify_disconnect. It corrupt the "connected" state. so I have to remove the checking.
Thanks
Richard
Quoted 113 lines
drivers/usb/otg/mxs-phy.c new file +110
-0+mxs_phy_hw_init (to_mxs_phy (phy)); +writel_relaxed (BM_USBPHY_CTRL_ENHOSTDISCONDETECT , + phy->io_priv +HW_USBPHY_CTRL_SET ); + mxs_phy->connected =1 ; + +return 0 ; +} + +static int mxs_phy_on_disconnect (struct usb_phy *phy,int port) +{ +struct mxs_phy *mxs_phy =to_mxs_phy (phy); + +dev_dbg (phy->dev,"Disconnect on port %d\n" , port); + +if (!mxs_phy->connected) +return 0 ; +writel_relaxed (BM_USBPHY_CTRL_ENHOSTDISCONDETECT , + phy->io_priv +HW_USBPHY_CTRL_CLR ); + mxs_phy->connected =0 ; + +return 0 ; +} + +static int mxs_phy_probe (struct platform_device *pdev) +{ +struct resource *res; +void __iomem *base; +struct clk *clk; +struct mxs_phy *mxs_phy; + + res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); +if (!res) { +dev_err (&pdev->dev,"can't get device resources\n" ); +return -ENOENT ; + } + + base =devm_request_and_ioremap (&pdev->dev, res); +if (!base) +return -EBUSY ; + + clk =devm_clk_get (&pdev->dev,NULL ); +if (IS_ERR (clk)) { +dev_err (&pdev->dev, +"can't get the clock, err=%ld" ,PTR_ERR (clk)); +return PTR_ERR (clk); + } + + mxs_phy =devm_kzalloc (&pdev->dev,sizeof (*mxs_phy),GFP_KERNEL ); +if (!mxs_phy) { +dev_err (&pdev->dev,"Failed to allocate USB PHY structure!\n" ); +return -ENOMEM ; + } + + mxs_phy->phy.io_priv = base; + mxs_phy->phy.dev = &pdev->dev; + mxs_phy->phy.label =DRIVER_NAME ; + mxs_phy->phy.init = mxs_phy_init; + mxs_phy->phy.shutdown = mxs_phy_shutdown; + mxs_phy->phy.notify_connect = mxs_phy_on_connect; + mxs_phy->phy.notify_disconnect = mxs_phy_on_disconnect; + +ATOMIC_INIT_NOTIFIER_HEAD (&mxs_phy->phy.notifier); + + mxs_phy->clk = clk; + +platform_set_drvdata (pdev, &mxs_phy->phy); + +return 0 ; +} + +static int __devexit mxs_phy_remove(struct platform_device *pdev) +{ +platform_set_drvdata (pdev,NULL ); + +return 0 ; +} + +static const struct of_device_id mxs_phy_dt_ids[] = { + { .compatible ="fsl,imx23-usbphy" , }, + {/* sentinel */ } +}; +MODULE_DEVICE_TABLE (of, mxs_phy_dt_ids); + +static struct platform_driver mxs_phy_driver = { + .probe = mxs_phy_probe, + .remove =__devexit_p (mxs_phy_remove), + .driver = { + .name =DRIVER_NAME , + .owner =THIS_MODULE , + .of_match_table = mxs_phy_dt_ids, + }, +}; + +static int __init mxs_phy_module_init (void ) +{ +return platform_driver_register (&mxs_phy_driver); +} +postcore_initcall (mxs_phy_module_init); + +static void __exit mxs_phy_module_exit(void) +{ +platform_driver_unregister (&mxs_phy_driver); +} +module_exit (mxs_phy_module_exit); + +MODULE_ALIAS ("platform:mxs-usb-phy" ); +MODULE_AUTHOR ("Marek Vasut <[email protected]>" ); +MODULE_AUTHOR ("Richard Zhao <[email protected]>" ); +MODULE_DESCRIPTION ("Freescale MXS USB PHY driver" ); +MODULE_LICENSE ("GPL" );Signature · 1 line
1.7.9.5
PATCH v7 14/14 usb: chipidea: add imx platform driver
In reply to Richard ZhaoThis patch supports only the host-mode functionality so far.
--- .../devicetree/bindings/usb/ci13xxx-imx.txt | 20 ++ drivers/usb/chipidea/Makefile | 3 + drivers/usb/chipidea/ci13xxx_imx.c | 197 ++++++++++++++++++++ 3 files changed, 220 insertions(+) create mode 100644 Documentation/devicetree/bindings/usb/ci13xxx-imx.txt create mode 100644 drivers/usb/chipidea/ci13xxx_imx.c
Documentation/devicetree/bindings/usb/ci13xxx-imx.txt new file +20 -0
@@ -0,0 +1,20 @@ +* Freescale i.MX ci13xxx usb controllers + +Required properties: +- compatible: Should be "fsl,imx27-usb" +- reg: Should contain registers location and length +- interrupts: Should contain controller interrupt + +Optional properties: +- fsl,usbphy: phandler of usb phy that connects to the only one port +- fsl,hub-reset-gpios: gpio used to reset on-board usb hub +- fsl,vbus-power-gpios: gpio used to set vbus power of the only one port + +Examples: +usb at 02184000 { /* USB OTG */ + compatible = "fsl,imx6q-usb", "fsl,imx27-usb"; + reg = <0x02184000 0x200>; + interrupts = <0 43 0x04>; + fsl,usbphy = <&usbphy1>; + fsl,vbus-power-gpios = <&gpio3 22 0>; +};
drivers/usb/chipidea/Makefile +3 -0
@@ -14,3 +14,6 @@ ifneq ($(CONFIG_PCI),) obj-$(CONFIG_USB_CHIPIDEA) += ci13xxx_pci.o endif +ifneq ($(CONFIG_OF_DEVICE),) + obj-$(CONFIG_USB_CHIPIDEA) += ci13xxx_imx.o +endif
drivers/usb/chipidea/ci13xxx_imx.c new file +197 -0
197 lines not on this page · raw message
Signature · 1 line
1.7.9.5
PATCH v7 14/14 usb: chipidea: add imx platform driver
Quoted 25 lines · Richard Zhao
This patch supports only the host-mode functionality so far.
Signed-off-by Richard Zhao <[email protected]>Signed-off-by Marek Vasut <[email protected]>Cc Peter Chen <[email protected]>Cc Alexander Shishkin <[email protected]>Cc Felipe Balbi <[email protected]>Cc Greg Kroah-Hartman <[email protected]>Tested-by Subodh Nijsure <[email protected]>--- .../devicetree/bindings/usb/ci13xxx-imx.txt | 20 ++ drivers/usb/chipidea/Makefile | 3 + drivers/usb/chipidea/ci13xxx_imx.c | 197 ++++++++++++++++++++ 3 files changed, 220 insertions(+) create mode 100644 Documentation/devicetree/bindings/usb/ci13xxx-imx.txt create mode 100644 drivers/usb/chipidea/ci13xxx_imx.cDocumentation/devicetree/bindings/usb/ci13xxx-imx.txt new file +2
-0@@ -0,0 +1,20 @@ +* Freescale i.MX ci13xxx usb controllers +
Documentation/devicetree/bindings/usb/ci13xxx-imx.txt line 11
Quoted 10 lines
Documentation/devicetree/bindings/usb/ci13xxx-imx.txt new file +9
-0+Required properties: +- compatible: Should be "fsl,imx27-usb" +- reg: Should contain registers location and length +- interrupts: Should contain controller interrupt + +Optional properties: +- fsl,usbphy: phandler of usb phy that connects to the only one port +- fsl,hub-reset-gpios: gpio used to reset on-board usb hub +- fsl,vbus-power-gpios: gpio used to set vbus power of the only one port
These two properties are not implemented, are they? vbus is handled via a fixed regulator.
Further I'm looking into the phy and otg implementation. I think the handling of the regulator should go into mxs-phy.c, not into the ci13xxx_imx.c
Marc
Signature · 14 lines
Pengutronix e.K. | Marc Kleine-Budde | Industrial Linux Solutions | Phone: +49-231-2826-924 | Vertretung West/Dortmund | Fax: +49-5121-206917-5555 | Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de | -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 262 bytes Desc: OpenPGP digital signature URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120625/03d7b5c4/attachment.sig>
PATCH v7 14/14 usb: chipidea: add imx platform driver
Quoted 34 lines · Marc Kleine-Budde
Quoted 32 lines · Richard Zhao
This patch supports only the host-mode functionality so far.
Signed-off-by Richard Zhao <[email protected]>Signed-off-by Marek Vasut <[email protected]>Cc Peter Chen <[email protected]>Cc Alexander Shishkin <[email protected]>Cc Felipe Balbi <[email protected]>Cc Greg Kroah-Hartman <[email protected]>Tested-by Subodh Nijsure <[email protected]>--- .../devicetree/bindings/usb/ci13xxx-imx.txt | 20 ++ drivers/usb/chipidea/Makefile | 3 + drivers/usb/chipidea/ci13xxx_imx.c | 197 ++++++++++++++++++++ 3 files changed, 220 insertions(+) create mode 100644 Documentation/devicetree/bindings/usb/ci13xxx-imx.txt create mode 100644 drivers/usb/chipidea/ci13xxx_imx.cDocumentation/devicetree/bindings/usb/ci13xxx-imx.txt new file +9
-0@@ -0,0 +1,20 @@ +* Freescale i.MX ci13xxx usb controllers + +Required properties: +- compatible: Should be "fsl,imx27-usb" +- reg: Should contain registers location and length +- interrupts: Should contain controller interrupt + +Optional properties: +- fsl,usbphy: phandler of usb phy that connects to the only one port
Quoted 5 lines
Documentation/devicetree/bindings/usb/ci13xxx-imx.txt line 11
Quoted 2 lines
Documentation/devicetree/bindings/usb/ci13xxx-imx.txt new file +2
-0+- fsl,hub-reset-gpios: gpio used to reset on-board usb hub +- fsl,vbus-power-gpios: gpio used to set vbus power of the only one portThese two properties are not implemented, are they? vbus is handled via a fixed regulator.
I forgot to update the doc.
Quoted 4 lines
Further I'm looking into the phy and otg implementation. I think the handling of the regulator should go into
mxs-phy.c, not into theci13xxx_imx.c
Normally, we don't put it in phy driver. For example, most host driver don't call phy drivers.
Thanks
Richard
Quoted 10 lines
Marc
Signature · 4 lines
Pengutronix e.K. | Marc Kleine-Budde | Industrial Linux Solutions | Phone: +49-231-2826-924 | Vertretung West/Dortmund | Fax: +49-5121-206917-5555 | Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
PATCH v7 14/14 usb: chipidea: add imx platform driver
Quoted 40 lines · Richard Zhao
Quoted 34 lines · Marc Kleine-Budde
Quoted 32 lines · Richard Zhao
This patch supports only the host-mode functionality so far.
Signed-off-by Richard Zhao <[email protected]>Signed-off-by Marek Vasut <[email protected]>Cc Peter Chen <[email protected]>Cc Alexander Shishkin <[email protected]>Cc Felipe Balbi <[email protected]>Cc Greg Kroah-Hartman <[email protected]>Tested-by Subodh Nijsure <[email protected]>--- .../devicetree/bindings/usb/ci13xxx-imx.txt | 20 ++ drivers/usb/chipidea/Makefile | 3 + drivers/usb/chipidea/ci13xxx_imx.c | 197 ++++++++++++++++++++ 3 files changed, 220 insertions(+) create mode 100644 Documentation/devicetree/bindings/usb/ci13xxx-imx.txt create mode 100644 drivers/usb/chipidea/ci13xxx_imx.cDocumentation/devicetree/bindings/usb/ci13xxx-imx.txt new file +9
-0@@ -0,0 +1,20 @@ +* Freescale i.MX ci13xxx usb controllers + +Required properties: +- compatible: Should be "fsl,imx27-usb" +- reg: Should contain registers location and length +- interrupts: Should contain controller interrupt + +Optional properties: +- fsl,usbphy: phandler of usb phy that connects to the only one portQuoted 5 lines
Documentation/devicetree/bindings/usb/ci13xxx-imx.txt line 11
Quoted 2 lines
Documentation/devicetree/bindings/usb/ci13xxx-imx.txt new file +2
-0+- fsl,hub-reset-gpios: gpio used to reset on-board usb hub +- fsl,vbus-power-gpios: gpio used to set vbus power of the only one portThese two properties are not implemented, are they? vbus is handled via a fixed regulator.
Quoted 7 lines
I forgot to update the doc.
Quoted 4 lines
Further I'm looking into the phy and otg implementation. I think the handling of the regulator should go into
mxs-phy.c, not into theci13xxx_imx.cNormally, we don't put it in phy driver. For example, most host driver don't call phy drivers.
Yes, I've noticed that otg support is ... a bit messy in the linux kernel. There are some drivers that implement a otg state machine.
However, I have the udc on mx28 somewhat working. It's still a hack since I have to implement an otg driver for this, but the host part doesn't do otg so far...and unplug is not detected correctly.
cheers, Marc
Signature · 12 lines
Pengutronix e.K. | Marc Kleine-Budde | Industrial Linux Solutions | Phone: +49-231-2826-924 | Vertretung West/Dortmund | Fax: +49-5121-206917-5555 | Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de | -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 262 bytes Desc: OpenPGP digital signature URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120627/84cff2ae/attachment.sig>