public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/8] musb patches
@ 2009-12-28 11:09 Felipe Balbi
  2009-12-28 11:09 ` [PATCH 1/8] arm: omap: musb: remove unused data Felipe Balbi
                   ` (7 more replies)
  0 siblings, 8 replies; 17+ messages in thread
From: Felipe Balbi @ 2009-12-28 11:09 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: Linux OMAP Mailing List, Felipe Balbi

Hi Tony,

the following are few cleanups for the usb-musb.c
file. Another patch will go through Greg getting rid
of omap_readl/omap_writel.

For ease, these patches are also available at:

git://gitorious.org/usb/usb.git for-tony

. Boot tested on RX-51
. Compile tested with all defconfigs that have USB_MUSB_SOC=y

Felipe Balbi (8):
  arm: omap: musb: remove unused data
  arm: omap: musb: we can use clk framework
  arm: omap: musb: remove unused soft_con field
  arm: omap: musb: remove unused dma data
  arm: omap: musb: ioremap only what's ours
  arm: omap: musb: pass power to usb_musb_init
  arm: omap: musb: pass board mode to usb_musb_init
  arm: omap: musb: remove unnecessary return

 arch/arm/mach-omap2/board-2430sdp.c          |    3 +-
 arch/arm/mach-omap2/board-3430sdp.c          |    3 +-
 arch/arm/mach-omap2/board-cm-t35.c           |    3 +-
 arch/arm/mach-omap2/board-igep0020.c         |    3 +-
 arch/arm/mach-omap2/board-ldp.c              |    3 +-
 arch/arm/mach-omap2/board-omap3beagle.c      |    3 +-
 arch/arm/mach-omap2/board-omap3evm.c         |    3 +-
 arch/arm/mach-omap2/board-omap3pandora.c     |    3 +-
 arch/arm/mach-omap2/board-omap3touchbook.c   |    3 +-
 arch/arm/mach-omap2/board-overo.c            |    3 +-
 arch/arm/mach-omap2/board-rx51.c             |    3 +-
 arch/arm/mach-omap2/board-zoom-peripherals.c |    3 +-
 arch/arm/mach-omap2/usb-musb.c               |   87 +++-----------------------
 arch/arm/plat-omap/include/plat/usb.h        |    3 +-
 14 files changed, 34 insertions(+), 92 deletions(-)


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

* [PATCH 1/8] arm: omap: musb: remove unused data
  2009-12-28 11:09 [PATCH 0/8] musb patches Felipe Balbi
@ 2009-12-28 11:09 ` Felipe Balbi
  2009-12-28 11:09 ` [PATCH 2/8] arm: omap: musb: we can use clk framework Felipe Balbi
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 17+ messages in thread
From: Felipe Balbi @ 2009-12-28 11:09 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: Linux OMAP Mailing List, Felipe Balbi, Felipe Balbi

eps_bits wasn't being used anywhere, let's
remove it.

Signed-off-by: Felipe Balbi <me@felipebalbi.com>
---
 arch/arm/mach-omap2/usb-musb.c |   34 ----------------------------------
 1 files changed, 0 insertions(+), 34 deletions(-)

diff --git a/arch/arm/mach-omap2/usb-musb.c b/arch/arm/mach-omap2/usb-musb.c
index a80441d..de7ae49 100644
--- a/arch/arm/mach-omap2/usb-musb.c
+++ b/arch/arm/mach-omap2/usb-musb.c
@@ -68,39 +68,6 @@ static int musb_set_clock(struct clk *clk, int state)
 	return 0;
 }
 
