aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-samsung
diff options
context:
space:
mode:
authorBen Dooks <ben-linux@fluff.org>2010-05-20 05:55:32 -0400
committerBen Dooks <ben-linux@fluff.org>2010-05-20 05:55:32 -0400
commitea5a4e209ddca984bbb5803b30d5e013e631f9ac (patch)
treea7f2cdb121fc44cfd7c382207104f867f93736c9 /arch/arm/plat-samsung
parentfac3d3555568de1755025a9609daf492dd548a59 (diff)
parenteff4c74da7944ba30feb47b51d1e9e940e6682ff (diff)
ARM: Merge for-2635-4/s5pv210-boards
Merge branch 'for-2635-4/s5pv210-boards' into for-2635-4/partial1 Conflicts: arch/arm/mach-s5pv210/include/mach/map.h
Diffstat (limited to 'arch/arm/plat-samsung')
-rw-r--r--arch/arm/plat-samsung/Kconfig5
-rw-r--r--arch/arm/plat-samsung/Makefile1
-rw-r--r--arch/arm/plat-samsung/dev-i2c2.c70
-rw-r--r--arch/arm/plat-samsung/include/plat/devs.h1
-rw-r--r--arch/arm/plat-samsung/include/plat/fb.h7
-rw-r--r--arch/arm/plat-samsung/include/plat/iic-core.h7
-rw-r--r--arch/arm/plat-samsung/include/plat/iic.h2
-rw-r--r--arch/arm/plat-samsung/include/plat/sdhci.h55
8 files changed, 148 insertions, 0 deletions
diff --git a/arch/arm/plat-samsung/Kconfig b/arch/arm/plat-samsung/Kconfig
index 1077ebebfb03..b787d576d4b3 100644
--- a/arch/arm/plat-samsung/Kconfig
+++ b/arch/arm/plat-samsung/Kconfig
@@ -170,6 +170,11 @@ config S3C_DEV_I2C1
170 help 170 help
171 Compile in platform device definitions for I2C channel 1 171 Compile in platform device definitions for I2C channel 1
172 172
173config S3C_DEV_I2C2
174 bool
175 help
176 Compile in platform device definitions for I2C channel 2
177
173config S3C_DEV_FB 178config S3C_DEV_FB
174 bool 179 bool
175 help 180 help
diff --git a/arch/arm/plat-samsung/Makefile b/arch/arm/plat-samsung/Makefile
index 48288499a3b9..606ec8424c80 100644
--- a/arch/arm/plat-samsung/Makefile
+++ b/arch/arm/plat-samsung/Makefile
@@ -36,6 +36,7 @@ obj-$(CONFIG_S3C_DEV_HSMMC2) += dev-hsmmc2.o
36obj-$(CONFIG_S3C_DEV_HWMON) += dev-hwmon.o 36obj-$(CONFIG_S3C_DEV_HWMON) += dev-hwmon.o
37obj-y += dev-i2c0.o 37obj-y += dev-i2c0.o
38obj-$(CONFIG_S3C_DEV_I2C1) += dev-i2c1.o 38obj-$(CONFIG_S3C_DEV_I2C1) += dev-i2c1.o
39obj-$(CONFIG_S3C_DEV_I2C2) += dev-i2c2.o
39obj-$(CONFIG_S3C_DEV_FB) += dev-fb.o 40obj-$(CONFIG_S3C_DEV_FB) += dev-fb.o
40obj-y += dev-uart.o 41obj-y += dev-uart.o
41obj-$(CONFIG_S3C_DEV_USB_HOST) += dev-usb.o 42obj-$(CONFIG_S3C_DEV_USB_HOST) += dev-usb.o
diff --git a/arch/arm/plat-samsung/dev-i2c2.c b/arch/arm/plat-samsung/dev-i2c2.c
new file mode 100644
index 000000000000..07036dee09e7
--- /dev/null
+++ b/arch/arm/plat-samsung/dev-i2c2.c
@@ -0,0 +1,70 @@
1/* linux/arch/arm/plat-s3c/dev-i2c2.c
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * S3C series device definition for i2c device 2
7 *
8 * Based on plat-samsung/dev-i2c0.c
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13*/
14
15#include <linux/gfp.h>
16#include <linux/kernel.h>
17#include <linux/string.h>
18#include <linux/platform_device.h>
19
20#include <mach/irqs.h>
21#include <mach/map.h>
22
23#include <plat/regs-iic.h>
24#include <plat/iic.h>
25#include <plat/devs.h>
26#include <plat/cpu.h>
27
28static struct resource s3c_i2c_resource[] = {
29 [0] = {
30 .start = S3C_PA_IIC2,
31 .end = S3C_PA_IIC2 + SZ_4K - 1,
32 .flags = IORESOURCE_MEM,
33 },
34 [1] = {
35 .start = IRQ_CAN0,
36 .end = IRQ_CAN0,
37 .flags = IORESOURCE_IRQ,
38 },
39};
40
41struct platform_device s3c_device_i2c2 = {
42 .name = "s3c2410-i2c",
43 .id = 2,
44 .num_resources = ARRAY_SIZE(s3c_i2c_resource),
45 .resource = s3c_i2c_resource,
46};
47
48static struct s3c2410_platform_i2c default_i2c_data2 __initdata = {
49 .flags = 0,
50 .bus_num = 2,
51 .slave_addr = 0x10,
52 .frequency = 100*1000,
53 .sda_delay = 100,
54};
55
56void __init s3c_i2c2_set_platdata(struct s3c2410_platform_i2c *pd)
57{
58 struct s3c2410_platform_i2c *npd;
59
60 if (!pd)
61 pd = &default_i2c_data2;
62
63 npd = kmemdup(pd, sizeof(struct s3c2410_platform_i2c), GFP_KERNEL);
64 if (!npd)
65 printk(KERN_ERR "%s: no memory for platform data\n", __func__);
66 else if (!npd->cfg_gpio)
67 npd->cfg_gpio = s3c_i2c2_cfg_gpio;
68
69 s3c_device_i2c2.dev.platform_data = npd;
70}
diff --git a/arch/arm/plat-samsung/include/plat/devs.h b/arch/arm/plat-samsung/include/plat/devs.h
index ef69e56b2885..78d24202f4e4 100644
--- a/arch/arm/plat-samsung/include/plat/devs.h
+++ b/arch/arm/plat-samsung/include/plat/devs.h
@@ -45,6 +45,7 @@ extern struct platform_device s3c_device_lcd;
45extern struct platform_device s3c_device_wdt; 45extern struct platform_device s3c_device_wdt;
46extern struct platform_device s3c_device_i2c0; 46extern struct platform_device s3c_device_i2c0;
47extern struct platform_device s3c_device_i2c1; 47extern struct platform_device s3c_device_i2c1;
48extern struct platform_device s3c_device_i2c2;
48extern struct platform_device s3c_device_rtc; 49extern struct platform_device s3c_device_rtc;
49extern struct platform_device s3c_device_adc; 50extern struct platform_device s3c_device_adc;
50extern struct platform_device s3c_device_sdi; 51extern struct platform_device s3c_device_sdi;
diff --git a/arch/arm/plat-samsung/include/plat/fb.h b/arch/arm/plat-samsung/include/plat/fb.h
index 1f85649d8c18..27d3b497b55b 100644
--- a/arch/arm/plat-samsung/include/plat/fb.h
+++ b/arch/arm/plat-samsung/include/plat/fb.h
@@ -84,4 +84,11 @@ extern void s3c64xx_fb_gpio_setup_24bpp(void);
84 */ 84 */
85extern void s5pc100_fb_gpio_setup_24bpp(void); 85extern void s5pc100_fb_gpio_setup_24bpp(void);
86 86
87/**
88 * s5pv210_fb_gpio_setup_24bpp() - S5PV210/S5PC110 setup function for 24bpp LCD
89 *
90 * Initialise the GPIO for an 24bpp LCD display on the RGB interface.
91 */
92extern void s5pv210_fb_gpio_setup_24bpp(void);
93
87#endif /* __PLAT_S3C_FB_H */ 94#endif /* __PLAT_S3C_FB_H */
diff --git a/arch/arm/plat-samsung/include/plat/iic-core.h b/arch/arm/plat-samsung/include/plat/iic-core.h
index 36397ca20962..f182669b8e8e 100644
--- a/arch/arm/plat-samsung/include/plat/iic-core.h
+++ b/arch/arm/plat-samsung/include/plat/iic-core.h
@@ -32,4 +32,11 @@ static inline void s3c_i2c1_setname(char *name)
32#endif 32#endif
33} 33}
34 34
35static inline void s3c_i2c2_setname(char *name)
36{
37#ifdef CONFIG_S3C_DEV_I2C2
38 s3c_device_i2c2.name = name;
39#endif
40}
41
35#endif /* __ASM_ARCH_IIC_H */ 42#endif /* __ASM_ARCH_IIC_H */
diff --git a/arch/arm/plat-samsung/include/plat/iic.h b/arch/arm/plat-samsung/include/plat/iic.h
index 3083df00dee6..133308bf595d 100644
--- a/arch/arm/plat-samsung/include/plat/iic.h
+++ b/arch/arm/plat-samsung/include/plat/iic.h
@@ -54,9 +54,11 @@ struct s3c2410_platform_i2c {
54 */ 54 */
55extern void s3c_i2c0_set_platdata(struct s3c2410_platform_i2c *i2c); 55extern void s3c_i2c0_set_platdata(struct s3c2410_platform_i2c *i2c);
56extern void s3c_i2c1_set_platdata(struct s3c2410_platform_i2c *i2c); 56extern void s3c_i2c1_set_platdata(struct s3c2410_platform_i2c *i2c);
57extern void s3c_i2c2_set_platdata(struct s3c2410_platform_i2c *i2c);
57 58
58/* defined by architecture to configure gpio */ 59/* defined by architecture to configure gpio */
59extern void s3c_i2c0_cfg_gpio(struct platform_device *dev); 60extern void s3c_i2c0_cfg_gpio(struct platform_device *dev);
60extern void s3c_i2c1_cfg_gpio(struct platform_device *dev); 61extern void s3c_i2c1_cfg_gpio(struct platform_device *dev);
62extern void s3c_i2c2_cfg_gpio(struct platform_device *dev);
61 63
62#endif /* __ASM_ARCH_IIC_H */ 64#endif /* __ASM_ARCH_IIC_H */
diff --git a/arch/arm/plat-samsung/include/plat/sdhci.h b/arch/arm/plat-samsung/include/plat/sdhci.h
index 7d07cd7aa4f2..13f9fb20900a 100644
--- a/arch/arm/plat-samsung/include/plat/sdhci.h
+++ b/arch/arm/plat-samsung/include/plat/sdhci.h
@@ -75,6 +75,9 @@ extern void s5pc100_setup_sdhci0_cfg_gpio(struct platform_device *, int w);
75extern void s5pc100_setup_sdhci1_cfg_gpio(struct platform_device *, int w); 75extern void s5pc100_setup_sdhci1_cfg_gpio(struct platform_device *, int w);
76extern void s5pc100_setup_sdhci2_cfg_gpio(struct platform_device *, int w); 76extern void s5pc100_setup_sdhci2_cfg_gpio(struct platform_device *, int w);
77extern void s3c64xx_setup_sdhci2_cfg_gpio(struct platform_device *, int w); 77extern void s3c64xx_setup_sdhci2_cfg_gpio(struct platform_device *, int w);
78extern void s5pv210_setup_sdhci0_cfg_gpio(struct platform_device *, int w);
79extern void s5pv210_setup_sdhci1_cfg_gpio(struct platform_device *, int w);
80extern void s5pv210_setup_sdhci2_cfg_gpio(struct platform_device *, int w);
78 81
79/* S3C6400 SDHCI setup */ 82/* S3C6400 SDHCI setup */
80 83
@@ -218,4 +221,56 @@ static inline void s5pc100_default_sdhci1(void) { }
218static inline void s5pc100_default_sdhci2(void) { } 221static inline void s5pc100_default_sdhci2(void) { }
219#endif /* CONFIG_S5PC100_SETUP_SDHCI */ 222#endif /* CONFIG_S5PC100_SETUP_SDHCI */
220 223
224
225/* S5PC110 SDHCI setup */
226#ifdef CONFIG_S5PV210_SETUP_SDHCI
227extern char *s5pv210_hsmmc_clksrcs[4];
228
229extern void s5pv210_setup_sdhci_cfg_card(struct platform_device *dev,
230 void __iomem *r,
231 struct mmc_ios *ios,
232 struct mmc_card *card);
233
234#ifdef CONFIG_S3C_DEV_HSMMC
235static inline void s5pv210_default_sdhci0(void)
236{
237 s3c_hsmmc0_def_platdata.clocks = s5pv210_hsmmc_clksrcs;
238 s3c_hsmmc0_def_platdata.cfg_gpio = s5pv210_setup_sdhci0_cfg_gpio;
239 s3c_hsmmc0_def_platdata.cfg_card = s5pv210_setup_sdhci_cfg_card;
240}
241#else
242static inline void s5pc100_default_sdhci0(void) { }
243#endif /* CONFIG_S3C_DEV_HSMMC */
244
245#ifdef CONFIG_S3C_DEV_HSMMC1
246static inline void s5pv210_default_sdhci1(void)
247{
248 s3c_hsmmc1_def_platdata.clocks = s5pv210_hsmmc_clksrcs;
249 s3c_hsmmc1_def_platdata.cfg_gpio = s5pv210_setup_sdhci1_cfg_gpio;
250 s3c_hsmmc1_def_platdata.cfg_card = s5pv210_setup_sdhci_cfg_card;
251}
252#else
253static inline void s5pv210_default_sdhci1(void) { }
254#endif /* CONFIG_S3C_DEV_HSMMC1 */
255
256#ifdef CONFIG_S3C_DEV_HSMMC2
257static inline void s5pv210_default_sdhci2(void)
258{
259 s3c_hsmmc2_def_platdata.clocks = s5pv210_hsmmc_clksrcs;
260 s3c_hsmmc2_def_platdata.cfg_gpio = s5pv210_setup_sdhci2_cfg_gpio;
261 s3c_hsmmc2_def_platdata.cfg_card = s5pv210_setup_sdhci_cfg_card;
262}
263#else
264static inline void s5pv210_default_sdhci2(void) { }
265#endif /* CONFIG_S3C_DEV_HSMMC2 */
266
267#else
268static inline void s5pv210_default_sdhci0(void) { }
269static inline void s5pv210_default_sdhci1(void) { }
270static inline void s5pv210_default_sdhci2(void) { }
271#endif /* CONFIG_S5PC100_SETUP_SDHCI */
272
273
274
275
221#endif /* __PLAT_S3C_SDHCI_H */ 276#endif /* __PLAT_S3C_SDHCI_H */