Commit 743fcce0 authored by Sergei Shtylyov's avatar Sergei Shtylyov Committed by Simon Horman

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: default avatarAlan Stern <stern@rowland.harvard.edu>
Signed-off-by: default avatarSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Acked-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: default avatarAlan Stern <stern@rowland.harvard.edu>
Signed-off-by: default avatarSimon Horman <horms+renesas@verge.net.au>
parent 2c8788bf
...@@ -48,6 +48,12 @@ static int ehci_platform_reset(struct usb_hcd *hcd) ...@@ -48,6 +48,12 @@ static int ehci_platform_reset(struct usb_hcd *hcd)
ehci->big_endian_desc = pdata->big_endian_desc; ehci->big_endian_desc = pdata->big_endian_desc;
ehci->big_endian_mmio = pdata->big_endian_mmio; 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; ehci->caps = hcd->regs + pdata->caps_offset;
retval = ehci_setup(hcd); retval = ehci_setup(hcd);
if (retval) if (retval)
......
...@@ -19,6 +19,9 @@ ...@@ -19,6 +19,9 @@
#ifndef __USB_CORE_EHCI_PDRIVER_H #ifndef __USB_CORE_EHCI_PDRIVER_H
#define __USB_CORE_EHCI_PDRIVER_H #define __USB_CORE_EHCI_PDRIVER_H
struct platform_device;
struct usb_hcd;
/** /**
* struct usb_ehci_pdata - platform_data for generic ehci driver * struct usb_ehci_pdata - platform_data for generic ehci driver
* *
...@@ -50,6 +53,7 @@ struct usb_ehci_pdata { ...@@ -50,6 +53,7 @@ struct usb_ehci_pdata {
/* Turn on only VBUS suspend power and hotplug detection, /* Turn on only VBUS suspend power and hotplug detection,
* turn off everything else */ * turn off everything else */
void (*power_suspend)(struct platform_device *pdev); void (*power_suspend)(struct platform_device *pdev);
int (*pre_setup)(struct usb_hcd *hcd);
}; };
#endif /* __USB_CORE_EHCI_PDRIVER_H */ #endif /* __USB_CORE_EHCI_PDRIVER_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment