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>
This commit is contained in:

committed by
Simon Horman

parent
2c8788bfd8
commit
743fcce0a8
@@ -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)
|
||||
|
Reference in New Issue
Block a user