aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/mach-s3c6400/include/mach/map.h2
-rw-r--r--arch/arm/plat-s3c/Kconfig6
-rw-r--r--arch/arm/plat-s3c/Makefile1
-rw-r--r--arch/arm/plat-s3c/dev-i2c0.c8
-rw-r--r--arch/arm/plat-s3c/dev-i2c1.c68
-rw-r--r--arch/arm/plat-s3c/include/plat/devs.h1
-rw-r--r--arch/arm/plat-s3c/include/plat/iic.h2
-rw-r--r--arch/arm/plat-s3c64xx/include/plat/irqs.h5
8 files changed, 91 insertions, 2 deletions
diff --git a/arch/arm/mach-s3c6400/include/mach/map.h b/arch/arm/mach-s3c6400/include/mach/map.h
index f0d6fa616b6c..4d5cd7ee8c15 100644
--- a/arch/arm/mach-s3c6400/include/mach/map.h
+++ b/arch/arm/mach-s3c6400/include/mach/map.h
@@ -41,6 +41,7 @@
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#define S3C64XX_PA_IIC0 (0x7F004000)
44#define S3C64XX_PA_IIC1 (0x7F00F000)
44 45
45#define S3C64XX_PA_GPIO (0x7F008000) 46#define S3C64XX_PA_GPIO (0x7F008000)
46#define S3C64XX_VA_GPIO S3C_ADDR(0x00500000) 47#define S3C64XX_VA_GPIO S3C_ADDR(0x00500000)
@@ -60,5 +61,6 @@
60#define S3C_PA_HSMMC1 S3C64XX_PA_HSMMC1 61#define S3C_PA_HSMMC1 S3C64XX_PA_HSMMC1
61#define S3C_PA_HSMMC2 S3C64XX_PA_HSMMC2 62#define S3C_PA_HSMMC2 S3C64XX_PA_HSMMC2
62#define S3C_PA_IIC S3C64XX_PA_IIC0 63#define S3C_PA_IIC S3C64XX_PA_IIC0
64#define S3C_PA_IIC1 S3C64XX_PA_IIC1
63 65
64#endif /* __ASM_ARCH_6400_MAP_H */ 66#endif /* __ASM_ARCH_6400_MAP_H */
diff --git a/arch/arm/plat-s3c/Kconfig b/arch/arm/plat-s3c/Kconfig
index e6e64968a611..d7a6e487f218 100644
--- a/arch/arm/plat-s3c/Kconfig
+++ b/arch/arm/plat-s3c/Kconfig
@@ -160,3 +160,9 @@ config S3C_DEV_HSMMC1
160 depends on PLAT_S3C 160 depends on PLAT_S3C
161 help 161 help
162 Compile in platform device definitions for HSMMC channel 1 162 Compile in platform device definitions for HSMMC channel 1
163
164config S3C_DEV_I2C1
165 bool
166 depends on PLAT_S3C
167 help
168 Compile in platform device definitions for I2C channel 1
diff --git a/arch/arm/plat-s3c/Makefile b/arch/arm/plat-s3c/Makefile
index 187fa95b87d5..3fcee0c44e18 100644
--- a/arch/arm/plat-s3c/Makefile
+++ b/arch/arm/plat-s3c/Makefile
@@ -23,3 +23,4 @@ obj-y += gpio-config.o
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 25obj-y += dev-i2c0.o
26obj-$(CONFIG_S3C_DEV_I2C1) += dev-i2c1.o
diff --git a/arch/arm/plat-s3c/dev-i2c0.c b/arch/arm/plat-s3c/dev-i2c0.c
index 21870fd2ec98..2c0128c77c6e 100644
--- a/arch/arm/plat-s3c/dev-i2c0.c
+++ b/arch/arm/plat-s3c/dev-i2c0.c
@@ -37,12 +37,16 @@ static struct resource s3c_i2c_resource[] = {
37 37
38struct platform_device s3c_device_i2c0 = { 38struct platform_device s3c_device_i2c0 = {
39 .name = "s3c2410-i2c", 39 .name = "s3c2410-i2c",
40#ifdef CONFIG_S3C_DEV_I2C1
41 .id = 0,
42#else
40 .id = -1, 43 .id = -1,
44#endif
41 .num_resources = ARRAY_SIZE(s3c_i2c_resource), 45 .num_resources = ARRAY_SIZE(s3c_i2c_resource),
42 .resource = s3c_i2c_resource, 46 .resource = s3c_i2c_resource,
43}; 47};
44 48
45struct s3c2410_platform_i2c default_i2c_data __initdata = { 49static struct s3c2410_platform_i2c default_i2c_data0 __initdata = {
46 .flags = 0, 50 .flags = 0,
47 .slave_addr = 0x10, 51 .slave_addr = 0x10,
48 .bus_freq = 100*1000, 52 .bus_freq = 100*1000,
@@ -55,7 +59,7 @@ void __init s3c_i2c0_set_platdata(struct s3c2410_platform_i2c *pd)
55 struct s3c2410_platform_i2c *npd; 59 struct s3c2410_platform_i2c *npd;
56 60
57 if (!pd) 61 if (!pd)
58 pd = &default_i2c_data; 62 pd = &default_i2c_data0;
59 63
60 npd = kmemdup(pd, sizeof(struct s3c2410_platform_i2c), GFP_KERNEL); 64 npd = kmemdup(pd, sizeof(struct s3c2410_platform_i2c), GFP_KERNEL);
61 if (!npd) 65 if (!npd)
diff --git a/arch/arm/plat-s3c/dev-i2c1.c b/arch/arm/plat-s3c/dev-i2c1.c
new file mode 100644
index 000000000000..9658fb0aec95
--- /dev/null
+++ b/arch/arm/plat-s3c/dev-i2c1.c
@@ -0,0 +1,68 @@
1/* linux/arch/arm/plat-s3c/dev-i2c1.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 1
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_IIC1,
28 .end = S3C_PA_IIC1 + SZ_4K - 1,
29 .flags = IORESOURCE_MEM,
30 },
31 [1] = {
32 .start = IRQ_IIC1,
33 .end = IRQ_IIC1,
34 .flags = IORESOURCE_IRQ,
35 },
36};
37
38struct platform_device s3c_device_i2c1 = {
39 .name = "s3c2410-i2c",
40 .id = 1,
41 .num_resources = ARRAY_SIZE(s3c_i2c_resource),
42 .resource = s3c_i2c_resource,
43};
44
45static struct s3c2410_platform_i2c default_i2c_data1 __initdata = {
46 .flags = 0,
47 .bus_num = 1,
48 .slave_addr = 0x10,
49 .bus_freq = 100*1000,
50 .max_freq = 400*1000,
51 .sda_delay = S3C2410_IICLC_SDA_DELAY5 | S3C2410_IICLC_FILTER_ON,
52};
53
54void __init s3c_i2c1_set_platdata(struct s3c2410_platform_i2c *pd)
55{
56 struct s3c2410_platform_i2c *npd;
57
58 if (!pd)
59 pd = &default_i2c_data1;
60
61 npd = kmemdup(pd, sizeof(struct s3c2410_platform_i2c), GFP_KERNEL);
62 if (!npd)
63 printk(KERN_ERR "%s: no memory for platform data\n", __func__);
64 else if (!npd->cfg_gpio)
65 npd->cfg_gpio = s3c_i2c1_cfg_gpio;
66
67 s3c_device_i2c1.dev.platform_data = npd;
68}
diff --git a/arch/arm/plat-s3c/include/plat/devs.h b/arch/arm/plat-s3c/include/plat/devs.h
index d9e0c543ebd6..0e342d1fafbb 100644
--- a/arch/arm/plat-s3c/include/plat/devs.h
+++ b/arch/arm/plat-s3c/include/plat/devs.h
@@ -28,6 +28,7 @@ extern 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_i2c0; 30extern struct platform_device s3c_device_i2c0;
31extern struct platform_device s3c_device_i2c1;
31extern struct platform_device s3c_device_iis; 32extern struct platform_device s3c_device_iis;
32extern struct platform_device s3c_device_rtc; 33extern struct platform_device s3c_device_rtc;
33extern struct platform_device s3c_device_adc; 34extern 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 5073b1e74ee8..dc1dfcb9bc6c 100644
--- a/arch/arm/plat-s3c/include/plat/iic.h
+++ b/arch/arm/plat-s3c/include/plat/iic.h
@@ -48,8 +48,10 @@ struct s3c2410_platform_i2c {
48 * as the driver will no longer carry defaults. 48 * as the driver will no longer carry defaults.
49 */ 49 */
50extern void s3c_i2c0_set_platdata(struct s3c2410_platform_i2c *i2c); 50extern void s3c_i2c0_set_platdata(struct s3c2410_platform_i2c *i2c);
51extern void s3c_i2c1_set_platdata(struct s3c2410_platform_i2c *i2c);
51 52
52/* defined by architecture to configure gpio */ 53/* defined by architecture to configure gpio */
53extern void s3c_i2c0_cfg_gpio(struct platform_device *dev); 54extern void s3c_i2c0_cfg_gpio(struct platform_device *dev);
55extern void s3c_i2c1_cfg_gpio(struct platform_device *dev);
54 56
55#endif /* __ASM_ARCH_IIC_H */ 57#endif /* __ASM_ARCH_IIC_H */
diff --git a/arch/arm/plat-s3c64xx/include/plat/irqs.h b/arch/arm/plat-s3c64xx/include/plat/irqs.h
index bc25689c3f83..02e8dd4c97d5 100644
--- a/arch/arm/plat-s3c64xx/include/plat/irqs.h
+++ b/arch/arm/plat-s3c64xx/include/plat/irqs.h
@@ -70,6 +70,7 @@
70#define IRQ_CAMIF_C S3C64XX_IRQ_VIC0(3) 70#define IRQ_CAMIF_C S3C64XX_IRQ_VIC0(3)
71#define IRQ_CAMIF_P S3C64XX_IRQ_VIC0(4) 71#define IRQ_CAMIF_P S3C64XX_IRQ_VIC0(4)
72#define IRQ_CAMIF_MC S3C64XX_IRQ_VIC0(5) 72#define IRQ_CAMIF_MC S3C64XX_IRQ_VIC0(5)
73#define IRQ_S3C6410_IIC1 S3C64XX_IRQ_VIC0(5)
73#define IRQ_S3C6410_IIS S3C64XX_IRQ_VIC0(6) 74#define IRQ_S3C6410_IIS S3C64XX_IRQ_VIC0(6)
74#define IRQ_S3C6400_CAMIF_MP S3C64XX_IRQ_VIC0(6) 75#define IRQ_S3C6400_CAMIF_MP S3C64XX_IRQ_VIC0(6)
75#define IRQ_CAMIF_WE_C S3C64XX_IRQ_VIC0(7) 76#define IRQ_CAMIF_WE_C S3C64XX_IRQ_VIC0(7)
@@ -144,6 +145,10 @@
144#define IRQ_TIMER3 S3C64XX_TIMER_IRQ(3) 145#define IRQ_TIMER3 S3C64XX_TIMER_IRQ(3)
145#define IRQ_TIMER4 S3C64XX_TIMER_IRQ(4) 146#define IRQ_TIMER4 S3C64XX_TIMER_IRQ(4)
146 147
148/* compatibility for device defines */
149
150#define IRQ_IIC1 IRQ_S3C6410_IIC1
151
147/* Since the IRQ_EINT(x) are a linear mapping on current s3c64xx series 152/* Since the IRQ_EINT(x) are a linear mapping on current s3c64xx series
148 * we just defined them as an IRQ_EINT(x) macro from S3C_IRQ_EINT_BASE 153 * we just defined them as an IRQ_EINT(x) macro from S3C_IRQ_EINT_BASE
149 * which we place after the pair of VICs. */ 154 * which we place after the pair of VICs. */