linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] OMAP3: musb: add neednop flag to fix nop modular issue
@ 2010-05-27  7:04 Ajay Kumar Gupta
       [not found] ` <1274943888-17615-1-git-send-email-ajay.gupta-l0cyMroinI0@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Ajay Kumar Gupta @ 2010-05-27  7:04 UTC (permalink / raw)
  To: linux-usb-u79uwXL29TY76Z2rM5mHXA
  Cc: linux-omap-u79uwXL29TY76Z2rM5mHXA,
	felipe.balbi-xNZwKgViW5gAvxtiuMwx3w,
	amit.kucheria-LY4KaoCqKrnby3iVrkZq2A,
	khilman-1D3HCaltpLuhEniVeURVKkEOCMrvLtNR, Ajay Kumar Gupta

NOP transceiver is getting registered in board files of OMAP3EVM
and OMAP4430 SDP as they use ISP150x and internal transceivers.

This registration in board file forces NOP transceiver to be
built into the kernel.

Fixing this by adding new flag '.neednop' within board_data
structure which would be used to register/unregister NOP
tranceiver in omap platform file within musb driver.

Signed-off-by: Ajay Kumar Gupta <ajay.gupta-l0cyMroinI0@public.gmane.org>
---
Patch set created against today's linus's tree.

 arch/arm/mach-omap2/board-4430sdp.c   |    4 +---
 arch/arm/mach-omap2/board-omap3evm.c  |    5 +----
 arch/arm/plat-omap/include/plat/usb.h |    1 +
 3 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c
index e4a5d66..fb29837 100644
--- a/arch/arm/mach-omap2/board-4430sdp.c
+++ b/arch/arm/mach-omap2/board-4430sdp.c
@@ -17,7 +17,6 @@
 #include <linux/platform_device.h>
 #include <linux/io.h>
 #include <linux/gpio.h>
-#include <linux/usb/otg.h>
 #include <linux/spi/spi.h>
 #include <linux/i2c/twl.h>
 #include <linux/regulator/machine.h>
@@ -138,6 +137,7 @@ static struct omap_musb_board_data musb_board_data = {
 	.interface_type		= MUSB_INTERFACE_UTMI,
 	.mode			= MUSB_PERIPHERAL,
 	.power			= 100,
+	.neednop		= 1,
 };
 
 static struct omap2_hsmmc_info mmc[] = {
@@ -374,8 +374,6 @@ static void __init omap_4430sdp_init(void)
 	platform_add_devices(sdp4430_devices, ARRAY_SIZE(sdp4430_devices));
 	omap_serial_init();
 	omap4_twl6030_hsmmc_init(mmc);
-	/* OMAP4 SDP uses internal transceiver so register nop transceiver */
-	usb_nop_xceiv_register();
 	/* FIXME: allow multi-omap to boot until musb is updated for omap4 */
 	if (!cpu_is_omap44xx())
 		usb_musb_init(&musb_board_data);
diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c
index 81bba19..609f021 100644
--- a/arch/arm/mach-omap2/board-omap3evm.c
+++ b/arch/arm/mach-omap2/board-omap3evm.c
@@ -27,7 +27,6 @@
 #include <linux/spi/spi.h>
 #include <linux/spi/ads7846.h>
 #include <linux/i2c/twl.h>
-#include <linux/usb/otg.h>
 #include <linux/smsc911x.h>
 
 #include <linux/regulator/machine.h>
@@ -666,6 +665,7 @@ static struct omap_musb_board_data musb_board_data = {
 	.interface_type		= MUSB_INTERFACE_ULPI,
 	.mode			= MUSB_OTG,
 	.power			= 100,
+	.neednop		= 1,
 };
 
 static void __init omap3_evm_init(void)
@@ -682,9 +682,6 @@ static void __init omap3_evm_init(void)
 
 	omap_serial_init();
 
-	/* OMAP3EVM uses ISP1504 phy and so register nop transceiver */
-	usb_nop_xceiv_register();

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/3] musb: populate board_data within musb structure
       [not found] ` <1274943888-17615-1-git-send-email-ajay.gupta-l0cyMroinI0@public.gmane.org>
