From 2047672684cf85cb6f96a1fbc993180aaaf19a99 Mon Sep 17 00:00:00 2001 From: Jon Loeliger Date: Fri, 20 Oct 2006 15:50:15 -0500 Subject: Converted all 85xx boards to use a common FSL I2C driver. Introduced COFIG_FSL_I2C to select the common FSL I2C driver. And removed hard i2c path from a few u-boot.lds scipts too. Minor whitespace cleanups along the way. Signed-off-by: Jon Loeliger --- drivers/fsl_i2c.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'drivers/fsl_i2c.c') diff --git a/drivers/fsl_i2c.c b/drivers/fsl_i2c.c index af19191..65c2743 100644 --- a/drivers/fsl_i2c.c +++ b/drivers/fsl_i2c.c @@ -18,11 +18,14 @@ #include +#ifdef CONFIG_FSL_I2C #ifdef CONFIG_HARD_I2C #include +#include /* Functional interface */ + #include -#include +#include /* HW definitions */ #define I2C_TIMEOUT (CFG_HZ / 4) #define I2C ((struct fsl_i2c *)(CFG_IMMR + CFG_I2C_OFFSET)) @@ -32,7 +35,7 @@ void i2c_init(int speed, int slaveadd) { /* stop I2C controller */ - writeb(0x0 , &I2C->cr); + writeb(0x0, &I2C->cr); /* set clock */ writeb(0x3f, &I2C->fdr); @@ -53,7 +56,7 @@ i2c_init(int speed, int slaveadd) static __inline__ int i2c_wait4bus(void) { - ulong timeval = get_timer (0); + ulong timeval = get_timer(0); while (readb(&I2C->sr) & I2C_SR_MBB) { if (get_timer(timeval) > I2C_TIMEOUT) { @@ -235,3 +238,4 @@ i2c_reg_write(uchar i2c_addr, uchar reg, uchar val) } #endif /* CONFIG_HARD_I2C */ +#endif /* CONFIG_FSL_I2C */ -- cgit v1.1