public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/7] musb: Add structure 'musb_hdrc_board_data'
@ 2009-11-15  8:59 Ajay Kumar Gupta
  2009-11-15  8:59 ` [PATCH 1/7] musb: Add structure to get board specific data Ajay Kumar Gupta
  2009-11-16 21:08 ` [PATCH 0/7] musb: Add structure 'musb_hdrc_board_data' Tony Lindgren
  0 siblings, 2 replies; 9+ messages in thread
From: Ajay Kumar Gupta @ 2009-11-15  8:59 UTC (permalink / raw)
  To: linux-omap, davinci-linux-open-source
  Cc: felipe.balbi, khilman, Ajay Kumar Gupta

Hi,

This patch set adds a new structure 'musb_hdrc_board_data' to get all
board specific data from board files.

It is actually done to accomodate ULPI_VBUSCONTROL programming required
for OMAP3EVM Rev >=E which uses external Vbus supply to support 500mA.

Necessarly changes have been done in all the OMAP and Davinci platform
based boards.

Please review and provide your feedback.
[patches created against linux-omap/master branch and tested on OMAP3EVM]

Regards,
Ajay

Ajay Kumar Gupta (7):
  musb: Add structure to get board specific data
  musb: Get power (mA) from board data
  musb: Update musb_init() call for all OMAP3 boards
  musb: Update setup_usb() call for all Davinci boards
  musb: Add 'extvbus' in musb_hdrc_board_data
  musb: set 'extvbus' default value to zero
  musb: set 'extvbus' for OMAP3EVM Rev >=E

 arch/arm/mach-davinci/board-dm355-evm.c     |   10 +++++++++-
 arch/arm/mach-davinci/board-dm355-leopard.c |   10 +++++++++-
 arch/arm/mach-davinci/board-dm644x-evm.c    |    9 ++++++++-
 arch/arm/mach-davinci/board-sffsdr.c        |   10 +++++++++-
 arch/arm/mach-davinci/include/mach/common.h |    7 +++++--
 arch/arm/mach-davinci/usb.c                 |    8 ++++----
 arch/arm/mach-omap2/board-2430sdp.c         |    8 +++++++-
 arch/arm/mach-omap2/board-3430sdp.c         |    8 +++++++-
 arch/arm/mach-omap2/board-cm-t35.c          |    8 +++++++-
 arch/arm/mach-omap2/board-ldp.c             |    8 +++++++-
 arch/arm/mach-omap2/board-omap3beagle.c     |    8 +++++++-
 arch/arm/mach-omap2/board-omap3evm.c        |   10 +++++++++-
 arch/arm/mach-omap2/board-omap3pandora.c    |    8 +++++++-
 arch/arm/mach-omap2/board-overo.c           |    8 +++++++-
 arch/arm/mach-omap2/board-rx51.c            |    8 +++++++-
 arch/arm/mach-omap2/usb-musb.c              |   13 +++++--------
 arch/arm/plat-omap/include/plat/usb.h       |    3 ++-
 drivers/usb/musb/musb_core.c                |   14 +++++++++++++-
 drivers/usb/musb/musb_regs.h                |    5 +++++
 include/linux/usb/musb.h                    |   19 +++++++++++++------
 20 files changed, 147 insertions(+), 35 deletions(-)


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

* [PATCH 1/7] musb: Add structure to get board specific data
  2009-11-15  8:59 [PATCH 0/7] musb: Add structure 'musb_hdrc_board_data' Ajay Kumar Gupta
@ 2009-11-15  8:59 ` Ajay Kumar Gupta
  2009-11-15  8:59   ` [PATCH 2/7] musb: Get power (mA) from board data Ajay Kumar Gupta
  2009-11-16 21:08 ` [PATCH 0/7] musb: Add structure 'musb_hdrc_board_data' Tony Lindgren
  1 sibling, 1 reply; 9+ messages in thread
From: Ajay Kumar Gupta @ 2009-11-15  8:59 UTC (permalink / raw)
  To: linux-omap, davinci-linux-open-source
  Cc: felipe.balbi, khilman, Ajay Kumar Gupta

Adding 'musb_hdrc_board_data' which will have all the board specific
parameters such as; mA power, potpgt, extvbus, gpios etc.

Currently only 'power' and 'potpgt' is being moved from existing
'musb_hdrc_platform_data' to 'musb_hdrc_board_data' but any further
board specific functions or parameter can be added to this structure
later.

Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
---
 include/linux/usb/musb.h |   18 ++++++++++++------
 1 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/include/linux/usb/musb.h b/include/linux/usb/musb.h
index d437556..6e1426c 100644
--- a/include/linux/usb/musb.h
+++ b/include/linux/usb/musb.h
@@ -27,6 +27,15 @@ struct musb_hdrc_eps_bits {
 	u8		bits;
 };
 
+/* MUSB board-specific details */
+struct musb_hdrc_board_data {
+	/* power (mA/2) sourcing capability */
+	u8	power;
+	/* (HOST or OTG) msec/2 after VBUS on till power good */
+	u8		potpgt;
+
+};
+
 struct musb_hdrc_config {
 	/* MUSB configuration-specific details */
 	unsigned	multipoint:1;	/* multipoint device */
@@ -67,15 +76,9 @@ struct musb_hdrc_platform_data {
 	/* (HOST or OTG) switch VBUS on/off */
 	int		(*set_vbus)(struct device *dev, int is_on);
 
-	/* (HOST or OTG) mA/2 power supplied on (default = 8mA) */
-	u8		power;
-
 	/* (PERIPHERAL) mA/2 max power consumed (default = 100mA) */
 	u8		min_power;
 
-	/* (HOST or OTG) msec/2 after VBUS on till power good */
-	u8		potpgt;
-
 	/* Power the device on or off */
 	int		(*set_power)(int state);
 
@@ -84,6 +87,9 @@ struct musb_hdrc_platform_data {
 
 	/* MUSB configuration-specific details */
 	struct musb_hdrc_config	*config;
+
+	/* MUSB board-specific details */
+	struct musb_hdrc_board_data *board_data;
 };
 
 
-- 
1.6.2.4


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

* [PATCH 2/7] musb: Get power (mA) from board data
  2009-11-15  8:59 ` [PATCH 1/7] musb: Add structure to get board specific data Ajay Kumar Gupta
