]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - drivers/i2c/omap24xx_i2c.c
Cleanup: fix "MHz" spelling
[karo-tx-uboot.git] / drivers / i2c / omap24xx_i2c.c
index 7dab78685dfb44102295a2cf138d49f48118b9ac..d2e8207c5296d6be94b49ed573bddeb0157066ac 100644 (file)
@@ -22,8 +22,6 @@
 
 #include <common.h>
 
-#ifdef CONFIG_DRIVER_OMAP24XX_I2C
-
 #include <asm/arch/i2c.h>
 #include <asm/io.h>
 
@@ -47,7 +45,7 @@ void i2c_init (int speed, int slaveadd)
                udelay (50000);
        }
 
-       /* 12Mhz I2C module clock */
+       /* 12MHz I2C module clock */
        outw (0, I2C_PSC);
        speed = speed/1000;                 /* 100 or 400 */
        scl = ((12000/(speed*2)) - 7);  /* use 7 when PSC = 0 */
@@ -254,7 +252,7 @@ int i2c_read (uchar chip, uint addr, int alen, uchar * buffer, int len)
        for (i = 0; i < len; i++) {
                if (i2c_read_byte (chip, addr + i, &buffer[i])) {
                        printf ("I2C read: I/O error\n");
-                       i2c_init (CFG_I2C_SPEED, CFG_I2C_SLAVE);
+                       i2c_init (CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
                        return 1;
                }
        }
@@ -279,7 +277,7 @@ int i2c_write (uchar chip, uint addr, int alen, uchar * buffer, int len)
        for (i = 0; i < len; i++) {
                if (i2c_write_byte (chip, addr + i, buffer[i])) {
                        printf ("I2C read: I/O error\n");
-                       i2c_init (CFG_I2C_SPEED, CFG_I2C_SLAVE);
+                       i2c_init (CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
                        return 1;
                }
        }
@@ -325,5 +323,3 @@ static u16 wait_for_pin (void)
 }
        return status;
 }
-
-#endif /* CONFIG_DRIVER_OMAP24XX_I2C */