@ 2010-05-27  7:04   ` Ajay Kumar Gupta
  2010-05-27  7:04     ` [PATCH 3/3] musb: use neednop flag for nop registration Ajay Kumar Gupta
       [not found]     ` <1274943888-17615-2-git-send-email-ajay.gupta-l0cyMroinI0@public.gmane.org>
  0 siblings, 2 replies; 4+ messages in thread
From: Ajay Kumar Gupta @ 2010-05-27  7:04 UTC (permalink / raw)
  To: linux-usb-u79uwXL29TY76Z2rM5mHXA
  Cc: linux-omap-u79uwXL29TY76Z2rM5mHXA,
	felipe.balbi-xNZwKgViW5gAvxtiuMwx3w,
	amit.kucheria-LY4KaoCqKrnby3iVrkZq2A,
	khilman-1D3HCaltpLuhEniVeURVKkEOCMrvLtNR, Ajay Kumar Gupta

Added board_data within musb as it would be required in
musb_platform_exit() also to unregister the nop transceiver.

Also changed the signature of musb_platform_init() as now
board_data can be taken from musb itself.

Signed-off-by: Ajay Kumar Gupta <ajay.gupta-l0cyMroinI0@public.gmane.org>
---
 drivers/usb/musb/blackfin.c  |    2 +-
 drivers/usb/musb/davinci.c   |    2 +-
 drivers/usb/musb/musb_core.c |    3 ++-
 drivers/usb/musb/musb_core.h |    3 ++-
 drivers/usb/musb/omap2430.c  |    4 ++--
 drivers/usb/musb/tusb6010.c  |    2 +-
 6 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/drivers/usb/musb/blackfin.c b/drivers/usb/musb/blackfin.c
index b611420..0bef011 100644
--- a/drivers/usb/musb/blackfin.c
+++ b/drivers/usb/musb/blackfin.c
@@ -323,7 +323,7 @@ int musb_platform_set_mode(struct musb *musb, u8 musb_mode)
 	return -EIO;
 }
 
-int __init musb_platform_init(struct musb *musb, void *board_data)
+int __init musb_platform_init(struct musb *musb)
 {
 
 	/*
diff --git a/drivers/usb/musb/davinci.c b/drivers/usb/musb/davinci.c
index 5762436..ce2e16f 100644
--- a/drivers/usb/musb/davinci.c
+++ b/drivers/usb/musb/davinci.c
@@ -376,7 +376,7 @@ int musb_platform_set_mode(struct musb *musb, u8 mode)
 	return -EIO;
 }
 
-int __init musb_platform_init(struct musb *musb, void *board_data)
+int __init musb_platform_init(struct musb *musb)
 {
 	void __iomem	*tibase = musb->ctrl_base;
 	u32		revision;
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index d3911ab..1ccc4d7 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -1961,6 +1961,7 @@ bad_config:
 	}
 
 	spin_lock_init(&musb->lock);
+	musb->board_data = plat->board_data;
 	musb->board_mode = plat->mode;
 	musb->board_set_power = plat->set_power;
 	musb->set_clock = plat->set_clock;
@@ -1995,7 +1996,7 @@ bad_config:
 	 * isp1504, non-OTG, etc) mostly hooking up through ULPI.
 	 */
 	musb->isr = generic_interrupt;
-	status = musb_platform_init(musb, plat->board_data);
+	status = musb_platform_init(musb);
 	if (status < 0)
 		goto fail2;
 
diff --git a/drivers/usb/musb/musb_core.h b/drivers/usb/musb/musb_core.h
index 7cef2b7..9dddaa4 100644
--- a/drivers/usb/musb/musb_core.h
+++ b/drivers/usb/musb/musb_core.h
@@ -393,6 +393,7 @@ struct musb {
 	int			(*board_set_power)(int state);
 
 	int			(*set_clock)(struct clk *clk, int is_active);
+	void			*board_data;	/* board specific data */
 
 	u8			min_power;	/* vbus for periph, in mA/2 */
 
@@ -604,7 +605,7 @@ extern int musb_platform_get_vbus_status(struct musb *musb);
 #define musb_platform_get_vbus_status(x)	0
 #endif
 
-extern int __init musb_platform_init(struct musb *musb, void *board_data);
+extern int __init musb_platform_init(struct musb *musb);
 extern int musb_platform_exit(struct musb *musb);
 
 #endif	/* __MUSB_CORE_H__ */
diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c
index e06d65e..50591e7 100644
--- a/drivers/usb/musb/omap2430.c
+++ b/drivers/usb/musb/omap2430.c
@@ -189,10 +189,10 @@ int musb_platform_set_mode(struct musb *musb, u8 musb_mode)
 	return 0;
 }
 
-int __init musb_platform_init(struct musb *musb, void *board_data)
+int __init musb_platform_init(struct musb *musb)
 {
 	u32 l;
-	struct omap_musb_board_data *data = board_data;
+	struct omap_musb_board_data *data = musb->board_data;
 
 #if defined(CONFIG_ARCH_OMAP2430)
 	omap_cfg_reg(AE5_2430_USB0HS_STP);
diff --git a/drivers/usb/musb/tusb6010.c b/drivers/usb/musb/tusb6010.c
index 05c077f..60d3938 100644
--- a/drivers/usb/musb/tusb6010.c
+++ b/drivers/usb/musb/tusb6010.c
@@ -1104,7 +1104,7 @@ err:
 	return -ENODEV;
 }
 
-int __init musb_platform_init(struct musb *musb, void *board_data)
+int __init musb_platform_init(struct musb *musb)
 {
 	struct platform_device	*pdev;
 	struct resource		*mem;
-- 
1.6.2.4

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 3/3] musb: use neednop flag for nop registration
  2010-05-27  7:04   ` [PATCH 2/3] musb: populate board_data within musb structure Ajay Kumar Gupta