@ 2009-11-15  8:59   ` Ajay Kumar Gupta
  2009-11-15  8:59     ` [PATCH 3/7] musb: Update musb_init() call for all OMAP3 boards Ajay Kumar Gupta
  0 siblings, 1 reply; 9+ messages in thread
From: Ajay Kumar Gupta @ 2009-11-15  8:59 UTC (permalink / raw)
  To: linux-omap, davinci-linux-open-source
  Cc: felipe.balbi, khilman, Ajay Kumar Gupta

Different board may have different power sourcing capability and
now with 'struct musb_hdrc_board_data' in place; pass this data
from board files and also modify musb_core.c to get 'power' data
from 'plat->board_data'.

Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
---
 arch/arm/mach-omap2/usb-musb.c |    6 ------
 drivers/usb/musb/musb_core.c   |    4 +++-
 2 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-omap2/usb-musb.c b/arch/arm/mach-omap2/usb-musb.c
index a80441d..e89c6b1 100644
--- a/arch/arm/mach-omap2/usb-musb.c
+++ b/arch/arm/mach-omap2/usb-musb.c
@@ -124,12 +124,6 @@ static struct musb_hdrc_platform_data musb_plat = {
 	/* .clock is set dynamically */
 	.set_clock	= musb_set_clock,
 	.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 */
 };
 
 static u64 musb_dmamask = DMA_BIT_MASK(32);
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index 3a61ddb..818ccda 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -2033,7 +2033,9 @@ bad_config:
 		if (is_otg_enabled(musb))
 			hcd->self.otg_port = 1;
 		musb->xceiv->host = &hcd->self;
-		hcd->power_budget = 2 * (plat->power ? : 250);
+		if (plat->board_data)
+			hcd->power_budget =
+				2 * (plat->board_data->power ? : 250);
 	}
 
 	/* For the host-only role, we can activate right away.
-- 
1.6.2.4


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

* [PATCH 3/7] musb: Update musb_init() call for all OMAP3 boards
  2009-11-15  8:59   ` [PATCH 2/7] musb: Get power (mA) from board data Ajay Kumar Gupta
@ 2009-11-15  8:59     ` Ajay Kumar Gupta
  2009-11-15  8:59       ` [PATCH 4/7] musb: Update setup_usb() call for all Davinci boards Ajay Kumar Gupta
  0 siblings, 1 reply; 9+ messages in thread
From: Ajay Kumar Gupta @ 2009-11-15  8:59 UTC (permalink / raw)
  To: linux-omap, davinci-linux-open-source
  Cc: felipe.balbi, khilman, Ajay Kumar Gupta

musb_init() has been modified to pass board specific data so updating
this function call from all OMAP3 boards.

Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
---
 arch/arm/mach-omap2/board-2430sdp.c      |    7 ++++++-
 arch/arm/mach-omap2/board-3430sdp.c      |    7 ++++++-
 arch/arm/mach-omap2/board-cm-t35.c       |    7 ++++++-
 arch/arm/mach-omap2/board-ldp.c          |    7 ++++++-
 arch/arm/mach-omap2/board-omap3beagle.c  |    7 ++++++-
 arch/arm/mach-omap2/board-omap3evm.c     |    7 ++++++-
 arch/arm/mach-omap2/board-omap3pandora.c |    7 ++++++-
 arch/arm/mach-omap2/board-overo.c        |    7 ++++++-
 arch/arm/mach-omap2/board-rx51.c         |    7 ++++++-
 arch/arm/mach-omap2/usb-musb.c           |    7 +++++--
 arch/arm/plat-omap/include/plat/usb.h    |    3 ++-
 11 files changed, 61 insertions(+), 12 deletions(-)

diff --git a/arch/arm/mach-omap2/board-2430sdp.c b/arch/arm/mach-omap2/board-2430sdp.c
index db9374b..03d3634 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>
@@ -194,6 +195,10 @@ static struct twl4030_hsmmc_info mmc[] __initdata = {
 	{}	/* Terminator */
 };
 
+static struct musb_hdrc_board_data musb_bdata __initdata = {
+	.power = 50
+};
+
 static void __init omap_2430sdp_init(void)
 {
 	int ret;
@@ -203,7 +208,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(&musb_bdata);
 	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 a3c1271..dde1a96 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>
@@ -484,6 +485,10 @@ static void enable_board_wakeup_source(void)
 	omap_cfg_reg(AF26_34XX_SYS_NIRQ); /* T2 interrupt line (keypad) */
 }
 
+static struct musb_hdrc_board_data musb_bdata __initdata = {
+	.power = 50
+};
+
 static struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
 
 	.port_mode[0] = EHCI_HCD_OMAP_MODE_PHY,
@@ -509,7 +514,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(&musb_bdata);
 	board_smc91x_init();
 	enable_board_wakeup_source();
 	usb_ehci_init(&ehci_pdata);
diff --git a/arch/arm/mach-omap2/board-cm-t35.c b/arch/arm/mach-omap2/board-cm-t35.c
index 22c4529..5d7656c 100644
--- a/arch/arm/mach-omap2/board-cm-t35.c
+++ b/arch/arm/mach-omap2/board-cm-t35.c
@@ -31,6 +31,7 @@
 #include <linux/i2c/at24.h>
 #include <linux/i2c/twl4030.h>
 #include <linux/regulator/machine.h>
+#include <linux/usb/musb.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -383,6 +384,10 @@ static struct twl4030_hsmmc_info mmc[] = {
 	{}	/* Terminator */
 };
 
