Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci/voyager define and use PWMCLOCK_DEBUG



details:   https://anonhg.NetBSD.org/src/rev/c5547404929c
branches:  trunk
changeset: 772013:c5547404929c
user:      macallan <macallan%NetBSD.org@localhost>
date:      Tue Dec 13 14:46:07 2011 +0000

description:
define and use PWMCLOCK_DEBUG

diffstat:

 sys/dev/pci/voyager/files.voyager |   1 +
 sys/dev/pci/voyager/pwmclock.c    |  10 +++++++---
 2 files changed, 8 insertions(+), 3 deletions(-)

diffs (59 lines):

diff -r 9003db312f47 -r c5547404929c sys/dev/pci/voyager/files.voyager
--- a/sys/dev/pci/voyager/files.voyager Tue Dec 13 14:41:55 2011 +0000
+++ b/sys/dev/pci/voyager/files.voyager Tue Dec 13 14:46:07 2011 +0000
@@ -9,6 +9,7 @@
 defflag        opt_voyagerfb.h VOYAGERFB_DEBUG
 
 # a clock timer
+defflag opt_pwmclock.h PWMCLOCK_DEBUG
 device         pwmclock
 attach         pwmclock at voyagerbus
 file   dev/pci/voyager/pwmclock.c              pwmclock needs-flag
diff -r 9003db312f47 -r c5547404929c sys/dev/pci/voyager/pwmclock.c
--- a/sys/dev/pci/voyager/pwmclock.c    Tue Dec 13 14:41:55 2011 +0000
+++ b/sys/dev/pci/voyager/pwmclock.c    Tue Dec 13 14:46:07 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pwmclock.c,v 1.1 2011/12/13 14:39:37 macallan Exp $    */
+/*     $NetBSD: pwmclock.c,v 1.2 2011/12/13 14:46:07 macallan Exp $    */
 
 /*
  * Copyright (c) 2011 Michael Lorenz
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pwmclock.c,v 1.1 2011/12/13 14:39:37 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pwmclock.c,v 1.2 2011/12/13 14:46:07 macallan Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -44,6 +44,8 @@
 #include <mips/bonito/bonitoreg.h>
 #include <mips/bonito/bonitovar.h>
 
+#include "opt_pwmclock.h"
+
 #ifdef PWMCLOCK_DEBUG
 #define DPRINTF aprint_error
 #else
@@ -139,7 +141,7 @@
        initclocks_ptr = pwmclock_start;
 
        /* ok, let's see how far the cycle counter gets between interrupts */
-       aprint_normal_dev(sc->sc_dev, "calibrating CPU timer...\n");
+       DPRINTF("calibrating CPU timer...\n");
        for (clk = 1; clk < 8; clk++) {
                REGVAL(LS2F_CHIPCFG0) = (REGVAL(LS2F_CHIPCFG0) & ~LS2FCFG_FREQSCALE_MASK) | clk;
                bus_space_write_4(sc->sc_memt, sc->sc_regh, SM502_PWM1, sc->sc_reg);
@@ -153,9 +155,11 @@
                }
                sc->sc_scale[clk] = (acc >> 4) / 5000;
        }
+#ifdef PWMCLOCK_DEBUG
        for (clk = 1; clk < 8; clk++) {
                aprint_normal_dev(sc->sc_dev, "%d/8: %d\n", clk + 1, sc->sc_scale[clk]);
        }
+#endif
        sc->sc_step = 7;
        sc->sc_step_wanted = 7;
 



Home | Main Index | Thread Index | Old Index