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@
This commit is contained in:
Warner Losh 2008-09-28 22:27:29 +00:00
parent 2703cdbb1b
commit 8aaa15e202
2 changed files with 3 additions and 2 deletions

View File

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

View File

@ -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 */