]> git.sur5r.net Git - u-boot/commitdiff
EXYNOS: Resolve the i2c compilation error
authorAmar <amarendra.xt@samsung.com>
Wed, 10 Jul 2013 05:12:29 +0000 (10:42 +0530)
committerMinkyu Kang <mk7.kang@samsung.com>
Wed, 10 Jul 2013 05:20:26 +0000 (14:20 +0900)
This patch resolves the below mentioned compilation error of i2c driver
for non-FDT case

Compilation error:
s3c24x0_i2c.c: In function 'board_i2c_init':
s3c24x0_i2c.c:544:18: error: 'CONFIG_MAX_I2C_NUM' undeclared (first use
in this function) s3c24x0_i2c.c:544:18: note: each undeclared
identifier is reported only once for each function it appears in
s3c24x0_i2c.c:545:3: warning: implicit declaration of function

Signed-off-by: Rajeshwari Shinde <rajeshwari.s@samsung.com>
Signed-off-by: Amar <amarendra.xt@samsung.com>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
board/samsung/smdk5250/smdk5250.c
drivers/i2c/s3c24x0_i2c.c

index ae1f077c4c0e2d4387fec1a98a683858f4a47abb..f1d3d97fd685d3020ca5adec1cc7227b961cf5b4 100644 (file)
@@ -332,6 +332,16 @@ static int board_uart_init(void)
        return ret;
 }
 
+void board_i2c_init(const void *blob)
+{
+       int i;
+
+       for (i = 0; i < CONFIG_MAX_I2C_NUM; i++) {
+               exynos_pinmux_config((PERIPH_ID_I2C0 + i),
+                                    PINMUX_FLAG_NONE);
+       }
+}
+
 #ifdef CONFIG_BOARD_EARLY_INIT_F
 int board_early_init_f(void)
 {
index 3fc1c5b03b55c356b6f99b9371c4e9800546a169..382e4c2ecf5853de2d1e6d96b3ea7bd1a3a8f0b3 100644 (file)
@@ -515,10 +515,10 @@ int i2c_write(uchar chip, uint addr, int alen, uchar *buffer, int len)
                 len) != 0);
 }
 
+#ifdef CONFIG_OF_CONTROL
 void board_i2c_init(const void *blob)
 {
        int i;
-#ifdef CONFIG_OF_CONTROL
        int node_list[CONFIG_MAX_I2C_NUM];
        int count;
 
@@ -540,15 +540,8 @@ void board_i2c_init(const void *blob)
                bus->bus_num = i2c_busses++;
                exynos_pinmux_config(bus->id, 0);
        }
-#else
-       for (i = 0; i < CONFIG_MAX_I2C_NUM; i++) {
-               exynos_pinmux_config((PERIPH_ID_I2C0 + i),
-                                    PINMUX_FLAG_NONE);
-       }
-#endif
 }
 
-#ifdef CONFIG_OF_CONTROL
 static struct s3c24x0_i2c_bus *get_bus(unsigned int bus_idx)
 {
        if (bus_idx < i2c_busses)