]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[ARM] S3C: Make i2c device definition common to plat-s3c
authorBen Dooks <ben-linux@fluff.org>
Fri, 31 Oct 2008 16:14:40 +0000 (16:14 +0000)
committerBen Dooks <ben-linux@fluff.org>
Mon, 15 Dec 2008 23:40:26 +0000 (23:40 +0000)
Make the device i2c0 common to plat-s3c and move the
definitions from arch/arm/plat-s3c24xx/devs.c

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
31 files changed:
arch/arm/mach-s3c2410/include/mach/map.h
arch/arm/mach-s3c2410/mach-amlm5900.c
arch/arm/mach-s3c2410/mach-bast.c
arch/arm/mach-s3c2410/mach-h1940.c
arch/arm/mach-s3c2410/mach-n30.c
arch/arm/mach-s3c2410/mach-otom.c
arch/arm/mach-s3c2410/mach-qt2410.c
arch/arm/mach-s3c2410/mach-smdk2410.c
arch/arm/mach-s3c2410/mach-tct_hammer.c
arch/arm/mach-s3c2410/mach-vr1000.c
arch/arm/mach-s3c2412/mach-jive.c
arch/arm/mach-s3c2412/mach-smdk2413.c
arch/arm/mach-s3c2412/mach-vstms.c
arch/arm/mach-s3c2440/mach-anubis.c
arch/arm/mach-s3c2440/mach-at2440evb.c
arch/arm/mach-s3c2440/mach-nexcoder.c
arch/arm/mach-s3c2440/mach-osiris.c
arch/arm/mach-s3c2440/mach-rx3715.c
arch/arm/mach-s3c2440/mach-smdk2440.c
arch/arm/mach-s3c2443/mach-smdk2443.c
arch/arm/mach-s3c24a0/include/mach/map.h
arch/arm/mach-s3c6400/include/mach/map.h
arch/arm/plat-s3c/Makefile
arch/arm/plat-s3c/dev-i2c0.c [new file with mode: 0644]
arch/arm/plat-s3c/include/plat/devs.h
arch/arm/plat-s3c/include/plat/iic.h
arch/arm/plat-s3c24xx/Makefile
arch/arm/plat-s3c24xx/devs.c
arch/arm/plat-s3c24xx/include/plat/map.h
arch/arm/plat-s3c24xx/s3c244x.c
arch/arm/plat-s3c24xx/setup-i2c.c [new file with mode: 0644]

index d5ae6823fed4875403c433bd898f809a12ccfac1..255fdfeaf957a6d80e692cd24430dca7ec409c58 100644 (file)
@@ -92,7 +92,6 @@
 #define S3C24XX_PA_TIMER    S3C2410_PA_TIMER
 #define S3C24XX_PA_USBDEV   S3C2410_PA_USBDEV
 #define S3C24XX_PA_WATCHDOG S3C2410_PA_WATCHDOG
-#define S3C24XX_PA_IIC      S3C2410_PA_IIC
 #define S3C24XX_PA_IIS      S3C2410_PA_IIS
 #define S3C24XX_PA_GPIO     S3C2410_PA_GPIO
 #define S3C24XX_PA_RTC      S3C2410_PA_RTC
 #define S3C24XX_PA_SDI      S3C2410_PA_SDI
 #define S3C24XX_PA_NAND            S3C2410_PA_NAND
 
+#define S3C_PA_IIC          S3C2410_PA_IIC
 #define S3C_PA_UART        S3C24XX_PA_UART
 #define S3C_PA_HSMMC0      S3C2443_PA_HSMMC
 
index d061fea01900138879c776af78150e2966942db3..6d6995afeb439013d19833cc1f360c986a270b32 100644 (file)
@@ -52,6 +52,7 @@
 #include <mach/regs-lcd.h>
 #include <mach/regs-gpio.h>
 
+#include <plat/iic.h>
 #include <plat/devs.h>
 #include <plat/cpu.h>
 
@@ -150,7 +151,7 @@ static struct platform_device *amlm5900_devices[] __initdata = {
 #endif
        &s3c_device_adc,
        &s3c_device_wdt,
-       &s3c_device_i2c,
+       &s3c_device_i2c0,
        &s3c_device_usb,
        &s3c_device_rtc,
        &s3c_device_usbgadget,
@@ -233,6 +234,7 @@ static void __init amlm5900_init(void)
 #ifdef CONFIG_FB_S3C2410
        s3c24xx_fb_set_platdata(&amlm5900_fb_info);
 #endif
+       s3c_i2c0_set_platdata(NULL);
        platform_add_devices(amlm5900_devices, ARRAY_SIZE(amlm5900_devices));
 }
 
