From 16fa3dc75c22f9769d418f19c45e11b118aab2eb Mon Sep 17 00:00:00 2001 From: Keshava Munegowda Date: Mon, 16 Jul 2012 19:01:08 +0530 Subject: mfd: omap-usb-tll: HOST TLL platform driver The platform driver for the TLL component of the OMAP USB host controller is implemented. Depending on the TLL hardware revision , the TLL channels are configured. The USB HS core driver uses this driver through exported APIs from the TLL platform driver. usb_tll_enable and usb_tll_disble are the exported APIs of the USB TLL platform driver. Signed-off-by: Keshava Munegowda Reviewed-by: Partha Basak Acked-by: Felipe Balbi Signed-off-by: Samuel Ortiz --- arch/arm/plat-omap/include/plat/usb.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'arch/arm/plat-omap') diff --git a/arch/arm/plat-omap/include/plat/usb.h b/arch/arm/plat-omap/include/plat/usb.h index 548a4c8d63df..ca15a2632da3 100644 --- a/arch/arm/plat-omap/include/plat/usb.h +++ b/arch/arm/plat-omap/include/plat/usb.h @@ -64,6 +64,10 @@ struct usbhs_omap_platform_data { struct ehci_hcd_omap_platform_data *ehci_data; struct ohci_hcd_omap_platform_data *ohci_data; }; + +struct usbtll_omap_platform_data { + enum usbhs_omap_port_mode port_mode[OMAP3_HS_USB_PORTS]; +}; /*-------------------------------------------------------------------------*/ struct omap_musb_board_data { @@ -82,6 +86,8 @@ enum musb_interface {MUSB_INTERFACE_ULPI, MUSB_INTERFACE_UTMI}; extern void usb_musb_init(struct omap_musb_board_data *board_data); extern void usbhs_init(const struct usbhs_omap_board_data *pdata); +extern int omap_tll_enable(void); +extern int omap_tll_disable(void); extern int omap4430_phy_power(struct device *dev, int ID, int on); extern int omap4430_phy_set_clk(struct device *dev, int on); -- cgit v1.2.3 From 4dc2cceb5a85e8792517ea9b7ba334eaae75a10d Mon Sep 17 00:00:00 2001 From: Keshava Munegowda Date: Mon, 16 Jul 2012 19:01:09 +0530 Subject: mfd: omap-usb-host: Invoke the TLL driver from USB HS core driver The usbhs driver invokes the enable/disable APIs of the usb tll driver in the runtime resume/suspend callbacks of the runtime get sync and put sync of the usbhs driver. Signed-off-by: Keshava Munegowda Reviewed-by: Partha Basak Acked-by: Felipe Balbi Signed-off-by: Samuel Ortiz --- arch/arm/plat-omap/include/plat/usb.h | 1 + drivers/mfd/omap-usb-host.c | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'arch/arm/plat-omap') diff --git a/arch/arm/plat-omap/include/plat/usb.h b/arch/arm/plat-omap/include/plat/usb.h index ca15a2632da3..e68d0998d55f 100644 --- a/arch/arm/plat-omap/include/plat/usb.h +++ b/arch/arm/plat-omap/include/plat/usb.h @@ -4,6 +4,7 @@ #define __ASM_ARCH_OMAP_USB_H #include +#include #include #include diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c index 41088ecbb2a9..8a256dfe6ddf 100644 --- a/drivers/mfd/omap-usb-host.c +++ b/drivers/mfd/omap-usb-host.c @@ -21,7 +21,6 @@ #include #include #include -#include #include #include #include @@ -436,6 +435,7 @@ static int usbhs_runtime_resume(struct device *dev) return -ENODEV; } + omap_tll_enable(); spin_lock_irqsave(&omap->lock, flags); if (omap->ehci_logic_fck && !IS_ERR(omap->ehci_logic_fck)) @@ -487,6 +487,7 @@ static int usbhs_runtime_suspend(struct device *dev) clk_disable(omap->ehci_logic_fck); spin_unlock_irqrestore(&omap->lock, flags); + omap_tll_disable(); return 0; } @@ -910,8 +911,10 @@ static int __init omap_usbhs_drvinit(void) * init before ehci and ohci drivers; * The usbhs core driver should be initialized much before * the omap ehci and ohci probe functions are called. + * This usbhs core driver should be initialized after + * usb tll driver */ -fs_initcall(omap_usbhs_drvinit); +fs_initcall_sync(omap_usbhs_drvinit); static void __exit omap_usbhs_drvexit(void) { -- cgit v1.2.3