-static struct musb_hdrc_eps_bits musb_eps[] = {
-	{	"ep1_tx", 10,	},
-	{	"ep1_rx", 10,	},
-	{	"ep2_tx", 9,	},
-	{	"ep2_rx", 9,	},
-	{	"ep3_tx", 3,	},
-	{	"ep3_rx", 3,	},
-	{	"ep4_tx", 3,	},
-	{	"ep4_rx", 3,	},
-	{	"ep5_tx", 3,	},
-	{	"ep5_rx", 3,	},
-	{	"ep6_tx", 3,	},
-	{	"ep6_rx", 3,	},
-	{	"ep7_tx", 3,	},
-	{	"ep7_rx", 3,	},
-	{	"ep8_tx", 2,	},
-	{	"ep8_rx", 2,	},
-	{	"ep9_tx", 2,	},
-	{	"ep9_rx", 2,	},
-	{	"ep10_tx", 2,	},
-	{	"ep10_rx", 2,	},
-	{	"ep11_tx", 2,	},
-	{	"ep11_rx", 2,	},
-	{	"ep12_tx", 2,	},
-	{	"ep12_rx", 2,	},
-	{	"ep13_tx", 2,	},
-	{	"ep13_rx", 2,	},
-	{	"ep14_tx", 2,	},
-	{	"ep14_rx", 2,	},
-	{	"ep15_tx", 2,	},
-	{	"ep15_rx", 2,	},
-};
-
 static struct musb_hdrc_config musb_config = {
 	.multipoint	= 1,
 	.dyn_fifo	= 1,
@@ -110,7 +77,6 @@ static struct musb_hdrc_config musb_config = {
 	.dma_channels	= 7,
 	.dma_req_chan	= (1 << 0) | (1 << 1) | (1 << 2) | (1 << 3),
 	.ram_bits	= 12,
-	.eps_bits	= musb_eps,
 };
 
 static struct musb_hdrc_platform_data musb_plat = {
-- 
1.6.6.rc0


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

* [PATCH 2/8] arm: omap: musb: we can use clk framework
  2009-12-28 11:09 [PATCH 0/8] musb patches Felipe Balbi
  2009-12-28 11:09 ` [PATCH 1/8] arm: omap: musb: remove unused data Felipe Balbi
@ 2009-12-28 11:09 ` Felipe Balbi
  2009-12-28 11:09 ` [PATCH 3/8] arm: omap: musb: remove unused soft_con field Felipe Balbi
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 17+ messages in thread
From: Felipe Balbi @ 2009-12-28 11:09 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: Linux OMAP Mailing List, Felipe Balbi

... in order to handle musb's clock. Let's start
removing the old musb-only set_clock function.

Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
---
 arch/arm/mach-omap2/usb-musb.c |   22 ----------------------
 1 files changed, 0 insertions(+), 22 deletions(-)

diff --git a/arch/arm/mach-omap2/usb-musb.c b/arch/arm/mach-omap2/usb-musb.c
index de7ae49..5a55c12 100644
--- a/arch/arm/mach-omap2/usb-musb.c
+++ b/arch/arm/mach-omap2/usb-musb.c
@@ -47,27 +47,6 @@ static struct resource musb_resources[] = {
 	},
 };
 
-static int clk_on;
-
-static int musb_set_clock(struct clk *clk, int state)
-{
-	if (state) {
-		if (clk_on > 0)
-			return -ENODEV;
-
-		clk_enable(clk);
-		clk_on = 1;
-	} else {
-		if (clk_on == 0)
-			return -ENODEV;
-
-		clk_disable(clk);
-		clk_on = 0;
-	}
-
-	return 0;
-}
-
 static struct musb_hdrc_config musb_config = {
 	.multipoint	= 1,
 	.dyn_fifo	= 1,
@@ -88,7 +67,6 @@ static struct musb_hdrc_platform_data musb_plat = {
 	.mode		= MUSB_PERIPHERAL,
 #endif
 	/* .clock is set dynamically */
-	.set_clock	= musb_set_clock,
 	.config		= &musb_config,
 
 	/* REVISIT charge pump on TWL4030 can supply up to
-- 
1.6.6.rc0


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

* [PATCH 3/8] arm: omap: musb: remove unused soft_con field
  2009-12-28 11:09 [PATCH 0/8] musb patches Felipe Balbi
  2009-12-28 11:09 ` [PATCH 1/8] arm: omap: musb: remove unused data Felipe Balbi
  2009-12-28 11:09 ` [PATCH 2/8] arm: omap: musb: we can use clk framework Felipe Balbi
@ 2009-12-28 11:09 ` Felipe Balbi
  2009-12-28 11:09 ` [PATCH 4/8] arm: omap: musb: remove unused dma data Felipe Balbi
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 17+ messages in thread
From: Felipe Balbi @ 2009-12-28 11:09 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: Linux OMAP Mailing List, Felipe Balbi

remove unused data.

Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
---
 arch/arm/mach-omap2/usb-musb.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap2/usb-musb.c b/arch/arm/mach-omap2/usb-musb.c
index 5a55c12..ceee958 100644
--- a/arch/arm/mach-omap2/usb-musb.c
+++ b/arch/arm/mach-omap2/usb-musb.c
@@ -50,7 +50,6 @@ static struct resource musb_resources[] = {
 static struct musb_hdrc_config musb_config = {
 	.multipoint	= 1,
 	.dyn_fifo	= 1,
-	.soft_con	= 1,
 	.dma		= 1,
 	.num_eps	= 16,
 	.dma_channels	= 7,
-- 
1.6.6.rc0


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

* [PATCH 4/8] arm: omap: musb: remove unused dma data
  2009-12-28 11:09 [PATCH 0/8] musb patches Felipe Balbi
                   ` (2 preceding siblings ...)
  2009-12-28 11:09 ` [PATCH 3/8] arm: omap: musb: remove unused soft_con field Felipe Balbi
@ 2009-12-28 11:09 ` Felipe Balbi
  2009-12-28 11:09 ` [PATCH 5/8] arm: omap: musb: ioremap only what's ours Felipe Balbi
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 17+ messages in thread
From: Felipe Balbi @ 2009-12-28 11:09 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: Linux OMAP Mailing List, Felipe Balbi

we don't use those anywhere on musb driver, so
let's remove those old stuff.

Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
---
 arch/arm/mach-omap2/usb-musb.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-omap2/usb-musb.c b/arch/arm/mach-omap2/usb-musb.c
index ceee958..12b0d24 100644
--- a/arch/arm/mach-omap2/usb-musb.c
+++ b/arch/arm/mach-omap2/usb-musb.c
@@ -50,10 +50,7 @@ static struct resource musb_resources[] = {
 static struct musb_hdrc_config musb_config = {
 	.multipoint	= 1,
 	.dyn_fifo	= 1,
-	.dma		= 1,
 	.num_eps	= 16,
-	.dma_channels	= 7,
-	.dma_req_chan	= (1 << 0) | (1 << 1) | (1 << 2) | (1 << 3),
 	.ram_bits	= 12,
 };
 
-- 
1.6.6.rc0


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

* [PATCH 5/8] arm: omap: musb: ioremap only what's ours
  2009-12-28 11:09 [PATCH 0/8] musb patches Felipe Balbi
                   ` (3 preceding siblings ...)
  2009-12-28 11:09 ` [PATCH 4/8] arm: omap: musb: remove unused dma data Felipe Balbi
@ 2009-12-28 11:09 ` Felipe Balbi
  2009-12-28 11:09 ` [PATCH 6/8] arm: omap: musb: pass power to usb_musb_init Felipe Balbi
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 17+ messages in thread
From: Felipe Balbi @ 2009-12-28 11:09 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: Linux OMAP Mailing List, Felipe Balbi

omap3430 TRM says the OTG address space is 4k, not 8k.

Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
---
 arch/arm/mach-omap2/usb-musb.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap2/usb-musb.c b/arch/arm/mach-omap2/usb-musb.c
index 12b0d24..d12e311 100644
--- a/arch/arm/mach-omap2/usb-musb.c
+++ b/arch/arm/mach-omap2/usb-musb.c
@@ -92,7 +92,7 @@ void __init usb_musb_init(void)
 		musb_resources[0].start = OMAP243X_HS_BASE;
 	else
 		musb_resources[0].start = OMAP34XX_HSUSB_OTG_BASE;
-	musb_resources[0].end = musb_resources[0].start + SZ_8K - 1;
+	musb_resources[0].end = musb_resources[0].start + SZ_4K - 1;
 
 	/*
 	 * REVISIT: This line can be removed once all the platforms using
-- 
1.6.6.rc0


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

* [PATCH 6/8] arm: omap: musb: pass power to usb_musb_init
  2009-12-28 11:09 [PATCH 0/8] musb patches Felipe Balbi
                   ` (4 preceding siblings ...)
  2009-12-28 11:09 ` [PATCH 5/8] arm: omap: musb: ioremap only what's ours Felipe Balbi
@ 2009-12-28 11:09 ` Felipe Balbi
  2009-12-29 19:51   ` Tony Lindgren
  2009-12-28 11:09 ` [PATCH 7/8] arm: omap: musb: pass board mode " Felipe Balbi
  2009-12-28 11:09 ` [PATCH 8/8] arm: omap: musb: remove unnecessary return Felipe Balbi
  7 siblings, 1 reply; 17+ messages in thread
From: Felipe Balbi @ 2009-12-28 11:09 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: Linux OMAP Mailing List, Felipe Balbi

each board might have a different charge pump and
thus able to source more or less current on vbus
so let power be easily configurable.

Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
---
 arch/arm/mach-omap2/board-2430sdp.c          |    2 +-
 arch/arm/mach-omap2/board-3430sdp.c          |    2 +-
 arch/arm/mach-omap2/board-cm-t35.c           |    2 +-
 arch/arm/mach-omap2/board-igep0020.c         |    2 +-
 arch/arm/mach-omap2/board-ldp.c              |    2 +-
 arch/arm/mach-omap2/board-omap3beagle.c      |    2 +-
 arch/arm/mach-omap2/board-omap3evm.c         |    2 +-
 arch/arm/mach-omap2/board-omap3pandora.c     |    2 +-
 arch/arm/mach-omap2/board-omap3touchbook.c   |    2 +-
 arch/arm/mach-omap2/board-overo.c            |    2 +-
 arch/arm/mach-omap2/board-rx51.c             |    2 +-
 arch/arm/mach-omap2/board-zoom-peripherals.c |    2 +-
 arch/arm/mach-omap2/usb-musb.c               |   12 ++++--------
 arch/arm/plat-omap/include/plat/usb.h        |    2 +-
 14 files changed, 17 insertions(+), 21 deletions(-)

diff --git a/arch/arm/mach-omap2/board-2430sdp.c b/arch/arm/mach-omap2/board-2430sdp.c
index e508904..d3857d6 100644
--- a/arch/arm/mach-omap2/board-2430sdp.c
+++ b/arch/arm/mach-omap2/board-2430sdp.c
@@ -203,7 +203,7 @@ static void __init omap_2430sdp_init(void)
 	platform_add_devices(sdp2430_devices, ARRAY_SIZE(sdp2430_devices));
 	omap_serial_init();
 	twl4030_mmc_init(mmc);
-	usb_musb_init();
+	usb_musb_init(100);
 	board_smc91x_init();
 
 	/* Turn off secondary LCD backlight */
diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c
index c90b0d0..1d52fd1 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -664,7 +664,7 @@ static void __init omap_3430sdp_init(void)
 				ARRAY_SIZE(sdp3430_spi_board_info));
 	ads7846_dev_init();
 	omap_serial_init();
-	usb_musb_init();
+	usb_musb_init(100);
 	board_smc91x_init();
 	sdp3430_display_init();
 	enable_board_wakeup_source();
diff --git a/arch/arm/mach-omap2/board-cm-t35.c b/arch/arm/mach-omap2/board-cm-t35.c
index 2626a9f..56922f4 100644
--- a/arch/arm/mach-omap2/board-cm-t35.c
+++ b/arch/arm/mach-omap2/board-cm-t35.c
@@ -585,7 +585,7 @@ static void __init cm_t35_init(void)
 	cm_t35_init_ethernet();
 	cm_t35_init_led();
 
-	usb_musb_init();
+	usb_musb_init(100);
 }
 
 MACHINE_START(CM_T35, "Compulab CM-T35")
diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c
index 117b8fd..16be1d5 100644
--- a/arch/arm/mach-omap2/board-igep0020.c
+++ b/arch/arm/mach-omap2/board-igep0020.c
@@ -216,7 +216,7 @@ static void __init igep2_init(void)
 	omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
 	igep2_i2c_init();
 	omap_serial_init();
-	usb_musb_init();
+	usb_musb_init(100);
 
 	igep2_init_smsc911x();
 
diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
index 995d4a2..ca2acd2 100644
--- a/arch/arm/mach-omap2/board-ldp.c
+++ b/arch/arm/mach-omap2/board-ldp.c
@@ -394,7 +394,7 @@ static void __init omap_ldp_init(void)
 				ARRAY_SIZE(ldp_spi_board_info));
 	ads7846_dev_init();
 	omap_serial_init();
-	usb_musb_init();
+	usb_musb_init(100);
 
 	twl4030_mmc_init(mmc);
 	/* link regulators to MMC adapters */
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index 231cb4e..52f65e6 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -443,7 +443,7 @@ static void __init omap3_beagle_init(void)
 	/* REVISIT leave DVI powered down until it's needed ... */
 	gpio_direction_output(170, true);
 
-	usb_musb_init();
+	usb_musb_init(100);
 	usb_ehci_init(&ehci_pdata);
 	omap3beagle_flash_init();
 
diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c
index 34de178..c5fd85d 100644
--- a/arch/arm/mach-omap2/board-omap3evm.c
+++ b/arch/arm/mach-omap2/board-omap3evm.c
@@ -469,7 +469,7 @@ static void __init omap3_evm_init(void)
 		omap_mux_init_gpio(135, OMAP_PIN_OUTPUT);
 		ehci_pdata.reset_gpio_port[1] = 135;
 	}
-	usb_musb_init();
+	usb_musb_init(100);
 	usb_ehci_init(&ehci_pdata);
 	ads7846_dev_init();
 	omap3evm_init_smsc911x();
diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c
index ef17cf1..b0cdf77 100644
--- a/arch/arm/mach-omap2/board-omap3pandora.c
+++ b/arch/arm/mach-omap2/board-omap3pandora.c
@@ -413,7 +413,7 @@ static void __init omap3pandora_init(void)
 	omap3pandora_ads7846_init();
 	usb_ehci_init(&ehci_pdata);
 	pandora_keys_gpio_init();
-	usb_musb_init();
+	usb_musb_init(100);
 
 	/* Ensure SDRC pins are mux'd for self-refresh */
 	omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT);
diff --git a/arch/arm/mach-omap2/board-omap3touchbook.c b/arch/arm/mach-omap2/board-omap3touchbook.c
index fe3d22c..f7f7670 100644
--- a/arch/arm/mach-omap2/board-omap3touchbook.c
+++ b/arch/arm/mach-omap2/board-omap3touchbook.c
@@ -545,7 +545,7 @@ static void __init omap3_touchbook_init(void)
 	spi_register_board_info(omap3_ads7846_spi_board_info,
 				ARRAY_SIZE(omap3_ads7846_spi_board_info));
 	omap3_ads7846_init();
-	usb_musb_init();
+	usb_musb_init(100);
 	usb_ehci_init(&ehci_pdata);
 	omap3touchbook_flash_init();
 
diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c
index d192dd9..4e07a08 100644
--- a/arch/arm/mach-omap2/board-overo.c
+++ b/arch/arm/mach-omap2/board-overo.c
@@ -420,7 +420,7 @@ static void __init overo_init(void)
 	platform_add_devices(overo_devices, ARRAY_SIZE(overo_devices));
 	omap_serial_init();
 	overo_flash_init();
-	usb_musb_init();
+	usb_musb_init(100);
 	usb_ehci_init(&ehci_pdata);
 	overo_ads7846_init();
 	overo_init_smsc911x();
diff --git a/arch/arm/mach-omap2/board-rx51.c b/arch/arm/mach-omap2/board-rx51.c
index 67bb347..0e19316 100644
--- a/arch/arm/mach-omap2/board-rx51.c
+++ b/arch/arm/mach-omap2/board-rx51.c
@@ -82,7 +82,7 @@ static void __init rx51_init(void)
 {
 	omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
 	omap_serial_init();
-	usb_musb_init();
+	usb_musb_init(0);
 	rx51_peripherals_init();
 
 	/* Ensure SDRC pins are mux'd for self-refresh */
diff --git a/arch/arm/mach-omap2/board-zoom-peripherals.c b/arch/arm/mach-omap2/board-zoom-peripherals.c
index 8dd277c..abb5fc2 100755
--- a/arch/arm/mach-omap2/board-zoom-peripherals.c
+++ b/arch/arm/mach-omap2/board-zoom-peripherals.c
@@ -267,5 +267,5 @@ void __init zoom_peripherals_init(void)
 {
 	omap_i2c_init();
 	omap_serial_init();
-	usb_musb_init();
+	usb_musb_init(100);
 }
diff --git a/arch/arm/mach-omap2/usb-musb.c b/arch/arm/mach-omap2/usb-musb.c
index d12e311..6c2895e 100644
--- a/arch/arm/mach-omap2/usb-musb.c
+++ b/arch/arm/mach-omap2/usb-musb.c
@@ -64,12 +64,7 @@ static struct musb_hdrc_platform_data musb_plat = {
 #endif
 	/* .clock is set dynamically */
 	.config		= &musb_config,
-
-	/* REVISIT charge pump on TWL4030 can supply up to
-	 * 100 mA ... but this value is board-specific, like
-	 * "mode", and should be passed to usb_musb_init().
-	 */
-	.power		= 50,			/* up to 100 mA */
+	/* .power	= DYNAMIC, */
 };
 
 static u64 musb_dmamask = DMA_BIT_MASK(32);
@@ -86,7 +81,7 @@ static struct platform_device musb_device = {
 	.resource	= musb_resources,
 };
 
-void __init usb_musb_init(void)
+void __init usb_musb_init(unsigned power)
 {
 	if (cpu_is_omap243x())
 		musb_resources[0].start = OMAP243X_HS_BASE;
@@ -99,6 +94,7 @@ void __init usb_musb_init(void)
 	 * musb_core.c have been converted to use use clkdev.
 	 */
 	musb_plat.clock = "ick";
+	musb_plat.power = power >> 1;
 
 	if (platform_device_register(&musb_device) < 0) {
 		printk(KERN_ERR "Unable to register HS-USB (MUSB) device\n");
@@ -107,7 +103,7 @@ void __init usb_musb_init(void)
 }
 
 #else
-void __init usb_musb_init(void)
+void __init usb_musb_init(unsigned power)
 {
 }
 #endif /* CONFIG_USB_MUSB_SOC */
diff --git a/arch/arm/plat-omap/include/plat/usb.h b/arch/arm/plat-omap/include/plat/usb.h
index 33a500e..1b779a1 100644
--- a/arch/arm/plat-omap/include/plat/usb.h
+++ b/arch/arm/plat-omap/include/plat/usb.h
@@ -42,7 +42,7 @@ struct ehci_hcd_omap_platform_data {
 #define UDC_BASE			OMAP2_UDC_BASE
 #define OMAP_OHCI_BASE			OMAP2_OHCI_BASE
 
-extern void usb_musb_init(void);
+extern void usb_musb_init(unsigned power);
 
 extern void usb_ehci_init(struct ehci_hcd_omap_platform_data *pdata);
 
-- 
1.6.6.rc0


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

* [PATCH 7/8] arm: omap: musb: pass board mode to usb_musb_init
  2009-12-28 11:09 [PATCH 0/8] musb patches Felipe Balbi
                   ` (5 preceding siblings ...)
  2009-12-28 11:09 ` [PATCH 6/8] arm: omap: musb: pass power to usb_musb_init Felipe Balbi
@ 2009-12-28 11:09 ` Felipe Balbi
  2009-12-29 19:51   ` Tony Lindgren
  2009-12-30  4:44   ` Gupta, Ajay Kumar
  2009-12-28 11:09 ` [PATCH 8/8] arm: omap: musb: remove unnecessary return Felipe Balbi
  7 siblings, 2 replies; 17+ messages in thread
From: Felipe Balbi @ 2009-12-28 11:09 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: Linux OMAP Mailing List, Felipe Balbi

each board will have a different mode which is peculiar
to that board.

Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
---
 arch/arm/mach-omap2/board-2430sdp.c          |    3 ++-
 arch/arm/mach-omap2/board-3430sdp.c          |    3 ++-
 arch/arm/mach-omap2/board-cm-t35.c           |    3 ++-
 arch/arm/mach-omap2/board-igep0020.c         |    3 ++-
 arch/arm/mach-omap2/board-ldp.c              |    3 ++-
 arch/arm/mach-omap2/board-omap3beagle.c      |    3 ++-
 arch/arm/mach-omap2/board-omap3evm.c         |    3 ++-
 arch/arm/mach-omap2/board-omap3pandora.c     |    3 ++-
 arch/arm/mach-omap2/board-omap3touchbook.c   |    3 ++-
 arch/arm/mach-omap2/board-overo.c            |    3 ++-
 arch/arm/mach-omap2/board-rx51.c             |    3 ++-
 arch/arm/mach-omap2/board-zoom-peripherals.c |    3 ++-
 arch/arm/mach-omap2/usb-musb.c               |   13 ++++---------
 arch/arm/plat-omap/include/plat/usb.h        |    3 ++-
 14 files changed, 30 insertions(+), 22 deletions(-)

diff --git a/arch/arm/mach-omap2/board-2430sdp.c b/arch/arm/mach-omap2/board-2430sdp.c
index d3857d6..45d3197 100644
--- a/arch/arm/mach-omap2/board-2430sdp.c
+++ b/arch/arm/mach-omap2/board-2430sdp.c
@@ -23,6 +23,7 @@
 #include <linux/err.h>
 #include <linux/clk.h>
 #include <linux/io.h>
+#include <linux/usb/musb.h>
 
 #include <mach/hardware.h>
 #include <asm/mach-types.h>
@@ -203,7 +204,7 @@ static void __init omap_2430sdp_init(void)
 	platform_add_devices(sdp2430_devices, ARRAY_SIZE(sdp2430_devices));
 	omap_serial_init();
 	twl4030_mmc_init(mmc);
-	usb_musb_init(100);
+	usb_musb_init(MUSB_OTG, 100);
 	board_smc91x_init();
 
 	/* Turn off secondary LCD backlight */
diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c
index 1d52fd1..37e7328 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -24,6 +24,7 @@
 #include <linux/regulator/machine.h>
 #include <linux/io.h>
 #include <linux/gpio.h>
+#include <linux/usb/musb.h>
 
 #include <mach/hardware.h>
 #include <asm/mach-types.h>
@@ -664,7 +665,7 @@ static void __init omap_3430sdp_init(void)
 				ARRAY_SIZE(sdp3430_spi_board_info));
 	ads7846_dev_init();
 	omap_serial_init();
-	usb_musb_init(100);
+	usb_musb_init(MUSB_OTG, 100);
 	board_smc91x_init();
 	sdp3430_display_init();
 	enable_board_wakeup_source();
diff --git a/arch/arm/mach-omap2/board-cm-t35.c b/arch/arm/mach-omap2/board-cm-t35.c
index 56922f4..9d5db6b 100644
--- a/arch/arm/mach-omap2/board-cm-t35.c
+++ b/arch/arm/mach-omap2/board-cm-t35.c
@@ -27,6 +27,7 @@
 #include <linux/input/matrix_keypad.h>
 #include <linux/delay.h>
 #include <linux/gpio.h>
+#include <linux/usb/musb.h>
 
 #include <linux/i2c/at24.h>
 #include <linux/i2c/twl.h>
@@ -585,7 +586,7 @@ static void __init cm_t35_init(void)
 	cm_t35_init_ethernet();
 	cm_t35_init_led();
 
-	usb_musb_init(100);
+	usb_musb_init(MUSB_OTG, 100);
 }
 
 MACHINE_START(CM_T35, "Compulab CM-T35")
diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c
index 16be1d5..6fc0608 100644
--- a/arch/arm/mach-omap2/board-igep0020.c
+++ b/arch/arm/mach-omap2/board-igep0020.c
@@ -17,6 +17,7 @@
 #include <linux/io.h>
 #include <linux/gpio.h>
 #include <linux/interrupt.h>
+#include <linux/usb/musb.h>
 
 #include <linux/regulator/machine.h>
 #include <linux/i2c/twl.h>
@@ -216,7 +217,7 @@ static void __init igep2_init(void)
 	omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
 	igep2_i2c_init();
 	omap_serial_init();
-	usb_musb_init(100);
+	usb_musb_init(MUSB_OTG, 100);
 
 	igep2_init_smsc911x();
 
diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
index ca2acd2..7e8c8a8 100644
--- a/arch/arm/mach-omap2/board-ldp.c
+++ b/arch/arm/mach-omap2/board-ldp.c
@@ -27,6 +27,7 @@
 #include <linux/i2c/twl.h>
 #include <linux/io.h>
 #include <linux/smsc911x.h>
+#include <linux/usb/musb.h>
 
 #include <mach/hardware.h>
 #include <asm/mach-types.h>
@@ -394,7 +395,7 @@ static void __init omap_ldp_init(void)
 				ARRAY_SIZE(ldp_spi_board_info));
 	ads7846_dev_init();
 	omap_serial_init();
-	usb_musb_init(100);
+	usb_musb_init(MUSB_OTG, 100);
 
 	twl4030_mmc_init(mmc);
 	/* link regulators to MMC adapters */
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index 52f65e6..17f6381 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -23,6 +23,7 @@
 #include <linux/gpio.h>
 #include <linux/input.h>
 #include <linux/gpio_keys.h>
+#include <linux/usb/musb.h>
 
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/partitions.h>
@@ -443,7 +444,7 @@ static void __init omap3_beagle_init(void)
 	/* REVISIT leave DVI powered down until it's needed ... */
 	gpio_direction_output(170, true);
 
-	usb_musb_init(100);
+	usb_musb_init(MUSB_OTG, 100);
 	usb_ehci_init(&ehci_pdata);
 	omap3beagle_flash_init();
 
diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c
index c5fd85d..1160004 100644
--- a/arch/arm/mach-omap2/board-omap3evm.c
+++ b/arch/arm/mach-omap2/board-omap3evm.c
@@ -23,6 +23,7 @@
 #include <linux/input/matrix_keypad.h>
 #include <linux/leds.h>
 #include <linux/interrupt.h>
+#include <linux/usb/musb.h>
 
 #include <linux/spi/spi.h>
 #include <linux/spi/ads7846.h>
@@ -469,7 +470,7 @@ static void __init omap3_evm_init(void)
 		omap_mux_init_gpio(135, OMAP_PIN_OUTPUT);
 		ehci_pdata.reset_gpio_port[1] = 135;
 	}
-	usb_musb_init(100);
+	usb_musb_init(MUSB_OTG, 100);
 	usb_ehci_init(&ehci_pdata);
 	ads7846_dev_init();
 	omap3evm_init_smsc911x();
diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c
index b0cdf77..191b75c 100644
--- a/arch/arm/mach-omap2/board-omap3pandora.c
+++ b/arch/arm/mach-omap2/board-omap3pandora.c
@@ -29,6 +29,7 @@
 #include <linux/input.h>
 #include <linux/input/matrix_keypad.h>
 #include <linux/gpio_keys.h>
+#include <linux/usb/musb.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -413,7 +414,7 @@ static void __init omap3pandora_init(void)
 	omap3pandora_ads7846_init();
 	usb_ehci_init(&ehci_pdata);
 	pandora_keys_gpio_init();
-	usb_musb_init(100);
+	usb_musb_init(MUSB_OTG, 100);
 
 	/* Ensure SDRC pins are mux'd for self-refresh */
 	omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT);
diff --git a/arch/arm/mach-omap2/board-omap3touchbook.c b/arch/arm/mach-omap2/board-omap3touchbook.c
index f7f7670..287b914 100644
--- a/arch/arm/mach-omap2/board-omap3touchbook.c
+++ b/arch/arm/mach-omap2/board-omap3touchbook.c
@@ -23,6 +23,7 @@
 #include <linux/gpio.h>
 #include <linux/input.h>
 #include <linux/gpio_keys.h>
+#include <linux/usb/musb.h>
 
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/partitions.h>
@@ -545,7 +546,7 @@ static void __init omap3_touchbook_init(void)
 	spi_register_board_info(omap3_ads7846_spi_board_info,
 				ARRAY_SIZE(omap3_ads7846_spi_board_info));
 	omap3_ads7846_init();
-	usb_musb_init(100);
+	usb_musb_init(MUSB_OTG, 100);
 	usb_ehci_init(&ehci_pdata);
 	omap3touchbook_flash_init();
 
diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c
index 4e07a08..df04029 100644
--- a/arch/arm/mach-omap2/board-overo.c
+++ b/arch/arm/mach-omap2/board-overo.c
@@ -28,6 +28,7 @@
 #include <linux/platform_device.h>
 #include <linux/i2c/twl.h>
 #include <linux/regulator/machine.h>
+#include <linux/usb/musb.h>
 
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/nand.h>
@@ -420,7 +421,7 @@ static void __init overo_init(void)
 	platform_add_devices(overo_devices, ARRAY_SIZE(overo_devices));
 	omap_serial_init();
 	overo_flash_init();
-	usb_musb_init(100);
+	usb_musb_init(MUSB_OTG, 100);
 	usb_ehci_init(&ehci_pdata);
 	overo_ads7846_init();
 	overo_init_smsc911x();
diff --git a/arch/arm/mach-omap2/board-rx51.c b/arch/arm/mach-omap2/board-rx51.c
index 0e19316..2480870 100644
--- a/arch/arm/mach-omap2/board-rx51.c
+++ b/arch/arm/mach-omap2/board-rx51.c
@@ -16,6 +16,7 @@
 #include <linux/clk.h>
 #include <linux/io.h>
 #include <linux/gpio.h>
+#include <linux/usb/musb.h>
 
 #include <mach/hardware.h>
 #include <asm/mach-types.h>
@@ -82,7 +83,7 @@ static void __init rx51_init(void)
 {
 	omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
 	omap_serial_init();
-	usb_musb_init(0);
+	usb_musb_init(MUSB_PERIPHERAL, 0);
 	rx51_peripherals_init();
 
 	/* Ensure SDRC pins are mux'd for self-refresh */
diff --git a/arch/arm/mach-omap2/board-zoom-peripherals.c b/arch/arm/mach-omap2/board-zoom-peripherals.c
index abb5fc2..f157733 100755
--- a/arch/arm/mach-omap2/board-zoom-peripherals.c
+++ b/arch/arm/mach-omap2/board-zoom-peripherals.c
@@ -16,6 +16,7 @@
 #include <linux/gpio.h>
 #include <linux/i2c/twl.h>
 #include <linux/regulator/machine.h>
+#include <linux/usb/musb.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -267,5 +268,5 @@ void __init zoom_peripherals_init(void)
 {
 	omap_i2c_init();
 	omap_serial_init();
-	usb_musb_init(100);
+	usb_musb_init(MUSB_OTG, 100);
 }
diff --git a/arch/arm/mach-omap2/usb-musb.c b/arch/arm/mach-omap2/usb-musb.c
index 6c2895e..e0050c5 100644
--- a/arch/arm/mach-omap2/usb-musb.c
+++ b/arch/arm/mach-omap2/usb-musb.c
@@ -55,16 +55,10 @@ static struct musb_hdrc_config musb_config = {
 };
 
 static struct musb_hdrc_platform_data musb_plat = {
-#ifdef CONFIG_USB_MUSB_OTG
-	.mode		= MUSB_OTG,
-#elif defined(CONFIG_USB_MUSB_HDRC_HCD)
-	.mode		= MUSB_HOST,
-#elif defined(CONFIG_USB_GADGET_MUSB_HDRC)
-	.mode		= MUSB_PERIPHERAL,
-#endif
 	/* .clock is set dynamically */
 	.config		= &musb_config,
 	/* .power	= DYNAMIC, */
+	/* .mode	= DYNAMIC, */
 };
 
 static u64 musb_dmamask = DMA_BIT_MASK(32);
@@ -81,7 +75,7 @@ static struct platform_device musb_device = {
 	.resource	= musb_resources,
 };
 
-void __init usb_musb_init(unsigned power)
+void __init usb_musb_init(enum musb_mode mode, unsigned power)
 {
 	if (cpu_is_omap243x())
 		musb_resources[0].start = OMAP243X_HS_BASE;
@@ -95,6 +89,7 @@ void __init usb_musb_init(unsigned power)
 	 */
 	musb_plat.clock = "ick";
 	musb_plat.power = power >> 1;
+	musb_plat.mode = mode;
 
 	if (platform_device_register(&musb_device) < 0) {
 		printk(KERN_ERR "Unable to register HS-USB (MUSB) device\n");
@@ -103,7 +98,7 @@ void __init usb_musb_init(unsigned power)
 }
 
 #else
-void __init usb_musb_init(unsigned power)
+void __init usb_musb_init(enum musb_mode mode, unsigned power)
 {
 }
 #endif /* CONFIG_USB_MUSB_SOC */
diff --git a/arch/arm/plat-omap/include/plat/usb.h b/arch/arm/plat-omap/include/plat/usb.h
index 1b779a1..1e03105 100644
--- a/arch/arm/plat-omap/include/plat/usb.h
+++ b/arch/arm/plat-omap/include/plat/usb.h
@@ -3,6 +3,7 @@
 #ifndef	__ASM_ARCH_OMAP_USB_H
 #define	__ASM_ARCH_OMAP_USB_H
 
+#include <linux/usb/musb.h>
 #include <plat/board.h>
 
 #define OMAP3_HS_USB_PORTS	3
@@ -42,7 +43,7 @@ struct ehci_hcd_omap_platform_data {
 #define UDC_BASE			OMAP2_UDC_BASE
 #define OMAP_OHCI_BASE			OMAP2_OHCI_BASE
 
-extern void usb_musb_init(unsigned power);
+extern void usb_musb_init(enum musb_mode mode, unsigned power);
 
 extern void usb_ehci_init(struct ehci_hcd_omap_platform_data *pdata);
 
-- 
1.6.6.rc0


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

* [PATCH 8/8] arm: omap: musb: remove unnecessary return
  2009-12-28 11:09 [PATCH 0/8] musb patches Felipe Balbi
                   ` (6 preceding siblings ...)
  2009-12-28 11:09 ` [PATCH 7/8] arm: omap: musb: pass board mode " Felipe Balbi
@ 2009-12-28 11:09 ` Felipe Balbi
  7 siblings, 0 replies; 17+ messages in thread
From: Felipe Balbi @ 2009-12-28 11:09 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: Linux OMAP Mailing List, Felipe Balbi

trivial patch, no functional changes.

Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
---
 arch/arm/mach-omap2/usb-musb.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-omap2/usb-musb.c b/arch/arm/mach-omap2/usb-musb.c
index e0050c5..ec8869a 100644
--- a/arch/arm/mach-omap2/usb-musb.c
+++ b/arch/arm/mach-omap2/usb-musb.c
@@ -91,10 +91,8 @@ void __init usb_musb_init(enum musb_mode mode, unsigned power)
 	musb_plat.power = power >> 1;
 	musb_plat.mode = mode;
 
-	if (platform_device_register(&musb_device) < 0) {
+	if (platform_device_register(&musb_device) < 0)
 		printk(KERN_ERR "Unable to register HS-USB (MUSB) device\n");
-		return;
-	}
 }
 
 #else
-- 
1.6.6.rc0


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

* Re: [PATCH 6/8] arm: omap: musb: pass power to usb_musb_init
  2009-12-28 11:09 ` [PATCH 6/8] arm: omap: musb: pass power to usb_musb_init Felipe Balbi
@ 2009-12-29 19:51   ` Tony Lindgren
  2009-12-29 19:53     ` Felipe Balbi
  0 siblings, 1 reply; 17+ messages in thread
From: Tony Lindgren @ 2009-12-29 19:51 UTC (permalink / raw)
  To: Felipe Balbi; +Cc: Linux OMAP Mailing List

* Felipe Balbi <felipe.balbi@nokia.com> [091228 03:10]:
> each board might have a different charge pump and
> thus able to source more or less current on vbus
> so let power be easily configurable.

In order to justify merging this as a fix, can you please update
the subject and description to describe that this fixes the
the power value?

Regards,

Tony
 
> Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
> ---
>  arch/arm/mach-omap2/board-2430sdp.c          |    2 +-
>  arch/arm/mach-omap2/board-3430sdp.c          |    2 +-
>  arch/arm/mach-omap2/board-cm-t35.c           |    2 +-
>  arch/arm/mach-omap2/board-igep0020.c         |    2 +-
>  arch/arm/mach-omap2/board-ldp.c              |    2 +-
>  arch/arm/mach-omap2/board-omap3beagle.c      |    2 +-
>  arch/arm/mach-omap2/board-omap3evm.c         |    2 +-
>  arch/arm/mach-omap2/board-omap3pandora.c     |    2 +-
>  arch/arm/mach-omap2/board-omap3touchbook.c   |    2 +-
>  arch/arm/mach-omap2/board-overo.c            |    2 +-
>  arch/arm/mach-omap2/board-rx51.c             |    2 +-
>  arch/arm/mach-omap2/board-zoom-peripherals.c |    2 +-
>  arch/arm/mach-omap2/usb-musb.c               |   12 ++++--------
>  arch/arm/plat-omap/include/plat/usb.h        |    2 +-
>  14 files changed, 17 insertions(+), 21 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/board-2430sdp.c b/arch/arm/mach-omap2/board-2430sdp.c
> index e508904..d3857d6 100644
> --- a/arch/arm/mach-omap2/board-2430sdp.c
> +++ b/arch/arm/mach-omap2/board-2430sdp.c
> @@ -203,7 +203,7 @@ static void __init omap_2430sdp_init(void)
>  	platform_add_devices(sdp2430_devices, ARRAY_SIZE(sdp2430_devices));
>  	omap_serial_init();
>  	twl4030_mmc_init(mmc);
> -	usb_musb_init();
> +	usb_musb_init(100);
>  	board_smc91x_init();
>  
>  	/* Turn off secondary LCD backlight */
> diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c
> index c90b0d0..1d52fd1 100644
> --- a/arch/arm/mach-omap2/board-3430sdp.c
> +++ b/arch/arm/mach-omap2/board-3430sdp.c
> @@ -664,7 +664,7 @@ static void __init omap_3430sdp_init(void)
>  				ARRAY_SIZE(sdp3430_spi_board_info));
>  	ads7846_dev_init();
>  	omap_serial_init();
> -	usb_musb_init();
> +	usb_musb_init(100);
>  	board_smc91x_init();
>  	sdp3430_display_init();
>  	enable_board_wakeup_source();
> diff --git a/arch/arm/mach-omap2/board-cm-t35.c b/arch/arm/mach-omap2/board-cm-t35.c
> index 2626a9f..56922f4 100644
> --- a/arch/arm/mach-omap2/board-cm-t35.c
> +++ b/arch/arm/mach-omap2/board-cm-t35.c
> @@ -585,7 +585,7 @@ static void __init cm_t35_init(void)
>  	cm_t35_init_ethernet();
>  	cm_t35_init_led();
>  
> -	usb_musb_init();
> +	usb_musb_init(100);
>  }
>  
>  MACHINE_START(CM_T35, "Compulab CM-T35")
> diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c
> index 117b8fd..16be1d5 100644
> --- a/arch/arm/mach-omap2/board-igep0020.c
> +++ b/arch/arm/mach-omap2/board-igep0020.c
> @@ -216,7 +216,7 @@ static void __init igep2_init(void)
>  	omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
>  	igep2_i2c_init();
>  	omap_serial_init();
> -	usb_musb_init();
> +	usb_musb_init(100);
>  
>  	igep2_init_smsc911x();
>  
> diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
> index 995d4a2..ca2acd2 100644
> --- a/arch/arm/mach-omap2/board-ldp.c
> +++ b/arch/arm/mach-omap2/board-ldp.c
> @@ -394,7 +394,7 @@ static void __init omap_ldp_init(void)
>  				ARRAY_SIZE(ldp_spi_board_info));
>  	ads7846_dev_init();
>  	omap_serial_init();
> -	usb_musb_init();
> +	usb_musb_init(100);
>  
>  	twl4030_mmc_init(mmc);
>  	/* link regulators to MMC adapters */
> diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
> index 231cb4e..52f65e6 100644
> --- a/arch/arm/mach-omap2/board-omap3beagle.c
> +++ b/arch/arm/mach-omap2/board-omap3beagle.c
> @@ -443,7 +443,7 @@ static void __init omap3_beagle_init(void)
>  	/* REVISIT leave DVI powered down until it's needed ... */
>  	gpio_direction_output(170, true);
>  
> -	usb_musb_init();
> +	usb_musb_init(100);
>  	usb_ehci_init(&ehci_pdata);
>  	omap3beagle_flash_init();
>  
> diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c
> index 34de178..c5fd85d 100644
> --- a/arch/arm/mach-omap2/board-omap3evm.c
> +++ b/arch/arm/mach-omap2/board-omap3evm.c
> @@ -469,7 +469,7 @@ static void __init omap3_evm_init(void)
>  		omap_mux_init_gpio(135, OMAP_PIN_OUTPUT);
>  		ehci_pdata.reset_gpio_port[1] = 135;
>  	}
> -	usb_musb_init();
> +	usb_musb_init(100);
>  	usb_ehci_init(&ehci_pdata);
>  	ads7846_dev_init();
>  	omap3evm_init_smsc911x();
> diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c
> index ef17cf1..b0cdf77 100644
> --- a/arch/arm/mach-omap2/board-omap3pandora.c
> +++ b/arch/arm/mach-omap2/board-omap3pandora.c
> @@ -413,7 +413,7 @@ static void __init omap3pandora_init(void)
>  	omap3pandora_ads7846_init();
>  	usb_ehci_init(&ehci_pdata);
>  	pandora_keys_gpio_init();
> -	usb_musb_init();
> +	usb_musb_init(100);
>  
>  	/* Ensure SDRC pins are mux'd for self-refresh */
>  	omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT);
> diff --git a/arch/arm/mach-omap2/board-omap3touchbook.c b/arch/arm/mach-omap2/board-omap3touchbook.c
> index fe3d22c..f7f7670 100644
> --- a/arch/arm/mach-omap2/board-omap3touchbook.c
> +++ b/arch/arm/mach-omap2/board-omap3touchbook.c
> @@ -545,7 +545,7 @@ static void __init omap3_touchbook_init(void)
>  	spi_register_board_info(omap3_ads7846_spi_board_info,
>  				ARRAY_SIZE(omap3_ads7846_spi_board_info));
>  	omap3_ads7846_init();
> -	usb_musb_init();
> +	usb_musb_init(100);
>  	usb_ehci_init(&ehci_pdata);
>  	omap3touchbook_flash_init();
>  
> diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c
> index d192dd9..4e07a08 100644
> --- a/arch/arm/mach-omap2/board-overo.c
> +++ b/arch/arm/mach-omap2/board-overo.c
> @@ -420,7 +420,7 @@ static void __init overo_init(void)
>  	platform_add_devices(overo_devices, ARRAY_SIZE(overo_devices));
>  	omap_serial_init();
>  	overo_flash_init();
> -	usb_musb_init();
> +	usb_musb_init(100);
>  	usb_ehci_init(&ehci_pdata);
>  	overo_ads7846_init();
>  	overo_init_smsc911x();
> diff --git a/arch/arm/mach-omap2/board-rx51.c b/arch/arm/mach-omap2/board-rx51.c
> index 67bb347..0e19316 100644
> --- a/arch/arm/mach-omap2/board-rx51.c
> +++ b/arch/arm/mach-omap2/board-rx51.c
> @@ -82,7 +82,7 @@ static void __init rx51_init(void)
>  {
>  	omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
>  	omap_serial_init();
> -	usb_musb_init();
> +	usb_musb_init(0);
>  	rx51_peripherals_init();
>  
>  	/* Ensure SDRC pins are mux'd for self-refresh */
> diff --git a/arch/arm/mach-omap2/board-zoom-peripherals.c b/arch/arm/mach-omap2/board-zoom-peripherals.c
> index 8dd277c..abb5fc2 100755
> --- a/arch/arm/mach-omap2/board-zoom-peripherals.c
> +++ b/arch/arm/mach-omap2/board-zoom-peripherals.c
> @@ -267,5 +267,5 @@ void __init zoom_peripherals_init(void)
>  {
>  	omap_i2c_init();
>  	omap_serial_init();
> -	usb_musb_init();
> +	usb_musb_init(100);
>  }
> diff --git a/arch/arm/mach-omap2/usb-musb.c b/arch/arm/mach-omap2/usb-musb.c
> index d12e311..6c2895e 100644
> --- a/arch/arm/mach-omap2/usb-musb.c
> +++ b/arch/arm/mach-omap2/usb-musb.c
> @@ -64,12 +64,7 @@ static struct musb_hdrc_platform_data musb_plat = {
>  #endif
>  	/* .clock is set dynamically */
>  	.config		= &musb_config,
> -
> -	/* REVISIT charge pump on TWL4030 can supply up to
> -	 * 100 mA ... but this value is board-specific, like
> -	 * "mode", and should be passed to usb_musb_init().
> -	 */
> -	.power		= 50,			/* up to 100 mA */
> +	/* .power	= DYNAMIC, */
>  };
>  
>  static u64 musb_dmamask = DMA_BIT_MASK(32);
> @@ -86,7 +81,7 @@ static struct platform_device musb_device = {
>  	.resource	= musb_resources,
>  };
>  
> -void __init usb_musb_init(void)
> +void __init usb_musb_init(unsigned power)
>  {
>  	if (cpu_is_omap243x())
>  		musb_resources[0].start = OMAP243X_HS_BASE;
> @@ -99,6 +94,7 @@ void __init usb_musb_init(void)
>  	 * musb_core.c have been converted to use use clkdev.
>  	 */
>  	musb_plat.clock = "ick";
> +	musb_plat.power = power >> 1;
>  
>  	if (platform_device_register(&musb_device) < 0) {
>  		printk(KERN_ERR "Unable to register HS-USB (MUSB) device\n");
> @@ -107,7 +103,7 @@ void __init usb_musb_init(void)
>  }
>  
>  #else
> -void __init usb_musb_init(void)
> +void __init usb_musb_init(unsigned power)
>  {
>  }
>  #endif /* CONFIG_USB_MUSB_SOC */
> diff --git a/arch/arm/plat-omap/include/plat/usb.h b/arch/arm/plat-omap/include/plat/usb.h
> index 33a500e..1b779a1 100644
> --- a/arch/arm/plat-omap/include/plat/usb.h
> +++ b/arch/arm/plat-omap/include/plat/usb.h
> @@ -42,7 +42,7 @@ struct ehci_hcd_omap_platform_data {
>  #define UDC_BASE			OMAP2_UDC_BASE
>  #define OMAP_OHCI_BASE			OMAP2_OHCI_BASE
>  
> -extern void usb_musb_init(void);
> +extern void usb_musb_init(unsigned power);
>  
>  extern void usb_ehci_init(struct ehci_hcd_omap_platform_data *pdata);
>  
> -- 
> 1.6.6.rc0
> 

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

* Re: [PATCH 7/8] arm: omap: musb: pass board mode to usb_musb_init
  2009-12-28 11:09 ` [PATCH 7/8] arm: omap: musb: pass board mode " Felipe Balbi
@ 2009-12-29 19:51   ` Tony Lindgren
  2009-12-30  4:44   ` Gupta, Ajay Kumar
  1 sibling, 0 replies; 17+ messages in thread
From: Tony Lindgren @ 2009-12-29 19:51 UTC (permalink / raw)
  To: Felipe Balbi; +Cc: Linux OMAP Mailing List

* Felipe Balbi <felipe.balbi@nokia.com> [091228 03:10]:
> each board will have a different mode which is peculiar
> to that board.

The subject and description for this too should be updated
to say it fixes the mode.

Regards,

Tony
 
> Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
> ---
>  arch/arm/mach-omap2/board-2430sdp.c          |    3 ++-
>  arch/arm/mach-omap2/board-3430sdp.c          |    3 ++-
>  arch/arm/mach-omap2/board-cm-t35.c           |    3 ++-
>  arch/arm/mach-omap2/board-igep0020.c         |    3 ++-
>  arch/arm/mach-omap2/board-ldp.c              |    3 ++-
>  arch/arm/mach-omap2/board-omap3beagle.c      |    3 ++-
>  arch/arm/mach-omap2/board-omap3evm.c         |    3 ++-
>  arch/arm/mach-omap2/board-omap3pandora.c     |    3 ++-
>  arch/arm/mach-omap2/board-omap3touchbook.c   |    3 ++-
>  arch/arm/mach-omap2/board-overo.c            |    3 ++-
>  arch/arm/mach-omap2/board-rx51.c             |    3 ++-
>  arch/arm/mach-omap2/board-zoom-peripherals.c |    3 ++-
>  arch/arm/mach-omap2/usb-musb.c               |   13 ++++---------
>  arch/arm/plat-omap/include/plat/usb.h        |    3 ++-
>  14 files changed, 30 insertions(+), 22 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/board-2430sdp.c b/arch/arm/mach-omap2/board-2430sdp.c
> index d3857d6..45d3197 100644
> --- a/arch/arm/mach-omap2/board-2430sdp.c
> +++ b/arch/arm/mach-omap2/board-2430sdp.c
> @@ -23,6 +23,7 @@
>  #include <linux/err.h>
>  #include <linux/clk.h>
>  #include <linux/io.h>
> +#include <linux/usb/musb.h>
>  
>  #include <mach/hardware.h>
>  #include <asm/mach-types.h>
> @@ -203,7 +204,7 @@ static void __init omap_2430sdp_init(void)
>  	platform_add_devices(sdp2430_devices, ARRAY_SIZE(sdp2430_devices));
>  	omap_serial_init();
>  	twl4030_mmc_init(mmc);
> -	usb_musb_init(100);
> +	usb_musb_init(MUSB_OTG, 100);
>  	board_smc91x_init();
>  
>  	/* Turn off secondary LCD backlight */
> diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c
> index 1d52fd1..37e7328 100644
> --- a/arch/arm/mach-omap2/board-3430sdp.c
> +++ b/arch/arm/mach-omap2/board-3430sdp.c
> @@ -24,6 +24,7 @@
>  #include <linux/regulator/machine.h>
>  #include <linux/io.h>
>  #include <linux/gpio.h>
> +#include <linux/usb/musb.h>
>  
>  #include <mach/hardware.h>
>  #include <asm/mach-types.h>
> @@ -664,7 +665,7 @@ static void __init omap_3430sdp_init(void)
>  				ARRAY_SIZE(sdp3430_spi_board_info));
>  	ads7846_dev_init();
>  	omap_serial_init();
> -	usb_musb_init(100);
> +	usb_musb_init(MUSB_OTG, 100);
>  	board_smc91x_init();
>  	sdp3430_display_init();
>  	enable_board_wakeup_source();
> diff --git a/arch/arm/mach-omap2/board-cm-t35.c b/arch/arm/mach-omap2/board-cm-t35.c
> index 56922f4..9d5db6b 100644
> --- a/arch/arm/mach-omap2/board-cm-t35.c
> +++ b/arch/arm/mach-omap2/board-cm-t35.c
> @@ -27,6 +27,7 @@
>  #include <linux/input/matrix_keypad.h>
>  #include <linux/delay.h>
>  #include <linux/gpio.h>
> +#include <linux/usb/musb.h>
>  
>  #include <linux/i2c/at24.h>
>  #include <linux/i2c/twl.h>
> @@ -585,7 +586,7 @@ static void __init cm_t35_init(void)
>  	cm_t35_init_ethernet();
>  	cm_t35_init_led();
>  
> -	usb_musb_init(100);
> +	usb_musb_init(MUSB_OTG, 100);
>  }
>  
>  MACHINE_START(CM_T35, "Compulab CM-T35")
> diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c
> index 16be1d5..6fc0608 100644
> --- a/arch/arm/mach-omap2/board-igep0020.c
> +++ b/arch/arm/mach-omap2/board-igep0020.c
> @@ -17,6 +17,7 @@
>  #include <linux/io.h>
>  #include <linux/gpio.h>
>  #include <linux/interrupt.h>
> +#include <linux/usb/musb.h>
>  
>  #include <linux/regulator/machine.h>
>  #include <linux/i2c/twl.h>
> @@ -216,7 +217,7 @@ static void __init igep2_init(void)
>  	omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
>  	igep2_i2c_init();
>  	omap_serial_init();
> -	usb_musb_init(100);
> +	usb_musb_init(MUSB_OTG, 100);
>  
>  	igep2_init_smsc911x();
>  
> diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
> index ca2acd2..7e8c8a8 100644
> --- a/arch/arm/mach-omap2/board-ldp.c
> +++ b/arch/arm/mach-omap2/board-ldp.c
> @@ -27,6 +27,7 @@
>  #include <linux/i2c/twl.h>
>  #include <linux/io.h>
>  #include <linux/smsc911x.h>
> +#include <linux/usb/musb.h>
>  
>  #include <mach/hardware.h>
>  #include <asm/mach-types.h>
> @@ -394,7 +395,7 @@ static void __init omap_ldp_init(void)
>  				ARRAY_SIZE(ldp_spi_board_info));
>  	ads7846_dev_init();
>  	omap_serial_init();
> -	usb_musb_init(100);
> +	usb_musb_init(MUSB_OTG, 100);
>  
>  	twl4030_mmc_init(mmc);
>  	/* link regulators to MMC adapters */
> diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
> index 52f65e6..17f6381 100644
> --- a/arch/arm/mach-omap2/board-omap3beagle.c
> +++ b/arch/arm/mach-omap2/board-omap3beagle.c
> @@ -23,6 +23,7 @@
>  #include <linux/gpio.h>
>  #include <linux/input.h>
>  #include <linux/gpio_keys.h>
> +#include <linux/usb/musb.h>
>  
>  #include <linux/mtd/mtd.h>
>  #include <linux/mtd/partitions.h>
> @@ -443,7 +444,7 @@ static void __init omap3_beagle_init(void)
>  	/* REVISIT leave DVI powered down until it's needed ... */
>  	gpio_direction_output(170, true);
>  
> -	usb_musb_init(100);
> +	usb_musb_init(MUSB_OTG, 100);
>  	usb_ehci_init(&ehci_pdata);
>  	omap3beagle_flash_init();
>  
> diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c
> index c5fd85d..1160004 100644
> --- a/arch/arm/mach-omap2/board-omap3evm.c
> +++ b/arch/arm/mach-omap2/board-omap3evm.c
> @@ -23,6 +23,7 @@
>  #include <linux/input/matrix_keypad.h>
>  #include <linux/leds.h>
>  #include <linux/interrupt.h>
> +#include <linux/usb/musb.h>
>  
>  #include <linux/spi/spi.h>
>  #include <linux/spi/ads7846.h>
> @@ -469,7 +470,7 @@ static void __init omap3_evm_init(void)
>  		omap_mux_init_gpio(135, OMAP_PIN_OUTPUT);
>  		ehci_pdata.reset_gpio_port[1] = 135;
>  	}
> -	usb_musb_init(100);
> +	usb_musb_init(MUSB_OTG, 100);
>  	usb_ehci_init(&ehci_pdata);
>  	ads7846_dev_init();
>  	omap3evm_init_smsc911x();
> diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c
> index b0cdf77..191b75c 100644
> --- a/arch/arm/mach-omap2/board-omap3pandora.c
> +++ b/arch/arm/mach-omap2/board-omap3pandora.c
> @@ -29,6 +29,7 @@
>  #include <linux/input.h>
>  #include <linux/input/matrix_keypad.h>
>  #include <linux/gpio_keys.h>
> +#include <linux/usb/musb.h>
>  
>  #include <asm/mach-types.h>
>  #include <asm/mach/arch.h>
> @@ -413,7 +414,7 @@ static void __init omap3pandora_init(void)
>  	omap3pandora_ads7846_init();
>  	usb_ehci_init(&ehci_pdata);
>  	pandora_keys_gpio_init();
> -	usb_musb_init(100);
> +	usb_musb_init(MUSB_OTG, 100);
>  
>  	/* Ensure SDRC pins are mux'd for self-refresh */
>  	omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT);
> diff --git a/arch/arm/mach-omap2/board-omap3touchbook.c b/arch/arm/mach-omap2/board-omap3touchbook.c
> index f7f7670..287b914 100644
> --- a/arch/arm/mach-omap2/board-omap3touchbook.c
> +++ b/arch/arm/mach-omap2/board-omap3touchbook.c
> @@ -23,6 +23,7 @@
>  #include <linux/gpio.h>
>  #include <linux/input.h>
>  #include <linux/gpio_keys.h>
> +#include <linux/usb/musb.h>
>  
>  #include <linux/mtd/mtd.h>
>  #include <linux/mtd/partitions.h>
> @@ -545,7 +546,7 @@ static void __init omap3_touchbook_init(void)
>  	spi_register_board_info(omap3_ads7846_spi_board_info,
>  				ARRAY_SIZE(omap3_ads7846_spi_board_info));
>  	omap3_ads7846_init();
> -	usb_musb_init(100);
> +	usb_musb_init(MUSB_OTG, 100);
>  	usb_ehci_init(&ehci_pdata);
>  	omap3touchbook_flash_init();
>  
> diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c
> index 4e07a08..df04029 100644
> --- a/arch/arm/mach-omap2/board-overo.c
> +++ b/arch/arm/mach-omap2/board-overo.c
> @@ -28,6 +28,7 @@
>  #include <linux/platform_device.h>
>  #include <linux/i2c/twl.h>
>  #include <linux/regulator/machine.h>
> +#include <linux/usb/musb.h>
>  
>  #include <linux/mtd/mtd.h>
>  #include <linux/mtd/nand.h>
> @@ -420,7 +421,7 @@ static void __init overo_init(void)
>  	platform_add_devices(overo_devices, ARRAY_SIZE(overo_devices));
>  	omap_serial_init();
>  	overo_flash_init();
> -	usb_musb_init(100);
> +	usb_musb_init(MUSB_OTG, 100);
>  	usb_ehci_init(&ehci_pdata);
>  	overo_ads7846_init();
>  	overo_init_smsc911x();
> diff --git a/arch/arm/mach-omap2/board-rx51.c b/arch/arm/mach-omap2/board-rx51.c
> index 0e19316..2480870 100644
> --- a/arch/arm/mach-omap2/board-rx51.c
> +++ b/arch/arm/mach-omap2/board-rx51.c
> @@ -16,6 +16,7 @@
>  #include <linux/clk.h>
>  #include <linux/io.h>
>  #include <linux/gpio.h>
> +#include <linux/usb/musb.h>
>  
>  #include <mach/hardware.h>
>  #include <asm/mach-types.h>
> @@ -82,7 +83,7 @@ static void __init rx51_init(void)
>  {
>  	omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
>  	omap_serial_init();
> -	usb_musb_init(0);
> +	usb_musb_init(MUSB_PERIPHERAL, 0);
>  	rx51_peripherals_init();
>  
>  	/* Ensure SDRC pins are mux'd for self-refresh */
> diff --git a/arch/arm/mach-omap2/board-zoom-peripherals.c b/arch/arm/mach-omap2/board-zoom-peripherals.c
> index abb5fc2..f157733 100755
> --- a/arch/arm/mach-omap2/board-zoom-peripherals.c
> +++ b/arch/arm/mach-omap2/board-zoom-peripherals.c
> @@ -16,6 +16,7 @@
>  #include <linux/gpio.h>
>  #include <linux/i2c/twl.h>
>  #include <linux/regulator/machine.h>
> +#include <linux/usb/musb.h>
>  
>  #include <asm/mach-types.h>
>  #include <asm/mach/arch.h>
> @@ -267,5 +268,5 @@ void __init zoom_peripherals_init(void)
>  {
>  	omap_i2c_init();
>  	omap_serial_init();
> -	usb_musb_init(100);
> +	usb_musb_init(MUSB_OTG, 100);
>  }
> diff --git a/arch/arm/mach-omap2/usb-musb.c b/arch/arm/mach-omap2/usb-musb.c
> index 6c2895e..e0050c5 100644
> --- a/arch/arm/mach-omap2/usb-musb.c
> +++ b/arch/arm/mach-omap2/usb-musb.c
> @@ -55,16 +55,10 @@ static struct musb_hdrc_config musb_config = {
>  };
>  
>  static struct musb_hdrc_platform_data musb_plat = {
> -#ifdef CONFIG_USB_MUSB_OTG
> -	.mode		= MUSB_OTG,
> -#elif defined(CONFIG_USB_MUSB_HDRC_HCD)
> -	.mode		= MUSB_HOST,
> -#elif defined(CONFIG_USB_GADGET_MUSB_HDRC)
> -	.mode		= MUSB_PERIPHERAL,
> -#endif
>  	/* .clock is set dynamically */
>  	.config		= &musb_config,
>  	/* .power	= DYNAMIC, */
> +	/* .mode	= DYNAMIC, */
>  };
>  
>  static u64 musb_dmamask = DMA_BIT_MASK(32);
> @@ -81,7 +75,7 @@ static struct platform_device musb_device = {
>  	.resource	= musb_resources,
>  };
>  
> -void __init usb_musb_init(unsigned power)
> +void __init usb_musb_init(enum musb_mode mode, unsigned power)
>  {
>  	if (cpu_is_omap243x())
>  		musb_resources[0].start = OMAP243X_HS_BASE;
> @@ -95,6 +89,7 @@ void __init usb_musb_init(unsigned power)
>  	 */
>  	musb_plat.clock = "ick";
>  	musb_plat.power = power >> 1;
> +	musb_plat.mode = mode;
>  
>  	if (platform_device_register(&musb_device) < 0) {
>  		printk(KERN_ERR "Unable to register HS-USB (MUSB) device\n");
> @@ -103,7 +98,7 @@ void __init usb_musb_init(unsigned power)
>  }
>  
>  #else
> -void __init usb_musb_init(unsigned power)
> +void __init usb_musb_init(enum musb_mode mode, unsigned power)
>  {
>  }
>  #endif /* CONFIG_USB_MUSB_SOC */
> diff --git a/arch/arm/plat-omap/include/plat/usb.h b/arch/arm/plat-omap/include/plat/usb.h
> index 1b779a1..1e03105 100644
> --- a/arch/arm/plat-omap/include/plat/usb.h
> +++ b/arch/arm/plat-omap/include/plat/usb.h
> @@ -3,6 +3,7 @@
>  #ifndef	__ASM_ARCH_OMAP_USB_H
>  #define	__ASM_ARCH_OMAP_USB_H
>  
> +#include <linux/usb/musb.h>
>  #include <plat/board.h>
>  
>  #define OMAP3_HS_USB_PORTS	3
> @@ -42,7 +43,7 @@ struct ehci_hcd_omap_platform_data {
>  #define UDC_BASE			OMAP2_UDC_BASE
>  #define OMAP_OHCI_BASE			OMAP2_OHCI_BASE
>  
> -extern void usb_musb_init(unsigned power);
> +extern void usb_musb_init(enum musb_mode mode, unsigned power);
>  
>  extern void usb_ehci_init(struct ehci_hcd_omap_platform_data *pdata);
>  
> -- 
> 1.6.6.rc0
> 

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

* Re: [PATCH 6/8] arm: omap: musb: pass power to usb_musb_init
  2009-12-29 19:51   ` Tony Lindgren
@ 2009-12-29 19:53     ` Felipe Balbi
  2009-12-29 19:56       ` Felipe Balbi
  0 siblings, 1 reply; 17+ messages in thread
From: Felipe Balbi @ 2009-12-29 19:53 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: Felipe Balbi, Linux OMAP Mailing List

On Tue, 2009-12-29 at 11:51 -0800, Tony Lindgren wrote:
> * Felipe Balbi <felipe.balbi@nokia.com> [091228 03:10]:
> > each board might have a different charge pump and
> > thus able to source more or less current on vbus
> > so let power be easily configurable.
> 
> In order to justify merging this as a fix, can you please update
> the subject and description to describe that this fixes the
> the power value ?

for sure, doing it right now.

-- 
balbi


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

* Re: [PATCH 6/8] arm: omap: musb: pass power to usb_musb_init
  2009-12-29 19:53     ` Felipe Balbi
@ 2009-12-29 19:56       ` Felipe Balbi
  2009-12-29 20:02         ` Tony Lindgren
  0 siblings, 1 reply; 17+ messages in thread
From: Felipe Balbi @ 2009-12-29 19:56 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: Felipe Balbi, Linux OMAP Mailing List

On Tue, 2009-12-29 at 21:53 +0200, Felipe Balbi wrote:
> On Tue, 2009-12-29 at 11:51 -0800, Tony Lindgren wrote:
> > * Felipe Balbi <felipe.balbi@nokia.com> [091228 03:10]:
> > > each board might have a different charge pump and
> > > thus able to source more or less current on vbus
> > > so let power be easily configurable.
> > 
> > In order to justify merging this as a fix, can you please update
> > the subject and description to describe that this fixes the
> > the power value ?
> 
> for sure, doing it right now.

How about now ? (did the same to the board mode)

commit 860a17d3dc78cc8c640a83ade83dd0ec4f1217f1
Author: Felipe Balbi <felipe.balbi@nokia.com>
Date:   Mon Dec 28 00:46:19 2009 +0200

    arm: omap: musb: fix board mode by passing it to usb_musb_init
    
    each board will have a different mode which is peculiar
    to that board.
    
    Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>

commit 86b92c438109a95c20fad62804b4b8040f3676b7
Author: Felipe Balbi <felipe.balbi@nokia.com>
Date:   Mon Dec 28 00:30:42 2009 +0200

    arm: omap: musb: fix board power budget by passing it to
usb_musb_init
    
    each board might have a different charge pump and
    thus able to source more or less current on vbus
    so let power be easily configurable.
    
    Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>

-- 
balbi


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

* Re: [PATCH 6/8] arm: omap: musb: pass power to usb_musb_init
  2009-12-29 19:56       ` Felipe Balbi
@ 2009-12-29 20:02         ` Tony Lindgren
  2009-12-29 20:55           ` Tony Lindgren
  0 siblings, 1 reply; 17+ messages in thread
From: Tony Lindgren @ 2009-12-29 20:02 UTC (permalink / raw)
  To: Felipe Balbi; +Cc: Felipe Balbi, Linux OMAP Mailing List

* Felipe Balbi <me@felipebalbi.com> [091229 11:54]:
> On Tue, 2009-12-29 at 21:53 +0200, Felipe Balbi wrote:
> > On Tue, 2009-12-29 at 11:51 -0800, Tony Lindgren wrote:
> > > * Felipe Balbi <felipe.balbi@nokia.com> [091228 03:10]:
> > > > each board might have a different charge pump and
> > > > thus able to source more or less current on vbus
> > > > so let power be easily configurable.
> > > 
> > > In order to justify merging this as a fix, can you please update
> > > the subject and description to describe that this fixes the
> > > the power value ?
> > 
> > for sure, doing it right now.
> 
> How about now ? (did the same to the board mode)
> 
> commit 860a17d3dc78cc8c640a83ade83dd0ec4f1217f1
> Author: Felipe Balbi <felipe.balbi@nokia.com>
> Date:   Mon Dec 28 00:46:19 2009 +0200
> 
>     arm: omap: musb: fix board mode by passing it to usb_musb_init
>     
>     each board will have a different mode which is peculiar
>     to that board.
>     
>     Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
> 
> commit 86b92c438109a95c20fad62804b4b8040f3676b7
> Author: Felipe Balbi <felipe.balbi@nokia.com>
> Date:   Mon Dec 28 00:30:42 2009 +0200
> 
>     arm: omap: musb: fix board power budget by passing it to
> usb_musb_init
>     
>     each board might have a different charge pump and
>     thus able to source more or less current on vbus
>     so let power be easily configurable.
>     
>     Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>

Sounds good to me.

Thanks,

Tony

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

* Re: [PATCH 6/8] arm: omap: musb: pass power to usb_musb_init
  2009-12-29 20:02         ` Tony Lindgren
@ 2009-12-29 20:55           ` Tony Lindgren
  0 siblings, 0 replies; 17+ messages in thread
From: Tony Lindgren @ 2009-12-29 20:55 UTC (permalink / raw)
  To: Felipe Balbi; +Cc: Felipe Balbi, Linux OMAP Mailing List

* Tony Lindgren <tony@atomide.com> [091229 12:00]:
> * Felipe Balbi <me@felipebalbi.com> [091229 11:54]:
> > On Tue, 2009-12-29 at 21:53 +0200, Felipe Balbi wrote:
> > > On Tue, 2009-12-29 at 11:51 -0800, Tony Lindgren wrote:
> > > > * Felipe Balbi <felipe.balbi@nokia.com> [091228 03:10]:
> > > > > each board might have a different charge pump and
> > > > > thus able to source more or less current on vbus
> > > > > so let power be easily configurable.
> > > > 
> > > > In order to justify merging this as a fix, can you please update
> > > > the subject and description to describe that this fixes the
> > > > the power value ?
> > > 
> > > for sure, doing it right now.
> > 
> > How about now ? (did the same to the board mode)
> > 
> > commit 860a17d3dc78cc8c640a83ade83dd0ec4f1217f1
> > Author: Felipe Balbi <felipe.balbi@nokia.com>
> > Date:   Mon Dec 28 00:46:19 2009 +0200
> > 
> >     arm: omap: musb: fix board mode by passing it to usb_musb_init
> >     
> >     each board will have a different mode which is peculiar
> >     to that board.
> >     
> >     Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
> > 
> > commit 86b92c438109a95c20fad62804b4b8040f3676b7
> > Author: Felipe Balbi <felipe.balbi@nokia.com>
> > Date:   Mon Dec 28 00:30:42 2009 +0200
> > 
> >     arm: omap: musb: fix board power budget by passing it to
> > usb_musb_init
> >     
> >     each board might have a different charge pump and
> >     thus able to source more or less current on vbus
> >     so let power be easily configurable.
> >     
> >     Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
> 
> Sounds good to me.

Oh one more thing: Can you please repost the series one more
time with LAKML Cc'd? We should have all the arch/arm/*omap*/
patches reviewed there too. Maybe Cc linux-usb too?

Regards,

Tony

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

* RE: [PATCH 7/8] arm: omap: musb: pass board mode to usb_musb_init
  2009-12-28 11:09 ` [PATCH 7/8] arm: omap: musb: pass board mode " Felipe Balbi
  2009-12-29 19:51   ` Tony Lindgren
@ 2009-12-30  4:44   ` Gupta, Ajay Kumar
  2009-12-30 12:06     ` Felipe Balbi
  1 sibling, 1 reply; 17+ messages in thread
From: Gupta, Ajay Kumar @ 2009-12-30  4:44 UTC (permalink / raw)
  To: Felipe Balbi, Tony Lindgren; +Cc: Linux OMAP Mailing List


Hi,
> -----Original Message-----
> From: linux-omap-owner@vger.kernel.org [mailto:linux-omap-
> owner@vger.kernel.org] On Behalf Of Felipe Balbi
> Sent: Monday, December 28, 2009 4:40 PM
> To: Tony Lindgren
> Cc: Linux OMAP Mailing List; Felipe Balbi
> Subject: [PATCH 7/8] arm: omap: musb: pass board mode to usb_musb_init
> 
> each board will have a different mode which is peculiar
> to that board.
> 
> Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
> ---
<snip>

> 
>  #include <mach/hardware.h>
>  #include <asm/mach-types.h>
> @@ -203,7 +204,7 @@ static void __init omap_2430sdp_init(void)
>  	platform_add_devices(sdp2430_devices, ARRAY_SIZE(sdp2430_devices));
>  	omap_serial_init();
>  	twl4030_mmc_init(mmc);
> -	usb_musb_init(100);
> +	usb_musb_init(MUSB_OTG, 100);

Similarly, we would need another parameter 'extvbus' which is required by
OMAP3EVM Rev >= E. This way the parameter list would keep increasing and
would look ugly.

So how about passing a "struct musb_board_data" structure completely ? It
Can be generic across the musb platforms or we can have it only for OMAP
platforms.

Ajay

>  	board_smc91x_init();
> 

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

* RE: [PATCH 7/8] arm: omap: musb: pass board mode to usb_musb_init
  2009-12-30  4:44   ` Gupta, Ajay Kumar
@ 2009-12-30 12:06     ` Felipe Balbi
  0 siblings, 0 replies; 17+ messages in thread
From: Felipe Balbi @ 2009-12-30 12:06 UTC (permalink / raw)
  To: Gupta, Ajay Kumar; +Cc: Felipe Balbi, Tony Lindgren, Linux OMAP Mailing List

On Wed, 2009-12-30 at 10:14 +0530, Gupta, Ajay Kumar wrote:
> Hi,
> > -----Original Message-----
> > From: linux-omap-owner@vger.kernel.org [mailto:linux-omap-
> > owner@vger.kernel.org] On Behalf Of Felipe Balbi
> > Sent: Monday, December 28, 2009 4:40 PM
> > To: Tony Lindgren
> > Cc: Linux OMAP Mailing List; Felipe Balbi
> > Subject: [PATCH 7/8] arm: omap: musb: pass board mode to usb_musb_init
> > 
> > each board will have a different mode which is peculiar
> > to that board.
> > 
> > Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
> > ---
> <snip>
> 
> > 
> >  #include <mach/hardware.h>
> >  #include <asm/mach-types.h>
> > @@ -203,7 +204,7 @@ static void __init omap_2430sdp_init(void)
> >  	platform_add_devices(sdp2430_devices, ARRAY_SIZE(sdp2430_devices));
> >  	omap_serial_init();
> >  	twl4030_mmc_init(mmc);
> > -	usb_musb_init(100);
> > +	usb_musb_init(MUSB_OTG, 100);
> 
> Similarly, we would need another parameter 'extvbus' which is required by
> OMAP3EVM Rev >= E. This way the parameter list would keep increasing and
> would look ugly.
> 
> So how about passing a "struct musb_board_data" structure completely ? It
> Can be generic across the musb platforms or we can have it only for OMAP
> platforms.


I suggested that off list already. We will add some void * to
musb_platform_data which would allow archs to pass whatever data
structure they want down to drivers/usb/musb/<arch>.c

-- 
balbi


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

end of thread, other threads:[~2009-12-30 12:06 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-28 11:09 [PATCH 0/8] musb patches Felipe Balbi
2009-12-28 11:09 ` [PATCH 1/8] arm: omap: musb: remove unused data Felipe Balbi
2009-12-28 11:09 ` [PATCH 2/8] arm: omap: musb: we can use clk framework Felipe Balbi
2009-12-28 11:09 ` [PATCH 3/8] arm: omap: musb: remove unused soft_con field Felipe Balbi
2009-12-28 11:09 ` [PATCH 4/8] arm: omap: musb: remove unused dma data Felipe Balbi
2009-12-28 11:09 ` [PATCH 5/8] arm: omap: musb: ioremap only what's ours Felipe Balbi
2009-12-28 11:09 ` [PATCH 6/8] arm: omap: musb: pass power to usb_musb_init Felipe Balbi
2009-12-29 19:51   ` Tony Lindgren
2009-12-29 19:53     ` Felipe Balbi
2009-12-29 19:56       ` Felipe Balbi
2009-12-29 20:02         ` Tony Lindgren
2009-12-29 20:55           ` Tony Lindgren
2009-12-28 11:09 ` [PATCH 7/8] arm: omap: musb: pass board mode " Felipe Balbi
2009-12-29 19:51   ` Tony Lindgren
2009-12-30  4:44   ` Gupta, Ajay Kumar
2009-12-30 12:06     ` Felipe Balbi
2009-12-28 11:09 ` [PATCH 8/8] arm: omap: musb: remove unnecessary return Felipe Balbi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox