Merge branch 'mpc86xx'
[platform/kernel/u-boot.git] / cpu / mpc83xx / i2c.c
index 3db7d2c..70450f9 100644 (file)
@@ -41,7 +41,7 @@
 #include <i2c.h>
 #include <asm/i2c.h>
 
-#ifdef CONFIG_MPC8349ADS
+#if defined(CONFIG_MPC8349EMDS) || defined(CONFIG_TQM834X)
 i2c_t * mpc8349_i2c = (i2c_t*)(CFG_IMMRBAR + CFG_I2C_OFFSET);
 #endif
 
@@ -109,7 +109,9 @@ i2c_wait (int write)
 
                return 0;
        } while (get_timer (timeval) < I2C_TIMEOUT);
+
        debug("i2c_wait: timed out\n");
+       return -1;
 }
 
 static __inline__ int
@@ -231,12 +233,12 @@ int i2c_probe (uchar chip)
         * and looking for an <ACK> back.
         */
        udelay(10000);
-       return i2c_read (chip, 0, 1, (char *)&tmp, 1);
+       return i2c_read (chip, 0, 1, (uchar *)&tmp, 1);
 }
 
 uchar i2c_reg_read (uchar i2c_addr, uchar reg)
 {
-       char buf[1];
+       uchar buf[1];
 
        i2c_read (i2c_addr, reg, 1, buf, 1);