Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/sdmmc allow vendor specific code to hook into bus wi...



details:   https://anonhg.NetBSD.org/src/rev/810bf67b58fd
branches:  trunk
changeset: 341371:810bf67b58fd
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Mon Nov 02 22:18:45 2015 +0000

description:
allow vendor specific code to hook into bus width changes

diffstat:

 sys/dev/sdmmc/sdhc.c    |  10 ++++++++--
 sys/dev/sdmmc/sdhcvar.h |   3 ++-
 2 files changed, 10 insertions(+), 3 deletions(-)

diffs (48 lines):

diff -r e15a4084646b -r 810bf67b58fd sys/dev/sdmmc/sdhc.c
--- a/sys/dev/sdmmc/sdhc.c      Mon Nov 02 17:45:13 2015 +0000
+++ b/sys/dev/sdmmc/sdhc.c      Mon Nov 02 22:18:45 2015 +0000
@@ -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 @@
                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);
diff -r e15a4084646b -r 810bf67b58fd sys/dev/sdmmc/sdhcvar.h
--- a/sys/dev/sdmmc/sdhcvar.h   Mon Nov 02 17:45:13 2015 +0000
+++ b/sys/dev/sdmmc/sdhcvar.h   Mon Nov 02 22:18:45 2015 +0000
@@ -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 @@
        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 *);
 };



Home | Main Index | Thread Index | Old Index