index c04c24444e0dc13b1e71c89690e2f82ad71e359d..01bd76725b920040a6b7ea1687d1c84770f32f54 100644 (file)
@@ -406,7 +406,7 @@ static struct platform_device bast_sio = {
  * standard 100KHz i2c bus frequency
 */
 
-static struct s3c2410_platform_i2c bast_i2c_info = {
+static struct s3c2410_platform_i2c __initdata bast_i2c_info = {
        .flags          = 0,
        .slave_addr     = 0x10,
        .bus_freq       = 100*1000,
@@ -553,7 +553,7 @@ static struct platform_device *bast_devices[] __initdata = {
        &s3c_device_usb,
        &s3c_device_lcd,
        &s3c_device_wdt,
-       &s3c_device_i2c,
+       &s3c_device_i2c0,
        &s3c_device_rtc,
        &s3c_device_nand,
        &bast_device_dm9k,
@@ -588,7 +588,8 @@ static void __init bast_map_io(void)
        s3c24xx_register_clocks(bast_clocks, ARRAY_SIZE(bast_clocks));
 
        s3c_device_nand.dev.platform_data = &bast_nand_info;
-       s3c_device_i2c.dev.platform_data = &bast_i2c_info;
+
+       s3c_i2c0_set_platdata(&bast_i2c_info);
 
        s3c24xx_init_io(bast_iodesc, ARRAY_SIZE(bast_iodesc));
        s3c24xx_init_clocks(0);
index 836508b829bbf39e6753d1d4383d357d8138eff1..821a1668c3acccd6a1bee3abafe79a82008960a4 100644 (file)
@@ -39,6 +39,7 @@
 #include <mach/h1940-latch.h>
 #include <mach/fb.h>
 #include <plat/udc.h>
+#include <plat/iic.h>
 
 #include <plat/clock.h>
 #include <plat/devs.h>
@@ -184,7 +185,7 @@ static struct platform_device *h1940_devices[] __initdata = {
        &s3c_device_usb,
        &s3c_device_lcd,
        &s3c_device_wdt,
-       &s3c_device_i2c,
+       &s3c_device_i2c0,
        &s3c_device_iis,
        &s3c_device_usbgadget,
        &s3c_device_leds,
@@ -216,6 +217,7 @@ static void __init h1940_init(void)
 
        s3c24xx_fb_set_platdata(&h1940_fb_info);
        s3c24xx_udc_set_platdata(&h1940_udc_cfg);
+       s3c_i2c0_set_platdata(NULL);
 
        /* Turn off suspend on both USB ports, and switch the
         * selectable USB port to USB device mode. */
index 7a7c45d28fe75ad01e7cd24b19c9674a9a692a31..1269e59d2940472352140af7eeb01fe0c89d4ca5 100644 (file)
@@ -320,7 +320,7 @@ static struct s3c2410fb_mach_info n30_fb_info __initdata = {
 static struct platform_device *n30_devices[] __initdata = {
        &s3c_device_lcd,
        &s3c_device_wdt,
-       &s3c_device_i2c,
+       &s3c_device_i2c0,
        &s3c_device_iis,
        &s3c_device_usb,
        &s3c_device_usbgadget,
@@ -332,7 +332,7 @@ static struct platform_device *n30_devices[] __initdata = {
 static struct platform_device *n35_devices[] __initdata = {
        &s3c_device_lcd,
        &s3c_device_wdt,
-       &s3c_device_i2c,
+       &s3c_device_i2c0,
        &s3c_device_iis,
        &s3c_device_usbgadget,
        &n35_button_device,
@@ -501,7 +501,7 @@ static void __init n30_init_irq(void)
 static void __init n30_init(void)
 {
        s3c24xx_fb_set_platdata(&n30_fb_info);
-       s3c_device_i2c.dev.platform_data = &n30_i2ccfg;
+       s3c_device_i2c0.dev.platform_data = &n30_i2ccfg;
        s3c24xx_udc_set_platdata(&n30_udc_cfg);
 
        /* Turn off suspend on both USB ports, and switch the
index d8255cf87e446ef07f8f719d2413bf2957ab6b1a..f6c7261a4a12b56ff545cd293c4016dda25941a0 100644 (file)
@@ -35,6 +35,7 @@
 #include <plat/s3c2410.h>
 #include <plat/clock.h>
 #include <plat/devs.h>
+#include <plat/iic.h>
 #include <plat/cpu.h>
 
 static struct map_desc otom11_iodesc[] __initdata = {
@@ -94,7 +95,7 @@ static struct platform_device *otom11_devices[] __initdata = {
        &s3c_device_usb,
        &s3c_device_lcd,
        &s3c_device_wdt,
-       &s3c_device_i2c,
+       &s3c_device_i2c0,
        &s3c_device_iis,
        &s3c_device_rtc,
        &otom_device_nor,
@@ -109,6 +110,7 @@ static void __init otom11_map_io(void)
 
 static void __init otom11_init(void)
 {
+       s3c_i2c0_set_platdata(NULL);
        platform_add_devices(otom11_devices, ARRAY_SIZE(otom11_devices));
 }
 
index ef868472f6a4b02cf3b00fd3da0d3478e65fb369..9678a53ceeb13589da76d6328fa1003dd00fd305 100644 (file)
@@ -54,6 +54,7 @@
 #include <plat/udc.h>
 #include <mach/spi.h>
 #include <mach/spi-gpio.h>
+#include <plat/iic.h>
 
 #include <plat/common-smdk.h>
 #include <plat/devs.h>
@@ -247,7 +248,7 @@ static struct platform_device *qt2410_devices[] __initdata = {
        &s3c_device_usb,
        &s3c_device_lcd,
        &s3c_device_wdt,
-       &s3c_device_i2c,
+       &s3c_device_i2c0,
        &s3c_device_iis,
        &s3c_device_sdi,
        &s3c_device_usbgadget,
@@ -349,6 +350,7 @@ static void __init qt2410_machine_init(void)
        s3c2410_gpio_setpin(S3C2410_GPB0, 1);
 
        s3c24xx_udc_set_platdata(&qt2410_udc_cfg);
+       s3c_i2c0_set_platdata(NULL);
 
        s3c2410_gpio_cfgpin(S3C2410_GPB5, S3C2410_GPIO_OUTPUT);
 
index 152527bb287290e28522c581fbff65368eab4b08..c49126ccb1d59dadeed853e4b0be2b60f610b6f5 100644 (file)
@@ -47,6 +47,7 @@
 #include <asm/mach-types.h>
 
 #include <plat/regs-serial.h>
+#include <plat/iic.h>
 
 #include <plat/devs.h>
 #include <plat/cpu.h>
@@ -89,7 +90,7 @@ static struct platform_device *smdk2410_devices[] __initdata = {
        &s3c_device_usb,
        &s3c_device_lcd,
        &s3c_device_wdt,
-       &s3c_device_i2c,
+       &s3c_device_i2c0,
        &s3c_device_iis,
 };
 
@@ -102,6 +103,7 @@ static void __init smdk2410_map_io(void)
 
 static void __init smdk2410_init(void)
 {
+       s3c_i2c0_set_platdata(NULL);
        platform_add_devices(smdk2410_devices, ARRAY_SIZE(smdk2410_devices));
        smdk_machine_init();
 }
index 309dcf4c870af92c8603276d0b7f1e3ccfa83939..8fdb0430bd48098faa9bd55eb94ce7f11444d75c 100644 (file)
@@ -45,6 +45,7 @@
 #include <asm/mach-types.h>
 
 #include <plat/regs-serial.h>
+#include <plat/iic.h>
 #include <plat/devs.h>
 #include <plat/cpu.h>
 
@@ -127,7 +128,7 @@ static struct s3c2410_uartcfg tct_hammer_uartcfgs[] = {
 static struct platform_device *tct_hammer_devices[] __initdata = {
        &s3c_device_adc,
        &s3c_device_wdt,
-       &s3c_device_i2c,
+       &s3c_device_i2c0,
        &s3c_device_usb,
        &s3c_device_rtc,
        &s3c_device_usbgadget,
@@ -146,6 +147,7 @@ static void __init tct_hammer_map_io(void)
 
 static void __init tct_hammer_init(void)
 {
+       s3c_i2c0_set_platdata(NULL);
        platform_add_devices(tct_hammer_devices, ARRAY_SIZE(tct_hammer_devices));
 }
 
index 941353af16dc85f546107e222f5a5c5bec3649a9..61a1ea9c5c5cd46bf58ed1d78a3deda89003b0d3 100644 (file)
@@ -47,6 +47,7 @@
 #include <plat/clock.h>
 #include <plat/devs.h>
 #include <plat/cpu.h>
+#include <plat/iic.h>
 
 #include "usb-simtec.h"
 #include "nor-simtec.h"
@@ -334,7 +335,7 @@ static struct platform_device *vr1000_devices[] __initdata = {
        &s3c_device_usb,
        &s3c_device_lcd,
        &s3c_device_wdt,
-       &s3c_device_i2c,
+       &s3c_device_i2c0,
        &s3c_device_adc,
        &serial_device,
        &vr1000_dm9k0,
@@ -384,6 +385,7 @@ static void __init vr1000_map_io(void)
 
 static void __init vr1000_init(void)
 {
+       s3c_i2c0_set_platdata(NULL);
        platform_add_devices(vr1000_devices, ARRAY_SIZE(vr1000_devices));
 
        i2c_register_board_info(0, vr1000_i2c_devs,
index 25ff1ec9f8ad5f3874adcc856c933e7ead324a1c..e08a0f06224e841a9ae313d7fbcf6963078c459c 100644 (file)
@@ -53,6 +53,7 @@
 #include <plat/cpu.h>
 #include <plat/pm.h>
 #include <plat/udc.h>
+#include <plat/iic.h>
 
 static struct map_desc jive_iodesc[] __initdata = {
 };
@@ -450,14 +451,14 @@ static struct spi_board_info __initdata jive_spi_devs[] = {
 
 /* I2C bus and device configuration. */
 
-static struct s3c2410_platform_i2c jive_i2c_cfg = {
+static struct s3c2410_platform_i2c jive_i2c_cfg __initdata = {
        .max_freq       = 80 * 1000,
        .bus_freq       = 50 * 1000,
        .flags          = S3C_IICFLG_FILTER,
        .sda_delay      = 2,
 };
 
-static struct i2c_board_info jive_i2c_devs[] = {
+static struct i2c_board_info jive_i2c_devs[] __initdata = {
        [0] = {
                I2C_BOARD_INFO("lis302dl", 0x1c),
                .irq    = IRQ_EINT14,
@@ -470,7 +471,7 @@ static struct platform_device *jive_devices[] __initdata = {
        &s3c_device_usb,
        &s3c_device_rtc,
        &s3c_device_wdt,
-       &s3c_device_i2c,
+       &s3c_device_i2c0,
        &s3c_device_lcd,
        &jive_device_lcdspi,
        &jive_device_wm8750,
@@ -663,7 +664,7 @@ static void __init jive_machine_init(void)
 
        spi_register_board_info(jive_spi_devs, ARRAY_SIZE(jive_spi_devs));
 
-       s3c_device_i2c.dev.platform_data = &jive_i2c_cfg;
+       s3c_i2c0_set_platdata(&jive_i2c_cfg);
        i2c_register_board_info(0, jive_i2c_devs, ARRAY_SIZE(jive_i2c_devs));
 
        pm_power_off = jive_power_off;
index 8fd17b8d56799284c98e59b3d7efb283f747b4bc..eba66aa6bd209da9d3fbd920e110b9f09eaace16 100644 (file)
@@ -38,6 +38,7 @@
 
 #include <mach/idle.h>
 #include <plat/udc.h>
+#include <plat/iic.h>
 #include <mach/fb.h>
 
 #include <plat/s3c2410.h>
@@ -105,7 +106,7 @@ static struct platform_device *smdk2413_devices[] __initdata = {
        &s3c_device_usb,
        //&s3c_device_lcd,
        &s3c_device_wdt,
-       &s3c_device_i2c,
+       &s3c_device_i2c0,
        &s3c_device_iis,
        &s3c_device_usbgadget,
 };
@@ -142,6 +143,7 @@ static void __init smdk2413_machine_init(void)
 
 
        s3c24xx_udc_set_platdata(&smdk2413_udc_cfg);
+       s3c_i2c0_set_platdata(NULL);
 
        platform_add_devices(smdk2413_devices, ARRAY_SIZE(smdk2413_devices));
        smdk_machine_init();
index da32a6cb17ae266d7d801e996454b9914a86b19d..11e8ad49fc7be740a941a386a291ed9cfa31d013 100644 (file)
@@ -39,6 +39,7 @@
 #include <mach/idle.h>
 #include <mach/fb.h>
 
+#include <plat/iic.h>
 #include <plat/nand.h>
 
 #include <plat/s3c2410.h>
@@ -122,7 +123,7 @@ static struct s3c2410_platform_nand vstms_nand_info = {
 static struct platform_device *vstms_devices[] __initdata = {
        &s3c_device_usb,
        &s3c_device_wdt,
-       &s3c_device_i2c,
+       &s3c_device_i2c0,
        &s3c_device_iis,
        &s3c_device_rtc,
        &s3c_device_nand,
@@ -151,6 +152,7 @@ static void __init vstms_map_io(void)
 
 static void __init vstms_init(void)
 {
+       s3c_i2c0_set_platdata(NULL);
        platform_add_devices(vstms_devices, ARRAY_SIZE(vstms_devices));
 }
 
index 334379bdfc6eb79e74ec1f81fa5e3b0dc7a83cc1..a9bbc41c4568a293094555f341841c8add3acf5d 100644 (file)
@@ -40,6 +40,7 @@
 #include <mach/regs-mem.h>
 #include <mach/regs-lcd.h>
 #include <plat/nand.h>
+#include <plat/iic.h>
 
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/nand.h>
@@ -404,7 +405,7 @@ static struct platform_device *anubis_devices[] __initdata = {
        &s3c_device_usb,
        &s3c_device_wdt,
        &s3c_device_adc,
-       &s3c_device_i2c,
+       &s3c_device_i2c0,
        &s3c_device_rtc,
        &s3c_device_nand,
        &anubis_device_ide0,
@@ -468,6 +469,7 @@ static void __init anubis_map_io(void)
 
 static void __init anubis_init(void)
 {
+       s3c_i2c0_set_platdata(NULL);
        platform_add_devices(anubis_devices, ARRAY_SIZE(anubis_devices));
 
        i2c_register_board_info(0, anubis_i2c_devs,
index 07b42a0207d11b42cc9d1b0460b7165c018508c7..55e07ae5ab8c0368aeef7953e9a1992bc9b69812 100644 (file)
@@ -36,6 +36,7 @@
 #include <mach/regs-mem.h>
 #include <mach/regs-lcd.h>
 #include <plat/nand.h>
+#include <plat/iic.h>
 
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/nand.h>
@@ -166,7 +167,7 @@ static struct platform_device *at2440evb_devices[] __initdata = {
        &s3c_device_usb,
        &s3c_device_wdt,
        &s3c_device_adc,
-       &s3c_device_i2c,
+       &s3c_device_i2c0,
        &s3c_device_rtc,
        &s3c_device_nand,
        &at2440evb_device_eth,
@@ -183,6 +184,7 @@ static void __init at2440evb_map_io(void)
 
 static void __init at2440evb_init(void)
 {
+       s3c_i2c0_set_platdata(NULL);
        platform_add_devices(at2440evb_devices, ARRAY_SIZE(at2440evb_devices));
 }
 
index a546307fd53d8abb2ff39d84bc2a72b401c893ea..7aeaa972d7f5856bb46e9a6156190dd6f065c693 100644 (file)
@@ -37,6 +37,7 @@
 //#include <asm/debug-ll.h>
 #include <mach/regs-gpio.h>
 #include <plat/regs-serial.h>
+#include <plat/iic.h>
 
 #include <plat/s3c2410.h>
 #include <plat/s3c2440.h>
@@ -107,7 +108,7 @@ static struct platform_device *nexcoder_devices[] __initdata = {
        &s3c_device_usb,
        &s3c_device_lcd,
        &s3c_device_wdt,
-       &s3c_device_i2c,
+       &s3c_device_i2c0,
        &s3c_device_iis,
        &s3c_device_rtc,
        &s3c_device_camif,
@@ -142,6 +143,7 @@ static void __init nexcoder_map_io(void)
 
 static void __init nexcoder_init(void)
 {
+       s3c_i2c0_set_platdata(NULL);
        platform_add_devices(nexcoder_devices, ARRAY_SIZE(nexcoder_devices));
 };
 
index 884a3c7ae75f532ab161758dc39580167700adfa..41a00f57e5da67d05651052c2aae9e207b96b944 100644 (file)
@@ -38,6 +38,7 @@
 #include <mach/regs-mem.h>
 #include <mach/regs-lcd.h>
 #include <plat/nand.h>
+#include <plat/iic.h>
 
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/nand.h>
@@ -335,7 +336,7 @@ static struct i2c_board_info osiris_i2c_devs[] __initdata = {
 /* Standard Osiris devices */
 
 static struct platform_device *osiris_devices[] __initdata = {
-       &s3c_device_i2c,
+       &s3c_device_i2c0,
        &s3c_device_wdt,
        &s3c_device_nand,
        &osiris_pcmcia,
@@ -398,6 +399,8 @@ static void __init osiris_init(void)
        sysdev_class_register(&osiris_pm_sysclass);
        sysdev_register(&osiris_pm_sysdev);
 
+       s3c_i2c0_set_platdata(NULL);
+
        i2c_register_board_info(0, osiris_i2c_devs,
                                ARRAY_SIZE(osiris_i2c_devs));
 
index fbd081de592f522bb41dd870c1fd0453dc9a53b8..12d378f84ad2d717cd8cab0cccceef548e0fbe4a 100644 (file)
@@ -179,7 +179,7 @@ static struct platform_device *rx3715_devices[] __initdata = {
        &s3c_device_usb,
        &s3c_device_lcd,
        &s3c_device_wdt,
-       &s3c_device_i2c,
+       &s3c_device_i2c0,
        &s3c_device_iis,
        &s3c_device_nand,
 };
index fefeaaa4155fff74bb21d9320b38063342b54acd..db6eafbd4d9036f707497fdc66935e921c1938f8 100644 (file)
@@ -37,6 +37,7 @@
 
 #include <mach/idle.h>
 #include <mach/fb.h>
+#include <plat/iic.h>
 
 #include <plat/s3c2410.h>
 #include <plat/s3c2440.h>
@@ -152,7 +153,7 @@ static struct platform_device *smdk2440_devices[] __initdata = {
        &s3c_device_usb,
        &s3c_device_lcd,
        &s3c_device_wdt,
-       &s3c_device_i2c,
+       &s3c_device_i2c0,
        &s3c_device_iis,
 };
 
@@ -166,6 +167,7 @@ static void __init smdk2440_map_io(void)
 static void __init smdk2440_machine_init(void)
 {
        s3c24xx_fb_set_platdata(&smdk2440_fb_info);
+       s3c_i2c0_set_platdata(NULL);
 
        platform_add_devices(smdk2440_devices, ARRAY_SIZE(smdk2440_devices));
        smdk_machine_init();
index 815a3bd1d37b7fe42efbbee6ed51653f5278cf04..039a4624310508fcfec0e9226ead564d6e610df2 100644 (file)
@@ -37,6 +37,7 @@
 
 #include <mach/idle.h>
 #include <mach/fb.h>
+#include <plat/iic.h>
 
 #include <plat/s3c2410.h>
 #include <plat/s3c2440.h>
@@ -103,7 +104,7 @@ static struct s3c2410_uartcfg smdk2443_uartcfgs[] __initdata = {
 
 static struct platform_device *smdk2443_devices[] __initdata = {
        &s3c_device_wdt,
-       &s3c_device_i2c,
+       &s3c_device_i2c0,
        &s3c_device_hsmmc0,
 };
 
@@ -116,6 +117,7 @@ static void __init smdk2443_map_io(void)
 
 static void __init smdk2443_machine_init(void)
 {
+       s3c_i2c0_set_platdata(NULL);
        platform_add_devices(smdk2443_devices, ARRAY_SIZE(smdk2443_devices));
        smdk_machine_init();
 }
index 6667355a47a1fb4756f0b90b0237c4d099a33cef..a01132717e34f59078f729dec3f4c456b0c0fb0b 100644 (file)
@@ -71,7 +71,6 @@
 #define S3C24XX_PA_TIMER       S3C24A0_PA_TIMER
 #define S3C24XX_PA_USBDEV      S3C24A0_PA_USBDEV
 #define S3C24XX_PA_WATCHDOG    S3C24A0_PA_WATCHDOG
-#define S3C24XX_PA_IIC         S3C24A0_PA_IIC
 #define S3C24XX_PA_IIS         S3C24A0_PA_IIS
 #define S3C24XX_PA_GPIO                S3C24A0_PA_GPIO
 #define S3C24XX_PA_RTC         S3C24A0_PA_RTC
@@ -81,5 +80,6 @@
 #define S3C24XX_PA_NAND                S3C24A0_PA_NAND
 
 #define S3C_PA_UART            S3C24A0_PA_UART
+#define S3C_PA_IIC             S3C24A0_PA_IIC
 
 #endif /* __ASM_ARCH_24A0_MAP_H */
index aadaaaf2d8b6172384fd82685c6cfa8e2eae160b..f0d6fa616b6cc3f14c02d0dc3f2c6ba67117327e 100644 (file)
@@ -40,6 +40,7 @@
 
 #define S3C64XX_PA_SYSCON      (0x7E00F000)
 #define S3C64XX_PA_TIMER       (0x7F006000)
+#define S3C64XX_PA_IIC0                (0x7F004000)
 
 #define S3C64XX_PA_GPIO                (0x7F008000)
 #define S3C64XX_VA_GPIO                S3C_ADDR(0x00500000)
@@ -58,5 +59,6 @@
 #define S3C_PA_HSMMC0          S3C64XX_PA_HSMMC0
 #define S3C_PA_HSMMC1          S3C64XX_PA_HSMMC1
 #define S3C_PA_HSMMC2          S3C64XX_PA_HSMMC2
+#define S3C_PA_IIC             S3C64XX_PA_IIC0
 
 #endif /* __ASM_ARCH_6400_MAP_H */
index 3f6544a95fe8c2817c4500fd81cb76d2ccd6a8d3..187fa95b87d59bb947daacc8e8f824e32caa54d5 100644 (file)
@@ -22,3 +22,4 @@ obj-y                         += gpio-config.o
 
 obj-$(CONFIG_S3C_DEV_HSMMC)    += dev-hsmmc.o
 obj-$(CONFIG_S3C_DEV_HSMMC1)   += dev-hsmmc1.o
+obj-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 (file)
index 0000000..21870fd
--- /dev/null
@@ -0,0 +1,67 @@
+/* linux/arch/arm/plat-s3c/dev-i2c0.c
+ *
+ * Copyright 2008 Simtec Electronics
+ *     Ben Dooks <ben@simtec.co.uk>
+ *     http://armlinux.simtec.co.uk/
+ *
+ * S3C series device definition for i2c device 0
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+*/
+
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/platform_device.h>
+
+#include <mach/map.h>
+
+#include <plat/regs-iic.h>
+#include <plat/iic.h>
+#include <plat/devs.h>
+#include <plat/cpu.h>
+
+static struct resource s3c_i2c_resource[] = {
+       [0] = {
+               .start = S3C_PA_IIC,
+               .end   = S3C_PA_IIC + SZ_4K - 1,
+               .flags = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start = IRQ_IIC,
+               .end   = IRQ_IIC,
+               .flags = IORESOURCE_IRQ,
+       },
+};
+
+struct platform_device s3c_device_i2c0 = {
+       .name             = "s3c2410-i2c",
+       .id               = -1,
+       .num_resources    = ARRAY_SIZE(s3c_i2c_resource),
+       .resource         = s3c_i2c_resource,
+};
+
+struct s3c2410_platform_i2c default_i2c_data __initdata = {
+       .flags          = 0,
+       .slave_addr     = 0x10,
+       .bus_freq       = 100*1000,
+       .max_freq       = 400*1000,
+       .sda_delay      = S3C2410_IICLC_SDA_DELAY5 | S3C2410_IICLC_FILTER_ON,
+};
+
+void __init s3c_i2c0_set_platdata(struct s3c2410_platform_i2c *pd)
+{
+       struct s3c2410_platform_i2c *npd;
+
+       if (!pd)
+               pd = &default_i2c_data;
+
+       npd = kmemdup(pd, sizeof(struct s3c2410_platform_i2c), GFP_KERNEL);
+       if (!npd)
+               printk(KERN_ERR "%s: no memory for platform data\n", __func__);
+       else if (!npd->cfg_gpio)
+               npd->cfg_gpio = s3c_i2c0_cfg_gpio;
+
+       s3c_device_i2c0.dev.platform_data = npd;
+}
index f173863b8cc743ac6e12378fb85d0ed6bca49b32..d9e0c543ebd6bef8306a543d420ed33b4c5efae1 100644 (file)
@@ -27,7 +27,7 @@ extern struct platform_device s3c_device_timer[];
 extern struct platform_device s3c_device_usb;
 extern struct platform_device s3c_device_lcd;
 extern struct platform_device s3c_device_wdt;
-extern struct platform_device s3c_device_i2c;
+extern struct platform_device s3c_device_i2c0;
 extern struct platform_device s3c_device_iis;
 extern struct platform_device s3c_device_rtc;
 extern struct platform_device s3c_device_adc;
index 5106acaa1d0ebfe1252e54a46ebd206ca6f5729f..5073b1e74ee874da08123dd5ea2524a5d032dfac 100644 (file)
@@ -28,6 +28,28 @@ struct s3c2410_platform_i2c {
        unsigned long   max_freq;       /* max frequency for the bus */
        unsigned long   min_freq;       /* min frequency for the bus */
        unsigned int    sda_delay;      /* pclks (s3c2440 only) */
+
+       void    (*cfg_gpio)(struct platform_device *dev);
 };
 
+/**
+ * s3c_i2c0_set_platdata - set platform data for i2c0 device
+ * @i2c: The platform data to set, or NULL for default data.
+ *
+ * Register the given platform data for use with the i2c0 device. This
+ * call copies the platform data, so the caller can use __initdata for
+ * their copy.
+ *
+ * This call will set cfg_gpio if is null to the default platform
+ * implementation.
+ *
+ * Any user of s3c_device_i2c0 should call this, even if it is with
+ * NULL to ensure that the device is given the default platform data
+ * as the driver will no longer carry defaults.
+ */
+extern void s3c_i2c0_set_platdata(struct s3c2410_platform_i2c *i2c);
+
+/* defined by architecture to configure gpio */
+extern void s3c_i2c0_cfg_gpio(struct platform_device *dev);
+
 #endif /* __ASM_ARCH_IIC_H */
index 2a65ba7eb34d28fe3f587957cb6355ab9d092cf5..763d3444048b7035693cdda3c6e665719602435c 100644 (file)
@@ -32,6 +32,9 @@ obj-$(CONFIG_HAVE_PWM)                += pwm.o
 obj-$(CONFIG_S3C2410_CLOCK)    += s3c2410-clock.o
 obj-$(CONFIG_S3C2410_DMA)      += dma.o
 
+# device specific setup and/or initialisation
+obj-$(CONFIG_ARCH_S3C2410)     += setup-i2c.o
+
 # SPI gpio central GPIO functions
 
 obj-$(CONFIG_S3C24XX_SPI_BUS0_GPE11_GPE12_GPE13) += spi-bus0-gpe11_12_13.o
index 3a2fcd94791e47bcf9ada88fabd061d38c02e14e..3cb07b6a0e4c0edbb9466d127e762f429e871828 100644 (file)
@@ -271,31 +271,6 @@ struct platform_device s3c_device_wdt = {
 
 EXPORT_SYMBOL(s3c_device_wdt);
 
-/* I2C */
-
-static struct resource s3c_i2c_resource[] = {
-       [0] = {
-               .start = S3C24XX_PA_IIC,
-               .end   = S3C24XX_PA_IIC + S3C24XX_SZ_IIC - 1,
-               .flags = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start = IRQ_IIC,
-               .end   = IRQ_IIC,
-               .flags = IORESOURCE_IRQ,
-       }
-
-};
-
-struct platform_device s3c_device_i2c = {
-       .name             = "s3c2410-i2c",
-       .id               = -1,
-       .num_resources    = ARRAY_SIZE(s3c_i2c_resource),
-       .resource         = s3c_i2c_resource,
-};
-
-EXPORT_SYMBOL(s3c_device_i2c);
-
 /* IIS */
 
 static struct resource s3c_iis_resource[] = {
index e7be0c0d370284f5f9b32d6e3dcd36c3109c4dc9..fef8ea8b8e1e7abd3b547de245f510565f7859ae 100644 (file)
@@ -51,7 +51,6 @@
 
 /* Standard size definitions for peripheral blocks. */
 
-#define S3C24XX_SZ_IIC         SZ_1M
 #define S3C24XX_SZ_IIS         SZ_1M
 #define S3C24XX_SZ_ADC         SZ_1M
 #define S3C24XX_SZ_SPI         SZ_1M
index 494368403055f293bd239d167c66badb53869d74..c1de6bb0101b2fd815fd4dff198ac3baa87a9024 100644 (file)
@@ -68,7 +68,7 @@ void __init s3c244x_map_io(void)
        /* rename any peripherals used differing from the s3c2410 */
 
        s3c_device_sdi.name  = "s3c2440-sdi";
-       s3c_device_i2c.name  = "s3c2440-i2c";
+       s3c_device_i2c0.name  = "s3c2440-i2c";
        s3c_device_nand.name = "s3c2440-nand";
        s3c_device_usbgadget.name = "s3c2440-usbgadget";
 }
diff --git a/arch/arm/plat-s3c24xx/setup-i2c.c b/arch/arm/plat-s3c24xx/setup-i2c.c
new file mode 100644 (file)
index 0000000..d62b7e7
--- /dev/null
@@ -0,0 +1,25 @@
+/* linux/arch/arm/plat-s3c24xx/setup-i2c.c
+ *
+ * Copyright 2008 Simtec Electronics
+ *     Ben Dooks <ben@simtec.co.uk>
+ *
+ * S3C24XX Base setup for i2c device
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+*/
+
+#include <linux/kernel.h>
+
+struct platform_device;
+
+#include <plat/iic.h>
+#include <mach/hardware.h>
+#include <mach/regs-gpio.h>
+
+void s3c_i2c0_cfg_gpio(struct platform_device *dev)
+{
+       s3c2410_gpio_cfgpin(S3C2410_GPE15, S3C2410_GPE15_IICSDA);
+       s3c2410_gpio_cfgpin(S3C2410_GPE14, S3C2410_GPE14_IICSCL);
+}