linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] Some am3517 related patches [V4]
@ 2010-05-13 12:39 Stanley.Miao
  2010-05-13 12:39 ` [PATCH 1/3] AM3517: rename the i2c boardinfo to make it more readable Stanley.Miao
  2010-05-14 21:30 ` [PATCH 0/3] Some am3517 related patches [V4] Tony Lindgren
  0 siblings, 2 replies; 5+ messages in thread
From: Stanley.Miao @ 2010-05-13 12:39 UTC (permalink / raw)
  To: linux-omap; +Cc: stanley.miao, tony

Changes from V3:
1, refresh the the patches against the current omap-for-linus branch
2, Added "features" in mmc->slot[i].

Stanley.Miao (3):
      AM3517: rename the i2c boardinfo to make it more readable
      omap: init the gpio pinmux for mmc
      omap hsmmc: fix the hsmmc driver for am3517

 arch/arm/mach-omap2/board-am3517evm.c |   20 ++++++++++----------
 arch/arm/mach-omap2/devices.c         |    9 +++++++++
 arch/arm/mach-omap2/hsmmc.c           |   27 +++++++++++++++++++++------
 arch/arm/plat-omap/include/plat/mmc.h |    4 ++++
 4 files changed, 44 insertions(+), 16 deletions(-)


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

* [PATCH 1/3] AM3517: rename the i2c boardinfo to make it more readable
  2010-05-13 12:39 [PATCH 0/3] Some am3517 related patches [V4] Stanley.Miao
@ 2010-05-13 12:39 ` Stanley.Miao
  2010-05-13 12:39   ` [PATCH 2/3] omap: init the gpio pinmux for mmc Stanley.Miao
  2010-05-14 21:30 ` [PATCH 0/3] Some am3517 related patches [V4] Tony Lindgren
  1 sibling, 1 reply; 5+ messages in thread
From: Stanley.Miao @ 2010-05-13 12:39 UTC (permalink / raw)
  To: linux-omap; +Cc: stanley.miao, tony

There are three i2c buses on am3517, and each i2c bus has several devices
on it, so we can't name the i2c boardinfo structures with one of these
devices. In order to make it more readable, now rename these three boardinfo
structures based on i2c indexes.

Signed-off-by: Stanley.Miao <stanley.miao@windriver.com>
Acked-By: Vaibhav Hiremath <hvaibhav@ti.com>
---
 arch/arm/mach-omap2/board-am3517evm.c |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-omap2/board-am3517evm.c
index 19b9e41..af383a8 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -136,7 +136,7 @@ void am3517_evm_ethernet_init(struct emac_platform_data *pdata)
 #define LCD_PANEL_BKLIGHT_PWR	182
 #define LCD_PANEL_PWM		181
 
-static struct i2c_board_info __initdata am3517evm_i2c_boardinfo[] = {
+static struct i2c_board_info __initdata am3517evm_i2c1_boardinfo[] = {
 	{
 		I2C_BOARD_INFO("s35390a", 0x30),
 		.type		= "s35390a",
@@ -166,7 +166,7 @@ static void __init am3517_evm_rtc_init(void)
 		gpio_free(GPIO_RTCS35390A_IRQ);
 		return;
 	}
-	am3517evm_i2c_boardinfo[0].irq = gpio_to_irq(GPIO_RTCS35390A_IRQ);
+	am3517evm_i2c1_boardinfo[0].irq = gpio_to_irq(GPIO_RTCS35390A_IRQ);
 }
 
 /*
@@ -177,7 +177,7 @@ static void __init am3517_evm_rtc_init(void)
 static struct pca953x_platform_data am3517evm_gpio_expander_info_0 = {
 	.gpio_base	= OMAP_MAX_GPIO_LINES,
 };
-static struct i2c_board_info __initdata am3517evm_tca6416_info_0[] = {
+static struct i2c_board_info __initdata am3517evm_i2c2_boardinfo[] = {
 	{
 		I2C_BOARD_INFO("tca6416", 0x21),
 		.platform_data = &am3517evm_gpio_expander_info_0,
@@ -191,7 +191,7 @@ static struct pca953x_platform_data am3517evm_ui_gpio_expander_info_1 = {
 static struct pca953x_platform_data am3517evm_ui_gpio_expander_info_2 = {
 	.gpio_base	= OMAP_MAX_GPIO_LINES + 32,
 };
-static struct i2c_board_info __initdata am3517evm_ui_tca6416_info[] = {
+static struct i2c_board_info __initdata am3517evm_i2c3_boardinfo[] = {
 	{
 		I2C_BOARD_INFO("tca6416", 0x20),
 		.platform_data = &am3517evm_ui_gpio_expander_info_1,
@@ -205,10 +205,10 @@ static struct i2c_board_info __initdata am3517evm_ui_tca6416_info[] = {
 static int __init am3517_evm_i2c_init(void)
 {
 	omap_register_i2c_bus(1, 400, NULL, 0);
-	omap_register_i2c_bus(2, 400, am3517evm_tca6416_info_0,
-			ARRAY_SIZE(am3517evm_tca6416_info_0));
-	omap_register_i2c_bus(3, 400, am3517evm_ui_tca6416_info,
-			ARRAY_SIZE(am3517evm_ui_tca6416_info));
+	omap_register_i2c_bus(2, 400, am3517evm_i2c2_boardinfo,
+			ARRAY_SIZE(am3517evm_i2c2_boardinfo));
+	omap_register_i2c_bus(3, 400, am3517evm_i2c3_boardinfo,
+			ARRAY_SIZE(am3517evm_i2c3_boardinfo));
 
 	return 0;
 }
@@ -455,8 +455,8 @@ static void __init am3517_evm_init(void)
 	/* RTC - S35390A */
 	am3517_evm_rtc_init();
 
-	i2c_register_board_info(1, am3517evm_i2c_boardinfo,
-				ARRAY_SIZE(am3517evm_i2c_boardinfo));
+	i2c_register_board_info(1, am3517evm_i2c1_boardinfo,
+				ARRAY_SIZE(am3517evm_i2c1_boardinfo));
 	/*Ethernet*/
 	am3517_evm_ethernet_init(&am3517_evm_emac_pdata);
 }
-- 
1.5.4.3


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

* [PATCH 2/3] omap: init the gpio pinmux for mmc
  2010-05-13 12:39 ` [PATCH 1/3] AM3517: rename the i2c boardinfo to make it more readable Stanley.Miao
