public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ARM: OMAP: Fix MMC gpio_wp for BeagleBoard C2 and above
@ 2009-09-18  9:32 Jarkko Nikula
  2009-09-18 10:22 ` Jarkko Nikula
  0 siblings, 1 reply; 4+ messages in thread
From: Jarkko Nikula @ 2009-09-18  9:32 UTC (permalink / raw)
  To: linux-omap; +Cc: Jarkko Nikula

Earlier BeagleBoards were using pad AH8 muxed to GPIO29 for MMC write-protect.
However, this signal has been changed to pad AG9 in board revision C2.

Fix this by adding mux configuration for pad AG9, runtime check for board
revisions and set the gpio number and pad muxing accordingly.

Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
---
 arch/arm/mach-omap2/board-omap3beagle.c |    7 ++++++-
 arch/arm/mach-omap2/mux.c               |    2 ++
 arch/arm/plat-omap/include/mach/mux.h   |    1 +
 3 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index a661fe3..ea7db8a 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -139,8 +139,13 @@ static struct gpio_led gpio_leds[];
 static int beagle_twl_gpio_setup(struct device *dev,
 		unsigned gpio, unsigned ngpio)
 {
+	if (system_rev >= 0x20 && system_rev <= 0x34301000) {
+		omap_cfg_reg(AG9_34XX_GPIO23);
+		mmc[0].gpio_wp = 23;
+	} else {
+		omap_cfg_reg(AH8_34XX_GPIO29);
+	}
 	/* gpio + 0 is "mmc0_cd" (input/IRQ) */
-	omap_cfg_reg(AH8_34XX_GPIO29);
 	mmc[0].gpio_cd = gpio + 0;
 	twl4030_mmc_init(mmc);
 
diff --git a/arch/arm/mach-omap2/mux.c b/arch/arm/mach-omap2/mux.c
index 2daa595..8045b61 100644
--- a/arch/arm/mach-omap2/mux.c
+++ b/arch/arm/mach-omap2/mux.c
@@ -460,6 +460,8 @@ MUX_CFG_34XX("AF26_34XX_GPIO0", 0x1e0,
 		OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT)
 MUX_CFG_34XX("AF22_34XX_GPIO9", 0xa18,
 		OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT)
+MUX_CFG_34XX("AH8_34XX_GPIO23", 0x5ee,
+		OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT)
 MUX_CFG_34XX("AH8_34XX_GPIO29", 0x5fa,
 		OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT)
 MUX_CFG_34XX("U8_34XX_GPIO54_OUT", 0x0b4,
diff --git a/arch/arm/plat-omap/include/mach/mux.h b/arch/arm/plat-omap/include/mach/mux.h
index 98dfab6..9fd6171 100644
--- a/arch/arm/plat-omap/include/mach/mux.h
+++ b/arch/arm/plat-omap/include/mach/mux.h
@@ -840,6 +840,7 @@ enum omap34xx_index {
 	 */
 	AF26_34XX_GPIO0,
 	AF22_34XX_GPIO9,
+	AG9_34XX_GPIO23,
 	AH8_34XX_GPIO29,
 	U8_34XX_GPIO54_OUT,
 	U8_34XX_GPIO54_DOWN,
-- 
1.6.3.3


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

* Re: [PATCH] ARM: OMAP: Fix MMC gpio_wp for BeagleBoard C2 and above
  2009-09-18  9:32 [PATCH] ARM: OMAP: Fix MMC gpio_wp for BeagleBoard C2 and above Jarkko Nikula
@ 2009-09-18 10:22 ` Jarkko Nikula
  2009-09-18 10:27   ` [PATCHv2] " jhnikula
  0 siblings, 1 reply; 4+ messages in thread
From: Jarkko Nikula @ 2009-09-18 10:22 UTC (permalink / raw)
  To: linux-omap

On Fri, 18 Sep 2009 12:32:52 +0300
Jarkko Nikula <jhnikula@gmail.com> wrote:

> Earlier BeagleBoards were using pad AH8 muxed to GPIO29 for MMC write-protect.
> However, this signal has been changed to pad AG9 in board revision C2.
> 
> Fix this by adding mux configuration for pad AG9, runtime check for board
> revisions and set the gpio number and pad muxing accordingly.
> 
...
> +MUX_CFG_34XX("AH8_34XX_GPIO23", 0x5ee,
> +		OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT)
>  MUX_CFG_34XX("AH8_34XX_GPIO29", 0x5fa,
>  		OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT)

Stupid copy-paste error here. Will print the wrong pad. I'll resend
in a minute.


-- 
Jarkko

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

* [PATCHv2] ARM: OMAP: Fix MMC gpio_wp for BeagleBoard C2 and above
  2009-09-18 10:22 ` Jarkko Nikula
