summaryrefslogtreecommitdiff
path: root/drivers/i2c/bfin-twi_i2c.c
diff options
context:
space:
mode:
authorSonic Zhang <sonic.zhang@analog.com>2014-01-28 13:53:34 +0800
committerHeiko Schocher <hs@denx.de>2014-02-20 06:46:56 +0100
commitd6a320d5bb3050eeb9a586481145d3a75ef24db8 (patch)
tree89c94515625e3e071bf2be44fb32db285cd289a6 /drivers/i2c/bfin-twi_i2c.c
parentbb0fad0ea095944c76dc94fcd13b91699413f79f (diff)
downloadu-boot-imx-d6a320d5bb3050eeb9a586481145d3a75ef24db8.zip
u-boot-imx-d6a320d5bb3050eeb9a586481145d3a75ef24db8.tar.gz
u-boot-imx-d6a320d5bb3050eeb9a586481145d3a75ef24db8.tar.bz2
blackfin: add spi and i2c specific get clock functions
Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Diffstat (limited to 'drivers/i2c/bfin-twi_i2c.c')
-rw-r--r--drivers/i2c/bfin-twi_i2c.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/i2c/bfin-twi_i2c.c b/drivers/i2c/bfin-twi_i2c.c
index 5c37280..cfab064 100644
--- a/drivers/i2c/bfin-twi_i2c.c
+++ b/drivers/i2c/bfin-twi_i2c.c
@@ -10,6 +10,7 @@
#include <i2c.h>
#include <asm/blackfin.h>
+#include <asm/clock.h>
#include <asm/mach-common/bits/twi.h>
/* Every register is 32bit aligned, but only 16bits in size */
@@ -274,7 +275,7 @@ unsigned int i2c_get_bus_speed(void)
*/
void i2c_init(int speed, int slaveaddr)
{
- uint8_t prescale = ((get_sclk() / 1000 / 1000 + 5) / 10) & 0x7F;
+ uint8_t prescale = ((get_i2c_clk() / 1000 / 1000 + 5) / 10) & 0x7F;
/* Set TWI internal clock as 10MHz */
twi->control = prescale;