summaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorSergei Shtylyov <sergei.shtylyov@cogentembedded.com>2013-06-02 01:33:56 +0400
committerSimon Horman <horms+renesas@verge.net.au>2013-06-11 16:10:45 +0900
commit743fcce0a89e04dc511b4ea40eba8e3f7cec92d4 (patch)
tree5063feeef309582fb3a0904834f732d25f39fcf6 /drivers/usb
parent2c8788bfd89bad424d3c288b5a52ce141271b862 (diff)
downloadlinux-743fcce0a89e04dc511b4ea40eba8e3f7cec92d4.tar.gz
linux-743fcce0a89e04dc511b4ea40eba8e3f7cec92d4.tar.xz
ehci-platform: add pre_setup() method to platform data
Sometimes there is a need to initialize some non-standard registers mapped to the EHCI region before accessing the standard EHCI registers. Add pre_setup() method with 'struct usb_hcd *' parameter to be called just before ehci_setup() to the 'ehci-platform' driver's platform data for this purpose... While at it, add the missing incomplete declaration of 'struct platform_device' to <linux/usb/ehci_pdriver.h>... The patch has been tested on the Marzen and BOCK-W boards. Suggested-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/host/ehci-platform.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/usb/host/ehci-platform.c b/drivers/usb/host/ehci-platform.c
index f47f2594c9d4..d1f5cea435aa 100644
--- a/drivers/usb/host/ehci-platform.c
+++ b/drivers/usb/host/ehci-platform.c
@@ -48,6 +48,12 @@ static int ehci_platform_reset(struct usb_hcd *hcd)
ehci->big_endian_desc = pdata->big_endian_desc;
ehci->big_endian_mmio = pdata->big_endian_mmio;
+ if (pdata->pre_setup) {
+ retval = pdata->pre_setup(hcd);
+ if (retval < 0)
+ return retval;
+ }
+
ehci->caps = hcd->regs + pdata->caps_offset;
retval = ehci_setup(hcd);
if (retval)