From de2e1b0c988c901989713869a8bea3b3d02bb9ce Mon Sep 17 00:00:00 2001 From: Maulik Mankad Date: Fri, 12 Mar 2010 10:29:07 +0200 Subject: usb: musb: Set transceiver interface type Program the OTG_INTERFSEL register based on transcevier type passed from board file. Adapt signature of musb_platform_init() function for davinci, blackfin and tusb6010. Signed-off-by: Maulik Mankad Cc: David Brownell Cc: Sergei Shtylyov Cc: Olof Johansson Signed-off-by: Felipe Balbi Signed-off-by: Greg Kroah-Hartman --- drivers/usb/musb/omap2430.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'drivers/usb/musb/omap2430.c') diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c index 82592633502f..0e5d0670506b 100644 --- a/drivers/usb/musb/omap2430.c +++ b/drivers/usb/musb/omap2430.c @@ -199,9 +199,10 @@ int musb_platform_set_mode(struct musb *musb, u8 musb_mode) return 0; } -int __init musb_platform_init(struct musb *musb) +int __init musb_platform_init(struct musb *musb, void *board_data) { u32 l; + struct omap_musb_board_data *data = board_data; #if defined(CONFIG_ARCH_OMAP2430) omap_cfg_reg(AE5_2430_USB0HS_STP); @@ -235,7 +236,15 @@ int __init musb_platform_init(struct musb *musb) musb_writel(musb->mregs, OTG_SYSCONFIG, l); l = musb_readl(musb->mregs, OTG_INTERFSEL); - l |= ULPI_12PIN; + + if (data->interface_type == MUSB_INTERFACE_UTMI) { + /* OMAP4 uses Internal PHY GS70 which uses UTMI interface */ + l &= ~ULPI_12PIN; /* Disable ULPI */ + l |= UTMI_8BIT; /* Enable UTMI */ + } else { + l |= ULPI_12PIN; + } + musb_writel(musb->mregs, OTG_INTERFSEL, l); pr_debug("HS USB OTG: revision 0x%x, sysconfig 0x%02x, " -- cgit v1.2.3 From ca0d44525060cf852b87c35f64d786b8a2a75c3d Mon Sep 17 00:00:00 2001 From: Sergei Shtylyov Date: Thu, 25 Mar 2010 13:25:20 +0200 Subject: MUSB: OMAP: remove omap_vbus_power() This function does nothing... Signed-off-by: Sergei Shtylyov Signed-off-by: Felipe Balbi Signed-off-by: Greg Kroah-Hartman --- drivers/usb/musb/omap2430.c | 8 -------- 1 file changed, 8 deletions(-) (limited to 'drivers/usb/musb/omap2430.c') diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c index 0e5d0670506b..c2413c76126d 100644 --- a/drivers/usb/musb/omap2430.c +++ b/drivers/usb/musb/omap2430.c @@ -145,10 +145,6 @@ void musb_platform_enable(struct musb *musb) void musb_platform_disable(struct musb *musb) { } -static void omap_vbus_power(struct musb *musb, int is_on, int sleeping) -{ -} - static void omap_set_vbus(struct musb *musb, int is_on) { u8 devctl; @@ -255,8 +251,6 @@ int __init musb_platform_init(struct musb *musb, void *board_data) musb_readl(musb->mregs, OTG_INTERFSEL), musb_readl(musb->mregs, OTG_SIMENABLE)); - omap_vbus_power(musb, musb->board_mode == MUSB_HOST, 1); - if (is_host_enabled(musb)) musb->board_set_vbus = omap_set_vbus; @@ -336,8 +330,6 @@ static int musb_platform_resume(struct musb *musb) int musb_platform_exit(struct musb *musb) { - omap_vbus_power(musb, 0 /*off*/, 1); - musb_platform_suspend(musb); return 0; -- cgit v1.2.3 From 5b3078b2d789f4bd49006a3633dc106e56c47e28 Mon Sep 17 00:00:00 2001 From: Sergei Shtylyov Date: Thu, 25 Mar 2010 13:25:22 +0200 Subject: MUSB: OMAP: make musb_platform_suspend() 'static' This function is only called inside omap2430.c... Signed-off-by: Sergei Shtylyov Signed-off-by: Felipe Balbi Signed-off-by: Greg Kroah-Hartman --- drivers/usb/musb/omap2430.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/usb/musb/omap2430.c') diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c index c2413c76126d..d05eef2baaaf 100644 --- a/drivers/usb/musb/omap2430.c +++ b/drivers/usb/musb/omap2430.c @@ -275,7 +275,7 @@ void musb_platform_restore_context(struct musb *musb, } #endif -int musb_platform_suspend(struct musb *musb) +static int musb_platform_suspend(struct musb *musb) { u32 l; -- cgit v1.2.3 From 00ce8eca856bc1e0b943427d2cf76122ae3b1255 Mon Sep 17 00:00:00 2001 From: Anand Gadiyar Date: Thu, 25 Mar 2010 13:25:24 +0200 Subject: usb: musb: omap2430: remove unused define get_cpu_rev() is unused in this driver. It is probably legacy code. So remove it. Signed-off-by: Anand Gadiyar Signed-off-by: Felipe Balbi Signed-off-by: Greg Kroah-Hartman --- drivers/usb/musb/omap2430.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'drivers/usb/musb/omap2430.c') diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c index d05eef2baaaf..def37ebe2ff4 100644 --- a/drivers/usb/musb/omap2430.c +++ b/drivers/usb/musb/omap2430.c @@ -39,10 +39,6 @@ #include "musb_core.h" #include "omap2430.h" -#ifdef CONFIG_ARCH_OMAP3430 -#define get_cpu_rev() 2 -#endif - static struct timer_list musb_idle_timer; -- cgit v1.2.3 From 82e2af47fe7a494fafb3f6ed39a7856c1307411b Mon Sep 17 00:00:00 2001 From: Anand Gadiyar Date: Thu, 25 Mar 2010 13:25:25 +0200 Subject: usb: musb: omap2430.c: remove unnecessary includes We don't need mach-types and hardware.h Signed-off-by: Anand Gadiyar Signed-off-by: Felipe Balbi Signed-off-by: Greg Kroah-Hartman --- drivers/usb/musb/omap2430.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'drivers/usb/musb/omap2430.c') diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c index def37ebe2ff4..e06d65e36bf7 100644 --- a/drivers/usb/musb/omap2430.c +++ b/drivers/usb/musb/omap2430.c @@ -32,8 +32,6 @@ #include #include -#include -#include #include #include "musb_core.h" -- cgit v1.2.3