Skip to contentSkip to conversation

omap4: pandaboard: fix up mmc card detect logic

PATCH Superseded Nishanth Menon 2 participants 2 messages Oct 19, 2010

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 omap4: pandaboard: fix up mmc card detect logic

From: Menon, Nishanth <[email protected]>

For MMC1 Controller, card detect interrupt source is twl6030 which is non-gpio. The card detect call back function provides card present/absent status by reading MMC Control register present on twl6030. This functionality was introduced in mfd tree on track to kernel.org

Sync pandaboard to the same and make mmc work.

Cc Tony Lindgren <[email protected]>
Cc Madhusudhan Chikkature <[email protected]>
Cc Adrian Hunter <[email protected]>
Cc Samuel Ortiz <[email protected]>

---
v2: reposting to l-a, l-o
Depends on
http://git.kernel.org/?p=linux/kernel/git/sameo/mfd-2.6.git;a=commitdiff;h=1bf5197061a4aec99e9fd4f92d4a543310f83585;hp=0c9b33e5a23e2053165c9e30ffff3b3a3cf1b2b8
Discussion:
http://marc.info/?t=128714921300007&r=1&w=2

 arch/arm/mach-omap2/board-omap4panda.c |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)
arch/arm/mach-omap2/board-omap4panda.c +12 -3
index 702f2a6..1ecd0a6 100644
@@ -160,10 +160,19 @@ static int omap4_twl6030_hsmmc_late_init(struct device *dev)
 				struct platform_device, dev);
 	struct omap_mmc_platform_data *pdata = dev->platform_data;
 
+	if (!pdata) {
+		dev_err(dev, "%s: NULL platform data\n", __func__);
+		return -EINVAL;
+	}
 	/* Setting MMC1 Card detect Irq */
-	if (pdev->id == 0)
-		pdata->slots[0].card_detect_irq = TWL6030_IRQ_BASE +
-						MMCDETECT_INTR_OFFSET;
+	if (pdev->id == 0) {
+		ret = twl6030_mmc_card_detect_config();
+		 if (ret)
+			dev_err(dev, "%s: Error card detect config(%d)\n",
+				__func__, ret);
+		 else
+			pdata->slots[0].card_detect = twl6030_mmc_card_detect;
+	}
 	return ret;
 }
 
Signature · 1 line
1.6.3.3
#1 lore raw

PATCH v2 1/1 omap4: pandaboard: fix up mmc card detect logic

Hi Nishanth,

Quoted 15 lines · Nishanth Menon

From: Menon, Nishanth <[email protected]>

For MMC1 Controller, card detect interrupt source is twl6030 which is non-gpio. The card detect call back function provides card present/absent status by reading MMC Control register present on twl6030. This functionality was introduced in mfd tree on track to kernel.org

Sync pandaboard to the same and make mmc work.

Cc Tony Lindgren <[email protected]>
Cc Madhusudhan Chikkature <[email protected]>
Cc Adrian Hunter <[email protected]>
Cc Samuel Ortiz <[email protected]>
Quoted 5 lines

Patch applied, thanks a lot.

Cheers,
Samuel.

Signature · 2 lines
Intel Open Source Technology Centre
http://oss.intel.com/