@ 2009-09-18 10:27   ` jhnikula
  2009-09-22 21:10     ` [APPLIED] " Tony Lindgren
  0 siblings, 1 reply; 4+ messages in thread
From: jhnikula @ 2009-09-18 10:27 UTC (permalink / raw)
  To: linux-omap; +Cc: Jarkko Nikula

From: Jarkko Nikula <jhnikula@gmail.com>

Earlier BeagleBoards were using pad AH8 muxed to GPIO29 for MMC write-protect.
However, this signal has been changed to pad AG9 in board revision C2.

Fix this by adding mux configuration for pad AG9, runtime check for board
revisions and set the gpio number and pad muxing accordingly.

Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
---
 arch/arm/mach-omap2/board-omap3beagle.c |    7 ++++++-
 arch/arm/mach-omap2/mux.c               |    2 ++
 arch/arm/plat-omap/include/mach/mux.h   |    1 +
 3 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index a661fe3..ea7db8a 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -139,8 +139,13 @@ static struct gpio_led gpio_leds[];
 static int beagle_twl_gpio_setup(struct device *dev,
 		unsigned gpio, unsigned ngpio)
 {
+	if (system_rev >= 0x20 && system_rev <= 0x34301000) {
+		omap_cfg_reg(AG9_34XX_GPIO23);
+		mmc[0].gpio_wp = 23;
+	} else {
+		omap_cfg_reg(AH8_34XX_GPIO29);
+	}
 	/* gpio + 0 is "mmc0_cd" (input/IRQ) */
-	omap_cfg_reg(AH8_34XX_GPIO29);
 	mmc[0].gpio_cd = gpio + 0;
 	twl4030_mmc_init(mmc);
 
diff --git a/arch/arm/mach-omap2/mux.c b/arch/arm/mach-omap2/mux.c
index 2daa595..8d773e8 100644
--- a/arch/arm/mach-omap2/mux.c
+++ b/arch/arm/mach-omap2/mux.c
@@ -460,6 +460,8 @@ MUX_CFG_34XX("AF26_34XX_GPIO0", 0x1e0,
 		OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT)
 MUX_CFG_34XX("AF22_34XX_GPIO9", 0xa18,
 		OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT)
+MUX_CFG_34XX("AG9_34XX_GPIO23", 0x5ee,
+		OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT)
 MUX_CFG_34XX("AH8_34XX_GPIO29", 0x5fa,
 		OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT)
 MUX_CFG_34XX("U8_34XX_GPIO54_OUT", 0x0b4,
diff --git a/arch/arm/plat-omap/include/mach/mux.h b/arch/arm/plat-omap/include/mach/mux.h
index 98dfab6..9fd6171 100644
--- a/arch/arm/plat-omap/include/mach/mux.h
+++ b/arch/arm/plat-omap/include/mach/mux.h
@@ -840,6 +840,7 @@ enum omap34xx_index {
 	 */
 	AF26_34XX_GPIO0,
 	AF22_34XX_GPIO9,
+	AG9_34XX_GPIO23,
 	AH8_34XX_GPIO29,
 	U8_34XX_GPIO54_OUT,
 	U8_34XX_GPIO54_DOWN,
-- 
1.6.3.3


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

* [APPLIED] [PATCHv2] ARM: OMAP: Fix MMC gpio_wp for BeagleBoard C2 and above
  2009-09-18 10:27   ` [PATCHv2] " jhnikula
@ 2009-09-22 21:10     ` Tony Lindgren
  0 siblings, 0 replies; 4+ messages in thread
From: Tony Lindgren @ 2009-09-22 21:10 UTC (permalink / raw)
  To: linux-omap

This patch has been applied to the linux-omap
by youw fwiendly patch wobot.

Branch in linux-omap: omap-fixes

Initial commit ID (Likely to change): b4fe313921180cdc56bab164e0d99ce1e97318e8

PatchWorks
http://patchwork.kernel.org/patch/48485/

Git (Likely to change, and takes a while to get mirrored)
http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-omap-2.6.git;a=commit;h=b4fe313921180cdc56bab164e0d99ce1e97318e8



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

end of thread, other threads:[~2009-09-22 21:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-18  9:32 [PATCH] ARM: OMAP: Fix MMC gpio_wp for BeagleBoard C2 and above Jarkko Nikula
2009-09-18 10:22 ` Jarkko Nikula
2009-09-18 10:27   ` [PATCHv2] " jhnikula
2009-09-22 21:10     ` [APPLIED] " Tony Lindgren

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