All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sdio: add MMC_CAP_VDD_165_195 host capability
@ 2009-09-28 17:58 Ohad Ben-Cohen
  2009-09-28 18:10 ` Matt Fleming
  0 siblings, 1 reply; 22+ messages in thread
From: Ohad Ben-Cohen @ 2009-09-28 17:58 UTC (permalink / raw)
  To: akpm
  Cc: philipl, ian, matt, pierre, roberto.foglietta, david.vrabel, linux-mmc

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

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.

Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
---
 drivers/mmc/core/sdio.c  |    7 +++++++
 include/linux/mmc/host.h |    1 +
 2 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
index cdb845b..a9f3ed6 100644
--- a/drivers/mmc/core/sdio.c
+++ b/drivers/mmc/core/sdio.c
@@ -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);
 
 	/*
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 81bb423..5fa95b3 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -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 */
-- 
1.5.4.3




^ permalink raw reply related	[flat|nested] 22+ messages in thread
* [PATCH] sdio: add MMC_CAP_VDD_165_195 host capability
@ 2009-09-28 17:55 Ohad Ben-Cohen
  0 siblings, 0 replies; 22+ messages in thread
From: Ohad Ben-Cohen @ 2009-09-28 17:55 UTC (permalink / raw)
  To: akpm; +Cc: ian, matt, pierre, roberto.foglietta, david.vrabel, linux-mmc

[resending due to mailer issues - sorry]
---
From: Ohad Ben-Cohen <ohad@wizery.com>

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.

Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
---
 drivers/mmc/core/sdio.c  |    7 +++++++
 include/linux/mmc/host.h |    1 +
 2 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
index cdb845b..a9f3ed6 100644
--- a/drivers/mmc/core/sdio.c
+++ b/drivers/mmc/core/sdio.c
@@ -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);
 
 	/*
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 81bb423..5fa95b3 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -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 */
-- 
1.5.4.3




^ permalink raw reply related	[flat|nested] 22+ messages in thread
* [PATCH] sdio: add MMC_CAP_VDD_165_195 host capability
@ 2009-09-28 17:51 Ohad Ben-Cohen
  2009-09-28 18:09 ` David Vrabel
  0 siblings, 1 reply; 22+ messages in thread
From: Ohad Ben-Cohen @ 2009-09-28 17:51 UTC (permalink / raw)
  To: akpm
  Cc: p hilipl, ian, matt, pierre, roberto.foglietta, david.vrabel, linux-mmc

From: Ohad Ben-Cohen <ohad@wizery.com>

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.

Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
---
 drivers/mmc/core/sdio.c  |    7 +++++++
 include/linux/mmc/host.h |    1 +
 2 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
index cdb845b..a9f3ed6 100644
--- a/drivers/mmc/core/sdio.c
+++ b/drivers/mmc/core/sdio.c
@@ -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);
 
 	/*
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 81bb423..5fa95b3 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -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 */
-- 
1.5.4.3




^ permalink raw reply related	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2009-10-14 11:05 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-28 17:58 [PATCH] sdio: add MMC_CAP_VDD_165_195 host capability Ohad Ben-Cohen
2009-09-28 18:10 ` Matt Fleming
2009-09-28 20:10   ` Ohad Ben-Cohen
2009-09-28 22:59   ` Andrew Morton
2009-09-29  5:53     ` Matt Fleming
  -- strict thread matches above, loose matches on Subject: below --
2009-09-28 17:55 Ohad Ben-Cohen
2009-09-28 17:51 Ohad Ben-Cohen
2009-09-28 18:09 ` David Vrabel
2009-09-28 20:02   ` Ohad Ben-Cohen
2009-09-29  2:25   ` Philip Langdale
2009-09-29 18:28     ` Pierre Ossman
2009-09-29 20:20       ` Philip Langdale
2009-09-29 21:37         ` Pierre Ossman
2009-09-30  6:10           ` Philip Langdale
2009-10-08 18:38             ` Pierre Ossman
2009-10-10 18:42               ` Philip Langdale
2009-10-12 13:11                 ` David Vrabel
2009-10-13  2:39                   ` Philip Langdale
2009-10-14  7:56                     ` Ohad Ben-Cohen
2009-10-14  8:48                       ` Pierre Ossman
2009-10-14 10:34                         ` David Vrabel
2009-10-14 11:05                           ` Pierre Ossman

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.