Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/sdmmc correct clk div calculation for SD 3.0 control...



details:   https://anonhg.NetBSD.org/src/rev/26b3545e304b
branches:  trunk
changeset: 802776:26b3545e304b
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Wed Oct 01 20:59:37 2014 +0000

description:
correct clk div calculation for SD 3.0 controllers

diffstat:

 sys/dev/sdmmc/sdhc.c |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (27 lines):

diff -r 801d09b7bea6 -r 26b3545e304b sys/dev/sdmmc/sdhc.c
--- a/sys/dev/sdmmc/sdhc.c      Wed Oct 01 14:12:29 2014 +0000
+++ b/sys/dev/sdmmc/sdhc.c      Wed Oct 01 20:59:37 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sdhc.c,v 1.48 2014/10/01 00:25:43 jmcneill Exp $       */
+/*     $NetBSD: sdhc.c,v 1.49 2014/10/01 20:59:37 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.48 2014/10/01 00:25:43 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sdhc.c,v 1.49 2014/10/01 20:59:37 jmcneill Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_sdmmc.h"
@@ -814,6 +814,8 @@
        }
        if (hp->specver == SDHC_SPEC_VERS_300) {
                div = howmany(hp->clkbase, freq);
+               if (div > 0)
+                       --div;
                if (div > 0x3ff)
                        return false;
                *divp = (((div >> 8) & SDHC_SDCLK_XDIV_MASK)



Home | Main Index | Thread Index | Old Index