summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorDale Rahn <drahn@cvs.openbsd.org>2010-02-10 23:33:09 +0000
committerDale Rahn <drahn@cvs.openbsd.org>2010-02-10 23:33:09 +0000
commit7d999a741a2d7da83b996a57a71c0d30cfca70b9 (patch)
treedc83a2e09bb1090e86ea3d6ccfed3708c23d487b /sys
parent6c7e5dc60b220007e4302bb7c557ba2ffb7272a6 (diff)
Only allow the common voltages of the card and the host when writing the OCR
back to the card. fixes a problem where the controller supported lower voltages than the card. With variable name change requested miod, ok miod@ krw@
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/sdmmc/sdmmc_mem.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/dev/sdmmc/sdmmc_mem.c b/sys/dev/sdmmc/sdmmc_mem.c
index d7980b58d3d..8750b53c715 100644
--- a/sys/dev/sdmmc/sdmmc_mem.c
+++ b/sys/dev/sdmmc/sdmmc_mem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sdmmc_mem.c,v 1.13 2009/10/03 18:42:36 kettenis Exp $ */
+/* $OpenBSD: sdmmc_mem.c,v 1.14 2010/02/10 23:33:08 drahn Exp $ */
/*
* Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org>
@@ -96,6 +96,8 @@ sdmmc_mem_enable(struct sdmmc_softc *sc)
/* Tell the card(s) to enter the idle state (again). */
sdmmc_go_idle_state(sc);
+ host_ocr &= card_ocr; /* only allow the common voltages */
+
if (sdmmc_send_if_cond(sc, card_ocr) == 0)
host_ocr |= SD_OCR_SDHC_CAP;