diff options
author | Naveen Krishna Ch <ch.naveen@samsung.com> | 2010-07-20 23:51:56 -0400 |
---|---|---|
committer | Kukjin Kim <kgene.kim@samsung.com> | 2010-08-05 05:36:22 -0400 |
commit | 170d7415db431801baf5105298cf73131cc6d4f2 (patch) | |
tree | 006a7d3f6e451f38a794fb41e86ac691cf6522ef /arch | |
parent | 4550ee20c8d1c280bd26ec3afbcf636ae2897486 (diff) |
ARM: S5PV210: Add support for I2C devices on SMDKV210 and SMDKC110
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>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-s5pv210/Kconfig | 8 | ||||
-rw-r--r-- | arch/arm/mach-s5pv210/mach-smdkc110.c | 31 | ||||
-rw-r--r-- | arch/arm/mach-s5pv210/mach-smdkv210.c | 28 |
3 files changed, 65 insertions, 2 deletions
diff --git a/arch/arm/mach-s5pv210/Kconfig b/arch/arm/mach-s5pv210/Kconfig index 18270d848908..d9464a6d9416 100644 --- a/arch/arm/mach-s5pv210/Kconfig +++ b/arch/arm/mach-s5pv210/Kconfig | |||
@@ -80,11 +80,15 @@ config MACH_SMDKC110 | |||
80 | bool "SMDKC110" | 80 | bool "SMDKC110" |
81 | select CPU_S5PV210 | 81 | select CPU_S5PV210 |
82 | select ARCH_SPARSEMEM_ENABLE | 82 | select ARCH_SPARSEMEM_ENABLE |
83 | select S3C_DEV_I2C1 | ||
84 | select S3C_DEV_I2C2 | ||
83 | select SAMSUNG_DEV_IDE | 85 | select SAMSUNG_DEV_IDE |
84 | select S3C_DEV_RTC | 86 | select S3C_DEV_RTC |
85 | select S3C_DEV_WDT | 87 | select S3C_DEV_WDT |
86 | select HAVE_S3C_RTC | 88 | select HAVE_S3C_RTC |
87 | select HAVE_S3C2410_WATCHDOG | 89 | select HAVE_S3C2410_WATCHDOG |
90 | select S5PV210_SETUP_I2C1 | ||
91 | select S5PV210_SETUP_I2C2 | ||
88 | select S5PV210_SETUP_IDE | 92 | select S5PV210_SETUP_IDE |
89 | help | 93 | help |
90 | Machine support for Samsung SMDKC110 | 94 | Machine support for Samsung SMDKC110 |
@@ -108,6 +112,8 @@ config MACH_SMDKV210 | |||
108 | select S3C_DEV_HSMMC1 | 112 | select S3C_DEV_HSMMC1 |
109 | select S3C_DEV_HSMMC2 | 113 | select S3C_DEV_HSMMC2 |
110 | select S3C_DEV_HSMMC3 | 114 | select S3C_DEV_HSMMC3 |
115 | select S3C_DEV_I2C1 | ||
116 | select S3C_DEV_I2C2 | ||
111 | select SAMSUNG_DEV_IDE | 117 | select SAMSUNG_DEV_IDE |
112 | select SAMSUNG_DEV_KEYPAD | 118 | select SAMSUNG_DEV_KEYPAD |
113 | select SAMSUNG_DEV_TS | 119 | select SAMSUNG_DEV_TS |
@@ -115,6 +121,8 @@ config MACH_SMDKV210 | |||
115 | select S3C_DEV_WDT | 121 | select S3C_DEV_WDT |
116 | select HAVE_S3C_RTC | 122 | select HAVE_S3C_RTC |
117 | select HAVE_S3C2410_WATCHDOG | 123 | select HAVE_S3C2410_WATCHDOG |
124 | select S5PV210_SETUP_I2C1 | ||
125 | select S5PV210_SETUP_I2C2 | ||
118 | select S5PV210_SETUP_IDE | 126 | select S5PV210_SETUP_IDE |
119 | select S5PV210_SETUP_KEYPAD | 127 | select S5PV210_SETUP_KEYPAD |
120 | select S5PV210_SETUP_SDHCI | 128 | select S5PV210_SETUP_SDHCI |
diff --git a/arch/arm/mach-s5pv210/mach-smdkc110.c b/arch/arm/mach-s5pv210/mach-smdkc110.c index 4816facce63c..9f4f0bdd2cc3 100644 --- a/arch/arm/mach-s5pv210/mach-smdkc110.c +++ b/arch/arm/mach-s5pv210/mach-smdkc110.c | |||
@@ -12,6 +12,7 @@ | |||
12 | #include <linux/types.h> | 12 | #include <linux/types.h> |
13 | #include <linux/init.h> | 13 | #include <linux/init.h> |
14 | #include <linux/serial_core.h> | 14 | #include <linux/serial_core.h> |
15 | #include <linux/i2c.h> | ||
15 | 16 | ||
16 | #include <asm/mach/arch.h> | 17 | #include <asm/mach/arch.h> |
17 | #include <asm/mach/map.h> | 18 | #include <asm/mach/map.h> |
@@ -26,6 +27,7 @@ | |||
26 | #include <plat/devs.h> | 27 | #include <plat/devs.h> |
27 | #include <plat/cpu.h> | 28 | #include <plat/cpu.h> |
28 | #include <plat/ata.h> | 29 | #include <plat/ata.h> |
30 | #include <plat/iic.h> | ||
29 | 31 | ||
30 | /* Following are default values for UCON, ULCON and UFCON UART registers */ | 32 | /* Following are default values for UCON, ULCON and UFCON UART registers */ |
31 | #define S5PV210_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ | 33 | #define S5PV210_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ |
@@ -72,7 +74,7 @@ static struct s3c2410_uartcfg smdkv210_uartcfgs[] __initdata = { | |||
72 | }, | 74 | }, |
73 | }; | 75 | }; |
74 | 76 | ||
75 | static struct s3c_ide_platdata smdkv210_ide_pdata __initdata = { | 77 | static struct s3c_ide_platdata smdkc110_ide_pdata __initdata = { |
76 | .setup_gpio = s5pv210_ide_setup_gpio, | 78 | .setup_gpio = s5pv210_ide_setup_gpio, |
77 | }; | 79 | }; |
78 | 80 | ||
@@ -80,10 +82,25 @@ static struct platform_device *smdkc110_devices[] __initdata = { | |||
80 | &s5pv210_device_iis0, | 82 | &s5pv210_device_iis0, |
81 | &s5pv210_device_ac97, | 83 | &s5pv210_device_ac97, |
82 | &s3c_device_cfcon, | 84 | &s3c_device_cfcon, |
85 | &s3c_device_i2c0, | ||
86 | &s3c_device_i2c1, | ||
87 | &s3c_device_i2c2, | ||
83 | &s3c_device_rtc, | 88 | &s3c_device_rtc, |
84 | &s3c_device_wdt, | 89 | &s3c_device_wdt, |
85 | }; | 90 | }; |
86 | 91 | ||
92 | static struct i2c_board_info smdkc110_i2c_devs0[] __initdata = { | ||
93 | { I2C_BOARD_INFO("24c08", 0x50), }, /* Samsung S524AD0XD1 */ | ||
94 | }; | ||
95 | |||
96 | static struct i2c_board_info smdkc110_i2c_devs1[] __initdata = { | ||
97 | /* To Be Updated */ | ||
98 | }; | ||
99 | |||
100 | static struct i2c_board_info smdkc110_i2c_devs2[] __initdata = { | ||
101 | /* To Be Updated */ | ||
102 | }; | ||
103 | |||
87 | static void __init smdkc110_map_io(void) | 104 | static void __init smdkc110_map_io(void) |
88 | { | 105 | { |
89 | s5p_init_io(NULL, 0, S5P_VA_CHIPID); | 106 | s5p_init_io(NULL, 0, S5P_VA_CHIPID); |
@@ -93,7 +110,17 @@ static void __init smdkc110_map_io(void) | |||
93 | 110 | ||
94 | static void __init smdkc110_machine_init(void) | 111 | static void __init smdkc110_machine_init(void) |
95 | { | 112 | { |
96 | s3c_ide_set_platdata(&smdkv210_ide_pdata); | 113 | s3c_i2c0_set_platdata(NULL); |
114 | s3c_i2c1_set_platdata(NULL); | ||
115 | s3c_i2c2_set_platdata(NULL); | ||
116 | i2c_register_board_info(0, smdkc110_i2c_devs0, | ||
117 | ARRAY_SIZE(smdkc110_i2c_devs0)); | ||
118 | i2c_register_board_info(1, smdkc110_i2c_devs1, | ||
119 | ARRAY_SIZE(smdkc110_i2c_devs1)); | ||
120 | i2c_register_board_info(2, smdkc110_i2c_devs2, | ||
121 | ARRAY_SIZE(smdkc110_i2c_devs2)); | ||
122 | |||
123 | s3c_ide_set_platdata(&smdkc110_ide_pdata); | ||
97 | 124 | ||
98 | platform_add_devices(smdkc110_devices, ARRAY_SIZE(smdkc110_devices)); | 125 | platform_add_devices(smdkc110_devices, ARRAY_SIZE(smdkc110_devices)); |
99 | } | 126 | } |
diff --git a/arch/arm/mach-s5pv210/mach-smdkv210.c b/arch/arm/mach-s5pv210/mach-smdkv210.c index a6c504ec47eb..1e4ed147dbc7 100644 --- a/arch/arm/mach-s5pv210/mach-smdkv210.c +++ b/arch/arm/mach-s5pv210/mach-smdkv210.c | |||
@@ -10,6 +10,7 @@ | |||
10 | 10 | ||
11 | #include <linux/kernel.h> | 11 | #include <linux/kernel.h> |
12 | #include <linux/types.h> | 12 | #include <linux/types.h> |
13 | #include <linux/i2c.h> | ||
13 | #include <linux/init.h> | 14 | #include <linux/init.h> |
14 | #include <linux/serial_core.h> | 15 | #include <linux/serial_core.h> |
15 | 16 | ||
@@ -28,6 +29,7 @@ | |||
28 | #include <plat/adc.h> | 29 | #include <plat/adc.h> |
29 | #include <plat/ts.h> | 30 | #include <plat/ts.h> |
30 | #include <plat/ata.h> | 31 | #include <plat/ata.h> |
32 | #include <plat/iic.h> | ||
31 | #include <plat/keypad.h> | 33 | #include <plat/keypad.h> |
32 | 34 | ||
33 | /* Following are default values for UCON, ULCON and UFCON UART registers */ | 35 | /* Following are default values for UCON, ULCON and UFCON UART registers */ |
@@ -107,12 +109,27 @@ static struct platform_device *smdkv210_devices[] __initdata = { | |||
107 | &s3c_device_hsmmc1, | 109 | &s3c_device_hsmmc1, |
108 | &s3c_device_hsmmc2, | 110 | &s3c_device_hsmmc2, |
109 | &s3c_device_hsmmc3, | 111 | &s3c_device_hsmmc3, |
112 | &s3c_device_i2c0, | ||
113 | &s3c_device_i2c1, | ||
114 | &s3c_device_i2c2, | ||
110 | &samsung_device_keypad, | 115 | &samsung_device_keypad, |
111 | &s3c_device_rtc, | 116 | &s3c_device_rtc, |
112 | &s3c_device_ts, | 117 | &s3c_device_ts, |
113 | &s3c_device_wdt, | 118 | &s3c_device_wdt, |
114 | }; | 119 | }; |
115 | 120 | ||
121 | static struct i2c_board_info smdkv210_i2c_devs0[] __initdata = { | ||
122 | { I2C_BOARD_INFO("24c08", 0x50), }, /* Samsung S524AD0XD1 */ | ||
123 | }; | ||
124 | |||
125 | static struct i2c_board_info smdkv210_i2c_devs1[] __initdata = { | ||
126 | /* To Be Updated */ | ||
127 | }; | ||
128 | |||
129 | static struct i2c_board_info smdkv210_i2c_devs2[] __initdata = { | ||
130 | /* To Be Updated */ | ||
131 | }; | ||
132 | |||
116 | static struct s3c2410_ts_mach_info s3c_ts_platform __initdata = { | 133 | static struct s3c2410_ts_mach_info s3c_ts_platform __initdata = { |
117 | .delay = 10000, | 134 | .delay = 10000, |
118 | .presc = 49, | 135 | .presc = 49, |
@@ -130,6 +147,17 @@ static void __init smdkv210_machine_init(void) | |||
130 | { | 147 | { |
131 | samsung_keypad_set_platdata(&smdkv210_keypad_data); | 148 | samsung_keypad_set_platdata(&smdkv210_keypad_data); |
132 | s3c24xx_ts_set_platdata(&s3c_ts_platform); | 149 | s3c24xx_ts_set_platdata(&s3c_ts_platform); |
150 | |||
151 | s3c_i2c0_set_platdata(NULL); | ||
152 | s3c_i2c1_set_platdata(NULL); | ||
153 | s3c_i2c2_set_platdata(NULL); | ||
154 | i2c_register_board_info(0, smdkv210_i2c_devs0, | ||
155 | ARRAY_SIZE(smdkv210_i2c_devs0)); | ||
156 | i2c_register_board_info(1, smdkv210_i2c_devs1, | ||
157 | ARRAY_SIZE(smdkv210_i2c_devs1)); | ||
158 | i2c_register_board_info(2, smdkv210_i2c_devs2, | ||
159 | ARRAY_SIZE(smdkv210_i2c_devs2)); | ||
160 | |||
133 | s3c_ide_set_platdata(&smdkv210_ide_pdata); | 161 | s3c_ide_set_platdata(&smdkv210_ide_pdata); |
134 | 162 | ||
135 | platform_add_devices(smdkv210_devices, ARRAY_SIZE(smdkv210_devices)); | 163 | platform_add_devices(smdkv210_devices, ARRAY_SIZE(smdkv210_devices)); |