]> git.karo-electronics.de Git - linux-beck.git/commitdiff
ARM: S5PV210: Add support for I2C devices on SMDKV210 and SMDKC110
authorNaveen Krishna Ch <ch.naveen@samsung.com>
Wed, 21 Jul 2010 03:51:56 +0000 (09:21 +0530)
committerKukjin Kim <kgene.kim@samsung.com>
Thu, 5 Aug 2010 09:36:22 +0000 (18:36 +0900)
This patch adds support I2C-0/1/2 devices to the SMDKV210/SMDKC110.

Signed-off-by: Naveen Krishna Ch <ch.naveen@samsung.com>
[kgene.kim@samsung.com: Fixes wrong name]
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
arch/arm/mach-s5pv210/Kconfig
arch/arm/mach-s5pv210/mach-smdkc110.c
arch/arm/mach-s5pv210/mach-smdkv210.c

index 18270d848908c26ff14269a8e7c6e29ff4062d30..d9464a6d94167159b5ae21aba06425ddde3aa15e 100644 (file)
@@ -80,11 +80,15 @@ config MACH_SMDKC110
        bool "SMDKC110"
        select CPU_S5PV210
        select ARCH_SPARSEMEM_ENABLE
+       select S3C_DEV_I2C1
+       select S3C_DEV_I2C2
        select SAMSUNG_DEV_IDE
        select S3C_DEV_RTC
        select S3C_DEV_WDT
        select HAVE_S3C_RTC
        select HAVE_S3C2410_WATCHDOG
+       select S5PV210_SETUP_I2C1
+       select S5PV210_SETUP_I2C2
        select S5PV210_SETUP_IDE
        help
          Machine support for Samsung SMDKC110
@@ -108,6 +112,8 @@ config MACH_SMDKV210
        select S3C_DEV_HSMMC1
        select S3C_DEV_HSMMC2
        select S3C_DEV_HSMMC3
+       select S3C_DEV_I2C1
+       select S3C_DEV_I2C2
        select SAMSUNG_DEV_IDE
        select SAMSUNG_DEV_KEYPAD
        select SAMSUNG_DEV_TS
@@ -115,6 +121,8 @@ config MACH_SMDKV210
        select S3C_DEV_WDT
        select HAVE_S3C_RTC
        select HAVE_S3C2410_WATCHDOG
+       select S5PV210_SETUP_I2C1
+       select S5PV210_SETUP_I2C2
        select S5PV210_SETUP_IDE
        select S5PV210_SETUP_KEYPAD
        select S5PV210_SETUP_SDHCI
index 4816facce63cd570d8d0b2f84e7d5598eb72d128..9f4f0bdd2cc32a6f90699a614b1e9d11cf5693d6 100644 (file)
@@ -12,6 +12,7 @@
 #include <linux/types.h>
 #include <linux/init.h>
 #include <linux/serial_core.h>
+#include <linux/i2c.h>
 
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
@@ -26,6 +27,7 @@
 #include <plat/devs.h>
 #include <plat/cpu.h>
 #include <plat/ata.h>
+#include <plat/iic.h>
 
 /* Following are default values for UCON, ULCON and UFCON UART registers */
 #define S5PV210_UCON_DEFAULT   (S3C2410_UCON_TXILEVEL |        \
@@ -72,7 +74,7 @@ static struct s3c2410_uartcfg smdkv210_uartcfgs[] __initdata = {
        },
 };
 
