Use at91_master_clock instead of AT91C_MASTER_CLOCK.

This commit is contained in:
Warner Losh 2009-01-22 21:55:37 +00:00
parent 6af05bc921
commit 3180286fb2
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=187601
2 changed files with 3 additions and 2 deletions

View File

@ -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);

View File

@ -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 */