Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/sdmmc Add sc_vendor_bus_clock hook



details:   https://anonhg.NetBSD.org/src/rev/09ed84ad1c08
branches:  trunk
changeset: 783254:09ed84ad1c08
user:      matt <matt%NetBSD.org@localhost>
date:      Wed Dec 12 15:15:31 2012 +0000

description:
Add sc_vendor_bus_clock hook
>From jmcneill.

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 3be1eca4ce1a -r 09ed84ad1c08 sys/dev/sdmmc/sdhc.c
--- a/sys/dev/sdmmc/sdhc.c      Wed Dec 12 15:12:11 2012 +0000
+++ b/sys/dev/sdmmc/sdhc.c      Wed Dec 12 15:15:31 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sdhc.c,v 1.33 2012/12/12 06:24:01 riastradh Exp $      */
+/*     $NetBSD: sdhc.c,v 1.34 2012/12/12 15:15:31 matt 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.33 2012/12/12 06:24:01 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sdhc.c,v 1.34 2012/12/12 15:15:31 matt Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_sdmmc.h"
@@ -813,6 +813,12 @@
 
        mutex_enter(&hp->host_mtx);
 
+       if (hp->sc->sc_vendor_bus_clock) {
+               error = (*hp->sc->sc_vendor_bus_clock)(hp->sc, freq);
+               if (error != 0)
+                       goto out;
+       }
+
        /*
         * Stop SD clock before changing the frequency.
         */
diff -r 3be1eca4ce1a -r 09ed84ad1c08 sys/dev/sdmmc/sdhcvar.h
--- a/sys/dev/sdmmc/sdhcvar.h   Wed Dec 12 15:12:11 2012 +0000
+++ b/sys/dev/sdmmc/sdhcvar.h   Wed Dec 12 15:15:31 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sdhcvar.h,v 1.9 2012/10/29 13:30:25 kiyohara Exp $     */
+/*     $NetBSD: sdhcvar.h,v 1.10 2012/12/12 15:15:31 matt Exp $        */
 /*     $OpenBSD: sdhcvar.h,v 1.3 2007/09/06 08:01:01 jsg Exp $ */
 
 /*
@@ -55,6 +55,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_clock)(struct sdhc_softc *, int);
 };
 
 /* Host controller functions called by the attachment driver. */



Home | Main Index | Thread Index | Old Index