summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/dev/sdmmc/sdhc.c9
-rw-r--r--sys/dev/sdmmc/sdhcvar.h4
2 files changed, 11 insertions, 2 deletions
diff --git a/sys/dev/sdmmc/sdhc.c b/sys/dev/sdmmc/sdhc.c
index ca8fbaa4bc4..c242a600d4a 100644
--- a/sys/dev/sdmmc/sdhc.c
+++ b/sys/dev/sdmmc/sdhc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sdhc.c,v 1.54 2017/04/06 03:15:29 deraadt Exp $ */
+/* $OpenBSD: sdhc.c,v 1.55 2017/05/05 15:10:07 kettenis Exp $ */
/*
* Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org>
@@ -25,6 +25,7 @@
#include <sys/device.h>
#include <sys/kernel.h>
#include <sys/malloc.h>
+#include <sys/proc.h>
#include <sys/systm.h>
#include <dev/sdmmc/sdhcreg.h>
@@ -317,6 +318,9 @@ sdhc_host_found(struct sdhc_softc *sc, bus_space_tag_t iot,
saa.caps |= SMC_CAPS_MMC_DDR52;
}
+ if (ISSET(sc->sc_flags, SDHC_F_NODDR50))
+ saa.caps &= ~SMC_CAPS_MMC_DDR52;
+
hp->sdmmc = config_found(&sc->sc_dev, &saa, NULL);
if (hp->sdmmc == NULL) {
error = 0;
@@ -684,6 +688,9 @@ sdhc_signal_voltage(sdmmc_chipset_handle_t sch, int signal_voltage)
{
struct sdhc_host *hp = sch;
+ if (hp->sc->sc_signal_voltage)
+ return hp->sc->sc_signal_voltage(hp->sc, signal_voltage);
+
if (SDHC_SPEC_VERSION(hp->version) < SDHC_SPEC_V3)
return EINVAL;
diff --git a/sys/dev/sdmmc/sdhcvar.h b/sys/dev/sdmmc/sdhcvar.h
index e6a419e2719..9d4d759a2bc 100644
--- a/sys/dev/sdmmc/sdhcvar.h
+++ b/sys/dev/sdmmc/sdhcvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: sdhcvar.h,v 1.9 2016/04/30 11:32:23 kettenis Exp $ */
+/* $OpenBSD: sdhcvar.h,v 1.10 2017/05/05 15:10:07 kettenis Exp $ */
/*
* Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org>
@@ -32,6 +32,7 @@ struct sdhc_softc {
bus_dma_tag_t sc_dmat;
int (*sc_card_detect)(struct sdhc_softc *);
+ int (*sc_signal_voltage)(struct sdhc_softc *, int);
};
/* Host controller functions called by the attachment driver. */
@@ -45,5 +46,6 @@ void sdhc_needs_discover(struct sdhc_softc *);
/* flag values */
#define SDHC_F_NOPWR0 (1 << 0)
+#define SDHC_F_NODDR50 (1 << 1)
#endif