From 4facc1b2e44ed89d1b525130feaf73695a100ece Mon Sep 17 00:00:00 2001 From: Minkyu Kang Date: Fri, 20 Aug 2010 14:52:48 +0900 Subject: [PATCH] s5pc210: universal: support gpio i2c Signed-off-by: Minkyu Kang --- board/samsung/universal_c210/universal.c | 32 ++++++++++++++++++++++++++++++++ include/configs/s5pc210_universal.h | 4 +--- 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/board/samsung/universal_c210/universal.c b/board/samsung/universal_c210/universal.c index 05709ed..1c4d649 100644 --- a/board/samsung/universal_c210/universal.c +++ b/board/samsung/universal_c210/universal.c @@ -23,6 +23,7 @@ */ #include +#include #include 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; diff --git a/include/configs/s5pc210_universal.h b/include/configs/s5pc210_universal.h index 830401f..edcad16 100644 --- a/include/configs/s5pc210_universal.h +++ b/include/configs/s5pc210_universal.h @@ -118,7 +118,7 @@ #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 @@ -321,7 +321,6 @@ //#define CONFIG_MISC_INIT_R -#if 0 /* I2C */ #if 0 #define CONFIG_DRIVER_S5PC1XX_I2C @@ -338,7 +337,6 @@ #define CONFIG_I2C_MULTI_BUS #define CONFIG_SYS_MAX_I2C_BUS 7 #endif -#endif /* USB Downloader */ #define CONFIG_CMD_USBDOWN -- 2.7.4