svn commit: r187601 - head/sys/arm/at91

Warner Losh imp at FreeBSD.org
Thu Jan 22 13:55:39 PST 2009


Author: imp
Date: Thu Jan 22 21:55:37 2009
New Revision: 187601
URL: http://svn.freebsd.org/changeset/base/187601

Log:
  Use at91_master_clock instead of AT91C_MASTER_CLOCK.

Modified:
  head/sys/arm/at91/at91_twi.c
  head/sys/arm/at91/at91_twireg.h

Modified: head/sys/arm/at91/at91_twi.c
==============================================================================
--- head/sys/arm/at91/at91_twi.c	Thu Jan 22 21:55:04 2009	(r187600)
+++ head/sys/arm/at91/at91_twi.c	Thu Jan 22 21:55:37 2009	(r187601)
@@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$");
 
 #include <arm/at91/at91rm92reg.h>
 #include <arm/at91/at91_twireg.h>
+#include <arm/at91/at91var.h>
 
 #include <dev/iicbus/iiconf.h>
 #include <dev/iicbus/iicbus.h>
@@ -128,7 +129,7 @@ at91_twi_attach(device_t dev)
 		AT91_TWI_LOCK_DESTROY(sc);
 		goto out;
 	}
-	sc->cwgr = TWI_CWGR_CKDIV(8 * AT91C_MASTER_CLOCK / TWI_FASTEST_CLOCK) |
+	sc->cwgr = TWI_CWGR_CKDIV(8 * at91_master_clock / TWI_FASTEST_CLOCK) |
 	    TWI_CWGR_CHDIV(TWI_CWGR_DIV(TWI_DEF_CLK)) |
 	    TWI_CWGR_CLDIV(TWI_CWGR_DIV(TWI_DEF_CLK));
 	WR4(sc, TWI_CR, TWI_CR_SWRST);

Modified: head/sys/arm/at91/at91_twireg.h
==============================================================================
--- head/sys/arm/at91/at91_twireg.h	Thu Jan 22 21:55:04 2009	(r187600)
+++ head/sys/arm/at91/at91_twireg.h	Thu Jan 22 21:55:37 2009	(r187601)
@@ -63,7 +63,7 @@
 #define TWI_CWGR_CKDIV(x) ((x) << 16)	/* Clock Divider */
 #define TWI_CWGR_CHDIV(x) ((x) << 8)	/* Clock High Divider */
 #define TWI_CWGR_CLDIV(x) ((x) << 0)	/* Clock Low Divider */
-#define TWI_CWGR_DIV(rate) ((AT91C_MASTER_CLOCK /(4*(rate))) - 2)
+#define TWI_CWGR_DIV(rate) ((at91_master_clock /(4*(rate))) - 2)
 
 /* TWI_SR */
 /* TWI_IER */


More information about the svn-src-head mailing list