-static struct s3c_ide_platdata smdkv210_ide_pdata __initdata = {
+static struct s3c_ide_platdata smdkc110_ide_pdata __initdata = {
        .setup_gpio     = s5pv210_ide_setup_gpio,
 };
 
@@ -80,10 +82,25 @@ static struct platform_device *smdkc110_devices[] __initdata = {
        &s5pv210_device_iis0,
        &s5pv210_device_ac97,
        &s3c_device_cfcon,
+       &s3c_device_i2c0,
+       &s3c_device_i2c1,
+       &s3c_device_i2c2,
        &s3c_device_rtc,
        &s3c_device_wdt,
 };
 
+static struct i2c_board_info smdkc110_i2c_devs0[] __initdata = {
+       { I2C_BOARD_INFO("24c08", 0x50), },     /* Samsung S524AD0XD1 */
+};
+
+static struct i2c_board_info smdkc110_i2c_devs1[] __initdata = {
+       /* To Be Updated */
+};
+
+static struct i2c_board_info smdkc110_i2c_devs2[] __initdata = {
+       /* To Be Updated */
+};
+
 static void __init smdkc110_map_io(void)
 {
        s5p_init_io(NULL, 0, S5P_VA_CHIPID);
@@ -93,7 +110,17 @@ static void __init smdkc110_map_io(void)
 
 static void __init smdkc110_machine_init(void)
 {
-       s3c_ide_set_platdata(&smdkv210_ide_pdata);
+       s3c_i2c0_set_platdata(NULL);
+       s3c_i2c1_set_platdata(NULL);
+       s3c_i2c2_set_platdata(NULL);
+       i2c_register_board_info(0, smdkc110_i2c_devs0,
+                       ARRAY_SIZE(smdkc110_i2c_devs0));
+       i2c_register_board_info(1, smdkc110_i2c_devs1,
+                       ARRAY_SIZE(smdkc110_i2c_devs1));
+       i2c_register_board_info(2, smdkc110_i2c_devs2,
+                       ARRAY_SIZE(smdkc110_i2c_devs2));
+
+       s3c_ide_set_platdata(&smdkc110_ide_pdata);
 
        platform_add_devices(smdkc110_devices, ARRAY_SIZE(smdkc110_devices));
 }
index a6c504ec47eb1371825c4689b5f71252000cb075..1e4ed147dbc7f01158646383904ac568c154b1d2 100644 (file)
@@ -10,6 +10,7 @@
 
 #include <linux/kernel.h>
 #include <linux/types.h>
+#include <linux/i2c.h>
 #include <linux/init.h>
 #include <linux/serial_core.h>
 
@@ -28,6 +29,7 @@
 #include <plat/adc.h>
 #include <plat/ts.h>
 #include <plat/ata.h>
+#include <plat/iic.h>
 #include <plat/keypad.h>
 
 /* Following are default values for UCON, ULCON and UFCON UART registers */
@@ -107,12 +109,27 @@ static struct platform_device *smdkv210_devices[] __initdata = {
        &s3c_device_hsmmc1,
        &s3c_device_hsmmc2,
        &s3c_device_hsmmc3,
+       &s3c_device_i2c0,
+       &s3c_device_i2c1,
+       &s3c_device_i2c2,
        &samsung_device_keypad,
        &s3c_device_rtc,
        &s3c_device_ts,
        &s3c_device_wdt,
 };
 
+static struct i2c_board_info smdkv210_i2c_devs0[] __initdata = {
+       { I2C_BOARD_INFO("24c08", 0x50), },     /* Samsung S524AD0XD1 */
+};
+
+static struct i2c_board_info smdkv210_i2c_devs1[] __initdata = {
+       /* To Be Updated */
+};
+
+static struct i2c_board_info smdkv210_i2c_devs2[] __initdata = {
+       /* To Be Updated */
+};
+
 static struct s3c2410_ts_mach_info s3c_ts_platform __initdata = {
        .delay                  = 10000,
        .presc                  = 49,
@@ -130,6 +147,17 @@ static void __init smdkv210_machine_init(void)
 {
        samsung_keypad_set_platdata(&smdkv210_keypad_data);
        s3c24xx_ts_set_platdata(&s3c_ts_platform);
+
+       s3c_i2c0_set_platdata(NULL);
+       s3c_i2c1_set_platdata(NULL);
+       s3c_i2c2_set_platdata(NULL);
+       i2c_register_board_info(0, smdkv210_i2c_devs0,
+                       ARRAY_SIZE(smdkv210_i2c_devs0));
+       i2c_register_board_info(1, smdkv210_i2c_devs1,
+                       ARRAY_SIZE(smdkv210_i2c_devs1));
+       i2c_register_board_info(2, smdkv210_i2c_devs2,
+                       ARRAY_SIZE(smdkv210_i2c_devs2));
+
        s3c_ide_set_platdata(&smdkv210_ide_pdata);
 
        platform_add_devices(smdkv210_devices, ARRAY_SIZE(smdkv210_devices));