Skip to content

Commit

Permalink
[ARM] S3C: Make i2c device definition common to plat-s3c
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ben Dooks committed Dec 15, 2008
1 parent a2205cd commit 3e1b776
Show file tree
Hide file tree
Showing 31 changed files with 183 additions and 56 deletions.
2 changes: 1 addition & 1 deletion arch/arm/mach-s3c2410/include/mach/map.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -101,6 +100,7 @@
#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

Expand Down
4 changes: 3 additions & 1 deletion arch/arm/mach-s3c2410/mach-amlm5900.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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));
}

Expand Down
7 changes: 4 additions & 3 deletions arch/arm/mach-s3c2410/mach-bast.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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);
Expand Down
4 changes: 3 additions & 1 deletion arch/arm/mach-s3c2410/mach-h1940.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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. */
Expand Down
6 changes: 3 additions & 3 deletions arch/arm/mach-s3c2410/mach-n30.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion arch/arm/mach-s3c2410/mach-otom.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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,
Expand All @@ -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));
}

Expand Down
4 changes: 3 additions & 1 deletion arch/arm/mach-s3c2410/mach-qt2410.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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);

Expand Down
4 changes: 3 additions & 1 deletion arch/arm/mach-s3c2410/mach-smdk2410.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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,
};

Expand All @@ -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();
}
Expand Down
4 changes: 3 additions & 1 deletion arch/arm/mach-s3c2410/mach-tct_hammer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down Expand Up @@ -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,
Expand All @@ -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));
}

Expand Down
4 changes: 3 additions & 1 deletion arch/arm/mach-s3c2410/mach-vr1000.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
9 changes: 5 additions & 4 deletions arch/arm/mach-s3c2412/mach-jive.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
};
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 3 additions & 1 deletion arch/arm/mach-s3c2412/mach-smdk2413.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@

#include <mach/idle.h>
#include <plat/udc.h>
#include <plat/iic.h>
#include <mach/fb.h>

#include <plat/s3c2410.h>
Expand Down Expand Up @@ -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,
};
Expand Down Expand Up @@ -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();
Expand Down
4 changes: 3 additions & 1 deletion arch/arm/mach-s3c2412/mach-vstms.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#include <mach/idle.h>
#include <mach/fb.h>

#include <plat/iic.h>
#include <plat/nand.h>

#include <plat/s3c2410.h>
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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));
}

Expand Down
4 changes: 3 additions & 1 deletion arch/arm/mach-s3c2440/mach-anubis.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
4 changes: 3 additions & 1 deletion arch/arm/mach-s3c2440/mach-at2440evb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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,
Expand All @@ -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));
}

Expand Down
Loading

0 comments on commit 3e1b776

Please sign in to comment.