@ 2010-05-27  7:04     ` Ajay Kumar Gupta
       [not found]     ` <1274943888-17615-2-git-send-email-ajay.gupta-l0cyMroinI0@public.gmane.org>
  1 sibling, 0 replies; 4+ messages in thread
From: Ajay Kumar Gupta @ 2010-05-27  7:04 UTC (permalink / raw)
  To: linux-usb
  Cc: linux-omap, felipe.balbi, amit.kucheria, khilman,
	Ajay Kumar Gupta

Some of the boards based on OMAP3 (like OMAP3EVM) and all the
board on OMAP4 uses nop transceiver so register and unregister
it based on '.neednop' flag passed from board files.

Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
---
 drivers/usb/musb/omap2430.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c
index 50591e7..2ec1bc4 100644
--- a/drivers/usb/musb/omap2430.c
+++ b/drivers/usb/musb/omap2430.c
@@ -198,6 +198,9 @@ int __init musb_platform_init(struct musb *musb)
 	omap_cfg_reg(AE5_2430_USB0HS_STP);
 #endif
 
+	if (data->neednop)
+		usb_nop_xceiv_register();
+
 	/* We require some kind of external transceiver, hooked
 	 * up through ULPI.  TWL4030-family PMICs include one,
 	 * which needs a driver, drivers aren't always needed.
@@ -323,8 +326,12 @@ static int musb_platform_resume(struct musb *musb)
 
 int musb_platform_exit(struct musb *musb)
 {
+	struct omap_musb_board_data *data = musb->board_data;
 
 	musb_platform_suspend(musb);
 
+	if (data->neednop)
+		usb_nop_xceiv_unregister();
+
 	return 0;
 }
-- 
1.6.2.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* RE: [PATCH 2/3] musb: populate board_data within musb structure
       [not found]     ` <1274943888-17615-2-git-send-email-ajay.gupta-l0cyMroinI0@public.gmane.org>
@ 2010-05-27  9:03       ` Kalliguddi, Hema
  0 siblings, 0 replies; 4+ messages in thread
From: Kalliguddi, Hema @ 2010-05-27  9:03 UTC (permalink / raw)
  To: Gupta, Ajay Kumar,
	linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
  Cc: linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	felipe.balbi-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org,
	amit.kucheria-LY4KaoCqKrnby3iVrkZq2A@public.gmane.org,
	khilman-1D3HCaltpLuhEniVeURVKkEOCMrvLtNR@public.gmane.org

 

>-----Original Message-----
>From: linux-usb-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org 
>[mailto:linux-usb-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org] On Behalf Of Gupta, Ajay Kumar
>Sent: Thursday, May 27, 2010 12:35 PM
>To: linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
>Cc: linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org; felipe.balbi-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org; 
>amit.kucheria-LY4KaoCqKrnby3iVrkZq2A@public.gmane.org; khilman-1D3HCaltpLuhEniVeURVKkEOCMrvLtNR@public.gmane.org; 
>Gupta, Ajay Kumar
>Subject: [PATCH 2/3] musb: populate board_data within musb structure
>
>Added board_data within musb as it would be required in
>musb_platform_exit() also to unregister the nop transceiver.
>
>Also changed the signature of musb_platform_init() as now
>board_data can be taken from musb itself.
>
>Signed-off-by: Ajay Kumar Gupta <ajay.gupta-l0cyMroinI0@public.gmane.org>
>---
> drivers/usb/musb/blackfin.c  |    2 +-
> drivers/usb/musb/davinci.c   |    2 +-
> drivers/usb/musb/musb_core.c |    3 ++-
> drivers/usb/musb/musb_core.h |    3 ++-
> drivers/usb/musb/omap2430.c  |    4 ++--
> drivers/usb/musb/tusb6010.c  |    2 +-
> 6 files changed, 9 insertions(+), 7 deletions(-)
>
>diff --git a/drivers/usb/musb/blackfin.c b/drivers/usb/musb/blackfin.c
>index b611420..0bef011 100644
>--- a/drivers/usb/musb/blackfin.c
>+++ b/drivers/usb/musb/blackfin.c
>@@ -323,7 +323,7 @@ int musb_platform_set_mode(struct musb 
>*musb, u8 musb_mode)
> 	return -EIO;
> }
> 
>-int __init musb_platform_init(struct musb *musb, void *board_data)
>+int __init musb_platform_init(struct musb *musb)
> {
> 
> 	/*
>diff --git a/drivers/usb/musb/davinci.c b/drivers/usb/musb/davinci.c
>index 5762436..ce2e16f 100644
>--- a/drivers/usb/musb/davinci.c
>+++ b/drivers/usb/musb/davinci.c
>@@ -376,7 +376,7 @@ int musb_platform_set_mode(struct musb 
>*musb, u8 mode)
> 	return -EIO;
> }
> 
>-int __init musb_platform_init(struct musb *musb, void *board_data)
>+int __init musb_platform_init(struct musb *musb)
> {
> 	void __iomem	*tibase = musb->ctrl_base;
> 	u32		revision;
>diff --git a/drivers/usb/musb/musb_core.c 
>b/drivers/usb/musb/musb_core.c
>index d3911ab..1ccc4d7 100644
>--- a/drivers/usb/musb/musb_core.c
>+++ b/drivers/usb/musb/musb_core.c
>@@ -1961,6 +1961,7 @@ bad_config:
> 	}
> 
> 	spin_lock_init(&musb->lock);
>+	musb->board_data = plat->board_data;
> 	musb->board_mode = plat->mode;
> 	musb->board_set_power = plat->set_power;
> 	musb->set_clock = plat->set_clock;

I think musb structure already has a pointer to device structure which intern has the platform_data pointer.
I think all of these member variables are not required. Might need to cleanup the musb structre. 

>@@ -1995,7 +1996,7 @@ bad_config:
> 	 * isp1504, non-OTG, etc) mostly hooking up through ULPI.
> 	 */
> 	musb->isr = generic_interrupt;
>-	status = musb_platform_init(musb, plat->board_data);
>+	status = musb_platform_init(musb);
> 	if (status < 0)
> 		goto fail2;
> 
>diff --git a/drivers/usb/musb/musb_core.h 
>b/drivers/usb/musb/musb_core.h
>index 7cef2b7..9dddaa4 100644
>--- a/drivers/usb/musb/musb_core.h
>+++ b/drivers/usb/musb/musb_core.h
>@@ -393,6 +393,7 @@ struct musb {
> 	int			(*board_set_power)(int state);
> 
> 	int			(*set_clock)(struct clk *clk, 
>int is_active);
>+	void			*board_data;	/* board 
>specific data */
> 
> 	u8			min_power;	/* vbus for 
>periph, in mA/2 */
> 
>@@ -604,7 +605,7 @@ extern int 
>musb_platform_get_vbus_status(struct musb *musb);
> #define musb_platform_get_vbus_status(x)	0
> #endif
> 
>-extern int __init musb_platform_init(struct musb *musb, void 
>*board_data);
>+extern int __init musb_platform_init(struct musb *musb);
> extern int musb_platform_exit(struct musb *musb);
> 
> #endif	/* __MUSB_CORE_H__ */
>diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c
>index e06d65e..50591e7 100644
>--- a/drivers/usb/musb/omap2430.c
>+++ b/drivers/usb/musb/omap2430.c
>@@ -189,10 +189,10 @@ int musb_platform_set_mode(struct musb 
>*musb, u8 musb_mode)
> 	return 0;
> }
> 
>-int __init musb_platform_init(struct musb *musb, void *board_data)
>+int __init musb_platform_init(struct musb *musb)
> {
> 	u32 l;
>-	struct omap_musb_board_data *data = board_data;
>+	struct omap_musb_board_data *data = musb->board_data;
> 
> #if defined(CONFIG_ARCH_OMAP2430)
> 	omap_cfg_reg(AE5_2430_USB0HS_STP);
>diff --git a/drivers/usb/musb/tusb6010.c b/drivers/usb/musb/tusb6010.c
>index 05c077f..60d3938 100644
>--- a/drivers/usb/musb/tusb6010.c
>+++ b/drivers/usb/musb/tusb6010.c
>@@ -1104,7 +1104,7 @@ err:
> 	return -ENODEV;
> }
> 
>-int __init musb_platform_init(struct musb *musb, void *board_data)
>+int __init musb_platform_init(struct musb *musb)
> {
> 	struct platform_device	*pdev;
> 	struct resource		*mem;
>-- 
>1.6.2.4
>
>--
>To unsubscribe from this list: send the line "unsubscribe linux-usb" in
>the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
>More majordomo info at  http://vger.kernel.org/majordomo-info.html
>--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-05-27  9:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-27  7:04 [PATCH 1/3] OMAP3: musb: add neednop flag to fix nop modular issue Ajay Kumar Gupta
     [not found] ` <1274943888-17615-1-git-send-email-ajay.gupta-l0cyMroinI0@public.gmane.org>
2010-05-27  7:04   ` [PATCH 2/3] musb: populate board_data within musb structure Ajay Kumar Gupta
2010-05-27  7:04     ` [PATCH 3/3] musb: use neednop flag for nop registration Ajay Kumar Gupta
     [not found]     ` <1274943888-17615-2-git-send-email-ajay.gupta-l0cyMroinI0@public.gmane.org>
2010-05-27  9:03       ` [PATCH 2/3] musb: populate board_data within musb structure Kalliguddi, Hema

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).