All of lore.kernel.org
 help / color / mirror / Atom feed
From: sricharan <r.sricharan@ti.com>
To: linux-omap@vger.kernel.org
Subject: [PATCH 1/5] OMAP4: hsmmc: Initialise the mmc mux pins
Date: Mon, 15 Nov 2010 13:08:01 +0530	[thread overview]
Message-ID: <1289806685-20688-2-git-send-email-r.sricharan@ti.com> (raw)
In-Reply-To: <1289806685-20688-1-git-send-email-r.sricharan@ti.com>

Use the mux framework to initialise the mmc mux pins.

Signed-off-by: sricharan <r.sricharan@ti.com>
---
 arch/arm/mach-omap2/devices.c |   83 +++++++++++++++++++++++++++++++++++++++++
 1 files changed, 83 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index eaf3799..56b1ac9 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -784,6 +784,89 @@ static inline void omap2_mmc_mux(struct omap_mmc_platform_data *mmc_controller,
 		 * For MMC3 the pins need to be muxed in the board-*.c files
 		 */
 	}
+
+	if (cpu_is_omap44xx()) {
+		switch (controller_nr) {
+		case 0:
+			/* MMC 1 */
+			omap_mux_init_signal("sdmmc1_clk.sdmmc1_clk",
+						OMAP_PIN_INPUT_PULLUP);
+			omap_mux_init_signal("sdmmc1_cmd.sdmmc1_cmd",
+						OMAP_PIN_INPUT_PULLUP);
+			omap_mux_init_signal("sdmmc1_dat0.sdmmc1_dat0",
+						OMAP_PIN_INPUT_PULLUP);
+			if (mmc_controller->slots[0].caps &
+				(MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA)) {
+				omap_mux_init_signal("sdmmc1_dat1.sdmmc1_dat1",
+						OMAP_PIN_INPUT_PULLUP);
+				omap_mux_init_signal("sdmmc1_dat2.sdmmc1_dat2",
+						OMAP_PIN_INPUT_PULLUP);
+				omap_mux_init_signal("sdmmc1_dat3.sdmmc1_dat3",
+						OMAP_PIN_INPUT_PULLUP);
+			}
+			if (mmc_controller->slots[0].caps &
+						MMC_CAP_8_BIT_DATA) {
+				omap_mux_init_signal("sdmmc1_dat4.sdmmc1_dat4",
+						OMAP_PIN_INPUT_PULLUP);
+				omap_mux_init_signal("sdmmc1_dat5.sdmmc1_dat5",
+						OMAP_PIN_INPUT_PULLUP);
+				omap_mux_init_signal("sdmmc1_dat6.sdmmc1_dat6",
+						OMAP_PIN_INPUT_PULLUP);
+				omap_mux_init_signal("sdmmc1_dat7.sdmmc1_dat7",
+						OMAP_PIN_INPUT_PULLUP);
+			}
+			break;
+		case 1:
+			/* MMC2 */
+			omap_mux_init_signal("gpmc_noe.sdmmc2_clk",
+						OMAP_PIN_INPUT_PULLUP);
+			omap_mux_init_signal("gpmc_nwe.sdmmc2_cmd",
+						OMAP_PIN_INPUT_PULLUP);
+			omap_mux_init_signal("gpmc_ad0.sdmmc2_dat0",
+						OMAP_PIN_INPUT_PULLUP);
+			if (mmc_controller->slots[0].caps &
+				(MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA)) {
+				omap_mux_init_signal("gpmc_ad1.sdmmc2_dat1",
+						OMAP_PIN_INPUT_PULLUP);
+				omap_mux_init_signal("gpmc_ad2.sdmmc2_dat2",
+						OMAP_PIN_INPUT_PULLUP);
+				omap_mux_init_signal("gpmc_ad3.sdmmc2_dat3",
+						OMAP_PIN_INPUT_PULLUP);
+			}
+			if (mmc_controller->slots[0].caps &
+							MMC_CAP_8_BIT_DATA) {
+				omap_mux_init_signal("gpmc_ad4.sdmmc2_dat4",
+						OMAP_PIN_INPUT_PULLUP);
+				omap_mux_init_signal("gpmc_ad5.sdmmc2_dat5",
+						OMAP_PIN_INPUT_PULLUP);
+				omap_mux_init_signal("gpmc_ad6.sdmmc2_dat6",
+						OMAP_PIN_INPUT_PULLUP);
+				omap_mux_init_signal("gpmc_ad7.sdmmc2_dat7",
+						OMAP_PIN_INPUT_PULLUP);
+			}
+			break;
+		case 4:
+			/* MMC5 only for omap4 */
+			omap_mux_init_signal("sdmmc5_clk.sdmmc5_clk",
+						OMAP_PIN_INPUT_PULLUP);
+			omap_mux_init_signal("sdmmc5_cmd.sdmmc5_cmd",
+						OMAP_PIN_INPUT_PULLUP);
+			omap_mux_init_signal("sdmmc5_dat0.sdmmc5_dat0",
+						OMAP_PIN_INPUT_PULLUP);
+			if (mmc_controller->slots[0].caps &
+				MMC_CAP_4_BIT_DATA) {
+				omap_mux_init_signal("sdmmc5_dat1.sdmmc5_dat1",
+						OMAP_PIN_INPUT_PULLUP);
+				omap_mux_init_signal("sdmmc5_dat2.sdmmc5_dat2",
+						OMAP_PIN_INPUT_PULLUP);
+				omap_mux_init_signal("sdmmc5_dat3.sdmmc5_dat3",
+						OMAP_PIN_INPUT_PULLUP);
+			}
+			break;
+		default:
+			break;
+		}
+	}
 }
 
 void __init omap2_init_mmc(struct omap_mmc_platform_data **mmc_data,
-- 
1.7.0.4


  reply	other threads:[~2010-11-15  7:35 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-15  7:38 [PATCH 0/5] OMAP4: mux: Initialise OMAP4 mux pins sricharan
2010-11-15  7:38 ` sricharan [this message]
2010-11-18 19:03   ` [PATCH 1/5] OMAP4: hsmmc: Initialise the mmc " Tony Lindgren
2010-11-15  7:38 ` [PATCH 2/5] OMAP4: usb-musb: Initialise the usb " sricharan
2010-11-15  7:38 ` [PATCH 3/5] OMAP4: mcbsp: Initialise the mcbsp " sricharan
2010-11-15  7:38 ` [PATCH 4/5] OMAP4: board-4430sdp: Initialise the mcspi " sricharan
2010-11-15  7:38 ` [PATCH 5/5] OMAP4: serial: Initialise the uart " sricharan
2010-11-15 22:33 ` [PATCH 0/5] OMAP4: mux: Initialise OMAP4 " Cousson, Benoit
2010-11-18 19:06 ` Tony Lindgren
2010-11-18 21:06   ` Cousson, Benoit
2010-11-18 21:26     ` Tony Lindgren
2010-11-19  8:48       ` R, Sricharan
2010-11-19 16:04         ` 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=1289806685-20688-2-git-send-email-r.sricharan@ti.com \
    --to=r.sricharan@ti.com \
    --cc=linux-omap@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.