linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: tony@atomide.com (Tony Lindgren)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 11/12] omap: Fix MMC gpio_wp for BeagleBoard C2 and above
Date: Thu, 24 Sep 2009 16:45:47 -0700	[thread overview]
Message-ID: <20090924234547.6065.10188.stgit@localhost> (raw)
In-Reply-To: <20090924233027.6065.95725.stgit@localhost>

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>
Signed-off-by: Tony Lindgren <tony@atomide.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 500c995..70df6b4 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 339ba80..b5fac32 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 4bcf8a5..0f49d2d 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,

  parent reply	other threads:[~2009-09-24 23:45 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-24 23:31 [PATCH 00/12] Omap fixes for 2.6.32-rc1 Tony Lindgren
2009-09-24 23:32 ` [PATCH 01/12] omap: Fix compile for arch/arm/mach-omap2 Tony Lindgren
2009-09-24 23:34 ` [PATCH 02/12] omap: Fix mcspi compile for 2420 Tony Lindgren
2009-09-24 23:35 ` [PATCH 03/12] omap: Fix 44xx compile Tony Lindgren
2009-09-24 23:36 ` [PATCH 04/12] omap: Add missing mux pin for EHCI phy reset line Tony Lindgren
2009-09-24 23:38 ` [PATCH 05/12] omap: mailbox: Execute softreset at startup Tony Lindgren
2009-09-24 23:39 ` [PATCH 06/12] omap: mailbox: Flush posted write when acking mailbox irq Tony Lindgren
2009-09-25  7:12   ` Artem Bityutskiy
2009-09-25 15:51     ` Tony Lindgren
2009-09-24 23:40 ` [PATCH 07/12] omap: iovmm: Fix compiler warning Tony Lindgren
2009-09-24 23:41 ` [PATCH 08/12] omap: Fix wrong jtag_id for 850 Tony Lindgren
2009-09-24 23:43 ` [PATCH 09/12] omap: Fix a OMAP_MPUIO_VBASE typo " Tony Lindgren
2009-09-24 23:44 ` [PATCH 10/12] omap: Fix matrix_keymap_data usage Tony Lindgren
2009-09-24 23:45 ` Tony Lindgren [this message]
2009-09-24 23:47 ` [PATCH 12/12] omap: rng: Use resource_size instead of manual calculation Tony Lindgren
2009-09-28 16:26 ` [PATCH 13/12] omap: mailbox: Fix wrong condition check in while loop Tony Lindgren
2009-09-28 16:39   ` [PATCH 13/12] omap: Fix wrong condition check in while loop for mailbox and iommu2 Tony Lindgren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090924234547.6065.10188.stgit@localhost \
    --to=tony@atomide.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).