Use at91_master_clock instead of AT91C_MASTER_CLOCK.
This commit is contained in:
parent
57d525aa7f
commit
94037e905a
@ -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);
|
||||
|
@ -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 */
|
||||
|
Loading…
Reference in New Issue
Block a user