Skip to contentSkip to conversation

sdio: add MMC_CAP_VDD_165_195 host capability

PATCH In review Ohad Ben-Cohen 4 participants 5 messages Sep 28, 2009 – Sep 29, 2009 MMC, SD and SDIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sdio: add MMC_CAP_VDD_165_195 host capability

[I should really ditch my mailer, I know. hope it's the last attempt. Sorry x 2]
---
From: Ohad Ben-Cohen <[email protected]>

To allow the usage of MMC_VDD_165_195, host capability MMC_CAP_VDD_165_195 is introduced. This is necessary because MMC_VDD_165_195 is currently reserved/undefined.

---
 drivers/mmc/core/sdio.c  |    7 +++++++
 include/linux/mmc/host.h |    1 +
 2 files changed, 8 insertions(+), 0 deletions(-)
drivers/mmc/core/sdio.c +7 -0
index cdb845b..a9f3ed6 100644
@@ -494,6 +494,13 @@ int mmc_attach_sdio(struct mmc_host *host, u32 ocr)
 		ocr &= ~0x7F;
 	}
 
+	if ((ocr & MMC_VDD_165_195) && !(host->caps & MMC_CAP_VDD_165_195)) {
+		printk(KERN_WARNING "%s: SDIO card claims to support the "
+			"incompletely defined 'low voltage range'. This "
+			"will be ignored.\n", mmc_hostname(host));
+		ocr &= ~MMC_VDD_165_195;
+	}
+
 	host->ocr = mmc_select_voltage(host, ocr);
 
 	/*
include/linux/mmc/host.h +1 -0
index 81bb423..5fa95b3 100644
@@ -150,6 +150,7 @@ struct mmc_host {
 #define MMC_CAP_DISABLE		(1 << 7)	/* Can the host be disabled */
 #define MMC_CAP_NONREMOVABLE	(1 << 8)	/* Nonremovable e.g. eMMC */
 #define MMC_CAP_WAIT_WHILE_BUSY	(1 << 9)	/* Waits while card is busy */
+#define MMC_CAP_VDD_165_195	(1 << 10)	/* Accepts MMC_VDD_165_195 */
 
 	/* host specific block data */
 	unsigned int		max_seg_size;	/* see blk_queue_max_segment_size */
Signature · 1 line
1.5.4.3
#1 lore raw
Quoted 8 lines · Ohad Ben-Cohen

[I should really ditch my mailer, I know. hope it's the last attempt. Sorry x 2]
---
From: Ohad Ben-Cohen <[email protected]>

To allow the usage of MMC_VDD_165_195, host capability MMC_CAP_VDD_165_195 is introduced. This is necessary because MMC_VDD_165_195 is currently reserved/undefined.

Have you got patches that add this capability to the TI 127x and ZOOM2 board setup files?

Quoted 14 lines
---
 drivers/mmc/core/sdio.c  |    7 +++++++
 include/linux/mmc/host.h |    1 +
 2 files changed, 8 insertions(+), 0 deletions(-)
drivers/mmc/core/sdio.c +0 -0
index cdb845b..a9f3ed6 100644
@@ -494,6 +494,13 @@ int mmc_attach_sdio(struct mmc_host *host, u32 ocr)
 		ocr &= ~0x7F;
 	}
 

drivers/mmc/core/sdio.c int mmc_attach_sdio(struct mmc_host *host, u32 ocr) · line 506

Quoted 10 lines
drivers/mmc/core/sdio.c +7 -0
+	if ((ocr & MMC_VDD_165_195) && !(host->caps & MMC_CAP_VDD_165_195)) {
+		printk(KERN_WARNING "%s: SDIO card claims to support the "
+			"incompletely defined 'low voltage range'. This "
+			"will be ignored.\n", mmc_hostname(host));
+		ocr &= ~MMC_VDD_165_195;
+	}
+
 	host->ocr = mmc_select_voltage(host, ocr);
 
 	/*

I know you copied this warning from the old code but does anyone think it's worth making this warning a bit clearer? e.g,

Quoted 4 lines
drivers/mmc/core/sdio.c +4 -0
+		printk(KERN_WARNING "%s: SDIO card claims to support the "
+			"incompletely defined 'low voltage range', but the "
+			"host controller does not. This voltage range"
+			"will be ignored.\n", mmc_hostname(host));
#2 lore raw

Hi Matt,

Quoted 2 lines · Matt Fleming

Have you got patches that add this capability to the TI 127x and ZOOM2 board setup files?

Sure, but I planned on waiting for the discussion on this to conclude. Seems like it is moot now.

Thanks,
Ohad.

#3 lore raw
In reply to Matt Fleming
Quoted 10 lines · On Mon, 28 Sep 2009 19:10:48 +0100 Matt Fleming <[email protected]> wrote:
Quoted 10 lines
drivers/mmc/core/sdio.c +7 -0
+	if ((ocr & MMC_VDD_165_195) && !(host->caps & MMC_CAP_VDD_165_195)) {
+		printk(KERN_WARNING "%s: SDIO card claims to support the "
+			"incompletely defined 'low voltage range'. This "
+			"will be ignored.\n", mmc_hostname(host));
+		ocr &= ~MMC_VDD_165_195;
+	}
+
 	host->ocr = mmc_select_voltage(host, ocr);
Quoted 4 lines
Quoted 1 line

/*

I know you copied this warning from the old code

It'd be better to avoid copying anything at all. Are we missing code-sharing opportunities here?

Quoted 7 lines

but does anyone think
it's worth making this warning a bit clearer? e.g,

drivers/mmc/core/sdio.c int mmc_attach_sdio(struct mmc_host *host, u32 ocr) · line 500

Quoted 4 lines
drivers/mmc/core/sdio.c +4 -0
+		printk(KERN_WARNING "%s: SDIO card claims to support the "
+			"incompletely defined 'low voltage range', but the "
+			"host controller does not. This voltage range"
+			"will be ignored.\n", mmc_hostname(host));

That looks better to me.

#4 lore raw
Quoted 13 lines · Andrew Morton
Quoted 10 lines · On Mon, 28 Sep 2009 19:10:48 +0100 Matt Fleming <[email protected]> wrote:
Quoted 10 lines
drivers/mmc/core/sdio.c +7 -0
+	if ((ocr & MMC_VDD_165_195) && !(host->caps & MMC_CAP_VDD_165_195)) {
+		printk(KERN_WARNING "%s: SDIO card claims to support the "
+			"incompletely defined 'low voltage range'. This "
+			"will be ignored.\n", mmc_hostname(host));
+		ocr &= ~MMC_VDD_165_195;
+	}
+
 	host->ocr = mmc_select_voltage(host, ocr);
Quoted 8 lines
Quoted 4 lines
Quoted 1 line

/*

I know you copied this warning from the old code

It'd be better to avoid copying anything at all. Are we missing code-sharing opportunities here?

No, Ohad's commit 27cce39f555def6f5ebe7f03d69ccc44ab25f0b2 "sdio: do not ignore MMC_VDD_165_195" deleted this warning and this commit is just bringing it back from the dead.

It seems that Philip and David have other ideas on how they want to handle this voltage range so this patch probably doesn't need picking up.