+static struct musb_hdrc_board_data musb_bdata __initdata = {
+	.power = 50
+};
+
 static struct ehci_hcd_omap_platform_data ehci_pdata = {
 	.port_mode[0] = EHCI_HCD_OMAP_MODE_PHY,
 	.port_mode[1] = EHCI_HCD_OMAP_MODE_PHY,
@@ -491,7 +496,7 @@ static void __init cm_t35_init(void)
 	cm_t35_init_ethernet();
 	cm_t35_init_led();
 
-	usb_musb_init();
+	usb_musb_init(&musb_bdata);
 
 	omap_cfg_reg(AF26_34XX_SYS_NIRQ);
 }
diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
index c062238..0546c78 100644
--- a/arch/arm/mach-omap2/board-ldp.c
+++ b/arch/arm/mach-omap2/board-ldp.c
@@ -27,6 +27,7 @@
 #include <linux/i2c/twl4030.h>
 #include <linux/io.h>
 #include <linux/smsc911x.h>
+#include <linux/usb/musb.h>
 
 #include <mach/hardware.h>
 #include <asm/mach-types.h>
@@ -374,6 +375,10 @@ static struct platform_device *ldp_devices[] __initdata = {
 	&ldp_gpio_keys_device,
 };
 
+static struct musb_hdrc_board_data musb_bdata __initdata = {
+	.power = 50
+};
+
 static void __init omap_ldp_init(void)
 {
 	omap_i2c_init();
@@ -384,7 +389,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(&musb_bdata);
 
 	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 7ad9846..683b468 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -30,6 +30,7 @@
 
 #include <linux/regulator/machine.h>
 #include <linux/i2c/twl4030.h>
+#include <linux/usb/musb.h>
 
 #include <mach/hardware.h>
 #include <asm/mach-types.h>
@@ -400,6 +401,10 @@ static void __init omap3beagle_flash_init(void)
 	}
 }
 
+static struct musb_hdrc_board_data musb_bdata __initdata = {
+	.power = 50
+};
+
 static struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
 
 	.port_mode[0] = EHCI_HCD_OMAP_MODE_PHY,
@@ -424,7 +429,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(&musb_bdata);
 	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 be93142..dad690f 100644
--- a/arch/arm/mach-omap2/board-omap3evm.c
+++ b/arch/arm/mach-omap2/board-omap3evm.c
@@ -27,6 +27,7 @@
 #include <linux/spi/ads7846.h>
 #include <linux/i2c/twl4030.h>
 #include <linux/usb/otg.h>
+#include <linux/usb/musb.h>
 
 #include <linux/regulator/machine.h>
 
@@ -376,6 +377,10 @@ static struct platform_device *omap3_evm_devices[] __initdata = {
 	&omap3evm_smc911x_device,
 };
 
+static struct musb_hdrc_board_data musb_bdata __initdata = {
+	.power = 50
+};
+
 static struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
 
 	.port_mode[0] = EHCI_HCD_OMAP_MODE_UNKNOWN,
@@ -427,7 +432,7 @@ static void __init omap3_evm_init(void)
 		omap_cfg_reg(AF4_34XX_GPIO135_OUT);
 		ehci_pdata.reset_gpio_port[1] = 135;
 	}
-	usb_musb_init();
+	usb_musb_init(&musb_bdata);
 	usb_ehci_init(&ehci_pdata);
 	ads7846_dev_init();
 }
diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c
index d81d1a0..da97a0d 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>
@@ -387,6 +388,10 @@ static struct platform_device *omap3pandora_devices[] __initdata = {
 	&pandora_keys_gpio,
 };
 
+static struct musb_hdrc_board_data musb_bdata __initdata = {
+	.power = 50
+};
+
 static struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
 
 	.port_mode[0] = EHCI_HCD_OMAP_MODE_PHY,
@@ -410,7 +415,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(&musb_bdata);
 
 	/* Ensure SDRC pins are mux'd for self-refresh */
 	omap_cfg_reg(H16_34XX_SDRC_CKE0);
diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c
index 92f3f3a..d16c714 100644
--- a/arch/arm/mach-omap2/board-overo.c
+++ b/arch/arm/mach-omap2/board-overo.c
@@ -32,6 +32,7 @@
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/nand.h>
 #include <linux/mtd/partitions.h>
+#include <linux/usb/musb.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -384,6 +385,10 @@ static struct platform_device *overo_devices[] __initdata = {
 	&overo_lcd_device,
 };
 
+static struct musb_hdrc_board_data musb_bdata __initdata = {
+	.power = 50
+};
+
 static struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
 	.port_mode[0] = EHCI_HCD_OMAP_MODE_UNKNOWN,
 	.port_mode[1] = EHCI_HCD_OMAP_MODE_PHY,
@@ -402,7 +407,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(&musb_bdata);
 	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 1bb1de2..60c8f9f 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>
@@ -55,6 +56,10 @@ static struct omap_board_config_kernel rx51_config[] = {
 	{ OMAP_TAG_LCD,		&rx51_lcd_config },
 };
 
