diff options
Diffstat (limited to 'arch/arm/plat-samsung')
-rw-r--r-- | arch/arm/plat-samsung/Kconfig | 7 | ||||
-rw-r--r-- | arch/arm/plat-samsung/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/plat-samsung/dev-i2c2.c | 70 | ||||
-rw-r--r-- | arch/arm/plat-samsung/include/plat/devs.h | 1 | ||||
-rw-r--r-- | arch/arm/plat-samsung/include/plat/fb.h | 7 | ||||
-rw-r--r-- | arch/arm/plat-samsung/include/plat/iic-core.h | 7 | ||||
-rw-r--r-- | arch/arm/plat-samsung/include/plat/iic.h | 2 | ||||
-rw-r--r-- | arch/arm/plat-samsung/include/plat/sdhci.h | 55 |
8 files changed, 149 insertions, 1 deletions
diff --git a/arch/arm/plat-samsung/Kconfig b/arch/arm/plat-samsung/Kconfig index 229919e9744c..b787d576d4b3 100644 --- a/arch/arm/plat-samsung/Kconfig +++ b/arch/arm/plat-samsung/Kconfig | |||
@@ -6,7 +6,7 @@ | |||
6 | 6 | ||
7 | config PLAT_SAMSUNG | 7 | config PLAT_SAMSUNG |
8 | bool | 8 | bool |
9 | depends on ARCH_S3C2410 || ARCH_S3C24A0 || ARCH_S3C64XX || ARCH_S5PC1XX | 9 | depends on ARCH_S3C2410 || ARCH_S3C24A0 || ARCH_S3C64XX |
10 | select NO_IOPORT | 10 | select NO_IOPORT |
11 | default y | 11 | default y |
12 | help | 12 | help |
@@ -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 | ||
173 | config S3C_DEV_I2C2 | ||
174 | bool | ||
175 | help | ||
176 | Compile in platform device definitions for I2C channel 2 | ||
177 | |||
173 | config S3C_DEV_FB | 178 | config 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 | |||
36 | obj-$(CONFIG_S3C_DEV_HWMON) += dev-hwmon.o | 36 | obj-$(CONFIG_S3C_DEV_HWMON) += dev-hwmon.o |
37 | obj-y += dev-i2c0.o | 37 | obj-y += dev-i2c0.o |
38 | obj-$(CONFIG_S3C_DEV_I2C1) += dev-i2c1.o | 38 | obj-$(CONFIG_S3C_DEV_I2C1) += dev-i2c1.o |
39 | obj-$(CONFIG_S3C_DEV_I2C2) += dev-i2c2.o | ||
39 | obj-$(CONFIG_S3C_DEV_FB) += dev-fb.o | 40 | obj-$(CONFIG_S3C_DEV_FB) += dev-fb.o |
40 | obj-y += dev-uart.o | 41 | obj-y += dev-uart.o |
41 | obj-$(CONFIG_S3C_DEV_USB_HOST) += dev-usb.o | 42 | obj-$(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 | |||
28 | static 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 | |||
41 | struct 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 | |||
48 | static 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 | |||
56 | void __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 e03bce04a79a..fed082a28ad9 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; | |||
45 | extern struct platform_device s3c_device_wdt; | 45 | extern struct platform_device s3c_device_wdt; |
46 | extern struct platform_device s3c_device_i2c0; | 46 | extern struct platform_device s3c_device_i2c0; |
47 | extern struct platform_device s3c_device_i2c1; | 47 | extern struct platform_device s3c_device_i2c1; |
48 | extern struct platform_device s3c_device_i2c2; | ||
48 | extern struct platform_device s3c_device_rtc; | 49 | extern struct platform_device s3c_device_rtc; |
49 | extern struct platform_device s3c_device_adc; | 50 | extern struct platform_device s3c_device_adc; |
50 | extern struct platform_device s3c_device_sdi; | 51 | extern 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 | */ |
85 | extern void s5pc100_fb_gpio_setup_24bpp(void); | 85 | extern 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 | */ | ||
92 | extern 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 | ||
35 | static 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 | */ |
55 | extern void s3c_i2c0_set_platdata(struct s3c2410_platform_i2c *i2c); | 55 | extern void s3c_i2c0_set_platdata(struct s3c2410_platform_i2c *i2c); |
56 | extern void s3c_i2c1_set_platdata(struct s3c2410_platform_i2c *i2c); | 56 | extern void s3c_i2c1_set_platdata(struct s3c2410_platform_i2c *i2c); |
57 | extern 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 */ |
59 | extern void s3c_i2c0_cfg_gpio(struct platform_device *dev); | 60 | extern void s3c_i2c0_cfg_gpio(struct platform_device *dev); |
60 | extern void s3c_i2c1_cfg_gpio(struct platform_device *dev); | 61 | extern void s3c_i2c1_cfg_gpio(struct platform_device *dev); |
62 | extern 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); | |||
75 | extern void s5pc100_setup_sdhci1_cfg_gpio(struct platform_device *, int w); | 75 | extern void s5pc100_setup_sdhci1_cfg_gpio(struct platform_device *, int w); |
76 | extern void s5pc100_setup_sdhci2_cfg_gpio(struct platform_device *, int w); | 76 | extern void s5pc100_setup_sdhci2_cfg_gpio(struct platform_device *, int w); |
77 | extern void s3c64xx_setup_sdhci2_cfg_gpio(struct platform_device *, int w); | 77 | extern void s3c64xx_setup_sdhci2_cfg_gpio(struct platform_device *, int w); |
78 | extern void s5pv210_setup_sdhci0_cfg_gpio(struct platform_device *, int w); | ||
79 | extern void s5pv210_setup_sdhci1_cfg_gpio(struct platform_device *, int w); | ||
80 | extern 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) { } | |||
218 | static inline void s5pc100_default_sdhci2(void) { } | 221 | static 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 | ||
227 | extern char *s5pv210_hsmmc_clksrcs[4]; | ||
228 | |||
229 | extern 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 | ||
235 | static 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 | ||
242 | static inline void s5pc100_default_sdhci0(void) { } | ||
243 | #endif /* CONFIG_S3C_DEV_HSMMC */ | ||
244 | |||
245 | #ifdef CONFIG_S3C_DEV_HSMMC1 | ||
246 | static 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 | ||
253 | static inline void s5pv210_default_sdhci1(void) { } | ||
254 | #endif /* CONFIG_S3C_DEV_HSMMC1 */ | ||
255 | |||
256 | #ifdef CONFIG_S3C_DEV_HSMMC2 | ||
257 | static 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 | ||
264 | static inline void s5pv210_default_sdhci2(void) { } | ||
265 | #endif /* CONFIG_S3C_DEV_HSMMC2 */ | ||
266 | |||
267 | #else | ||
268 | static inline void s5pv210_default_sdhci0(void) { } | ||
269 | static inline void s5pv210_default_sdhci1(void) { } | ||
270 | static 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 */ |