i2c: fix init on generic board
authortrem <tremyfr@yahoo.fr>
Sat, 21 Sep 2013 16:13:34 +0000 (18:13 +0200)
committerHeiko Schocher <hs@denx.de>
Thu, 17 Oct 2013 05:20:24 +0000 (07:20 +0200)
On generic board, the i2c init initialize only
one bus. But the new i2c subsystem allow to
manage severals i2c bus. So in the case, instead
of initializing a bus, we just set the current
i2c bus. The initialization will be done in
the i2c command.

Signed-off-by: Philippe Reynes <tremyfr@yahoo.fr>
common/board_f.c

index 0ada1afe16b220f1080146fa196120d4e7b3e8a3..f0664bc2b2046acf3fc6f1177c076fcb6d432959 100644 (file)
@@ -249,7 +249,11 @@ void dram_init_banksize(void)
 static int init_func_i2c(void)
 {
        puts("I2C:   ");
+#ifdef CONFIG_SYS_I2C
+       i2c_init_all();
+#else
        i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
+#endif
        puts("ready\n");
        return 0;
 }