+static struct musb_hdrc_board_data musb_bdata __initdata = {
+	.power = 50
+};
+
 static void __init rx51_init_irq(void)
 {
 	struct omap_sdrc_params *sdrc_params;
@@ -72,7 +77,7 @@ extern void __init rx51_peripherals_init(void);
 static void __init rx51_init(void)
 {
 	omap_serial_init();
-	usb_musb_init();
+	usb_musb_init(&musb_bdata);
 	rx51_peripherals_init();
 
 	/* Ensure SDRC pins are mux'd for self-refresh */
diff --git a/arch/arm/mach-omap2/usb-musb.c b/arch/arm/mach-omap2/usb-musb.c
index e89c6b1..29a59c9 100644
--- a/arch/arm/mach-omap2/usb-musb.c
+++ b/arch/arm/mach-omap2/usb-musb.c
@@ -140,8 +140,11 @@ static struct platform_device musb_device = {
 	.resource	= musb_resources,
 };
 
-void __init usb_musb_init(void)
+void __init usb_musb_init(struct musb_hdrc_board_data *board_data)
 {
+	/* get board-specific data */
+	musb_plat.board_data = board_data;
+
 	if (cpu_is_omap243x())
 		musb_resources[0].start = OMAP243X_HS_BASE;
 	else
@@ -161,7 +164,7 @@ void __init usb_musb_init(void)
 }
 
 #else
-void __init usb_musb_init(void)
+void __init usb_musb_init(struct musb_hdrc_board_data *board_data)
 {
 }
 #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..ec6bfe0 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(void);
+extern void usb_musb_init(struct musb_hdrc_board_data *board_data);
 
 extern void usb_ehci_init(struct ehci_hcd_omap_platform_data *pdata);
 
-- 
1.6.2.4


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

* [PATCH 4/7] musb: Update setup_usb() call for all Davinci boards
  2009-11-15  8:59     ` [PATCH 3/7] musb: Update musb_init() call for all OMAP3 boards Ajay Kumar Gupta
@ 2009-11-15  8:59       ` Ajay Kumar Gupta
  2009-11-15  8:59         ` [PATCH 5/7] musb: Add 'extvbus' in musb_hdrc_board_data Ajay Kumar Gupta
  0 siblings, 1 reply; 9+ messages in thread
From: Ajay Kumar Gupta @ 2009-11-15  8:59 UTC (permalink / raw)
  To: linux-omap, davinci-linux-open-source
  Cc: felipe.balbi, khilman, Ajay Kumar Gupta

setup_usb() has been modified to pass board specific data so updating
this function call from all Davinci based boards.

Added "struct device;" to fix below compilation warning for Davinci boards.
"musb.h: struct device, defined within parameter list"

Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
---
 arch/arm/mach-davinci/board-dm355-evm.c     |    9 ++++++++-
 arch/arm/mach-davinci/board-dm355-leopard.c |    9 ++++++++-
 arch/arm/mach-davinci/board-dm644x-evm.c    |    8 +++++++-
 arch/arm/mach-davinci/board-sffsdr.c        |    9 ++++++++-
 arch/arm/mach-davinci/include/mach/common.h |    7 +++++--
 arch/arm/mach-davinci/usb.c                 |    8 ++++----
 6 files changed, 40 insertions(+), 10 deletions(-)

diff --git a/arch/arm/mach-davinci/board-dm355-evm.c b/arch/arm/mach-davinci/board-dm355-evm.c
index 77e8067..31c5741 100644
--- a/arch/arm/mach-davinci/board-dm355-evm.c
+++ b/arch/arm/mach-davinci/board-dm355-evm.c
@@ -24,6 +24,7 @@
 #include <media/tvp514x.h>
 #include <linux/spi/spi.h>
 #include <linux/spi/eeprom.h>
+#include <linux/usb/musb.h>
 
 #include <asm/setup.h>
 #include <asm/mach-types.h>
@@ -317,6 +318,12 @@ static struct spi_board_info dm355_evm_spi_info[] __initconst = {
 	},
 };
 
+/* musb board specific data */
+static struct musb_hdrc_board_data musb_bdata __initdata = {
+	.power = 250,	/* (power in mA)/2 */
+	.potpgt = 4,	/* (potpgt in msec)/2 */
+};
+
 static __init void dm355_evm_init(void)
 {
 	struct clk *aemif;
@@ -344,7 +351,7 @@ static __init void dm355_evm_init(void)
 	gpio_request(2, "usb_id_toggle");
 	gpio_direction_output(2, USB_ID_VALUE);
 	/* irlml6401 switches over 1A in under 8 msec */
-	setup_usb(500, 8);
+	setup_usb(&musb_bdata);
 
 	davinci_setup_mmc(0, &dm355evm_mmc_config);
 	davinci_setup_mmc(1, &dm355evm_mmc_config);
diff --git a/arch/arm/mach-davinci/board-dm355-leopard.c b/arch/arm/mach-davinci/board-dm355-leopard.c
index 84ad5d1..2c534f1 100644
--- a/arch/arm/mach-davinci/board-dm355-leopard.c
+++ b/arch/arm/mach-davinci/board-dm355-leopard.c
@@ -21,6 +21,7 @@
 #include <linux/clk.h>
 #include <linux/spi/spi.h>
 #include <linux/spi/eeprom.h>
+#include <linux/usb/musb.h>
 
 #include <asm/setup.h>
 #include <asm/mach-types.h>
@@ -243,6 +244,12 @@ static struct spi_board_info dm355_leopard_spi_info[] __initconst = {
 	},
 };
 
+/* musb board specific data */
+static struct musb_hdrc_board_data musb_bdata __initdata = {
+	.power = 250,	/* (power in mA)/2 */
+	.potpgt = 4,	/* (potpgt in msec)/2 */
+};
+
 static __init void dm355_leopard_init(void)
 {
 	struct clk *aemif;
@@ -270,7 +277,7 @@ static __init void dm355_leopard_init(void)
 	gpio_request(2, "usb_id_toggle");
 	gpio_direction_output(2, USB_ID_VALUE);
 	/* irlml6401 switches over 1A in under 8 msec */
-	setup_usb(500, 8);
+	setup_usb(&musb_bdata);
 
 	davinci_setup_mmc(0, &dm355leopard_mmc_config);
 	davinci_setup_mmc(1, &dm355leopard_mmc_config);
diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c b/arch/arm/mach-davinci/board-dm644x-evm.c
index 1213a00..307520e 100644
--- a/arch/arm/mach-davinci/board-dm644x-evm.c
+++ b/arch/arm/mach-davinci/board-dm644x-evm.c
@@ -29,6 +29,7 @@
 #include <linux/phy.h>
 #include <linux/clk.h>
 #include <linux/videodev2.h>
+#include <linux/usb/musb.h>
 
 #include <media/tvp514x.h>
 
@@ -438,6 +439,11 @@ static struct pcf857x_platform_data pcf_data_u18 = {
 	.teardown	= evm_u18_teardown,
 };
 
+/* musb board specific data */
+static struct musb_hdrc_board_data musb_bdata __initdata = {
+	.power = 250,	/* (power in mA)/2 */
+	.potpgt = 4,	/* (potpgt in msec)/2 */
+};
 
 /* U35 - various I/O signals used to manage USB, CF, ATA, etc */
 
@@ -477,7 +483,7 @@ evm_u35_setup(struct i2c_client *client, int gpio, unsigned ngpio, void *c)
 	/* irlml6401 switches over 1A, in under 8 msec;
 	 * now it can be managed by nDRV_VBUS ...
 	 */
-	setup_usb(500, 8);
+	setup_usb(&musb_bdata);
 
 	return 0;
 }
diff --git a/arch/arm/mach-davinci/board-sffsdr.c b/arch/arm/mach-davinci/board-sffsdr.c
index 7acdfd8..5dceeb0 100644
--- a/arch/arm/mach-davinci/board-sffsdr.c
+++ b/arch/arm/mach-davinci/board-sffsdr.c
@@ -38,6 +38,7 @@
 #include <linux/mtd/partitions.h>
 #include <linux/mtd/physmap.h>
 #include <linux/io.h>
+#include <linux/usb/musb.h>
 
 #include <asm/setup.h>
 #include <asm/mach-types.h>
@@ -149,6 +150,12 @@ static struct davinci_uart_config uart_config __initdata = {
 	.enabled_uarts = (1 << 0),
 };
 
+/* musb board specific data */
+static struct musb_hdrc_board_data musb_bdata __initdata = {
+	.power = 0,	/* (power in mA)/2 */
+	.potpgt = 0	/* (potpgt in msec)/2 */
+};
+
 static void __init davinci_sffsdr_map_io(void)
 {
 	dm644x_init();
@@ -164,7 +171,7 @@ static __init void davinci_sffsdr_init(void)
 	davinci_serial_init(&uart_config);
 	soc_info->emac_pdata->phy_mask = SFFSDR_PHY_MASK;
 	soc_info->emac_pdata->mdio_max_freq = SFFSDR_MDIO_FREQUENCY;
-	setup_usb(0, 0); /* We support only peripheral mode. */
+	setup_usb(&musb_bdata); /* We support only peripheral mode. */
 
 	/* mux VLYNQ pins */
 	davinci_cfg_reg(DM644X_VLYNQEN);
diff --git a/arch/arm/mach-davinci/include/mach/common.h b/arch/arm/mach-davinci/include/mach/common.h
index 1fd3917..dab784c 100644
--- a/arch/arm/mach-davinci/include/mach/common.h
+++ b/arch/arm/mach-davinci/include/mach/common.h
@@ -20,11 +20,14 @@ extern void davinci_irq_init(void);
 extern void __iomem *davinci_intc_base;
 extern int davinci_intc_type;
 
+struct device;
+#include <linux/usb/musb.h>
+
 /* parameters describe VBUS sourcing for host mode */
-extern void setup_usb(unsigned mA, unsigned potpgt_msec);
+extern void setup_usb(struct musb_hdrc_board_data *board_data);
 
 /* parameters describe VBUS sourcing for host mode */
-extern void setup_usb(unsigned mA, unsigned potpgt_msec);
+extern void setup_usb(struct musb_hdrc_board_data *board_data);
 
 struct davinci_timer_instance {
 	void __iomem	*base;
diff --git a/arch/arm/mach-davinci/usb.c b/arch/arm/mach-davinci/usb.c
index 06f5593..1b164dc 100644
--- a/arch/arm/mach-davinci/usb.c
+++ b/arch/arm/mach-davinci/usb.c
@@ -85,10 +85,10 @@ static struct platform_device usb_dev = {
 	.num_resources  = ARRAY_SIZE(usb_resources),
 };
 
-void __init setup_usb(unsigned mA, unsigned potpgt_msec)
+void __init setup_usb(struct musb_hdrc_board_data *board_data)
 {
-	usb_data.power = mA / 2;
-	usb_data.potpgt = potpgt_msec / 2;
+	/* get board-specific data */
+	usb_data.board_data = board_data;
 
 	if (cpu_is_davinci_dm646x()) {
 		/* Override the defaults as DM6467 uses different IRQs. */
@@ -102,7 +102,7 @@ void __init setup_usb(unsigned mA, unsigned potpgt_msec)
 
 #else
 
-void __init setup_usb(unsigned mA, unsigned potpgt_msec)
+void __init setup_usb(struct musb_hdrc_board_data *board_data)
 {
 }
 
-- 
1.6.2.4


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

* [PATCH 5/7] musb: Add 'extvbus' in musb_hdrc_board_data
  2009-11-15  8:59       ` [PATCH 4/7] musb: Update setup_usb() call for all Davinci boards Ajay Kumar Gupta
@ 2009-11-15  8:59         ` Ajay Kumar Gupta
  2009-11-15  8:59           ` [PATCH 6/7] musb: set 'extvbus' default value to zero Ajay Kumar Gupta
  0 siblings, 1 reply; 9+ messages in thread
From: Ajay Kumar Gupta @ 2009-11-15  8:59 UTC (permalink / raw)
  To: linux-omap, davinci-linux-open-source
  Cc: felipe.balbi, khilman, Ajay Kumar Gupta

Some of the board might use external Vbus power supply on musb
interface which would require to program ULPI_BUSCONTROL register.

Adding 'extvbus' flag which can be set from such boards which will
be checked at musb driver files before programming ULPI_BUSCONTROL.

Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
---
 drivers/usb/musb/musb_core.c |   12 +++++++++++-
 drivers/usb/musb/musb_regs.h |    5 +++++
 include/linux/usb/musb.h     |    3 ++-
 3 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index 818ccda..c0a6760 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -2027,15 +2027,25 @@ bad_config:
 	/* host side needs more setup */
 	if (is_host_enabled(musb)) {
 		struct usb_hcd	*hcd = musb_to_hcd(musb);
+		u8 busctl;
 
 		otg_set_host(musb->xceiv, &hcd->self);
 
 		if (is_otg_enabled(musb))
 			hcd->self.otg_port = 1;
 		musb->xceiv->host = &hcd->self;
-		if (plat->board_data)
+		if (plat->board_data) {
 			hcd->power_budget =
 				2 * (plat->board_data->power ? : 250);
+			/* program PHY to use external vBus if required */
+			if (plat->board_data->extvbus) {
+				busctl = musb_readb(musb->mregs,
+						MUSB_ULPI_BUSCONTROL);
+				busctl |= ULPI_USE_EXTVBUS;
+				musb_writeb(musb->mregs,
+						MUSB_ULPI_BUSCONTROL, busctl);
+			}
+		}
 	}
 
 	/* For the host-only role, we can activate right away.
diff --git a/drivers/usb/musb/musb_regs.h b/drivers/usb/musb/musb_regs.h
index cc1d71b..a0314df 100644
--- a/drivers/usb/musb/musb_regs.h
+++ b/drivers/usb/musb/musb_regs.h
@@ -72,6 +72,10 @@
 #define MUSB_DEVCTL_HR		0x02
 #define MUSB_DEVCTL_SESSION	0x01
 
+/* ULPI VBUSCONTROL */
+#define ULPI_USE_EXTVBUS	0x01
+#define ULPI_USE_EXTVBUSIND	0x02
+
 /* TESTMODE */
 #define MUSB_TEST_FORCE_HOST	0x80
 #define MUSB_TEST_FIFO_ACCESS	0x40
@@ -246,6 +250,7 @@
 
 /* REVISIT: vctrl/vstatus: optional vendor utmi+phy register at 0x68 */
 #define MUSB_HWVERS		0x6C	/* 8 bit */
+#define MUSB_ULPI_BUSCONTROL	0x70	/* 8 bit */
 
 #define MUSB_EPINFO		0x78	/* 8 bit */
 #define MUSB_RAMINFO		0x79	/* 8 bit */
diff --git a/include/linux/usb/musb.h b/include/linux/usb/musb.h
index 6e1426c..604c404 100644
--- a/include/linux/usb/musb.h
+++ b/include/linux/usb/musb.h
@@ -33,7 +33,8 @@ struct musb_hdrc_board_data {
 	u8	power;
 	/* (HOST or OTG) msec/2 after VBUS on till power good */
 	u8		potpgt;
-
+	/* flag to program PHY to use external Vbus */
+	u8		extvbus;
 };
 
 struct musb_hdrc_config {
-- 
1.6.2.4


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

* [PATCH 6/7] musb: set 'extvbus' default value to zero
  2009-11-15  8:59         ` [PATCH 5/7] musb: Add 'extvbus' in musb_hdrc_board_data Ajay Kumar Gupta
@ 2009-11-15  8:59           ` Ajay Kumar Gupta
  2009-11-15  8:59             ` [PATCH 7/7] musb: set 'extvbus' for OMAP3EVM Rev >=E Ajay Kumar Gupta
  0 siblings, 1 reply; 9+ messages in thread
From: Ajay Kumar Gupta @ 2009-11-15  8:59 UTC (permalink / raw)
  To: linux-omap, davinci-linux-open-source
  Cc: felipe.balbi, khilman, Ajay Kumar Gupta

Default value of 'extvbus' is being set as '0' to maintain the
current programming state of all the musb boards.

This flag should be set to '1' for boards using external vbus
supply such as, OMAP3EVM Rev >=E.

Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
---
 arch/arm/mach-davinci/board-dm355-evm.c     |    1 +
 arch/arm/mach-davinci/board-dm355-leopard.c |    1 +
 arch/arm/mach-davinci/board-dm644x-evm.c    |    1 +
 arch/arm/mach-davinci/board-sffsdr.c        |    3 ++-
 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-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-overo.c           |    3 ++-
 arch/arm/mach-omap2/board-rx51.c            |    3 ++-
 13 files changed, 23 insertions(+), 10 deletions(-)

diff --git a/arch/arm/mach-davinci/board-dm355-evm.c b/arch/arm/mach-davinci/board-dm355-evm.c
index 31c5741..ed011ae 100644
--- a/arch/arm/mach-davinci/board-dm355-evm.c
+++ b/arch/arm/mach-davinci/board-dm355-evm.c
@@ -322,6 +322,7 @@ static struct spi_board_info dm355_evm_spi_info[] __initconst = {
 static struct musb_hdrc_board_data musb_bdata __initdata = {
 	.power = 250,	/* (power in mA)/2 */
 	.potpgt = 4,	/* (potpgt in msec)/2 */
+	.extvbus = 0,
 };
 
 static __init void dm355_evm_init(void)
diff --git a/arch/arm/mach-davinci/board-dm355-leopard.c b/arch/arm/mach-davinci/board-dm355-leopard.c
index 2c534f1..4ab8ab5 100644
--- a/arch/arm/mach-davinci/board-dm355-leopard.c
+++ b/arch/arm/mach-davinci/board-dm355-leopard.c
@@ -248,6 +248,7 @@ static struct spi_board_info dm355_leopard_spi_info[] __initconst = {
 static struct musb_hdrc_board_data musb_bdata __initdata = {
 	.power = 250,	/* (power in mA)/2 */
 	.potpgt = 4,	/* (potpgt in msec)/2 */
+	.extvbus = 0,
 };
 
 static __init void dm355_leopard_init(void)
diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c b/arch/arm/mach-davinci/board-dm644x-evm.c
index 307520e..9e99882 100644
--- a/arch/arm/mach-davinci/board-dm644x-evm.c
+++ b/arch/arm/mach-davinci/board-dm644x-evm.c
@@ -443,6 +443,7 @@ static struct pcf857x_platform_data pcf_data_u18 = {
 static struct musb_hdrc_board_data musb_bdata __initdata = {
 	.power = 250,	/* (power in mA)/2 */
 	.potpgt = 4,	/* (potpgt in msec)/2 */
+	.extvbus = 0,
 };
 
 /* U35 - various I/O signals used to manage USB, CF, ATA, etc */
diff --git a/arch/arm/mach-davinci/board-sffsdr.c b/arch/arm/mach-davinci/board-sffsdr.c
index 5dceeb0..c6c9b20 100644
--- a/arch/arm/mach-davinci/board-sffsdr.c
+++ b/arch/arm/mach-davinci/board-sffsdr.c
@@ -153,7 +153,8 @@ static struct davinci_uart_config uart_config __initdata = {
 /* musb board specific data */
 static struct musb_hdrc_board_data musb_bdata __initdata = {
 	.power = 0,	/* (power in mA)/2 */
-	.potpgt = 0	/* (potpgt in msec)/2 */
+	.potpgt = 0,	/* (potpgt in msec)/2 */
+	.extvbus = 0,
 };
 
 static void __init davinci_sffsdr_map_io(void)
diff --git a/arch/arm/mach-omap2/board-2430sdp.c b/arch/arm/mach-omap2/board-2430sdp.c
index 03d3634..074941c 100644
--- a/arch/arm/mach-omap2/board-2430sdp.c
+++ b/arch/arm/mach-omap2/board-2430sdp.c
@@ -196,7 +196,8 @@ static struct twl4030_hsmmc_info mmc[] __initdata = {
 };
 
 static struct musb_hdrc_board_data musb_bdata __initdata = {
-	.power = 50
+	.power = 50,
+	.extvbus = 0,
 };
 
 static void __init omap_2430sdp_init(void)
diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c
index dde1a96..fd6fc56 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -486,7 +486,8 @@ static void enable_board_wakeup_source(void)
 }
 
 static struct musb_hdrc_board_data musb_bdata __initdata = {
-	.power = 50
+	.power = 50,
+	.extvbus = 0,
 };
 
 static struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
diff --git a/arch/arm/mach-omap2/board-cm-t35.c b/arch/arm/mach-omap2/board-cm-t35.c
index 5d7656c..134069c 100644
--- a/arch/arm/mach-omap2/board-cm-t35.c
+++ b/arch/arm/mach-omap2/board-cm-t35.c
@@ -385,7 +385,8 @@ static struct twl4030_hsmmc_info mmc[] = {
 };
 
 static struct musb_hdrc_board_data musb_bdata __initdata = {
-	.power = 50
+	.power = 50,
+	.extvbus = 0,
 };
 
 static struct ehci_hcd_omap_platform_data ehci_pdata = {
diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
index 0546c78..11526d6 100644
--- a/arch/arm/mach-omap2/board-ldp.c
+++ b/arch/arm/mach-omap2/board-ldp.c
@@ -376,7 +376,8 @@ static struct platform_device *ldp_devices[] __initdata = {
 };
 
 static struct musb_hdrc_board_data musb_bdata __initdata = {
-	.power = 50
+	.power = 50,
+	.extvbus = 0,
 };
 
 static void __init omap_ldp_init(void)
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index 683b468..2c970e3 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -402,7 +402,8 @@ static void __init omap3beagle_flash_init(void)
 }
 
 static struct musb_hdrc_board_data musb_bdata __initdata = {
-	.power = 50
+	.power = 50,
+	.extvbus = 0,
 };
 
 static struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c
index dad690f..0bcf909 100644
--- a/arch/arm/mach-omap2/board-omap3evm.c
+++ b/arch/arm/mach-omap2/board-omap3evm.c
@@ -378,7 +378,8 @@ static struct platform_device *omap3_evm_devices[] __initdata = {
 };
 
 static struct musb_hdrc_board_data musb_bdata __initdata = {
-	.power = 50
+	.power = 50,
+	.extvbus = 0,
 };
 
 static struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c
index da97a0d..7d91ac4 100644
--- a/arch/arm/mach-omap2/board-omap3pandora.c
+++ b/arch/arm/mach-omap2/board-omap3pandora.c
@@ -389,7 +389,8 @@ static struct platform_device *omap3pandora_devices[] __initdata = {
 };
 
 static struct musb_hdrc_board_data musb_bdata __initdata = {
-	.power = 50
+	.power = 50,
+	.extvbus = 0,
 };
 
 static struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c
index d16c714..68c3f5f 100644
--- a/arch/arm/mach-omap2/board-overo.c
+++ b/arch/arm/mach-omap2/board-overo.c
@@ -386,7 +386,8 @@ static struct platform_device *overo_devices[] __initdata = {
 };
 
 static struct musb_hdrc_board_data musb_bdata __initdata = {
-	.power = 50
+	.power = 50,
+	.extvbus = 0,
 };
 
 static struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
diff --git a/arch/arm/mach-omap2/board-rx51.c b/arch/arm/mach-omap2/board-rx51.c
index 60c8f9f..6b41a53 100644
--- a/arch/arm/mach-omap2/board-rx51.c
+++ b/arch/arm/mach-omap2/board-rx51.c
@@ -57,7 +57,8 @@ static struct omap_board_config_kernel rx51_config[] = {
 };
 
 static struct musb_hdrc_board_data musb_bdata __initdata = {
-	.power = 50
+	.power = 50,
+	.extvbus = 0,
 };
 
 static void __init rx51_init_irq(void)
-- 
1.6.2.4


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

* [PATCH 7/7] musb: set 'extvbus' for OMAP3EVM Rev >=E
  2009-11-15  8:59           ` [PATCH 6/7] musb: set 'extvbus' default value to zero Ajay Kumar Gupta
@ 2009-11-15  8:59             ` Ajay Kumar Gupta
  0 siblings, 0 replies; 9+ messages in thread
From: Ajay Kumar Gupta @ 2009-11-15  8:59 UTC (permalink / raw)
  To: linux-omap, davinci-linux-open-source
  Cc: felipe.balbi, khilman, Ajay Kumar Gupta

MUSB interface can source 500mA on OMAP3EVM Rev >= E while Rev < E
supports only 100mA so setting 'extvbus' flag to '1' for OMAP3EVM
Rev >= E.

Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
---
 arch/arm/mach-omap2/board-omap3evm.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c
index 0bcf909..a3c8344 100644
--- a/arch/arm/mach-omap2/board-omap3evm.c
+++ b/arch/arm/mach-omap2/board-omap3evm.c
@@ -428,6 +428,8 @@ static void __init omap3_evm_init(void)
 		omap_cfg_reg(AH14_34XX_GPIO21);
 		ehci_pdata.reset_gpio_port[1] = 21;
 
+		/* set flag to program ULPI_BUSCONTROL */
+		musb_bdata.extvbus = 1;
 	} else {
 		/* setup EHCI phy reset on MDC */
 		omap_cfg_reg(AF4_34XX_GPIO135_OUT);
-- 
1.6.2.4


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

* Re: [PATCH 0/7] musb: Add structure 'musb_hdrc_board_data'
  2009-11-15  8:59 [PATCH 0/7] musb: Add structure 'musb_hdrc_board_data' Ajay Kumar Gupta
  2009-11-15  8:59 ` [PATCH 1/7] musb: Add structure to get board specific data Ajay Kumar Gupta
@ 2009-11-16 21:08 ` Tony Lindgren
  1 sibling, 0 replies; 9+ messages in thread
From: Tony Lindgren @ 2009-11-16 21:08 UTC (permalink / raw)
  To: Ajay Kumar Gupta
  Cc: linux-omap, davinci-linux-open-source, felipe.balbi, khilman

* Ajay Kumar Gupta <ajay.gupta@ti.com> [091115 00:59]:
> Hi,
> 
> This patch set adds a new structure 'musb_hdrc_board_data' to get all
> board specific data from board files.
> 
> It is actually done to accomodate ULPI_VBUSCONTROL programming required
> for OMAP3EVM Rev >=E which uses external Vbus supply to support 500mA.
> 
> Necessarly changes have been done in all the OMAP and Davinci platform
> based boards.
> 
> Please review and provide your feedback.
> [patches created against linux-omap/master branch and tested on OMAP3EVM]

Can you please resend with linux-usb also Cc'd? There are more architectures
using musb other than omap and davinci.

Regards,

Tony
 
> Regards,
> Ajay
> 
> Ajay Kumar Gupta (7):
>   musb: Add structure to get board specific data
>   musb: Get power (mA) from board data
>   musb: Update musb_init() call for all OMAP3 boards
>   musb: Update setup_usb() call for all Davinci boards
>   musb: Add 'extvbus' in musb_hdrc_board_data
>   musb: set 'extvbus' default value to zero
>   musb: set 'extvbus' for OMAP3EVM Rev >=E
> 
>  arch/arm/mach-davinci/board-dm355-evm.c     |   10 +++++++++-
>  arch/arm/mach-davinci/board-dm355-leopard.c |   10 +++++++++-
>  arch/arm/mach-davinci/board-dm644x-evm.c    |    9 ++++++++-
>  arch/arm/mach-davinci/board-sffsdr.c        |   10 +++++++++-
>  arch/arm/mach-davinci/include/mach/common.h |    7 +++++--
>  arch/arm/mach-davinci/usb.c                 |    8 ++++----
>  arch/arm/mach-omap2/board-2430sdp.c         |    8 +++++++-
>  arch/arm/mach-omap2/board-3430sdp.c         |    8 +++++++-
>  arch/arm/mach-omap2/board-cm-t35.c          |    8 +++++++-
>  arch/arm/mach-omap2/board-ldp.c             |    8 +++++++-
>  arch/arm/mach-omap2/board-omap3beagle.c     |    8 +++++++-
>  arch/arm/mach-omap2/board-omap3evm.c        |   10 +++++++++-
>  arch/arm/mach-omap2/board-omap3pandora.c    |    8 +++++++-
>  arch/arm/mach-omap2/board-overo.c           |    8 +++++++-
>  arch/arm/mach-omap2/board-rx51.c            |    8 +++++++-
>  arch/arm/mach-omap2/usb-musb.c              |   13 +++++--------
>  arch/arm/plat-omap/include/plat/usb.h       |    3 ++-
>  drivers/usb/musb/musb_core.c                |   14 +++++++++++++-
>  drivers/usb/musb/musb_regs.h                |    5 +++++
>  include/linux/usb/musb.h                    |   19 +++++++++++++------
>  20 files changed, 147 insertions(+), 35 deletions(-)
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2009-11-16 21:08 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-15  8:59 [PATCH 0/7] musb: Add structure 'musb_hdrc_board_data' Ajay Kumar Gupta
2009-11-15  8:59 ` [PATCH 1/7] musb: Add structure to get board specific data Ajay Kumar Gupta
2009-11-15  8:59   ` [PATCH 2/7] musb: Get power (mA) from board data Ajay Kumar Gupta
2009-11-15  8:59     ` [PATCH 3/7] musb: Update musb_init() call for all OMAP3 boards Ajay Kumar Gupta
2009-11-15  8:59       ` [PATCH 4/7] musb: Update setup_usb() call for all Davinci boards Ajay Kumar Gupta
2009-11-15  8:59         ` [PATCH 5/7] musb: Add 'extvbus' in musb_hdrc_board_data Ajay Kumar Gupta
2009-11-15  8:59           ` [PATCH 6/7] musb: set 'extvbus' default value to zero Ajay Kumar Gupta
2009-11-15  8:59             ` [PATCH 7/7] musb: set 'extvbus' for OMAP3EVM Rev >=E Ajay Kumar Gupta
2009-11-16 21:08 ` [PATCH 0/7] musb: Add structure 'musb_hdrc_board_data' Tony Lindgren

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