aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/mach-s3c2410/include/mach/map.h2
-rw-r--r--arch/arm/mach-s3c2410/mach-amlm5900.c4
-rw-r--r--arch/arm/mach-s3c2410/mach-bast.c7
-rw-r--r--arch/arm/mach-s3c2410/mach-h1940.c4
-rw-r--r--arch/arm/mach-s3c2410/mach-n30.c6
-rw-r--r--arch/arm/mach-s3c2410/mach-otom.c4
-rw-r--r--arch/arm/mach-s3c2410/mach-qt2410.c4
-rw-r--r--arch/arm/mach-s3c2410/mach-smdk2410.c4
-rw-r--r--arch/arm/mach-s3c2410/mach-tct_hammer.c4
-rw-r--r--arch/arm/mach-s3c2410/mach-vr1000.c4
-rw-r--r--arch/arm/mach-s3c2412/mach-jive.c9
-rw-r--r--arch/arm/mach-s3c2412/mach-smdk2413.c4
-rw-r--r--arch/arm/mach-s3c2412/mach-vstms.c4
-rw-r--r--arch/arm/mach-s3c2440/mach-anubis.c4
-rw-r--r--arch/arm/mach-s3c2440/mach-at2440evb.c4
-rw-r--r--arch/arm/mach-s3c2440/mach-nexcoder.c4
-rw-r--r--arch/arm/mach-s3c2440/mach-osiris.c5
-rw-r--r--arch/arm/mach-s3c2440/mach-rx3715.c2
-rw-r--r--arch/arm/mach-s3c2440/mach-smdk2440.c4
-rw-r--r--arch/arm/mach-s3c2443/mach-smdk2443.c4
-rw-r--r--arch/arm/mach-s3c24a0/include/mach/map.h2
-rw-r--r--arch/arm/mach-s3c6400/include/mach/map.h2
-rw-r--r--arch/arm/plat-s3c/Makefile1
-rw-r--r--arch/arm/plat-s3c/dev-i2c0.c67
-rw-r--r--arch/arm/plat-s3c/include/plat/devs.h2
-rw-r--r--arch/arm/plat-s3c/include/plat/iic.h22
-rw-r--r--arch/arm/plat-s3c24xx/Makefile3
-rw-r--r--arch/arm/plat-s3c24xx/devs.c25
-rw-r--r--arch/arm/plat-s3c24xx/include/plat/map.h1
-rw-r--r--arch/arm/plat-s3c24xx/s3c244x.c2
-rw-r--r--arch/arm/plat-s3c24xx/setup-i2c.c25
31 files changed, 183 insertions, 56 deletions
diff --git a/arch/arm/mach-s3c2410/include/mach/map.h b/arch/arm/mach-s3c2410/include/mach/map.h
index d5ae6823fed4..255fdfeaf957 100644
--- a/arch/arm/mach-s3c2410/include/mach/map.h
+++ b/arch/arm/mach-s3c2410/include/mach/map.h
@@ -92,7 +92,6 @@
92#define S3C24XX_PA_TIMER S3C2410_PA_TIMER 92#define S3C24XX_PA_TIMER S3C2410_PA_TIMER
93#define S3C24XX_PA_USBDEV S3C2410_PA_USBDEV 93#define S3C24XX_PA_USBDEV S3C2410_PA_USBDEV
94#define S3C24XX_PA_WATCHDOG S3C2410_PA_WATCHDOG 94#define S3C24XX_PA_WATCHDOG S3C2410_PA_WATCHDOG
95#define S3C24XX_PA_IIC S3C2410_PA_IIC
96#define S3C24XX_PA_IIS S3C2410_PA_IIS 95#define S3C24XX_PA_IIS S3C2410_PA_IIS
97#define S3C24XX_PA_GPIO S3C2410_PA_GPIO 96#define S3C24XX_PA_GPIO S3C2410_PA_GPIO
98#define S3C24XX_PA_RTC S3C2410_PA_RTC 97#define S3C24XX_PA_RTC S3C2410_PA_RTC
@@ -101,6 +100,7 @@
101#define S3C24XX_PA_SDI S3C2410_PA_SDI 100#define S3C24XX_PA_SDI S3C2410_PA_SDI
102#define S3C24XX_PA_NAND S3C2410_PA_NAND 101#define S3C24XX_PA_NAND S3C2410_PA_NAND
103 102
103#define S3C_PA_IIC S3C2410_PA_IIC
104#define S3C_PA_UART S3C24XX_PA_UART 104#define S3C_PA_UART S3C24XX_PA_UART
105#define S3C_PA_HSMMC0 S3C2443_PA_HSMMC 105#define S3C_PA_HSMMC0 S3C2443_PA_HSMMC
106 106
diff --git a/arch/arm/mach-s3c2410/mach-amlm5900.c b/arch/arm/mach-s3c2410/mach-amlm5900.c
index d061fea01900..6d6995afeb43 100644
--- a/arch/arm/mach-s3c2410/mach-amlm5900.c
+++ b/arch/arm/mach-s3c2410/mach-amlm5900.c
@@ -52,6 +52,7 @@
52#include <mach/regs-lcd.h> 52#include <mach/regs-lcd.h>
53#include <mach/regs-gpio.h> 53#include <mach/regs-gpio.h>
54 54
55#include <plat/iic.h>
55#include <plat/devs.h> 56#include <plat/devs.h>
56#include <plat/cpu.h> 57#include <plat/cpu.h>
57 58
@@ -150,7 +151,7 @@ static struct platform_device *amlm5900_devices[] __initdata = {
150#endif 151#endif
151 &s3c_device_adc, 152 &s3c_device_adc,
152 &s3c_device_wdt, 153 &s3c_device_wdt,
153 &s3c_device_i2c, 154 &s3c_device_i2c0,
154 &s3c_device_usb, 155 &s3c_device_usb,
155 &s3c_device_rtc, 156 &s3c_device_rtc,
156 &s3c_device_usbgadget, 157 &s3c_device_usbgadget,
@@ -233,6 +234,7 @@ static void __init amlm5900_init(void)
233#ifdef CONFIG_FB_S3C2410 234#ifdef CONFIG_FB_S3C2410
234 s3c24xx_fb_set_platdata(&amlm5900_fb_info); 235 s3c24xx_fb_set_platdata(&amlm5900_fb_info);
235#endif 236#endif
237 s3c_i2c0_set_platdata(NULL);
236 platform_add_devices(amlm5900_devices, ARRAY_SIZE(amlm5900_devices)); 238 platform_add_devices(amlm5900_devices, ARRAY_SIZE(amlm5900_devices));
237} 239}
238 240
diff --git a/arch/arm/mach-s3c2410/mach-bast.c b/arch/arm/mach-s3c2410/mach-bast.c
index c04c24444e0d..01bd76725b92 100644
--- a/arch/arm/mach-s3c2410/mach-bast.c
+++ b/arch/arm/mach-s3c2410/mach-bast.c
@@ -406,7 +406,7 @@ static struct platform_device bast_sio = {
406 * standard 100KHz i2c bus frequency 406 * standard 100KHz i2c bus frequency
407*/ 407*/
408 408
409static struct s3c2410_platform_i2c bast_i2c_info = { 409static struct s3c2410_platform_i2c __initdata bast_i2c_info = {
410 .flags = 0, 410 .flags = 0,
411 .slave_addr = 0x10, 411 .slave_addr = 0x10,
412 .bus_freq = 100*1000, 412 .bus_freq = 100*1000,
@@ -553,7 +553,7 @@ static struct platform_device *bast_devices[] __initdata = {
553 &s3c_device_usb, 553 &s3c_device_usb,
554 &s3c_device_lcd, 554 &s3c_device_lcd,
555 &s3c_device_wdt, 555 &s3c_device_wdt,
556 &s3c_device_i2c, 556 &s3c_device_i2c0,
557 &s3c_device_rtc, 557 &s3c_device_rtc,
558 &s3c_device_nand, 558 &s3c_device_nand,
559 &bast_device_dm9k, 559 &bast_device_dm9k,
@@ -588,7 +588,8 @@ static void __init bast_map_io(void)
588 s3c24xx_register_clocks(bast_clocks, ARRAY_SIZE(bast_clocks)); 588 s3c24xx_register_clocks(bast_clocks, ARRAY_SIZE(bast_clocks));
589 589
590 s3c_device_nand.dev.platform_data = &bast_nand_info; 590 s3c_device_nand.dev.platform_data = &bast_nand_info;
591 s3c_device_i2c.dev.platform_data = &bast_i2c_info; 591
592 s3c_i2c0_set_platdata(&bast_i2c_info);
592 593
593 s3c24xx_init_io(bast_iodesc, ARRAY_SIZE(bast_iodesc)); 594 s3c24xx_init_io(bast_iodesc, ARRAY_SIZE(bast_iodesc));
594 s3c24xx_init_clocks(0); 595 s3c24xx_init_clocks(0);
diff --git a/arch/arm/mach-s3c2410/mach-h1940.c b/arch/arm/mach-s3c2410/mach-h1940.c
index 836508b829bb..821a1668c3ac 100644
--- a/arch/arm/mach-s3c2410/mach-h1940.c
+++ b/arch/arm/mach-s3c2410/mach-h1940.c
@@ -39,6 +39,7 @@
39#include <mach/h1940-latch.h> 39#include <mach/h1940-latch.h>
40#include <mach/fb.h> 40#include <mach/fb.h>
41#include <plat/udc.h> 41#include <plat/udc.h>
42#include <plat/iic.h>
42 43
43#include <plat/clock.h> 44#include <plat/clock.h>
44#include <plat/devs.h> 45#include <plat/devs.h>
@@ -184,7 +185,7 @@ static struct platform_device *h1940_devices[] __initdata = {
184 &s3c_device_usb, 185 &s3c_device_usb,
185 &s3c_device_lcd, 186 &s3c_device_lcd,
186 &s3c_device_wdt, 187 &s3c_device_wdt,
187 &s3c_device_i2c, 188 &s3c_device_i2c0,
188 &s3c_device_iis, 189 &s3c_device_iis,
189 &s3c_device_usbgadget, 190 &s3c_device_usbgadget,
190 &s3c_device_leds, 191 &s3c_device_leds,
@@ -216,6 +217,7 @@ static void __init h1940_init(void)
216 217
217 s3c24xx_fb_set_platdata(&h1940_fb_info); 218 s3c24xx_fb_set_platdata(&h1940_fb_info);
218 s3c24xx_udc_set_platdata(&h1940_udc_cfg); 219 s3c24xx_udc_set_platdata(&h1940_udc_cfg);
220 s3c_i2c0_set_platdata(NULL);
219 221
220 /* Turn off suspend on both USB ports, and switch the 222 /* Turn off suspend on both USB ports, and switch the
221 * selectable USB port to USB device mode. */ 223 * selectable USB port to USB device mode. */
diff --git a/arch/arm/mach-s3c2410/mach-n30.c b/arch/arm/mach-s3c2410/mach-n30.c
index 7a7c45d28fe7..1269e59d2940 100644
--- a/arch/arm/mach-s3c2410/mach-n30.c
+++ b/arch/arm/mach-s3c2410/mach-n30.c
@@ -320,7 +320,7 @@ static struct s3c2410fb_mach_info n30_fb_info __initdata = {
320static struct platform_device *n30_devices[] __initdata = { 320static struct platform_device *n30_devices[] __initdata = {
321 &s3c_device_lcd, 321 &s3c_device_lcd,
322 &s3c_device_wdt, 322 &s3c_device_wdt,
323 &s3c_device_i2c, 323 &s3c_device_i2c0,
324 &s3c_device_iis, 324 &s3c_device_iis,
325 &s3c_device_usb, 325 &s3c_device_usb,
326 &s3c_device_usbgadget, 326 &s3c_device_usbgadget,
@@ -332,7 +332,7 @@ static struct platform_device *n30_devices[] __initdata = {
332static struct platform_device *n35_devices[] __initdata = { 332static struct platform_device *n35_devices[] __initdata = {
333 &s3c_device_lcd, 333 &s3c_device_lcd,
334 &s3c_device_wdt, 334 &s3c_device_wdt,
335 &s3c_device_i2c, 335 &s3c_device_i2c0,
336 &s3c_device_iis, 336 &s3c_device_iis,
337 &s3c_device_usbgadget, 337 &s3c_device_usbgadget,
338 &n35_button_device, 338 &n35_button_device,
@@ -501,7 +501,7 @@ static void __init n30_init_irq(void)
501static void __init n30_init(void) 501static void __init n30_init(void)
502{ 502{
503 s3c24xx_fb_set_platdata(&n30_fb_info); 503 s3c24xx_fb_set_platdata(&n30_fb_info);
504 s3c_device_i2c.dev.platform_data = &n30_i2ccfg; 504 s3c_device_i2c0.dev.platform_data = &n30_i2ccfg;
505 s3c24xx_udc_set_platdata(&n30_udc_cfg); 505 s3c24xx_udc_set_platdata(&n30_udc_cfg);
506 506
507 /* Turn off suspend on both USB ports, and switch the 507 /* Turn off suspend on both USB ports, and switch the
diff --git a/arch/arm/mach-s3c2410/mach-otom.c b/arch/arm/mach-s3c2410/mach-otom.c
index d8255cf87e44..f6c7261a4a12 100644
--- a/arch/arm/mach-s3c2410/mach-otom.c
+++ b/arch/arm/mach-s3c2410/mach-otom.c
@@ -35,6 +35,7 @@
35#include <plat/s3c2410.h> 35#include <plat/s3c2410.h>
36#include <plat/clock.h> 36#include <plat/clock.h>
37#include <plat/devs.h> 37#include <plat/devs.h>
38#include <plat/iic.h>
38#include <plat/cpu.h> 39#include <plat/cpu.h>
39 40
40static struct map_desc otom11_iodesc[] __initdata = { 41static struct map_desc otom11_iodesc[] __initdata = {
@@ -94,7 +95,7 @@ static struct platform_device *otom11_devices[] __initdata = {
94 &s3c_device_usb, 95 &s3c_device_usb,
95 &s3c_device_lcd, 96 &s3c_device_lcd,
96 &s3c_device_wdt, 97 &s3c_device_wdt,
97 &s3c_device_i2c, 98 &s3c_device_i2c0,
98 &s3c_device_iis, 99 &s3c_device_iis,
99 &s3c_device_rtc, 100 &s3c_device_rtc,
100 &otom_device_nor, 101 &otom_device_nor,
@@ -109,6 +110,7 @@ static void __init otom11_map_io(void)
109 110
110static void __init otom11_init(void) 111static void __init otom11_init(void)
111{ 112{
113 s3c_i2c0_set_platdata(NULL);
112 platform_add_devices(otom11_devices, ARRAY_SIZE(otom11_devices)); 114 platform_add_devices(otom11_devices, ARRAY_SIZE(otom11_devices));
113} 115}
114 116
diff --git a/arch/arm/mach-s3c2410/mach-qt2410.c b/arch/arm/mach-s3c2410/mach-qt2410.c
index ef868472f6a4..9678a53ceeb1 100644
--- a/arch/arm/mach-s3c2410/mach-qt2410.c
+++ b/arch/arm/mach-s3c2410/mach-qt2410.c
@@ -54,6 +54,7 @@
54#include <plat/udc.h> 54#include <plat/udc.h>
55#include <mach/spi.h> 55#include <mach/spi.h>
56#include <mach/spi-gpio.h> 56#include <mach/spi-gpio.h>
57#include <plat/iic.h>
57 58
58#include <plat/common-smdk.h> 59#include <plat/common-smdk.h>
59#include <plat/devs.h> 60#include <plat/devs.h>
@@ -247,7 +248,7 @@ static struct platform_device *qt2410_devices[] __initdata = {
247 &s3c_device_usb, 248 &s3c_device_usb,
248 &s3c_device_lcd, 249 &s3c_device_lcd,
249 &s3c_device_wdt, 250 &s3c_device_wdt,
250 &s3c_device_i2c, 251 &s3c_device_i2c0,
251 &s3c_device_iis, 252 &s3c_device_iis,
252 &s3c_device_sdi, 253 &s3c_device_sdi,
253 &s3c_device_usbgadget, 254 &s3c_device_usbgadget,
@@ -349,6 +350,7 @@ static void __init qt2410_machine_init(void)
349 s3c2410_gpio_setpin(S3C2410_GPB0, 1); 350 s3c2410_gpio_setpin(S3C2410_GPB0, 1);
350 351
351 s3c24xx_udc_set_platdata(&qt2410_udc_cfg); 352 s3c24xx_udc_set_platdata(&qt2410_udc_cfg);
353 s3c_i2c0_set_platdata(NULL);
352 354
353 s3c2410_gpio_cfgpin(S3C2410_GPB5, S3C2410_GPIO_OUTPUT); 355 s3c2410_gpio_cfgpin(S3C2410_GPB5, S3C2410_GPIO_OUTPUT);
354 356
diff --git a/arch/arm/mach-s3c2410/mach-smdk2410.c b/arch/arm/mach-s3c2410/mach-smdk2410.c
index 152527bb2872..c49126ccb1d5 100644
--- a/arch/arm/mach-s3c2410/mach-smdk2410.c
+++ b/arch/arm/mach-s3c2410/mach-smdk2410.c
@@ -47,6 +47,7 @@
47#include <asm/mach-types.h> 47#include <asm/mach-types.h>
48 48
49#include <plat/regs-serial.h> 49#include <plat/regs-serial.h>
50#include <plat/iic.h>
50 51
51#include <plat/devs.h> 52#include <plat/devs.h>
52#include <plat/cpu.h> 53#include <plat/cpu.h>
@@ -89,7 +90,7 @@ static struct platform_device *smdk2410_devices[] __initdata = {
89 &s3c_device_usb, 90 &s3c_device_usb,
90 &s3c_device_lcd, 91 &s3c_device_lcd,
91 &s3c_device_wdt, 92 &s3c_device_wdt,
92 &s3c_device_i2c, 93 &s3c_device_i2c0,
93 &s3c_device_iis, 94 &s3c_device_iis,
94}; 95};
95 96
@@ -102,6 +103,7 @@ static void __init smdk2410_map_io(void)
102 103
103static void __init smdk2410_init(void) 104static void __init smdk2410_init(void)
104{ 105{
106 s3c_i2c0_set_platdata(NULL);
105 platform_add_devices(smdk2410_devices, ARRAY_SIZE(smdk2410_devices)); 107 platform_add_devices(smdk2410_devices, ARRAY_SIZE(smdk2410_devices));
106 smdk_machine_init(); 108 smdk_machine_init();
107} 109}
diff --git a/arch/arm/mach-s3c2410/mach-tct_hammer.c b/arch/arm/mach-s3c2410/mach-tct_hammer.c
index 309dcf4c870a..8fdb0430bd48 100644
--- a/arch/arm/mach-s3c2410/mach-tct_hammer.c
+++ b/arch/arm/mach-s3c2410/mach-tct_hammer.c
@@ -45,6 +45,7 @@
45#include <asm/mach-types.h> 45#include <asm/mach-types.h>
46 46
47#include <plat/regs-serial.h> 47#include <plat/regs-serial.h>
48#include <plat/iic.h>
48#include <plat/devs.h> 49#include <plat/devs.h>
49#include <plat/cpu.h> 50#include <plat/cpu.h>
50 51
@@ -127,7 +128,7 @@ static struct s3c2410_uartcfg tct_hammer_uartcfgs[] = {
127static struct platform_device *tct_hammer_devices[] __initdata = { 128static struct platform_device *tct_hammer_devices[] __initdata = {
128 &s3c_device_adc, 129 &s3c_device_adc,
129 &s3c_device_wdt, 130 &s3c_device_wdt,
130 &s3c_device_i2c, 131 &s3c_device_i2c0,
131 &s3c_device_usb, 132 &s3c_device_usb,
132 &s3c_device_rtc, 133 &s3c_device_rtc,
133 &s3c_device_usbgadget, 134 &s3c_device_usbgadget,
@@ -146,6 +147,7 @@ static void __init tct_hammer_map_io(void)
146 147
147static void __init tct_hammer_init(void) 148static void __init tct_hammer_init(void)
148{ 149{
150 s3c_i2c0_set_platdata(NULL);
149 platform_add_devices(tct_hammer_devices, ARRAY_SIZE(tct_hammer_devices)); 151 platform_add_devices(tct_hammer_devices, ARRAY_SIZE(tct_hammer_devices));
150} 152}
151 153
diff --git a/arch/arm/mach-s3c2410/mach-vr1000.c b/arch/arm/mach-s3c2410/mach-vr1000.c
index 941353af16dc..61a1ea9c5c5c 100644
--- a/arch/arm/mach-s3c2410/mach-vr1000.c
+++ b/arch/arm/mach-s3c2410/mach-vr1000.c
@@ -47,6 +47,7 @@
47#include <plat/clock.h> 47#include <plat/clock.h>
48#include <plat/devs.h> 48#include <plat/devs.h>
49#include <plat/cpu.h> 49#include <plat/cpu.h>
50#include <plat/iic.h>
50 51
51#include "usb-simtec.h" 52#include "usb-simtec.h"
52#include "nor-simtec.h" 53#include "nor-simtec.h"
@@ -334,7 +335,7 @@ static struct platform_device *vr1000_devices[] __initdata = {
334 &s3c_device_usb, 335 &s3c_device_usb,
335 &s3c_device_lcd, 336 &s3c_device_lcd,
336 &s3c_device_wdt, 337 &s3c_device_wdt,
337 &s3c_device_i2c, 338 &s3c_device_i2c0,
338 &s3c_device_adc, 339 &s3c_device_adc,
339 &serial_device, 340 &serial_device,
340 &vr1000_dm9k0, 341 &vr1000_dm9k0,
@@ -384,6 +385,7 @@ static void __init vr1000_map_io(void)
384 385
385static void __init vr1000_init(void) 386static void __init vr1000_init(void)
386{ 387{
388 s3c_i2c0_set_platdata(NULL);
387 platform_add_devices(vr1000_devices, ARRAY_SIZE(vr1000_devices)); 389 platform_add_devices(vr1000_devices, ARRAY_SIZE(vr1000_devices));
388 390
389 i2c_register_board_info(0, vr1000_i2c_devs, 391 i2c_register_board_info(0, vr1000_i2c_devs,
diff --git a/arch/arm/mach-s3c2412/mach-jive.c b/arch/arm/mach-s3c2412/mach-jive.c
index 25ff1ec9f8ad..e08a0f06224e 100644
--- a/arch/arm/mach-s3c2412/mach-jive.c
+++ b/arch/arm/mach-s3c2412/mach-jive.c
@@ -53,6 +53,7 @@
53#include <plat/cpu.h> 53#include <plat/cpu.h>
54#include <plat/pm.h> 54#include <plat/pm.h>
55#include <plat/udc.h> 55#include <plat/udc.h>
56#include <plat/iic.h>
56 57
57static struct map_desc jive_iodesc[] __initdata = { 58static struct map_desc jive_iodesc[] __initdata = {
58}; 59};
@@ -450,14 +451,14 @@ static struct spi_board_info __initdata jive_spi_devs[] = {
450 451
451/* I2C bus and device configuration. */ 452/* I2C bus and device configuration. */
452 453
453static struct s3c2410_platform_i2c jive_i2c_cfg = { 454static struct s3c2410_platform_i2c jive_i2c_cfg __initdata = {
454 .max_freq = 80 * 1000, 455 .max_freq = 80 * 1000,
455 .bus_freq = 50 * 1000, 456 .bus_freq = 50 * 1000,
456 .flags = S3C_IICFLG_FILTER, 457 .flags = S3C_IICFLG_FILTER,
457 .sda_delay = 2, 458 .sda_delay = 2,
458}; 459};
459 460
460static struct i2c_board_info jive_i2c_devs[] = { 461static struct i2c_board_info jive_i2c_devs[] __initdata = {
461 [0] = { 462 [0] = {
462 I2C_BOARD_INFO("lis302dl", 0x1c), 463 I2C_BOARD_INFO("lis302dl", 0x1c),
463 .irq = IRQ_EINT14, 464 .irq = IRQ_EINT14,
@@ -470,7 +471,7 @@ static struct platform_device *jive_devices[] __initdata = {
470 &s3c_device_usb, 471 &s3c_device_usb,
471 &s3c_device_rtc, 472 &s3c_device_rtc,
472 &s3c_device_wdt, 473 &s3c_device_wdt,
473 &s3c_device_i2c, 474 &s3c_device_i2c0,
474 &s3c_device_lcd, 475 &s3c_device_lcd,
475 &jive_device_lcdspi, 476 &jive_device_lcdspi,
476 &jive_device_wm8750, 477 &jive_device_wm8750,
@@ -663,7 +664,7 @@ static void __init jive_machine_init(void)
663 664
664 spi_register_board_info(jive_spi_devs, ARRAY_SIZE(jive_spi_devs)); 665 spi_register_board_info(jive_spi_devs, ARRAY_SIZE(jive_spi_devs));
665 666
666 s3c_device_i2c.dev.platform_data = &jive_i2c_cfg; 667 s3c_i2c0_set_platdata(&jive_i2c_cfg);
667 i2c_register_board_info(0, jive_i2c_devs, ARRAY_SIZE(jive_i2c_devs)); 668 i2c_register_board_info(0, jive_i2c_devs, ARRAY_SIZE(jive_i2c_devs));
668 669
669 pm_power_off = jive_power_off; 670 pm_power_off = jive_power_off;
diff --git a/arch/arm/mach-s3c2412/mach-smdk2413.c b/arch/arm/mach-s3c2412/mach-smdk2413.c
index 8fd17b8d5679..eba66aa6bd20 100644
--- a/arch/arm/mach-s3c2412/mach-smdk2413.c
+++ b/arch/arm/mach-s3c2412/mach-smdk2413.c
@@ -38,6 +38,7 @@
38 38
39#include <mach/idle.h> 39#include <mach/idle.h>
40#include <plat/udc.h> 40#include <plat/udc.h>
41#include <plat/iic.h>
41#include <mach/fb.h> 42#include <mach/fb.h>
42 43
43#include <plat/s3c2410.h> 44#include <plat/s3c2410.h>
@@ -105,7 +106,7 @@ static struct platform_device *smdk2413_devices[] __initdata = {
105 &s3c_device_usb, 106 &s3c_device_usb,
106 //&s3c_device_lcd, 107 //&s3c_device_lcd,
107 &s3c_device_wdt, 108 &s3c_device_wdt,
108 &s3c_device_i2c, 109 &s3c_device_i2c0,
109 &s3c_device_iis, 110 &s3c_device_iis,
110 &s3c_device_usbgadget, 111 &s3c_device_usbgadget,
111}; 112};
@@ -142,6 +143,7 @@ static void __init smdk2413_machine_init(void)
142 143
143 144
144 s3c24xx_udc_set_platdata(&smdk2413_udc_cfg); 145 s3c24xx_udc_set_platdata(&smdk2413_udc_cfg);
146 s3c_i2c0_set_platdata(NULL);
145 147
146 platform_add_devices(smdk2413_devices, ARRAY_SIZE(smdk2413_devices)); 148 platform_add_devices(smdk2413_devices, ARRAY_SIZE(smdk2413_devices));
147 smdk_machine_init(); 149 smdk_machine_init();
diff --git a/arch/arm/mach-s3c2412/mach-vstms.c b/arch/arm/mach-s3c2412/mach-vstms.c
index da32a6cb17ae..11e8ad49fc7b 100644
--- a/arch/arm/mach-s3c2412/mach-vstms.c
+++ b/arch/arm/mach-s3c2412/mach-vstms.c
@@ -39,6 +39,7 @@
39#include <mach/idle.h> 39#include <mach/idle.h>
40#include <mach/fb.h> 40#include <mach/fb.h>
41 41
42#include <plat/iic.h>
42#include <plat/nand.h> 43#include <plat/nand.h>
43 44
44#include <plat/s3c2410.h> 45#include <plat/s3c2410.h>
@@ -122,7 +123,7 @@ static struct s3c2410_platform_nand vstms_nand_info = {
122static struct platform_device *vstms_devices[] __initdata = { 123static struct platform_device *vstms_devices[] __initdata = {
123 &s3c_device_usb, 124 &s3c_device_usb,
124 &s3c_device_wdt, 125 &s3c_device_wdt,
125 &s3c_device_i2c, 126 &s3c_device_i2c0,
126 &s3c_device_iis, 127 &s3c_device_iis,
127 &s3c_device_rtc, 128 &s3c_device_rtc,
128 &s3c_device_nand, 129 &s3c_device_nand,
@@ -151,6 +152,7 @@ static void __init vstms_map_io(void)
151 152
152static void __init vstms_init(void) 153static void __init vstms_init(void)
153{ 154{
155 s3c_i2c0_set_platdata(NULL);
154 platform_add_devices(vstms_devices, ARRAY_SIZE(vstms_devices)); 156 platform_add_devices(vstms_devices, ARRAY_SIZE(vstms_devices));
155} 157}
156 158
diff --git a/arch/arm/mach-s3c2440/mach-anubis.c b/arch/arm/mach-s3c2440/mach-anubis.c
index 334379bdfc6e..a9bbc41c4568 100644
--- a/arch/arm/mach-s3c2440/mach-anubis.c
+++ b/arch/arm/mach-s3c2440/mach-anubis.c
@@ -40,6 +40,7 @@
40#include <mach/regs-mem.h> 40#include <mach/regs-mem.h>
41#include <mach/regs-lcd.h> 41#include <mach/regs-lcd.h>
42#include <plat/nand.h> 42#include <plat/nand.h>
43#include <plat/iic.h>
43 44
44#include <linux/mtd/mtd.h> 45#include <linux/mtd/mtd.h>
45#include <linux/mtd/nand.h> 46#include <linux/mtd/nand.h>
@@ -404,7 +405,7 @@ static struct platform_device *anubis_devices[] __initdata = {
404 &s3c_device_usb, 405 &s3c_device_usb,
405 &s3c_device_wdt, 406 &s3c_device_wdt,
406 &s3c_device_adc, 407 &s3c_device_adc,
407 &s3c_device_i2c, 408 &s3c_device_i2c0,
408 &s3c_device_rtc, 409 &s3c_device_rtc,
409 &s3c_device_nand, 410 &s3c_device_nand,
410 &anubis_device_ide0, 411 &anubis_device_ide0,
@@ -468,6 +469,7 @@ static void __init anubis_map_io(void)
468 469
469static void __init anubis_init(void) 470static void __init anubis_init(void)
470{ 471{
472 s3c_i2c0_set_platdata(NULL);
471 platform_add_devices(anubis_devices, ARRAY_SIZE(anubis_devices)); 473 platform_add_devices(anubis_devices, ARRAY_SIZE(anubis_devices));
472 474
473 i2c_register_board_info(0, anubis_i2c_devs, 475 i2c_register_board_info(0, anubis_i2c_devs,
diff --git a/arch/arm/mach-s3c2440/mach-at2440evb.c b/arch/arm/mach-s3c2440/mach-at2440evb.c
index 07b42a0207d1..55e07ae5ab8c 100644
--- a/arch/arm/mach-s3c2440/mach-at2440evb.c
+++ b/arch/arm/mach-s3c2440/mach-at2440evb.c
@@ -36,6 +36,7 @@
36#include <mach/regs-mem.h> 36#include <mach/regs-mem.h>
37#include <mach/regs-lcd.h> 37#include <mach/regs-lcd.h>
38#include <plat/nand.h> 38#include <plat/nand.h>
39#include <plat/iic.h>
39 40
40#include <linux/mtd/mtd.h> 41#include <linux/mtd/mtd.h>
41#include <linux/mtd/nand.h> 42#include <linux/mtd/nand.h>
@@ -166,7 +167,7 @@ static struct platform_device *at2440evb_devices[] __initdata = {
166 &s3c_device_usb, 167 &s3c_device_usb,
167 &s3c_device_wdt, 168 &s3c_device_wdt,
168 &s3c_device_adc, 169 &s3c_device_adc,
169 &s3c_device_i2c, 170 &s3c_device_i2c0,
170 &s3c_device_rtc, 171 &s3c_device_rtc,
171 &s3c_device_nand, 172 &s3c_device_nand,
172 &at2440evb_device_eth, 173 &at2440evb_device_eth,
@@ -183,6 +184,7 @@ static void __init at2440evb_map_io(void)
183 184
184static void __init at2440evb_init(void) 185static void __init at2440evb_init(void)
185{ 186{
187 s3c_i2c0_set_platdata(NULL);
186 platform_add_devices(at2440evb_devices, ARRAY_SIZE(at2440evb_devices)); 188 platform_add_devices(at2440evb_devices, ARRAY_SIZE(at2440evb_devices));
187} 189}
188 190
diff --git a/arch/arm/mach-s3c2440/mach-nexcoder.c b/arch/arm/mach-s3c2440/mach-nexcoder.c
index a546307fd53d..7aeaa972d7f5 100644
--- a/arch/arm/mach-s3c2440/mach-nexcoder.c
+++ b/arch/arm/mach-s3c2440/mach-nexcoder.c
@@ -37,6 +37,7 @@
37//#include <asm/debug-ll.h> 37//#include <asm/debug-ll.h>
38#include <mach/regs-gpio.h> 38#include <mach/regs-gpio.h>
39#include <plat/regs-serial.h> 39#include <plat/regs-serial.h>
40#include <plat/iic.h>
40 41
41#include <plat/s3c2410.h> 42#include <plat/s3c2410.h>
42#include <plat/s3c2440.h> 43#include <plat/s3c2440.h>
@@ -107,7 +108,7 @@ static struct platform_device *nexcoder_devices[] __initdata = {
107 &s3c_device_usb, 108 &s3c_device_usb,
108 &s3c_device_lcd, 109 &s3c_device_lcd,
109 &s3c_device_wdt, 110 &s3c_device_wdt,
110 &s3c_device_i2c, 111 &s3c_device_i2c0,
111 &s3c_device_iis, 112 &s3c_device_iis,
112 &s3c_device_rtc, 113 &s3c_device_rtc,
113 &s3c_device_camif, 114 &s3c_device_camif,
@@ -142,6 +143,7 @@ static void __init nexcoder_map_io(void)
142 143
143static void __init nexcoder_init(void) 144static void __init nexcoder_init(void)
144{ 145{
146 s3c_i2c0_set_platdata(NULL);
145 platform_add_devices(nexcoder_devices, ARRAY_SIZE(nexcoder_devices)); 147 platform_add_devices(nexcoder_devices, ARRAY_SIZE(nexcoder_devices));
146}; 148};
147 149
diff --git a/arch/arm/mach-s3c2440/mach-osiris.c b/arch/arm/mach-s3c2440/mach-osiris.c
index 884a3c7ae75f..41a00f57e5da 100644
--- a/arch/arm/mach-s3c2440/mach-osiris.c
+++ b/arch/arm/mach-s3c2440/mach-osiris.c
@@ -38,6 +38,7 @@
38#include <mach/regs-mem.h> 38#include <mach/regs-mem.h>
39#include <mach/regs-lcd.h> 39#include <mach/regs-lcd.h>
40#include <plat/nand.h> 40#include <plat/nand.h>
41#include <plat/iic.h>
41 42
42#include <linux/mtd/mtd.h> 43#include <linux/mtd/mtd.h>
43#include <linux/mtd/nand.h> 44#include <linux/mtd/nand.h>
@@ -335,7 +336,7 @@ static struct i2c_board_info osiris_i2c_devs[] __initdata = {
335/* Standard Osiris devices */ 336/* Standard Osiris devices */
336 337
337static struct platform_device *osiris_devices[] __initdata = { 338static struct platform_device *osiris_devices[] __initdata = {
338 &s3c_device_i2c, 339 &s3c_device_i2c0,
339 &s3c_device_wdt, 340 &s3c_device_wdt,
340 &s3c_device_nand, 341 &s3c_device_nand,
341 &osiris_pcmcia, 342 &osiris_pcmcia,
@@ -398,6 +399,8 @@ static void __init osiris_init(void)
398 sysdev_class_register(&osiris_pm_sysclass); 399 sysdev_class_register(&osiris_pm_sysclass);
399 sysdev_register(&osiris_pm_sysdev); 400 sysdev_register(&osiris_pm_sysdev);
400 401
402 s3c_i2c0_set_platdata(NULL);
403
401 i2c_register_board_info(0, osiris_i2c_devs, 404 i2c_register_board_info(0, osiris_i2c_devs,
402 ARRAY_SIZE(osiris_i2c_devs)); 405 ARRAY_SIZE(osiris_i2c_devs));
403 406
diff --git a/arch/arm/mach-s3c2440/mach-rx3715.c b/arch/arm/mach-s3c2440/mach-rx3715.c
index fbd081de592f..12d378f84ad2 100644
--- a/arch/arm/mach-s3c2440/mach-rx3715.c
+++ b/arch/arm/mach-s3c2440/mach-rx3715.c
@@ -179,7 +179,7 @@ static struct platform_device *rx3715_devices[] __initdata = {
179 &s3c_device_usb, 179 &s3c_device_usb,
180 &s3c_device_lcd, 180 &s3c_device_lcd,
181 &s3c_device_wdt, 181 &s3c_device_wdt,
182 &s3c_device_i2c, 182 &s3c_device_i2c0,
183 &s3c_device_iis, 183 &s3c_device_iis,
184 &s3c_device_nand, 184 &s3c_device_nand,
185}; 185};
diff --git a/arch/arm/mach-s3c2440/mach-smdk2440.c b/arch/arm/mach-s3c2440/mach-smdk2440.c
index fefeaaa4155f..db6eafbd4d90 100644
--- a/arch/arm/mach-s3c2440/mach-smdk2440.c
+++ b/arch/arm/mach-s3c2440/mach-smdk2440.c
@@ -37,6 +37,7 @@
37 37
38#include <mach/idle.h> 38#include <mach/idle.h>
39#include <mach/fb.h> 39#include <mach/fb.h>
40#include <plat/iic.h>
40 41
41#include <plat/s3c2410.h> 42#include <plat/s3c2410.h>
42#include <plat/s3c2440.h> 43#include <plat/s3c2440.h>
@@ -152,7 +153,7 @@ static struct platform_device *smdk2440_devices[] __initdata = {
152 &s3c_device_usb, 153 &s3c_device_usb,
153 &s3c_device_lcd, 154 &s3c_device_lcd,
154 &s3c_device_wdt, 155 &s3c_device_wdt,
155 &s3c_device_i2c, 156 &s3c_device_i2c0,
156 &s3c_device_iis, 157 &s3c_device_iis,
157}; 158};
158 159
@@ -166,6 +167,7 @@ static void __init smdk2440_map_io(void)
166static void __init smdk2440_machine_init(void) 167static void __init smdk2440_machine_init(void)
167{ 168{
168 s3c24xx_fb_set_platdata(&smdk2440_fb_info); 169 s3c24xx_fb_set_platdata(&smdk2440_fb_info);
170 s3c_i2c0_set_platdata(NULL);
169 171
170 platform_add_devices(smdk2440_devices, ARRAY_SIZE(smdk2440_devices)); 172 platform_add_devices(smdk2440_devices, ARRAY_SIZE(smdk2440_devices));
171 smdk_machine_init(); 173 smdk_machine_init();
diff --git a/arch/arm/mach-s3c2443/mach-smdk2443.c b/arch/arm/mach-s3c2443/mach-smdk2443.c
index 815a3bd1d37b..039a46243105 100644
--- a/arch/arm/mach-s3c2443/mach-smdk2443.c
+++ b/arch/arm/mach-s3c2443/mach-smdk2443.c
@@ -37,6 +37,7 @@
37 37
38#include <mach/idle.h> 38#include <mach/idle.h>
39#include <mach/fb.h> 39#include <mach/fb.h>
40#include <plat/iic.h>
40 41
41#include <plat/s3c2410.h> 42#include <plat/s3c2410.h>
42#include <plat/s3c2440.h> 43#include <plat/s3c2440.h>
@@ -103,7 +104,7 @@ static struct s3c2410_uartcfg smdk2443_uartcfgs[] __initdata = {
103 104
104static struct platform_device *smdk2443_devices[] __initdata = { 105static struct platform_device *smdk2443_devices[] __initdata = {
105 &s3c_device_wdt, 106 &s3c_device_wdt,
106 &s3c_device_i2c, 107 &s3c_device_i2c0,
107 &s3c_device_hsmmc0, 108 &s3c_device_hsmmc0,
108}; 109};
109 110
@@ -116,6 +117,7 @@ static void __init smdk2443_map_io(void)
116 117
117static void __init smdk2443_machine_init(void) 118static void __init smdk2443_machine_init(void)
118{ 119{
120 s3c_i2c0_set_platdata(NULL);
119 platform_add_devices(smdk2443_devices, ARRAY_SIZE(smdk2443_devices)); 121 platform_add_devices(smdk2443_devices, ARRAY_SIZE(smdk2443_devices));
120 smdk_machine_init(); 122 smdk_machine_init();
121} 123}
diff --git a/arch/arm/mach-s3c24a0/include/mach/map.h b/arch/arm/mach-s3c24a0/include/mach/map.h
index 6667355a47a1..a01132717e34 100644
--- a/arch/arm/mach-s3c24a0/include/mach/map.h
+++ b/arch/arm/mach-s3c24a0/include/mach/map.h
@@ -71,7 +71,6 @@
71#define S3C24XX_PA_TIMER S3C24A0_PA_TIMER 71#define S3C24XX_PA_TIMER S3C24A0_PA_TIMER
72#define S3C24XX_PA_USBDEV S3C24A0_PA_USBDEV 72#define S3C24XX_PA_USBDEV S3C24A0_PA_USBDEV
73#define S3C24XX_PA_WATCHDOG S3C24A0_PA_WATCHDOG 73#define S3C24XX_PA_WATCHDOG S3C24A0_PA_WATCHDOG
74#define S3C24XX_PA_IIC S3C24A0_PA_IIC
75#define S3C24XX_PA_IIS S3C24A0_PA_IIS 74#define S3C24XX_PA_IIS S3C24A0_PA_IIS
76#define S3C24XX_PA_GPIO S3C24A0_PA_GPIO 75#define S3C24XX_PA_GPIO S3C24A0_PA_GPIO
77#define S3C24XX_PA_RTC S3C24A0_PA_RTC 76#define S3C24XX_PA_RTC S3C24A0_PA_RTC
@@ -81,5 +80,6 @@
81#define S3C24XX_PA_NAND S3C24A0_PA_NAND 80#define S3C24XX_PA_NAND S3C24A0_PA_NAND
82 81
83#define S3C_PA_UART S3C24A0_PA_UART 82#define S3C_PA_UART S3C24A0_PA_UART
83#define S3C_PA_IIC S3C24A0_PA_IIC
84 84
85#endif /* __ASM_ARCH_24A0_MAP_H */ 85#endif /* __ASM_ARCH_24A0_MAP_H */
diff --git a/arch/arm/mach-s3c6400/include/mach/map.h b/arch/arm/mach-s3c6400/include/mach/map.h
index aadaaaf2d8b6..f0d6fa616b6c 100644
--- a/arch/arm/mach-s3c6400/include/mach/map.h
+++ b/arch/arm/mach-s3c6400/include/mach/map.h
@@ -40,6 +40,7 @@
40 40
41#define S3C64XX_PA_SYSCON (0x7E00F000) 41#define S3C64XX_PA_SYSCON (0x7E00F000)
42#define S3C64XX_PA_TIMER (0x7F006000) 42#define S3C64XX_PA_TIMER (0x7F006000)
43#define S3C64XX_PA_IIC0 (0x7F004000)
43 44
44#define S3C64XX_PA_GPIO (0x7F008000) 45#define S3C64XX_PA_GPIO (0x7F008000)
45#define S3C64XX_VA_GPIO S3C_ADDR(0x00500000) 46#define S3C64XX_VA_GPIO S3C_ADDR(0x00500000)
@@ -58,5 +59,6 @@
58#define S3C_PA_HSMMC0 S3C64XX_PA_HSMMC0 59#define S3C_PA_HSMMC0 S3C64XX_PA_HSMMC0
59#define S3C_PA_HSMMC1 S3C64XX_PA_HSMMC1 60#define S3C_PA_HSMMC1 S3C64XX_PA_HSMMC1
60#define S3C_PA_HSMMC2 S3C64XX_PA_HSMMC2 61#define S3C_PA_HSMMC2 S3C64XX_PA_HSMMC2
62#define S3C_PA_IIC S3C64XX_PA_IIC0
61 63
62#endif /* __ASM_ARCH_6400_MAP_H */ 64#endif /* __ASM_ARCH_6400_MAP_H */
diff --git a/arch/arm/plat-s3c/Makefile b/arch/arm/plat-s3c/Makefile
index 3f6544a95fe8..187fa95b87d5 100644
--- a/arch/arm/plat-s3c/Makefile
+++ b/arch/arm/plat-s3c/Makefile
@@ -22,3 +22,4 @@ obj-y += gpio-config.o
22 22
23obj-$(CONFIG_S3C_DEV_HSMMC) += dev-hsmmc.o 23obj-$(CONFIG_S3C_DEV_HSMMC) += dev-hsmmc.o
24obj-$(CONFIG_S3C_DEV_HSMMC1) += dev-hsmmc1.o 24obj-$(CONFIG_S3C_DEV_HSMMC1) += dev-hsmmc1.o
25obj-y += dev-i2c0.o
diff --git a/arch/arm/plat-s3c/dev-i2c0.c b/arch/arm/plat-s3c/dev-i2c0.c
new file mode 100644
index 000000000000..21870fd2ec98
--- /dev/null
+++ b/arch/arm/plat-s3c/dev-i2c0.c
@@ -0,0 +1,67 @@
1/* linux/arch/arm/plat-s3c/dev-i2c0.c
2 *
3 * Copyright 2008 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 * http://armlinux.simtec.co.uk/
6 *
7 * S3C series device definition for i2c device 0
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12*/
13
14#include <linux/kernel.h>
15#include <linux/string.h>
16#include <linux/platform_device.h>
17
18#include <mach/map.h>
19
20#include <plat/regs-iic.h>
21#include <plat/iic.h>
22#include <plat/devs.h>
23#include <plat/cpu.h>
24
25static struct resource s3c_i2c_resource[] = {
26 [0] = {
27 .start = S3C_PA_IIC,
28 .end = S3C_PA_IIC + SZ_4K - 1,
29 .flags = IORESOURCE_MEM,
30 },
31 [1] = {
32 .start = IRQ_IIC,
33 .end = IRQ_IIC,
34 .flags = IORESOURCE_IRQ,
35 },
36};
37
38struct platform_device s3c_device_i2c0 = {
39 .name = "s3c2410-i2c",
40 .id = -1,
41 .num_resources = ARRAY_SIZE(s3c_i2c_resource),
42 .resource = s3c_i2c_resource,
43};
44
45struct s3c2410_platform_i2c default_i2c_data __initdata = {
46 .flags = 0,
47 .slave_addr = 0x10,
48 .bus_freq = 100*1000,
49 .max_freq = 400*1000,
50 .sda_delay = S3C2410_IICLC_SDA_DELAY5 | S3C2410_IICLC_FILTER_ON,
51};
52
53void __init s3c_i2c0_set_platdata(struct s3c2410_platform_i2c *pd)
54{
55 struct s3c2410_platform_i2c *npd;
56
57 if (!pd)
58 pd = &default_i2c_data;
59
60 npd = kmemdup(pd, sizeof(struct s3c2410_platform_i2c), GFP_KERNEL);
61 if (!npd)
62 printk(KERN_ERR "%s: no memory for platform data\n", __func__);
63 else if (!npd->cfg_gpio)
64 npd->cfg_gpio = s3c_i2c0_cfg_gpio;
65
66 s3c_device_i2c0.dev.platform_data = npd;
67}
diff --git a/arch/arm/plat-s3c/include/plat/devs.h b/arch/arm/plat-s3c/include/plat/devs.h
index f173863b8cc7..d9e0c543ebd6 100644
--- a/arch/arm/plat-s3c/include/plat/devs.h
+++ b/arch/arm/plat-s3c/include/plat/devs.h
@@ -27,7 +27,7 @@ extern struct platform_device s3c_device_timer[];
27extern struct platform_device s3c_device_usb; 27extern struct platform_device s3c_device_usb;
28extern struct platform_device s3c_device_lcd; 28extern struct platform_device s3c_device_lcd;
29extern struct platform_device s3c_device_wdt; 29extern struct platform_device s3c_device_wdt;
30extern struct platform_device s3c_device_i2c; 30extern struct platform_device s3c_device_i2c0;
31extern struct platform_device s3c_device_iis; 31extern struct platform_device s3c_device_iis;
32extern struct platform_device s3c_device_rtc; 32extern struct platform_device s3c_device_rtc;
33extern struct platform_device s3c_device_adc; 33extern struct platform_device s3c_device_adc;
diff --git a/arch/arm/plat-s3c/include/plat/iic.h b/arch/arm/plat-s3c/include/plat/iic.h
index 5106acaa1d0e..5073b1e74ee8 100644
--- a/arch/arm/plat-s3c/include/plat/iic.h
+++ b/arch/arm/plat-s3c/include/plat/iic.h
@@ -28,6 +28,28 @@ struct s3c2410_platform_i2c {
28 unsigned long max_freq; /* max frequency for the bus */ 28 unsigned long max_freq; /* max frequency for the bus */
29 unsigned long min_freq; /* min frequency for the bus */ 29 unsigned long min_freq; /* min frequency for the bus */
30 unsigned int sda_delay; /* pclks (s3c2440 only) */ 30 unsigned int sda_delay; /* pclks (s3c2440 only) */
31
32 void (*cfg_gpio)(struct platform_device *dev);
31}; 33};
32 34
35/**
36 * s3c_i2c0_set_platdata - set platform data for i2c0 device
37 * @i2c: The platform data to set, or NULL for default data.
38 *
39 * Register the given platform data for use with the i2c0 device. This
40 * call copies the platform data, so the caller can use __initdata for
41 * their copy.
42 *
43 * This call will set cfg_gpio if is null to the default platform
44 * implementation.
45 *
46 * Any user of s3c_device_i2c0 should call this, even if it is with
47 * NULL to ensure that the device is given the default platform data
48 * as the driver will no longer carry defaults.
49 */
50extern void s3c_i2c0_set_platdata(struct s3c2410_platform_i2c *i2c);
51
52/* defined by architecture to configure gpio */
53extern void s3c_i2c0_cfg_gpio(struct platform_device *dev);
54
33#endif /* __ASM_ARCH_IIC_H */ 55#endif /* __ASM_ARCH_IIC_H */
diff --git a/arch/arm/plat-s3c24xx/Makefile b/arch/arm/plat-s3c24xx/Makefile
index 2a65ba7eb34d..763d3444048b 100644
--- a/arch/arm/plat-s3c24xx/Makefile
+++ b/arch/arm/plat-s3c24xx/Makefile
@@ -32,6 +32,9 @@ obj-$(CONFIG_HAVE_PWM) += pwm.o
32obj-$(CONFIG_S3C2410_CLOCK) += s3c2410-clock.o 32obj-$(CONFIG_S3C2410_CLOCK) += s3c2410-clock.o
33obj-$(CONFIG_S3C2410_DMA) += dma.o 33obj-$(CONFIG_S3C2410_DMA) += dma.o
34 34
35# device specific setup and/or initialisation
36obj-$(CONFIG_ARCH_S3C2410) += setup-i2c.o
37
35# SPI gpio central GPIO functions 38# SPI gpio central GPIO functions
36 39
37obj-$(CONFIG_S3C24XX_SPI_BUS0_GPE11_GPE12_GPE13) += spi-bus0-gpe11_12_13.o 40obj-$(CONFIG_S3C24XX_SPI_BUS0_GPE11_GPE12_GPE13) += spi-bus0-gpe11_12_13.o
diff --git a/arch/arm/plat-s3c24xx/devs.c b/arch/arm/plat-s3c24xx/devs.c
index 3a2fcd94791e..3cb07b6a0e4c 100644
--- a/arch/arm/plat-s3c24xx/devs.c
+++ b/arch/arm/plat-s3c24xx/devs.c
@@ -271,31 +271,6 @@ struct platform_device s3c_device_wdt = {
271 271
272EXPORT_SYMBOL(s3c_device_wdt); 272EXPORT_SYMBOL(s3c_device_wdt);
273 273
274/* I2C */
275
276static struct resource s3c_i2c_resource[] = {
277 [0] = {
278 .start = S3C24XX_PA_IIC,
279 .end = S3C24XX_PA_IIC + S3C24XX_SZ_IIC - 1,
280 .flags = IORESOURCE_MEM,
281 },
282 [1] = {
283 .start = IRQ_IIC,
284 .end = IRQ_IIC,
285 .flags = IORESOURCE_IRQ,
286 }
287
288};
289
290struct platform_device s3c_device_i2c = {
291 .name = "s3c2410-i2c",
292 .id = -1,
293 .num_resources = ARRAY_SIZE(s3c_i2c_resource),
294 .resource = s3c_i2c_resource,
295};
296
297EXPORT_SYMBOL(s3c_device_i2c);
298
299/* IIS */ 274/* IIS */
300 275
301static struct resource s3c_iis_resource[] = { 276static struct resource s3c_iis_resource[] = {
diff --git a/arch/arm/plat-s3c24xx/include/plat/map.h b/arch/arm/plat-s3c24xx/include/plat/map.h
index e7be0c0d3702..fef8ea8b8e1e 100644
--- a/arch/arm/plat-s3c24xx/include/plat/map.h
+++ b/arch/arm/plat-s3c24xx/include/plat/map.h
@@ -51,7 +51,6 @@
51 51
52/* Standard size definitions for peripheral blocks. */ 52/* Standard size definitions for peripheral blocks. */
53 53
54#define S3C24XX_SZ_IIC SZ_1M
55#define S3C24XX_SZ_IIS SZ_1M 54#define S3C24XX_SZ_IIS SZ_1M
56#define S3C24XX_SZ_ADC SZ_1M 55#define S3C24XX_SZ_ADC SZ_1M
57#define S3C24XX_SZ_SPI SZ_1M 56#define S3C24XX_SZ_SPI SZ_1M
diff --git a/arch/arm/plat-s3c24xx/s3c244x.c b/arch/arm/plat-s3c24xx/s3c244x.c
index 494368403055..c1de6bb0101b 100644
--- a/arch/arm/plat-s3c24xx/s3c244x.c
+++ b/arch/arm/plat-s3c24xx/s3c244x.c
@@ -68,7 +68,7 @@ void __init s3c244x_map_io(void)
68 /* rename any peripherals used differing from the s3c2410 */ 68 /* rename any peripherals used differing from the s3c2410 */
69 69
70 s3c_device_sdi.name = "s3c2440-sdi"; 70 s3c_device_sdi.name = "s3c2440-sdi";
71 s3c_device_i2c.name = "s3c2440-i2c"; 71 s3c_device_i2c0.name = "s3c2440-i2c";
72 s3c_device_nand.name = "s3c2440-nand"; 72 s3c_device_nand.name = "s3c2440-nand";
73 s3c_device_usbgadget.name = "s3c2440-usbgadget"; 73 s3c_device_usbgadget.name = "s3c2440-usbgadget";
74} 74}
diff --git a/arch/arm/plat-s3c24xx/setup-i2c.c b/arch/arm/plat-s3c24xx/setup-i2c.c
new file mode 100644
index 000000000000..d62b7e7fb355
--- /dev/null
+++ b/arch/arm/plat-s3c24xx/setup-i2c.c
@@ -0,0 +1,25 @@
1/* linux/arch/arm/plat-s3c24xx/setup-i2c.c
2 *
3 * Copyright 2008 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * S3C24XX Base setup for i2c device
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#include <linux/kernel.h>
14
15struct platform_device;
16
17#include <plat/iic.h>
18#include <mach/hardware.h>
19#include <mach/regs-gpio.h>
20
21void s3c_i2c0_cfg_gpio(struct platform_device *dev)
22{
23 s3c2410_gpio_cfgpin(S3C2410_GPE15, S3C2410_GPE15_IICSDA);
24 s3c2410_gpio_cfgpin(S3C2410_GPE14, S3C2410_GPE14_IICSCL);
25}