Patchwork [U-Boot,v9,2/4] EHCI: add callback ehci_fixup

login
register
mail settings
Submitter Jana Rapava
Date Sept. 28, 2011, 7:51 p.m.
Message ID <1317239475-32265-1-git-send-email-fermata7@gmail.com>
Download mbox | patch
Permalink /patch/116849/
State Superseded
Headers show

Comments

Jana Rapava - Sept. 28, 2011, 7:51 p.m.
Add callback to ehci_fixup to prepare
for solving the problem with VBUS reset on Efika.

Signed-off-by: Jana Rapava <fermata7@gmail.com>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Remy Bohmer <linux@bohmer.net>
Cc: Stefano Babic <sbabic@denx.de>

Acked-by: Marek Vasut <marek.vasut@gmail.com>
---
Changes for v1:
  - split into patchset
  - add callback ehci_fixup
Changes for v2:
    - make this the second patch in series
    - add comment to alias ehci_fixup
    - no actual changes
Changes for v3:
     - no actual changes
     - make the comment a sentence
     - rebase patch on top of u-boot-imx/next
Changes for v4:
      - no actual changes
      - change the versioning of changelog
      from per patchset to per patch
      - fix the appearance of comment
Changes for v5:
       - no actual changes
       - reword the comment
Changes for v6:
	- no actual changes
	- fix the comment

 drivers/usb/host/ehci-hcd.c |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)
Marek Vasut - Sept. 28, 2011, 8:36 p.m.
On Wednesday, September 28, 2011 09:51:15 PM Jana Rapava wrote:
> Add callback to ehci_fixup to prepare
> for solving the problem with VBUS reset on Efika.
> 
> Signed-off-by: Jana Rapava <fermata7@gmail.com>
> Cc: Marek Vasut <marek.vasut@gmail.com>
> Cc: Remy Bohmer <linux@bohmer.net>
> Cc: Stefano Babic <sbabic@denx.de>
> 
> Acked-by: Marek Vasut <marek.vasut@gmail.com>
> ---
> Changes for v1:
>   - split into patchset
>   - add callback ehci_fixup
> Changes for v2:
>     - make this the second patch in series
>     - add comment to alias ehci_fixup
>     - no actual changes
> Changes for v3:
>      - no actual changes
>      - make the comment a sentence
>      - rebase patch on top of u-boot-imx/next
> Changes for v4:
>       - no actual changes
>       - change the versioning of changelog
>       from per patchset to per patch
>       - fix the appearance of comment
> Changes for v5:
>        - no actual changes
>        - reword the comment
> Changes for v6:
> 	- no actual changes
> 	- fix the comment

So are there any changes or not ?!
Jana Rapava - Sept. 28, 2011, 9:14 p.m.
2011/9/28 Marek Vasut <marek.vasut@gmail.com>

> > Changes for v6:
> >       - no actual changes
> >       - fix the comment
>
> So are there any changes or not ?!
>

I only fixed the comment to look better, there were no actual changes.
Sorry, I really don't know how I could express it more clearly. I'll be glad
for any suggestions.

Regards,
Jana Rapava
Marek Vasut - Sept. 28, 2011, 9:26 p.m.
On Wednesday, September 28, 2011 11:14:06 PM Jana Rapava wrote:
> 2011/9/28 Marek Vasut <marek.vasut@gmail.com>
> 
> > > Changes for v6:
> > >       - no actual changes
> > >       - fix the comment
> > 
> > So are there any changes or not ?!
> 
> I only fixed the comment to look better, there were no actual changes.
> Sorry, I really don't know how I could express it more clearly. I'll be
> glad for any suggestions.

Ok then ... "no change in code, updated comment" ... but whatever, it's clear 
now.

Patch

diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index bdadd46..c548276 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -536,6 +536,18 @@  static inline int min3(int a, int b, int c)
 	return a;
 }
 
+inline void __ehci_fixup(uint32_t *status_reg, uint32_t *reg_ref)
+{
+	wait_ms(50);
+}
+
+/*
+ * This is an alias to __ehci_fixup() unless user provides other definition
+ * of ehci_fixup function.
+ */
+void ehci_fixup(uint32_t *status_reg, uint32_t *reg_ref)
+	 __attribute__((weak, alias("__ehci_fixup")));
+
 int
 ehci_submit_root(struct usb_device *dev, unsigned long pipe, void *buffer,
 		 int length, struct devrequest *req)
@@ -709,7 +721,7 @@  ehci_submit_root(struct usb_device *dev, unsigned long pipe, void *buffer,
 				 * usb 2.0 specification say 50 ms resets on
 				 * root
 				 */
-				wait_ms(50);
+				ehci_fixup(status_reg, &reg);
 				/* terminate the reset */
 				ehci_writel(status_reg, reg & ~EHCI_PS_PR);
 				/*