Module Name:    src
Committed By:   jmcneill
Date:           Mon Nov  2 22:18:45 UTC 2015

Modified Files:
        src/sys/dev/sdmmc: sdhc.c sdhcvar.h

Log Message:
allow vendor specific code to hook into bus width changes


To generate a diff of this commit:
cvs rdiff -u -r1.88 -r1.89 src/sys/dev/sdmmc/sdhc.c
cvs rdiff -u -r1.24 -r1.25 src/sys/dev/sdmmc/sdhcvar.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/sdmmc/sdhc.c
diff -u src/sys/dev/sdmmc/sdhc.c:1.88 src/sys/dev/sdmmc/sdhc.c:1.89
--- src/sys/dev/sdmmc/sdhc.c:1.88	Tue Oct  6 14:32:51 2015
+++ src/sys/dev/sdmmc/sdhc.c	Mon Nov  2 22:18:45 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: sdhc.c,v 1.88 2015/10/06 14:32:51 mlelstv Exp $	*/
+/*	$NetBSD: sdhc.c,v 1.89 2015/11/02 22:18:45 jmcneill Exp $	*/
 /*	$OpenBSD: sdhc.c,v 1.25 2009/01/13 19:44:20 grange Exp $	*/
 
 /*
@@ -23,7 +23,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sdhc.c,v 1.88 2015/10/06 14:32:51 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sdhc.c,v 1.89 2015/11/02 22:18:45 jmcneill Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_sdmmc.h"
@@ -1182,6 +1182,12 @@ sdhc_bus_width(sdmmc_chipset_handle_t sc
 		return 1;
 	}
 
+	if (hp->sc->sc_vendor_bus_width) {
+		const int error = hp->sc->sc_vendor_bus_width(hp->sc, width);
+		if (error != 0)
+			return error;
+	}
+
 	mutex_enter(&hp->intr_lock);
 
 	reg = HREAD1(hp, SDHC_HOST_CTL);

Index: src/sys/dev/sdmmc/sdhcvar.h
diff -u src/sys/dev/sdmmc/sdhcvar.h:1.24 src/sys/dev/sdmmc/sdhcvar.h:1.25
--- src/sys/dev/sdmmc/sdhcvar.h:1.24	Sun Aug  9 13:24:39 2015
+++ src/sys/dev/sdmmc/sdhcvar.h	Mon Nov  2 22:18:45 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: sdhcvar.h,v 1.24 2015/08/09 13:24:39 mlelstv Exp $	*/
+/*	$NetBSD: sdhcvar.h,v 1.25 2015/11/02 22:18:45 jmcneill Exp $	*/
 /*	$OpenBSD: sdhcvar.h,v 1.3 2007/09/06 08:01:01 jsg Exp $	*/
 
 /*
@@ -67,6 +67,7 @@ struct sdhc_softc {
 	int (*sc_vendor_rod)(struct sdhc_softc *, int);
 	int (*sc_vendor_write_protect)(struct sdhc_softc *);
 	int (*sc_vendor_card_detect)(struct sdhc_softc *);
+	int (*sc_vendor_bus_width)(struct sdhc_softc *, int);
 	int (*sc_vendor_bus_clock)(struct sdhc_softc *, int);
 	int (*sc_vendor_transfer_data_dma)(struct sdhc_softc *, struct sdmmc_command *);
 };

Reply via email to