Skip to contentSkip to conversation

omap4: pandaboard: fix up mmc card detect logic

PATCH Superseded Nishanth Menon 4 participants 5 messages Oct 15, 2010 – Oct 19, 2010

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

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

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]>

---

Depends on
http://git.kernel.org/?p=linux/kernel/git/sameo/mfd-2.6.git;a=commitdiff;h=1bf5197061a4aec99e9fd4f92d4a543310f83585;hp=0c9b33e5a23e2053165c9e30ffff3b3a3cf1b2b8
This patch probably should be squashed to that.

 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 a9d8a19..47cc8d2 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

Menon, Nishanth had written, on 10/15/2010 08:24 AM, the following:

Quoted 13 lines

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 6 lines

---

Depends on http://git.kernel.org/?p=linux/kernel/git/sameo/mfd-2.6.git;a=commitdiff;h=1bf5197061a4aec99e9fd4f92d4a543310f83585;hp=0c9b33e5a23e2053165c9e30ffff3b3a3cf1b2b8
This patch probably should be squashed to that.

Note to Tony/Sameo:
I generated this patch for linux-omap after cherry picking the above patch. reason being:
http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-omap-2.6.git;a=shortlog;h=refs/heads/omap-for-linus
has fixes we need for Pandaboard

I am at a loss however which tree this patch might be carried on..

Quoted 31 lines
 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 a9d8a19..47cc8d2 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 · 2 lines
Regards,
Nishanth Menon
Tested-by on v1 1/1
#2 lore raw
In reply to Nishanth Menon
Quoted 15 lines · On Fri, 15 Oct 2010 08:24:47 -0500 Nishanth Menon <[email protected]> wrote:

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 9 lines

---

Depends on
http://git.kernel.org/?p=linux/kernel/git/sameo/mfd-2.6.git;a=commitdiff;h=1bf5197061a4aec99e9fd4f92d4a543310f83585;hp=0c9b33e5a23e2053165c9e30ffff3b3a3cf1b2b8
This patch probably should be squashed to that.

 arch/arm/mach-omap2/board-omap4panda.c |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)

FWIW,

With the reference patch above and this I can mount the mmc root on Panda EA1.

Acked-by on v1 1/1
#3 lore raw
In reply to Nishanth Menon
Quoted 16 lines

-----Original Message-----
From: Nishanth Menon [mailto:[email protected]]
Sent: Friday, October 15, 2010 8:25 AM
To: l-o
Cc: Dave; Nishanth Menon; Tony Lindgren; Madhusudhan Chikkature; Adrian Hunter; Samuel Ortiz
Subject: [PATCH] omap4: pandaboard: fix up mmc card detect logic

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

Quoted 8 lines

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]>

The patch looks good.

Quoted 27 lines

---

Depends on
http://git.kernel.org/?p=linux/kernel/git/sameo/mfd-
2.6.git;a=commitdiff;h=1bf5197061a4aec99e9fd4f92d4a543310f83585;hp=0c9b33e 5a23e2053165c9e30ffff3b3a3cf1b2b8
This patch probably should be squashed to that.

 arch/arm/mach-omap2/board-omap4panda.c |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)
arch/arm/mach- renamed from arch/arm/mach-omap2/board-omap4panda.c +0 -0

omap2/board-omap4panda.c
index a9d8a19..47cc8d2 100644

arch/arm/mach-omap2/board-omap4panda.c +4 -0
@@ -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 */

arch/arm/mach-omap2/board-omap4panda.c static int omap4_twl6030_hsmmc_late_init(struct · line 175

Quoted 10 lines
arch/arm/mach-omap2/board-omap4panda.c +7 -3
-	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;

Quoted 6 lines
arch/arm/mach-omap2/board-omap4panda.c +1 -1
+	}
 	return ret;
 }
 
--

1.6.3.3

maintainer Acked-by
#4 lore raw
Quoted 23 lines · Madhusudhan
Quoted 23 lines

-----Original Message-----
From: Nishanth Menon [mailto:[email protected]]
Sent: Friday, October 15, 2010 8:25 AM
To: l-o
Cc: Dave; Nishanth Menon; Tony Lindgren; Madhusudhan Chikkature; Adrian Hunter; Samuel Ortiz
Subject: [PATCH] omap4: pandaboard: fix up mmc card detect logic

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 13 lines
Quoted 1 line

The patch looks good.

Quoted 8 lines

---

Depends on
http://git.kernel.org/?p=linux/kernel/git/sameo/mfd-
2.6.git;a=commitdiff;h=1bf5197061a4aec99e9fd4f92d4a543310f83585;hp=0c9b33e 5a23e2053165c9e30ffff3b3a3cf1b2b8
This patch probably should be squashed to that.

Nishant, please post one more time with linux-arm-kernel list also cc'd for review and add all the acks.

After that, Samuel, can you please apply it to your queue because of the depenency above?