summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2008-09-28 22:27:29 +0000
committerimp <imp@FreeBSD.org>2008-09-28 22:27:29 +0000
commitdb3715c928cd7dc3811372e9f8c03d03f1c044ee (patch)
tree1a2ead238cf6f4801b3a0bd7aba430ad7e2826ea
parentbc9f965b27df989d0a5cf2d26983a954932e04be (diff)
downloadFreeBSD-src-db3715c928cd7dc3811372e9f8c03d03f1c044ee.zip
FreeBSD-src-db3715c928cd7dc3811372e9f8c03d03f1c044ee.tar.gz
The OCR register defines both acceptable voltage bits, as well as bits
for other things. Mask out the voltage only bits when returning the Vdd mask for voltage computation. Submitted by: mav@
-rw-r--r--sys/dev/mmc/mmc.c4
-rw-r--r--sys/dev/mmc/mmcreg.h1
2 files changed, 3 insertions, 2 deletions
diff --git a/sys/dev/mmc/mmc.c b/sys/dev/mmc/mmc.c
index d89af3b..c3f96c9 100644
--- a/sys/dev/mmc/mmc.c
+++ b/sys/dev/mmc/mmc.c
@@ -239,8 +239,8 @@ mmc_rescan_cards(struct mmc_softc *sc)
static uint32_t
mmc_select_vdd(struct mmc_softc *sc, uint32_t ocr)
{
- // XXX
- return ocr;
+
+ return ocr & MMC_OCR_VOLTAGE;
}
static int
diff --git a/sys/dev/mmc/mmcreg.h b/sys/dev/mmc/mmcreg.h
index 1b868cb..fddaf97 100644
--- a/sys/dev/mmc/mmcreg.h
+++ b/sys/dev/mmc/mmcreg.h
@@ -292,6 +292,7 @@ struct mmc_request {
*
* The MMC_OCR_CCS appears to be valid for only SD cards.
*/
+#define MMC_OCR_VOLTAGE 0x3fffffffU /* Vdd Voltage mask */
#define MMC_OCR_LOW_VOLTAGE (1u << 7) /* Low Voltage Range -- tbd */
#define MMC_OCR_200_210 (1U << 8) /* Vdd voltage 2.00 ~ 2.10 */
#define MMC_OCR_210_220 (1U << 9) /* Vdd voltage 2.10 ~ 2.20 */
OpenPOWER on IntegriCloud