s5pc210: universal: support gpio i2c
authorMinkyu Kang <mk7.kang@samsung.com>
Fri, 20 Aug 2010 05:52:48 +0000 (14:52 +0900)
committerMinkyu Kang <mk7.kang@samsung.com>
Fri, 20 Aug 2010 05:52:48 +0000 (14:52 +0900)
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
board/samsung/universal_c210/universal.c
include/configs/s5pc210_universal.h

index 05709ed..1c4d649 100644 (file)
@@ -23,6 +23,7 @@
  */
 
 #include <common.h>
+#include <i2c.h>
 #include <asm/arch/gpio.h>
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -30,6 +31,37 @@ DECLARE_GLOBAL_DATA_PTR;
 static struct s5pc210_gpio_part1 *gpio1;
 static struct s5pc210_gpio_part2 *gpio2;
 
+enum {
+       I2C_PMIC,
+};
+
+/*
+ * i2c pmic
+ * SDA: GPJ4[0]
+ * SCL: GPJ4[3]
+ */
+static struct i2c_gpio_bus_data i2c_pmic = {
+       .sda_pin        = 6,
+       .scl_pin        = 7,
+};
+
+static struct i2c_gpio_bus i2c_gpio[] = {
+       {
+               .bus    = &i2c_pmic,
+       },
+};
+
+void i2c_init_board(void)
+{
+       int num_bus;
+
+       num_bus = ARRAY_SIZE(i2c_gpio);
+
+       i2c_gpio[I2C_PMIC].bus->gpio_base = (unsigned int)&gpio1->gpio_b;
+
+       i2c_gpio_init(i2c_gpio, num_bus, I2C_PMIC);
+}
+
 int board_init(void)
 {
        gpio1 = (struct s5pc210_gpio_part1 *) S5PC210_GPIO_PART1_BASE;
index 830401f..edcad16 100644 (file)
 #define CONFIG_CMD_ONENAND
 #define CONFIG_CMD_MTDPARTS
 #define CONFIG_CMD_MTDPARTS_LITE
-//#define CONFIG_CMD_I2C
+#define CONFIG_CMD_I2C
 #define CONFIG_CMD_MMC
 #define CONFIG_CMD_SLEEP
 #define CONFIG_CMD_PMIC
 
 //#define CONFIG_MISC_INIT_R
 
-#if 0
 /* I2C */
 #if 0
 #define CONFIG_DRIVER_S5PC1XX_I2C
 #define CONFIG_I2C_MULTI_BUS
 #define CONFIG_SYS_MAX_I2C_BUS 7
 #endif
-#endif
 
 /* USB Downloader */
 #define CONFIG_CMD_USBDOWN