Use at91_master_clock instead of AT91C_MASTER_CLOCK.

This commit is contained in:
imp 2009-01-22 21:55:37 +00:00
parent 57d525aa7f
commit 94037e905a
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 */