Tue Dec 13 14:46:07 2011 UTC ()
define and use PWMCLOCK_DEBUG


(macallan)
diff -r1.2 -r1.3 src/sys/dev/pci/voyager/files.voyager
diff -r1.1 -r1.2 src/sys/dev/pci/voyager/pwmclock.c

cvs diff -r1.2 -r1.3 src/sys/dev/pci/voyager/files.voyager (expand / switch to context diff)
--- src/sys/dev/pci/voyager/files.voyager 2011/12/13 14:39:37 1.2
+++ src/sys/dev/pci/voyager/files.voyager 2011/12/13 14:46:07 1.3
@@ -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

cvs diff -r1.1 -r1.2 src/sys/dev/pci/voyager/pwmclock.c (expand / switch to context diff)
--- src/sys/dev/pci/voyager/pwmclock.c 2011/12/13 14:39:37 1.1
+++ src/sys/dev/pci/voyager/pwmclock.c 2011/12/13 14:46:07 1.2
@@ -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;