From 743fcce0a89e04dc511b4ea40eba8e3f7cec92d4 Mon Sep 17 00:00:00 2001 From: Sergei Shtylyov Date: Sun, 2 Jun 2013 01:33:56 +0400 Subject: 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 ... The patch has been tested on the Marzen and BOCK-W boards. Suggested-by: Alan Stern Signed-off-by: Sergei Shtylyov Acked-by: Kuninori Morimoto Acked-by: Alan Stern Signed-off-by: Simon Horman --- drivers/usb/host/ehci-platform.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'drivers/usb/host') diff --git a/drivers/usb/host/ehci-platform.c b/drivers/usb/host/ehci-platform.c index f47f2594c9d..d1f5cea435a 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) -- cgit v1.2.3-70-g09d2