Message ID | 50EFF075.5090203@ti.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On 01/11/2013 12:59 PM, Roger Quadros wrote: > On 01/10/2013 10:48 PM, Alan Stern wrote: >> On Thu, 10 Jan 2013, Roger Quadros wrote: >> >>> If the OMAP's Host controller is in PHY mode then we instantiate >>> a platform device for the PHY (one for each port in PHY mode) and >>> hold a reference to it so that we can use the usb_phy API, e.g. >>> while suspend/resume. >>> >>> The platform data for the PHY must be supplied in the newly added >>> .phy_config parameter in struct usbhs_omap_platform_data. >>> >>> The end goal is to move the PHY's reset and power handling code >>> out of the ehci-omap driver and into the phy driver. >> >> As mentioned in another thread, I would prefer to have these changes to >> ehci-omap.c made after the driver is converted to the new "ehci-hcd is >> a library" scheme. The patch below does the conversion; it is meant to >> apply on top of the similar patch for ehci-mxc posted recently on the >> linux-usb mailing list. >> >> After this conversion, the omap_ehci_hcd private data structure doesn't >> have to be allocated specifically. It can be handled in the same way >> as the private data structure in the ehci-mxc patch. >> >> I haven't even tried to compile this. Please let me know how it works. >> > > Alan, > > Thanks for the patch. I've pasted the version that builds and works and > put you as the Author of the patch, hope it is fine. > > I could not find the equivalent ehci-mxc implementation though. Any > pointers to that? Thanks. OK I found it. Previously I was searching in the archives :P. cheers, -roger
On Fri, 11 Jan 2013, Roger Quadros wrote: > Alan, > > Thanks for the patch. I've pasted the version that builds and works and > put you as the Author of the patch, hope it is fine. As far as I can see, yours is the same as what I posted except that: You altered the changes to ehci-hcd.c and Makefile to remove the dependency on the ehci-mxc patch; You made an unimportant whitespace change in ehci-omap.c (moved a blank line before ehci_write()). Right? It's hard to compare the patches directly because the one you posted was whitespace-damaged. Anyway, if this is okay and there's nothing wrong with the ehci-mxc change (other than the comment for ehci->priv), I'll submit both of them to Greg soon. Alan Stern
diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig index d6bb128..432a463 100644 --- a/drivers/usb/host/Kconfig +++ b/drivers/usb/host/Kconfig @@ -155,7 +155,7 @@ config USB_EHCI_MXC Variation of ARC USB block used in some Freescale chips. config USB_EHCI_HCD_OMAP - bool "EHCI support for OMAP3 and later chips" + tristate "EHCI support for OMAP3 and later chips" depends on USB_EHCI_HCD && ARCH_OMAP default y ---help--- diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile index 1eb4c30..8a8d079 100644 --- a/drivers/usb/host/Makefile +++ b/drivers/usb/host/Makefile @@ -26,6 +26,7 @@ obj-$(CONFIG_PCI) += pci-quirks.o obj-$(CONFIG_USB_EHCI_HCD) += ehci-hcd.o obj-$(CONFIG_USB_EHCI_PCI) += ehci-pci.o obj-$(CONFIG_USB_EHCI_HCD_PLATFORM) += ehci-platform.o +obj-$(CONFIG_USB_EHCI_HCD_OMAP) += ehci-omap.o obj-$(CONFIG_USB_OXU210HP_HCD) += oxu210hp-hcd.o obj-$(CONFIG_USB_ISP116X_HCD) += isp116x-hcd.o diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c index c97503b..c44ef1d 100644 --- a/drivers/usb/host/ehci-hcd.c +++ b/drivers/usb/host/ehci-hcd.c @@ -1260,11 +1260,6 @@ MODULE_LICENSE ("GPL"); #define PLATFORM_DRIVER ehci_hcd_sh_driver #endif -#ifdef CONFIG_USB_EHCI_HCD_OMAP -#include "ehci-omap.c" -#define PLATFORM_DRIVER ehci_hcd_omap_driver -#endif - #ifdef CONFIG_PPC_PS3 #include "ehci-ps3.c" #define PS3_SYSTEM_BUS_DRIVER ps3_ehci_driver @@ -1352,6 +1347,7 @@ MODULE_LICENSE ("GPL"); #if !IS_ENABLED(CONFIG_USB_EHCI_PCI) && \ !IS_ENABLED(CONFIG_USB_EHCI_HCD_PLATFORM) && \ + !IS_ENABLED(CONFIG_USB_EHCI_HCD_OMAP) && \ !defined(CONFIG_USB_CHIPIDEA_HOST) && \ !defined(PLATFORM_DRIVER) && \ !defined(PS3_SYSTEM_BUS_DRIVER) && \ diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c index b96a4bf..6388aa6 100644 --- a/drivers/usb/host/ehci-omap.c +++ b/drivers/usb/host/ehci-omap.c @@ -36,6 +36,9 @@ * - convert to use hwmod and runtime PM */ +#include <linux/kernel.h> +#include <linux/module.h> +#include <linux/io.h> #include <linux/platform_device.h> #include <linux/slab.h> #include <linux/usb/ulpi.h> @@ -43,6 +46,10 @@ #include <linux/pm_runtime.h> #include <linux/gpio.h> #include <linux/clk.h> +#include <linux/usb.h> +#include <linux/usb/hcd.h> + +#include "ehci.h" #include <linux/platform_data/usb-omap.h> @@ -57,9 +64,11 @@ #define EHCI_INSNREG05_ULPI_EXTREGADD_SHIFT 8 #define EHCI_INSNREG05_ULPI_WRDATA_SHIFT 0 -/*-------------------------------------------------------------------------*/ +#define DRIVER_DESC "OMAP-EHCI Host Controller driver" -static const struct hc_driver ehci_omap_hc_driver; +static const char hcd_name[] = "ehci-omap"; + +/*-------------------------------------------------------------------------*/ static inline void ehci_write(void __iomem *base, u32 reg, u32 val) @@ -166,6 +175,12 @@ static void disable_put_regulator( /* configure so an HC device and id are always provided */ /* always called with process context; sleeping is OK */ +static struct hc_driver __read_mostly ehci_omap_hc_driver; + +static const struct ehci_driver_overrides ehci_omap_overrides __initdata = { + .reset = omap_ehci_init, +}; + /** * ehci_hcd_omap_probe - initialize TI-based HCDs