s5pc110: add i2c2 bus
authorMinkyu Kang <mk7.kang@samsung.com>
Fri, 4 Dec 2009 06:00:17 +0000 (15:00 +0900)
committerMinkyu Kang <mk7.kang@samsung.com>
Fri, 4 Dec 2009 06:00:17 +0000 (15:00 +0900)
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
board/samsung/universal/universal.c
include/configs/s5pc1xx_universal.h

index c32f76c..481618b 100644 (file)
@@ -43,10 +43,23 @@ DECLARE_GLOBAL_DATA_PTR;
 static unsigned int board_rev;
 static unsigned int battery_soc;
 
-#define I2C_GPIO3      0
-#define I2C_PMIC       1
-#define I2C_GPIO5      2
-#define I2C_GPIO6      3
+enum {
+       I2C_2,
+       I2C_GPIO3,
+       I2C_PMIC,
+       I2C_GPIO5,
+       I2C_GPIO6,
+};
+
+/*
+ * i2c 2
+ * SDA: GPD1[4]
+ * SCL: GPD1[5]
+ */
+static struct i2c_gpio_bus_data i2c_2 = {
+       .sda_pin        = 4,
+       .scl_pin        = 5,
+};
 
 /*
  * i2c gpio3
@@ -88,9 +101,10 @@ static struct i2c_gpio_bus_data i2c_gpio6 = {
        .scl_pin        = 1,
 };
 
-
 static struct i2c_gpio_bus i2c_gpio[] = {
        {
+               .bus    = &i2c_2,
+       }, {
                .bus    = &i2c_gpio3,
        }, {
                .bus    = &i2c_pmic,
@@ -111,10 +125,11 @@ void i2c_init_board(void)
        if (cpu_is_s5pc100())
                return;
 
-       i2c_gpio[0].bus->gpio_base = (unsigned int)&gpio->gpio_j3;
-       i2c_gpio[1].bus->gpio_base = (unsigned int)&gpio->gpio_j4;
-       i2c_gpio[2].bus->gpio_base = (unsigned int)&gpio->gpio_mp0_5;
-       i2c_gpio[3].bus->gpio_base = (unsigned int)&gpio->gpio_j3;
+       i2c_gpio[I2C_2].bus->gpio_base = (unsigned int)&gpio->gpio_d1;
+       i2c_gpio[I2C_GPIO3].bus->gpio_base = (unsigned int)&gpio->gpio_j3;
+       i2c_gpio[I2C_PMIC].bus->gpio_base = (unsigned int)&gpio->gpio_j4;
+       i2c_gpio[I2C_GPIO5].bus->gpio_base = (unsigned int)&gpio->gpio_mp0_5;
+       i2c_gpio[I2C_GPIO6].bus->gpio_base = (unsigned int)&gpio->gpio_j3;
 
        i2c_gpio_init(i2c_gpio, ARRAY_SIZE(i2c_gpio), I2C_PMIC);
 
index 78c9e16..7ab5c10 100644 (file)
 #define CONFIG_SYS_I2C_INIT_BOARD
 #define CONFIG_SYS_I2C_SPEED   50000
 #define CONFIG_I2C_MULTI_BUS
-#define CONFIG_SYS_MAX_I2C_BUS 4
+#define CONFIG_SYS_MAX_I2C_BUS 5
 #endif
 
 /* USB Downloader */