@ 2010-05-13 12:39   ` Stanley.Miao
  2010-05-13 12:39     ` [PATCH 3/3] omap hsmmc: fix the hsmmc driver for am3517 Stanley.Miao
  0 siblings, 1 reply; 5+ messages in thread
From: Stanley.Miao @ 2010-05-13 12:39 UTC (permalink / raw)
  To: linux-omap; +Cc: stanley.miao, tony

There is two gpio for mmc use, one is for card detecting, another is
used for checking write protect. Intialize its pinmux in case the bootloader
doesn't set it.

Signed-off-by: Stanley.Miao <stanley.miao@windriver.com>
---
 arch/arm/mach-omap2/devices.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index 10f3a3c..3d30f22 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -591,6 +591,15 @@ static inline void omap_hsmmc_reset(void) {}
 static inline void omap2_mmc_mux(struct omap_mmc_platform_data *mmc_controller,
 			int controller_nr)
 {
+	if ((mmc_controller->slots[0].switch_pin > 0) && \
+		(mmc_controller->slots[0].switch_pin < OMAP_MAX_GPIO_LINES))
+		omap_mux_init_gpio(mmc_controller->slots[0].switch_pin,
+					OMAP_PIN_INPUT_PULLUP);
+	if ((mmc_controller->slots[0].gpio_wp > 0) && \
+		(mmc_controller->slots[0].gpio_wp < OMAP_MAX_GPIO_LINES))
+		omap_mux_init_gpio(mmc_controller->slots[0].gpio_wp,
+					OMAP_PIN_INPUT_PULLUP);
+
 	if (cpu_is_omap2420() && controller_nr == 0) {
 		omap_cfg_reg(H18_24XX_MMC_CMD);
 		omap_cfg_reg(H15_24XX_MMC_CLKI);
-- 
1.5.4.3


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

* [PATCH 3/3] omap hsmmc: fix the hsmmc driver for am3517
  2010-05-13 12:39   ` [PATCH 2/3] omap: init the gpio pinmux for mmc Stanley.Miao
@ 2010-05-13 12:39     ` Stanley.Miao
  0 siblings, 0 replies; 5+ messages in thread
From: Stanley.Miao @ 2010-05-13 12:39 UTC (permalink / raw)
  To: linux-omap; +Cc: stanley.miao, tony

AM3517 don't have the register OMAP343X_CONTROL_PBIAS_LITE and the regulators
like "vmmc", so we set a noop "set_power" function for it.

Signed-off-by: Stanley.Miao <stanley.miao@windriver.com>
---
 arch/arm/mach-omap2/hsmmc.c           |   27 +++++++++++++++++++++------
 arch/arm/plat-omap/include/plat/mmc.h |    4 ++++
 2 files changed, 25 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-omap2/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c
index 9ad2295..2d36f3a 100644
--- a/arch/arm/mach-omap2/hsmmc.c
+++ b/arch/arm/mach-omap2/hsmmc.c
@@ -139,6 +139,12 @@ static void hsmmc23_before_set_reg(struct device *dev, int slot,
 	}
 }
 
+static int nop_mmc_set_power(struct device *dev, int slot, int power_on,
+							int vdd)
+{
+	return 0;
+}
+
 static struct omap_mmc_platform_data *hsmmc_data[OMAP34XX_NR_MMC] __initdata;
 
 void __init omap2_hsmmc_init(struct omap2_hsmmc_info *controllers)
@@ -216,11 +222,18 @@ void __init omap2_hsmmc_init(struct omap2_hsmmc_info *controllers)
 		 */
 		mmc->slots[0].ocr_mask = c->ocr_mask;
 
+		if (cpu_is_omap3517() || cpu_is_omap3505())
+			mmc->slots[0].set_power = nop_mmc_set_power;
+		else
+			mmc->slots[0].features |= HSMMC_HAS_PBIAS;
+
 		switch (c->mmc) {
 		case 1:
-			/* on-chip level shifting via PBIAS0/PBIAS1 */
-			mmc->slots[0].before_set_reg = hsmmc1_before_set_reg;
-			mmc->slots[0].after_set_reg = hsmmc1_after_set_reg;
+			if (mmc->slots[0].features & HSMMC_HAS_PBIAS) {
+				/* on-chip level shifting via PBIAS0/PBIAS1 */
+				mmc->slots[0].before_set_reg = hsmmc1_before_set_reg;
+				mmc->slots[0].after_set_reg = hsmmc1_after_set_reg;
+			}
 
 			/* Omap3630 HSMMC1 supports only 4-bit */
 			if (cpu_is_omap3630() && c->wires > 4) {
@@ -235,9 +248,11 @@ void __init omap2_hsmmc_init(struct omap2_hsmmc_info *controllers)
 				c->wires = 4;
 			/* FALLTHROUGH */
 		case 3:
-			/* off-chip level shifting, or none */
-			mmc->slots[0].before_set_reg = hsmmc23_before_set_reg;
-			mmc->slots[0].after_set_reg = NULL;
+			if (mmc->slots[0].features & HSMMC_HAS_PBIAS) {
+				/* off-chip level shifting, or none */
+				mmc->slots[0].before_set_reg = hsmmc23_before_set_reg;
+				mmc->slots[0].after_set_reg = NULL;
+			}
 			break;
 		default:
 			pr_err("MMC%d configuration not supported!\n", c->mmc);
diff --git a/arch/arm/plat-omap/include/plat/mmc.h b/arch/arm/plat-omap/include/plat/mmc.h
index a1bac07..c835f1e 100644
--- a/arch/arm/plat-omap/include/plat/mmc.h
+++ b/arch/arm/plat-omap/include/plat/mmc.h
@@ -102,6 +102,10 @@ struct omap_mmc_platform_data {
 		/* Regulator off remapped to sleep */
 		unsigned vcc_aux_disable_is_sleep:1;
 
+		/* we can put the features above into this variable */
+#define HSMMC_HAS_PBIAS		(1 << 0)
+		unsigned features;
+
 		int switch_pin;			/* gpio (card detect) */
 		int gpio_wp;			/* gpio (write protect) */
 
-- 
1.5.4.3


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

* Re: [PATCH 0/3] Some am3517 related patches [V4]
  2010-05-13 12:39 [PATCH 0/3] Some am3517 related patches [V4] Stanley.Miao
  2010-05-13 12:39 ` [PATCH 1/3] AM3517: rename the i2c boardinfo to make it more readable Stanley.Miao
@ 2010-05-14 21:30 ` Tony Lindgren
  1 sibling, 0 replies; 5+ messages in thread
From: Tony Lindgren @ 2010-05-14 21:30 UTC (permalink / raw)
  To: Stanley.Miao; +Cc: linux-omap

* Stanley.Miao <stanley.miao@windriver.com> [100513 05:24]:
> Changes from V3:
> 1, refresh the the patches against the current omap-for-linus branch
> 2, Added "features" in mmc->slot[i].
> 
> Stanley.Miao (3):
>       AM3517: rename the i2c boardinfo to make it more readable
>       omap: init the gpio pinmux for mmc
>       omap hsmmc: fix the hsmmc driver for am3517
> 
>  arch/arm/mach-omap2/board-am3517evm.c |   20 ++++++++++----------
>  arch/arm/mach-omap2/devices.c         |    9 +++++++++
>  arch/arm/mach-omap2/hsmmc.c           |   27 +++++++++++++++++++++------
>  arch/arm/plat-omap/include/plat/mmc.h |    4 ++++
>  4 files changed, 44 insertions(+), 16 deletions(-)

Thanks, I've added all three into omap for-next branch.

Regards,

Tony 

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

end of thread, other threads:[~2010-05-14 21:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-13 12:39 [PATCH 0/3] Some am3517 related patches [V4] Stanley.Miao
2010-05-13 12:39 ` [PATCH 1/3] AM3517: rename the i2c boardinfo to make it more readable Stanley.Miao
2010-05-13 12:39   ` [PATCH 2/3] omap: init the gpio pinmux for mmc Stanley.Miao
2010-05-13 12:39     ` [PATCH 3/3] omap hsmmc: fix the hsmmc driver for am3517 Stanley.Miao
2010-05-14 21:30 ` [PATCH 0/3] Some am3517 related patches [V4] Tony Lindgren

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