Commit 760189b3 authored by Keshava Munegowda's avatar Keshava Munegowda Committed by Samuel Ortiz

mfd: omap-usb-host: Remove TLL specific code from USB HS core driver

The TLL specific code such as channels clocks enable/disable,
initialization functions are removed from the USBHS core
driver. The hwmod of the usb tll is retrieved and omap device
build is performed to created the platform device for the
usb tll component.
Signed-off-by: default avatarKeshava Munegowda <keshava_mgowda@ti.com>
Reviewed-by: default avatarPartha Basak <parthab@india.ti.com>
Acked-by: default avatarFelipe Balbi <balbi@ti.com>
Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
parent 4dc2cceb
...@@ -35,10 +35,12 @@ ...@@ -35,10 +35,12 @@
#ifdef CONFIG_MFD_OMAP_USB_HOST #ifdef CONFIG_MFD_OMAP_USB_HOST
#define OMAP_USBHS_DEVICE "usbhs_omap" #define OMAP_USBHS_DEVICE "usbhs_omap"
#define OMAP_USBTLL_DEVICE "usbhs_tll"
#define USBHS_UHH_HWMODNAME "usb_host_hs" #define USBHS_UHH_HWMODNAME "usb_host_hs"
#define USBHS_TLL_HWMODNAME "usb_tll_hs" #define USBHS_TLL_HWMODNAME "usb_tll_hs"
static struct usbhs_omap_platform_data usbhs_data; static struct usbhs_omap_platform_data usbhs_data;
static struct usbtll_omap_platform_data usbtll_data;
static struct ehci_hcd_omap_platform_data ehci_data; static struct ehci_hcd_omap_platform_data ehci_data;
static struct ohci_hcd_omap_platform_data ohci_data; static struct ohci_hcd_omap_platform_data ohci_data;
...@@ -487,13 +489,14 @@ void __init setup_4430ohci_io_mux(const enum usbhs_omap_port_mode *port_mode) ...@@ -487,13 +489,14 @@ void __init setup_4430ohci_io_mux(const enum usbhs_omap_port_mode *port_mode)
void __init usbhs_init(const struct usbhs_omap_board_data *pdata) void __init usbhs_init(const struct usbhs_omap_board_data *pdata)
{ {
struct omap_hwmod *oh[2]; struct omap_hwmod *uhh_hwm, *tll_hwm;
struct platform_device *pdev; struct platform_device *pdev;
int bus_id = -1; int bus_id = -1;
int i; int i;
for (i = 0; i < OMAP3_HS_USB_PORTS; i++) { for (i = 0; i < OMAP3_HS_USB_PORTS; i++) {
usbhs_data.port_mode[i] = pdata->port_mode[i]; usbhs_data.port_mode[i] = pdata->port_mode[i];
usbtll_data.port_mode[i] = pdata->port_mode[i];
ohci_data.port_mode[i] = pdata->port_mode[i]; ohci_data.port_mode[i] = pdata->port_mode[i];
ehci_data.port_mode[i] = pdata->port_mode[i]; ehci_data.port_mode[i] = pdata->port_mode[i];
ehci_data.reset_gpio_port[i] = pdata->reset_gpio_port[i]; ehci_data.reset_gpio_port[i] = pdata->reset_gpio_port[i];
...@@ -512,25 +515,35 @@ void __init usbhs_init(const struct usbhs_omap_board_data *pdata) ...@@ -512,25 +515,35 @@ void __init usbhs_init(const struct usbhs_omap_board_data *pdata)
setup_4430ohci_io_mux(pdata->port_mode); setup_4430ohci_io_mux(pdata->port_mode);
} }
oh[0] = omap_hwmod_lookup(USBHS_UHH_HWMODNAME); uhh_hwm = omap_hwmod_lookup(USBHS_UHH_HWMODNAME);
if (!oh[0]) { if (!uhh_hwm) {
pr_err("Could not look up %s\n", USBHS_UHH_HWMODNAME); pr_err("Could not look up %s\n", USBHS_UHH_HWMODNAME);
return; return;
} }
oh[1] = omap_hwmod_lookup(USBHS_TLL_HWMODNAME); tll_hwm = omap_hwmod_lookup(USBHS_TLL_HWMODNAME);
if (!oh[1]) { if (!tll_hwm) {
pr_err("Could not look up %s\n", USBHS_TLL_HWMODNAME); pr_err("Could not look up %s\n", USBHS_TLL_HWMODNAME);
return; return;
} }
pdev = omap_device_build_ss(OMAP_USBHS_DEVICE, bus_id, oh, 2, pdev = omap_device_build(OMAP_USBTLL_DEVICE, bus_id, tll_hwm,
(void *)&usbhs_data, sizeof(usbhs_data), &usbtll_data, sizeof(usbtll_data),
omap_uhhtll_latency, omap_uhhtll_latency,
ARRAY_SIZE(omap_uhhtll_latency), false); ARRAY_SIZE(omap_uhhtll_latency), false);
if (IS_ERR(pdev)) { if (IS_ERR(pdev)) {
pr_err("Could not build hwmod devices %s,%s\n", pr_err("Could not build hwmod device %s\n",
USBHS_UHH_HWMODNAME, USBHS_TLL_HWMODNAME); USBHS_TLL_HWMODNAME);
return;
}
pdev = omap_device_build(OMAP_USBHS_DEVICE, bus_id, uhh_hwm,
&usbhs_data, sizeof(usbhs_data),
omap_uhhtll_latency,
ARRAY_SIZE(omap_uhhtll_latency), false);
if (IS_ERR(pdev)) {
pr_err("Could not build hwmod devices %s\n",
USBHS_UHH_HWMODNAME);
return; return;
} }
} }
......
This diff is collapsed.
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