diff options
Diffstat (limited to 'arch/arm/plat-samsung')
22 files changed, 577 insertions, 60 deletions
diff --git a/arch/arm/plat-samsung/Kconfig b/arch/arm/plat-samsung/Kconfig index 2753fb3e4f73..4529dd6232bc 100644 --- a/arch/arm/plat-samsung/Kconfig +++ b/arch/arm/plat-samsung/Kconfig | |||
@@ -160,6 +160,11 @@ config S3C_DEV_HSMMC2 | |||
160 | help | 160 | help |
161 | Compile in platform device definitions for HSMMC channel 2 | 161 | Compile in platform device definitions for HSMMC channel 2 |
162 | 162 | ||
163 | config S3C_DEV_HSMMC3 | ||
164 | bool | ||
165 | help | ||
166 | Compile in platform device definitions for HSMMC channel 3 | ||
167 | |||
163 | config S3C_DEV_HWMON | 168 | config S3C_DEV_HWMON |
164 | bool | 169 | bool |
165 | help | 170 | help |
@@ -216,6 +221,11 @@ config SAMSUNG_DEV_ADC | |||
216 | help | 221 | help |
217 | Compile in platform device definition for ADC controller | 222 | Compile in platform device definition for ADC controller |
218 | 223 | ||
224 | config SAMSUNG_DEV_IDE | ||
225 | bool | ||
226 | help | ||
227 | Compile in platform device definitions for IDE | ||
228 | |||
219 | config S3C64XX_DEV_SPI | 229 | config S3C64XX_DEV_SPI |
220 | bool | 230 | bool |
221 | help | 231 | help |
@@ -227,6 +237,11 @@ config SAMSUNG_DEV_TS | |||
227 | help | 237 | help |
228 | Common in platform device definitions for touchscreen device | 238 | Common in platform device definitions for touchscreen device |
229 | 239 | ||
240 | config SAMSUNG_DEV_KEYPAD | ||
241 | bool | ||
242 | help | ||
243 | Compile in platform device definitions for keypad | ||
244 | |||
230 | # DMA | 245 | # DMA |
231 | 246 | ||
232 | config S3C_DMA | 247 | config S3C_DMA |
diff --git a/arch/arm/plat-samsung/Makefile b/arch/arm/plat-samsung/Makefile index b1d82cc5e716..4d8ff923207a 100644 --- a/arch/arm/plat-samsung/Makefile +++ b/arch/arm/plat-samsung/Makefile | |||
@@ -12,7 +12,7 @@ obj- := | |||
12 | # Objects we always build independent of SoC choice | 12 | # Objects we always build independent of SoC choice |
13 | 13 | ||
14 | obj-y += init.o | 14 | obj-y += init.o |
15 | obj-y += time.o | 15 | obj-$(CONFIG_ARCH_USES_GETTIMEOFFSET) += time.o |
16 | obj-y += clock.o | 16 | obj-y += clock.o |
17 | obj-y += pwm-clock.o | 17 | obj-y += pwm-clock.o |
18 | obj-y += gpio.o | 18 | obj-y += gpio.o |
@@ -30,9 +30,12 @@ obj-$(CONFIG_S3C_ADC) += adc.o | |||
30 | 30 | ||
31 | # devices | 31 | # devices |
32 | 32 | ||
33 | obj-y += platformdata.o | ||
34 | |||
33 | obj-$(CONFIG_S3C_DEV_HSMMC) += dev-hsmmc.o | 35 | obj-$(CONFIG_S3C_DEV_HSMMC) += dev-hsmmc.o |
34 | obj-$(CONFIG_S3C_DEV_HSMMC1) += dev-hsmmc1.o | 36 | obj-$(CONFIG_S3C_DEV_HSMMC1) += dev-hsmmc1.o |
35 | obj-$(CONFIG_S3C_DEV_HSMMC2) += dev-hsmmc2.o | 37 | obj-$(CONFIG_S3C_DEV_HSMMC2) += dev-hsmmc2.o |
38 | obj-$(CONFIG_S3C_DEV_HSMMC3) += dev-hsmmc3.o | ||
36 | obj-$(CONFIG_S3C_DEV_HWMON) += dev-hwmon.o | 39 | obj-$(CONFIG_S3C_DEV_HWMON) += dev-hwmon.o |
37 | obj-y += dev-i2c0.o | 40 | obj-y += dev-i2c0.o |
38 | obj-$(CONFIG_S3C_DEV_I2C1) += dev-i2c1.o | 41 | obj-$(CONFIG_S3C_DEV_I2C1) += dev-i2c1.o |
@@ -47,7 +50,9 @@ obj-$(CONFIG_S3C_DEV_ONENAND) += dev-onenand.o | |||
47 | obj-$(CONFIG_S3C_DEV_RTC) += dev-rtc.o | 50 | obj-$(CONFIG_S3C_DEV_RTC) += dev-rtc.o |
48 | 51 | ||
49 | obj-$(CONFIG_SAMSUNG_DEV_ADC) += dev-adc.o | 52 | obj-$(CONFIG_SAMSUNG_DEV_ADC) += dev-adc.o |
53 | obj-$(CONFIG_SAMSUNG_DEV_IDE) += dev-ide.o | ||
50 | obj-$(CONFIG_SAMSUNG_DEV_TS) += dev-ts.o | 54 | obj-$(CONFIG_SAMSUNG_DEV_TS) += dev-ts.o |
55 | obj-$(CONFIG_SAMSUNG_DEV_KEYPAD) += dev-keypad.o | ||
51 | 56 | ||
52 | # DMA support | 57 | # DMA support |
53 | 58 | ||
diff --git a/arch/arm/plat-samsung/dev-hsmmc.c b/arch/arm/plat-samsung/dev-hsmmc.c index 4c05b39810e2..b0f93f11e281 100644 --- a/arch/arm/plat-samsung/dev-hsmmc.c +++ b/arch/arm/plat-samsung/dev-hsmmc.c | |||
@@ -60,6 +60,11 @@ void s3c_sdhci0_set_platdata(struct s3c_sdhci_platdata *pd) | |||
60 | struct s3c_sdhci_platdata *set = &s3c_hsmmc0_def_platdata; | 60 | struct s3c_sdhci_platdata *set = &s3c_hsmmc0_def_platdata; |
61 | 61 | ||
62 | set->max_width = pd->max_width; | 62 | set->max_width = pd->max_width; |
63 | set->cd_type = pd->cd_type; | ||
64 | set->ext_cd_init = pd->ext_cd_init; | ||
65 | set->ext_cd_cleanup = pd->ext_cd_cleanup; | ||
66 | set->ext_cd_gpio = pd->ext_cd_gpio; | ||
67 | set->ext_cd_gpio_invert = pd->ext_cd_gpio_invert; | ||
63 | 68 | ||
64 | if (pd->cfg_gpio) | 69 | if (pd->cfg_gpio) |
65 | set->cfg_gpio = pd->cfg_gpio; | 70 | set->cfg_gpio = pd->cfg_gpio; |
diff --git a/arch/arm/plat-samsung/dev-hsmmc1.c b/arch/arm/plat-samsung/dev-hsmmc1.c index e49bc4cd0ee6..1504fd802865 100644 --- a/arch/arm/plat-samsung/dev-hsmmc1.c +++ b/arch/arm/plat-samsung/dev-hsmmc1.c | |||
@@ -60,6 +60,11 @@ void s3c_sdhci1_set_platdata(struct s3c_sdhci_platdata *pd) | |||
60 | struct s3c_sdhci_platdata *set = &s3c_hsmmc1_def_platdata; | 60 | struct s3c_sdhci_platdata *set = &s3c_hsmmc1_def_platdata; |
61 | 61 | ||
62 | set->max_width = pd->max_width; | 62 | set->max_width = pd->max_width; |
63 | set->cd_type = pd->cd_type; | ||
64 | set->ext_cd_init = pd->ext_cd_init; | ||
65 | set->ext_cd_cleanup = pd->ext_cd_cleanup; | ||
66 | set->ext_cd_gpio = pd->ext_cd_gpio; | ||
67 | set->ext_cd_gpio_invert = pd->ext_cd_gpio_invert; | ||
63 | 68 | ||
64 | if (pd->cfg_gpio) | 69 | if (pd->cfg_gpio) |
65 | set->cfg_gpio = pd->cfg_gpio; | 70 | set->cfg_gpio = pd->cfg_gpio; |
diff --git a/arch/arm/plat-samsung/dev-hsmmc2.c b/arch/arm/plat-samsung/dev-hsmmc2.c index 824580bc0e06..b28ef173444d 100644 --- a/arch/arm/plat-samsung/dev-hsmmc2.c +++ b/arch/arm/plat-samsung/dev-hsmmc2.c | |||
@@ -61,6 +61,11 @@ void s3c_sdhci2_set_platdata(struct s3c_sdhci_platdata *pd) | |||
61 | struct s3c_sdhci_platdata *set = &s3c_hsmmc2_def_platdata; | 61 | struct s3c_sdhci_platdata *set = &s3c_hsmmc2_def_platdata; |
62 | 62 | ||
63 | set->max_width = pd->max_width; | 63 | set->max_width = pd->max_width; |
64 | set->cd_type = pd->cd_type; | ||
65 | set->ext_cd_init = pd->ext_cd_init; | ||
66 | set->ext_cd_cleanup = pd->ext_cd_cleanup; | ||
67 | set->ext_cd_gpio = pd->ext_cd_gpio; | ||
68 | set->ext_cd_gpio_invert = pd->ext_cd_gpio_invert; | ||
64 | 69 | ||
65 | if (pd->cfg_gpio) | 70 | if (pd->cfg_gpio) |
66 | set->cfg_gpio = pd->cfg_gpio; | 71 | set->cfg_gpio = pd->cfg_gpio; |
diff --git a/arch/arm/plat-samsung/dev-hsmmc3.c b/arch/arm/plat-samsung/dev-hsmmc3.c new file mode 100644 index 000000000000..85aaf0f2842f --- /dev/null +++ b/arch/arm/plat-samsung/dev-hsmmc3.c | |||
@@ -0,0 +1,77 @@ | |||
1 | /* linux/arch/arm/plat-samsung/dev-hsmmc3.c | ||
2 | * | ||
3 | * Copyright (c) 2010 Samsung Electronics Co., Ltd. | ||
4 | * http://www.samsung.com | ||
5 | * | ||
6 | * Copyright (c) 2008 Simtec Electronics | ||
7 | * Ben Dooks <ben@simtec.co.uk> | ||
8 | * http://armlinux.simtec.co.uk/ | ||
9 | * | ||
10 | * Based on arch/arm/plat-samsung/dev-hsmmc1.c | ||
11 | * | ||
12 | * Samsung device definition for hsmmc device 3 | ||
13 | * | ||
14 | * This program is free software; you can redistribute it and/or modify | ||
15 | * it under the terms of the GNU General Public License version 2 as | ||
16 | * published by the Free Software Foundation. | ||
17 | */ | ||
18 | |||
19 | #include <linux/kernel.h> | ||
20 | #include <linux/platform_device.h> | ||
21 | #include <linux/mmc/host.h> | ||
22 | |||
23 | #include <mach/map.h> | ||
24 | #include <plat/sdhci.h> | ||
25 | #include <plat/devs.h> | ||
26 | |||
27 | #define S3C_SZ_HSMMC (0x1000) | ||
28 | |||
29 | static struct resource s3c_hsmmc3_resource[] = { | ||
30 | [0] = { | ||
31 | .start = S3C_PA_HSMMC3, | ||
32 | .end = S3C_PA_HSMMC3 + S3C_SZ_HSMMC - 1, | ||
33 | .flags = IORESOURCE_MEM, | ||
34 | }, | ||
35 | [1] = { | ||
36 | .start = IRQ_MMC3, | ||
37 | .end = IRQ_MMC3, | ||
38 | .flags = IORESOURCE_IRQ, | ||
39 | } | ||
40 | }; | ||
41 | |||
42 | static u64 s3c_device_hsmmc3_dmamask = 0xffffffffUL; | ||
43 | |||
44 | struct s3c_sdhci_platdata s3c_hsmmc3_def_platdata = { | ||
45 | .max_width = 4, | ||
46 | .host_caps = (MMC_CAP_4_BIT_DATA | | ||
47 | MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED), | ||
48 | }; | ||
49 | |||
50 | struct platform_device s3c_device_hsmmc3 = { | ||
51 | .name = "s3c-sdhci", | ||
52 | .id = 3, | ||
53 | .num_resources = ARRAY_SIZE(s3c_hsmmc3_resource), | ||
54 | .resource = s3c_hsmmc3_resource, | ||
55 | .dev = { | ||
56 | .dma_mask = &s3c_device_hsmmc3_dmamask, | ||
57 | .coherent_dma_mask = 0xffffffffUL, | ||
58 | .platform_data = &s3c_hsmmc3_def_platdata, | ||
59 | }, | ||
60 | }; | ||
61 | |||
62 | void s3c_sdhci3_set_platdata(struct s3c_sdhci_platdata *pd) | ||
63 | { | ||
64 | struct s3c_sdhci_platdata *set = &s3c_hsmmc3_def_platdata; | ||
65 | |||
66 | set->max_width = pd->max_width; | ||
67 | set->cd_type = pd->cd_type; | ||
68 | set->ext_cd_init = pd->ext_cd_init; | ||
69 | set->ext_cd_cleanup = pd->ext_cd_cleanup; | ||
70 | set->ext_cd_gpio = pd->ext_cd_gpio; | ||
71 | set->ext_cd_gpio_invert = pd->ext_cd_gpio_invert; | ||
72 | |||
73 | if (pd->cfg_gpio) | ||
74 | set->cfg_gpio = pd->cfg_gpio; | ||
75 | if (pd->cfg_card) | ||
76 | set->cfg_card = pd->cfg_card; | ||
77 | } | ||
diff --git a/arch/arm/plat-samsung/dev-ide.c b/arch/arm/plat-samsung/dev-ide.c new file mode 100644 index 000000000000..b497982795a7 --- /dev/null +++ b/arch/arm/plat-samsung/dev-ide.c | |||
@@ -0,0 +1,44 @@ | |||
1 | /* linux/arch/arm/plat-samsung/dev-ide.c | ||
2 | * | ||
3 | * Copyright (c) 2010 Samsung Electronics Co., Ltd. | ||
4 | * http://www.samsung.com | ||
5 | * | ||
6 | * Samsung CF-ATA device definition. | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License version 2 as | ||
10 | * published by the Free Software Foundation. | ||
11 | */ | ||
12 | |||
13 | #include <linux/kernel.h> | ||
14 | #include <linux/interrupt.h> | ||
15 | #include <linux/platform_device.h> | ||
16 | |||
17 | #include <mach/map.h> | ||
18 | #include <plat/ata.h> | ||
19 | #include <plat/devs.h> | ||
20 | |||
21 | static struct resource s3c_cfcon_resource[] = { | ||
22 | [0] = { | ||
23 | .start = SAMSUNG_PA_CFCON, | ||
24 | .end = SAMSUNG_PA_CFCON + SZ_16K - 1, | ||
25 | .flags = IORESOURCE_MEM, | ||
26 | }, | ||
27 | [1] = { | ||
28 | .start = IRQ_CFCON, | ||
29 | .end = IRQ_CFCON, | ||
30 | .flags = IORESOURCE_IRQ, | ||
31 | }, | ||
32 | }; | ||
33 | |||
34 | struct platform_device s3c_device_cfcon = { | ||
35 | .id = 0, | ||
36 | .num_resources = ARRAY_SIZE(s3c_cfcon_resource), | ||
37 | .resource = s3c_cfcon_resource, | ||
38 | }; | ||
39 | |||
40 | void s3c_ide_set_platdata(struct s3c_ide_platdata *pdata) | ||
41 | { | ||
42 | s3c_set_platdata(pdata, sizeof(struct s3c_ide_platdata), | ||
43 | &s3c_device_cfcon); | ||
44 | } | ||
diff --git a/arch/arm/plat-samsung/dev-keypad.c b/arch/arm/plat-samsung/dev-keypad.c new file mode 100644 index 000000000000..677c2d731b65 --- /dev/null +++ b/arch/arm/plat-samsung/dev-keypad.c | |||
@@ -0,0 +1,50 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/plat-samsung/dev-keypad.c | ||
3 | * | ||
4 | * Copyright (C) 2010 Samsung Electronics Co.Ltd | ||
5 | * Author: Joonyoung Shim <jy0922.shim@samsung.com> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify it | ||
8 | * under the terms of the GNU General Public License as published by the | ||
9 | * Free Software Foundation; either version 2 of the License, or (at your | ||
10 | * option) any later version. | ||
11 | * | ||
12 | */ | ||
13 | |||
14 | #include <linux/platform_device.h> | ||
15 | #include <mach/irqs.h> | ||
16 | #include <mach/map.h> | ||
17 | #include <plat/cpu.h> | ||
18 | #include <plat/devs.h> | ||
19 | #include <plat/keypad.h> | ||
20 | |||
21 | static struct resource samsung_keypad_resources[] = { | ||
22 | [0] = { | ||
23 | .start = SAMSUNG_PA_KEYPAD, | ||
24 | .end = SAMSUNG_PA_KEYPAD + 0x20 - 1, | ||
25 | .flags = IORESOURCE_MEM, | ||
26 | }, | ||
27 | [1] = { | ||
28 | .start = IRQ_KEYPAD, | ||
29 | .end = IRQ_KEYPAD, | ||
30 | .flags = IORESOURCE_IRQ, | ||
31 | }, | ||
32 | }; | ||
33 | |||
34 | struct platform_device samsung_device_keypad = { | ||
35 | .name = "samsung-keypad", | ||
36 | .id = -1, | ||
37 | .num_resources = ARRAY_SIZE(samsung_keypad_resources), | ||
38 | .resource = samsung_keypad_resources, | ||
39 | }; | ||
40 | |||
41 | void __init samsung_keypad_set_platdata(struct samsung_keypad_platdata *pd) | ||
42 | { | ||
43 | struct samsung_keypad_platdata *npd; | ||
44 | |||
45 | npd = s3c_set_platdata(pd, sizeof(struct samsung_keypad_platdata), | ||
46 | &samsung_device_keypad); | ||
47 | |||
48 | if (!npd->cfg_gpio) | ||
49 | npd->cfg_gpio = samsung_keypad_cfg_gpio; | ||
50 | } | ||
diff --git a/arch/arm/plat-samsung/dev-wdt.c b/arch/arm/plat-samsung/dev-wdt.c index 5efca87cddbd..019b5b8cf14c 100644 --- a/arch/arm/plat-samsung/dev-wdt.c +++ b/arch/arm/plat-samsung/dev-wdt.c | |||
@@ -21,7 +21,7 @@ | |||
21 | static struct resource s3c_wdt_resource[] = { | 21 | static struct resource s3c_wdt_resource[] = { |
22 | [0] = { | 22 | [0] = { |
23 | .start = S3C_PA_WDT, | 23 | .start = S3C_PA_WDT, |
24 | .end = S3C_PA_WDT + SZ_1M - 1, | 24 | .end = S3C_PA_WDT + SZ_1K, |
25 | .flags = IORESOURCE_MEM, | 25 | .flags = IORESOURCE_MEM, |
26 | }, | 26 | }, |
27 | [1] = { | 27 | [1] = { |
diff --git a/arch/arm/plat-samsung/gpiolib.c b/arch/arm/plat-samsung/gpiolib.c index 8a8ba8bc1d96..c354089254fc 100644 --- a/arch/arm/plat-samsung/gpiolib.c +++ b/arch/arm/plat-samsung/gpiolib.c | |||
@@ -18,7 +18,7 @@ | |||
18 | #include <linux/kernel.h> | 18 | #include <linux/kernel.h> |
19 | #include <linux/irq.h> | 19 | #include <linux/irq.h> |
20 | #include <linux/io.h> | 20 | #include <linux/io.h> |
21 | #include <mach/gpio.h> | 21 | #include <linux/gpio.h> |
22 | #include <plat/gpio-core.h> | 22 | #include <plat/gpio-core.h> |
23 | #include <plat/gpio-cfg.h> | 23 | #include <plat/gpio-cfg.h> |
24 | #include <plat/gpio-cfg-helpers.h> | 24 | #include <plat/gpio-cfg-helpers.h> |
diff --git a/arch/arm/plat-samsung/include/plat/adc-core.h b/arch/arm/plat-samsung/include/plat/adc-core.h new file mode 100644 index 000000000000..a281568d5856 --- /dev/null +++ b/arch/arm/plat-samsung/include/plat/adc-core.h | |||
@@ -0,0 +1,28 @@ | |||
1 | /* linux/arch/arm/plat-samsung/include/plat/adc-core.h | ||
2 | * | ||
3 | * Copyright (c) 2010 Samsung Electronics Co., Ltd. | ||
4 | * http://www.samsung.com/ | ||
5 | * | ||
6 | * Samsung ADC Controller core functions | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License version 2 as | ||
10 | * published by the Free Software Foundation. | ||
11 | */ | ||
12 | |||
13 | #ifndef __ASM_PLAT_ADC_CORE_H | ||
14 | #define __ASM_PLAT_ADC_CORE_H __FILE__ | ||
15 | |||
16 | /* These functions are only for use with the core support code, such as | ||
17 | * the cpu specific initialisation code | ||
18 | */ | ||
19 | |||
20 | /* re-define device name depending on support. */ | ||
21 | static inline void s3c_adc_setname(char *name) | ||
22 | { | ||
23 | #ifdef CONFIG_SAMSUNG_DEV_ADC | ||
24 | s3c_device_adc.name = name; | ||
25 | #endif | ||
26 | } | ||
27 | |||
28 | #endif /* __ASM_PLAT_ADC_CORE_H */ | ||
diff --git a/arch/arm/plat-samsung/include/plat/ata-core.h b/arch/arm/plat-samsung/include/plat/ata-core.h new file mode 100644 index 000000000000..f5a4ec7141b1 --- /dev/null +++ b/arch/arm/plat-samsung/include/plat/ata-core.h | |||
@@ -0,0 +1,28 @@ | |||
1 | /* linux/arch/arm/plat-samsung/include/plat/ata-core.h | ||
2 | * | ||
3 | * Copyright (c) 2010 Samsung Electronics Co., Ltd. | ||
4 | * http://www.samsung.com | ||
5 | * | ||
6 | * Samsung CF-ATA Controller core functions | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License version 2 as | ||
10 | * published by the Free Software Foundation. | ||
11 | */ | ||
12 | |||
13 | #ifndef __ASM_PLAT_ATA_CORE_H | ||
14 | #define __ASM_PLAT_ATA_CORE_H __FILE__ | ||
15 | |||
16 | /* These functions are only for use with the core support code, such as | ||
17 | * the cpu specific initialisation code | ||
18 | */ | ||
19 | |||
20 | /* re-define device name depending on support. */ | ||
21 | static inline void s3c_cfcon_setname(char *name) | ||
22 | { | ||
23 | #ifdef CONFIG_SAMSUNG_DEV_IDE | ||
24 | s3c_device_cfcon.name = name; | ||
25 | #endif | ||
26 | } | ||
27 | |||
28 | #endif /* __ASM_PLAT_ATA_CORE_H */ | ||
diff --git a/arch/arm/plat-samsung/include/plat/ata.h b/arch/arm/plat-samsung/include/plat/ata.h new file mode 100644 index 000000000000..2a3855a8372a --- /dev/null +++ b/arch/arm/plat-samsung/include/plat/ata.h | |||
@@ -0,0 +1,36 @@ | |||
1 | /* linux/arch/arm/plat-samsung/include/plat/ata.h | ||
2 | * | ||
3 | * Copyright (c) 2010 Samsung Electronics Co., Ltd. | ||
4 | * http://www.samsung.com | ||
5 | * | ||
6 | * Samsung CF-ATA platform_device info | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License version 2 as | ||
10 | * published by the Free Software Foundation. | ||
11 | */ | ||
12 | |||
13 | #ifndef __ASM_PLAT_ATA_H | ||
14 | #define __ASM_PLAT_ATA_H __FILE__ | ||
15 | |||
16 | /** | ||
17 | * struct s3c_ide_platdata - S3C IDE driver platform data. | ||
18 | * @setup_gpio: Setup the external GPIO pins to the right state for data | ||
19 | * transfer in true-ide mode. | ||
20 | */ | ||
21 | struct s3c_ide_platdata { | ||
22 | void (*setup_gpio)(void); | ||
23 | }; | ||
24 | |||
25 | /* | ||
26 | * s3c_ide_set_platdata() - Setup the platform specifc data for IDE driver. | ||
27 | * @pdata: Platform data for IDE driver. | ||
28 | */ | ||
29 | extern void s3c_ide_set_platdata(struct s3c_ide_platdata *pdata); | ||
30 | |||
31 | /* architecture-specific IDE configuration */ | ||
32 | extern void s3c64xx_ide_setup_gpio(void); | ||
33 | extern void s5pc100_ide_setup_gpio(void); | ||
34 | extern void s5pv210_ide_setup_gpio(void); | ||
35 | |||
36 | #endif /*__ASM_PLAT_ATA_H */ | ||
diff --git a/arch/arm/plat-samsung/include/plat/devs.h b/arch/arm/plat-samsung/include/plat/devs.h index e6144e4b9118..85f6f23a510f 100644 --- a/arch/arm/plat-samsung/include/plat/devs.h +++ b/arch/arm/plat-samsung/include/plat/devs.h | |||
@@ -54,6 +54,8 @@ extern struct platform_device s3c_device_hwmon; | |||
54 | extern struct platform_device s3c_device_hsmmc0; | 54 | extern struct platform_device s3c_device_hsmmc0; |
55 | extern struct platform_device s3c_device_hsmmc1; | 55 | extern struct platform_device s3c_device_hsmmc1; |
56 | extern struct platform_device s3c_device_hsmmc2; | 56 | extern struct platform_device s3c_device_hsmmc2; |
57 | extern struct platform_device s3c_device_hsmmc3; | ||
58 | extern struct platform_device s3c_device_cfcon; | ||
57 | 59 | ||
58 | extern struct platform_device s3c_device_spi0; | 60 | extern struct platform_device s3c_device_spi0; |
59 | extern struct platform_device s3c_device_spi1; | 61 | extern struct platform_device s3c_device_spi1; |
@@ -100,6 +102,12 @@ extern struct platform_device s5pc100_device_iis0; | |||
100 | extern struct platform_device s5pc100_device_iis1; | 102 | extern struct platform_device s5pc100_device_iis1; |
101 | extern struct platform_device s5pc100_device_iis2; | 103 | extern struct platform_device s5pc100_device_iis2; |
102 | 104 | ||
105 | extern struct platform_device samsung_device_keypad; | ||
106 | |||
107 | extern struct platform_device s5p_device_fimc0; | ||
108 | extern struct platform_device s5p_device_fimc1; | ||
109 | extern struct platform_device s5p_device_fimc2; | ||
110 | |||
103 | /* s3c2440 specific devices */ | 111 | /* s3c2440 specific devices */ |
104 | 112 | ||
105 | #ifdef CONFIG_CPU_S3C2440 | 113 | #ifdef CONFIG_CPU_S3C2440 |
@@ -108,3 +116,15 @@ extern struct platform_device s3c_device_camif; | |||
108 | extern struct platform_device s3c_device_ac97; | 116 | extern struct platform_device s3c_device_ac97; |
109 | 117 | ||
110 | #endif | 118 | #endif |
119 | |||
120 | /** | ||
121 | * s3c_set_platdata() - helper for setting platform data | ||
122 | * @pd: The default platform data for this device. | ||
123 | * @pdsize: The size of the platform data. | ||
124 | * @pdev: Pointer to the device to fill in. | ||
125 | * | ||
126 | * This helper replaces a number of calls that copy and then set the | ||
127 | * platform data of the device. | ||
128 | */ | ||
129 | extern void *s3c_set_platdata(void *pd, size_t pdsize, | ||
130 | struct platform_device *pdev); | ||
diff --git a/arch/arm/plat-samsung/include/plat/fimc-core.h b/arch/arm/plat-samsung/include/plat/fimc-core.h new file mode 100644 index 000000000000..81a3bfeeccad --- /dev/null +++ b/arch/arm/plat-samsung/include/plat/fimc-core.h | |||
@@ -0,0 +1,44 @@ | |||
1 | /* | ||
2 | * arch/arm/plat-samsung/include/plat/fimc-core.h | ||
3 | * | ||
4 | * Copyright 2010 Samsung Electronics Co., Ltd. | ||
5 | * Sylwester Nawrocki <s.nawrocki@samsung.com> | ||
6 | * | ||
7 | * Samsung camera interface driver core functions | ||
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 | #ifndef __ASM_PLAT_FIMC_CORE_H | ||
15 | #define __ASM_PLAT_FIMC_CORE_H __FILE__ | ||
16 | |||
17 | /* | ||
18 | * These functions are only for use with the core support code, such as | ||
19 | * the CPU-specific initialization code. | ||
20 | */ | ||
21 | |||
22 | /* Re-define device name to differentiate the subsystem in various SoCs. */ | ||
23 | static inline void s3c_fimc_setname(int id, char *name) | ||
24 | { | ||
25 | switch (id) { | ||
26 | #ifdef CONFIG_S5P_DEV_FIMC0 | ||
27 | case 0: | ||
28 | s5p_device_fimc0.name = name; | ||
29 | break; | ||
30 | #endif | ||
31 | #ifdef CONFIG_S5P_DEV_FIMC1 | ||
32 | case 1: | ||
33 | s5p_device_fimc1.name = name; | ||
34 | break; | ||
35 | #endif | ||
36 | #ifdef CONFIG_S5P_DEV_FIMC2 | ||
37 | case 2: | ||
38 | s5p_device_fimc2.name = name; | ||
39 | break; | ||
40 | #endif | ||
41 | } | ||
42 | } | ||
43 | |||
44 | #endif /* __ASM_PLAT_FIMC_CORE_H */ | ||
diff --git a/arch/arm/plat-samsung/include/plat/keypad-core.h b/arch/arm/plat-samsung/include/plat/keypad-core.h new file mode 100644 index 000000000000..d513e1b3a31e --- /dev/null +++ b/arch/arm/plat-samsung/include/plat/keypad-core.h | |||
@@ -0,0 +1,31 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/plat-samsung/include/plat/keypad-core.h | ||
3 | * | ||
4 | * Copyright (C) 2010 Samsung Electronics Co.Ltd | ||
5 | * Author: Joonyoung Shim <jy0922.shim@samsung.com> | ||
6 | * | ||
7 | * Samsung keypad controller core function | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify it | ||
10 | * under the terms of the GNU General Public License as published by the | ||
11 | * Free Software Foundation; either version 2 of the License, or (at your | ||
12 | * option) any later version. | ||
13 | * | ||
14 | */ | ||
15 | |||
16 | #ifndef __ASM_ARCH_KEYPAD_CORE_H | ||
17 | #define __ASM_ARCH_KEYPAD_CORE_H | ||
18 | |||
19 | /* These function are only for use with the core support code, such as | ||
20 | * the cpu specific initialisation code | ||
21 | */ | ||
22 | |||
23 | /* re-define device name depending on support. */ | ||
24 | static inline void samsung_keypad_setname(char *name) | ||
25 | { | ||
26 | #ifdef CONFIG_SAMSUNG_DEV_KEYPAD | ||
27 | samsung_device_keypad.name = name; | ||
28 | #endif | ||
29 | } | ||
30 | |||
31 | #endif /* __ASM_ARCH_KEYPAD_CORE_H */ | ||
diff --git a/arch/arm/plat-samsung/include/plat/keypad.h b/arch/arm/plat-samsung/include/plat/keypad.h index 3a70c125fe51..b59a6483cd8a 100644 --- a/arch/arm/plat-samsung/include/plat/keypad.h +++ b/arch/arm/plat-samsung/include/plat/keypad.h | |||
@@ -40,4 +40,17 @@ struct samsung_keypad_platdata { | |||
40 | void (*cfg_gpio)(unsigned int rows, unsigned int cols); | 40 | void (*cfg_gpio)(unsigned int rows, unsigned int cols); |
41 | }; | 41 | }; |
42 | 42 | ||
43 | /** | ||
44 | * samsung_keypad_set_platdata - Set platform data for Samsung Keypad device. | ||
45 | * @pd: Platform data to register to device. | ||
46 | * | ||
47 | * Register the given platform data for use with Samsung Keypad device. | ||
48 | * The call will copy the platform data, so the board definitions can | ||
49 | * make the structure itself __initdata. | ||
50 | */ | ||
51 | extern void samsung_keypad_set_platdata(struct samsung_keypad_platdata *pd); | ||
52 | |||
53 | /* defined by architecture to configure gpio. */ | ||
54 | extern void samsung_keypad_cfg_gpio(unsigned int rows, unsigned int cols); | ||
55 | |||
43 | #endif /* __PLAT_SAMSUNG_KEYPAD_H */ | 56 | #endif /* __PLAT_SAMSUNG_KEYPAD_H */ |
diff --git a/arch/arm/plat-samsung/include/plat/regs-ata.h b/arch/arm/plat-samsung/include/plat/regs-ata.h new file mode 100644 index 000000000000..f5df92fdae26 --- /dev/null +++ b/arch/arm/plat-samsung/include/plat/regs-ata.h | |||
@@ -0,0 +1,56 @@ | |||
1 | /* linux/arch/arm/plat-samsung/include/plat/regs-ata.h | ||
2 | * | ||
3 | * Copyright (c) 2010 Samsung Electronics Co., Ltd. | ||
4 | * http://www.samsung.com | ||
5 | * | ||
6 | * Samsung CF-ATA register definitions | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License version 2 as | ||
10 | * published by the Free Software Foundation. | ||
11 | */ | ||
12 | |||
13 | #ifndef __ASM_PLAT_REGS_ATA_H | ||
14 | #define __ASM_PLAT_REGS_ATA_H __FILE__ | ||
15 | |||
16 | #define S3C_CFATA_REG(x) (x) | ||
17 | |||
18 | #define S3C_CFATA_MUX S3C_CFATA_REG(0x0) | ||
19 | |||
20 | #define S3C_ATA_CTRL S3C_CFATA_REG(0x0) | ||
21 | #define S3C_ATA_STATUS S3C_CFATA_REG(0x4) | ||
22 | #define S3C_ATA_CMD S3C_CFATA_REG(0x8) | ||
23 | #define S3C_ATA_SWRST S3C_CFATA_REG(0xc) | ||
24 | #define S3C_ATA_IRQ S3C_CFATA_REG(0x10) | ||
25 | #define S3C_ATA_IRQ_MSK S3C_CFATA_REG(0x14) | ||
26 | #define S3C_ATA_CFG S3C_CFATA_REG(0x18) | ||
27 | |||
28 | #define S3C_ATA_MDMA_TIME S3C_CFATA_REG(0x28) | ||
29 | #define S3C_ATA_PIO_TIME S3C_CFATA_REG(0x2c) | ||
30 | #define S3C_ATA_UDMA_TIME S3C_CFATA_REG(0x30) | ||
31 | #define S3C_ATA_XFR_NUM S3C_CFATA_REG(0x34) | ||
32 | #define S3C_ATA_XFR_CNT S3C_CFATA_REG(0x38) | ||
33 | #define S3C_ATA_TBUF_START S3C_CFATA_REG(0x3c) | ||
34 | #define S3C_ATA_TBUF_SIZE S3C_CFATA_REG(0x40) | ||
35 | #define S3C_ATA_SBUF_START S3C_CFATA_REG(0x44) | ||
36 | #define S3C_ATA_SBUF_SIZE S3C_CFATA_REG(0x48) | ||
37 | #define S3C_ATA_CADR_TBUF S3C_CFATA_REG(0x4c) | ||
38 | #define S3C_ATA_CADR_SBUF S3C_CFATA_REG(0x50) | ||
39 | #define S3C_ATA_PIO_DTR S3C_CFATA_REG(0x54) | ||
40 | #define S3C_ATA_PIO_FED S3C_CFATA_REG(0x58) | ||
41 | #define S3C_ATA_PIO_SCR S3C_CFATA_REG(0x5c) | ||
42 | #define S3C_ATA_PIO_LLR S3C_CFATA_REG(0x60) | ||
43 | #define S3C_ATA_PIO_LMR S3C_CFATA_REG(0x64) | ||
44 | #define S3C_ATA_PIO_LHR S3C_CFATA_REG(0x68) | ||
45 | #define S3C_ATA_PIO_DVR S3C_CFATA_REG(0x6c) | ||
46 | #define S3C_ATA_PIO_CSD S3C_CFATA_REG(0x70) | ||
47 | #define S3C_ATA_PIO_DAD S3C_CFATA_REG(0x74) | ||
48 | #define S3C_ATA_PIO_READY S3C_CFATA_REG(0x78) | ||
49 | #define S3C_ATA_PIO_RDATA S3C_CFATA_REG(0x7c) | ||
50 | |||
51 | #define S3C_CFATA_MUX_TRUEIDE 0x01 | ||
52 | |||
53 | #define S3C_ATA_CFG_SWAP 0x40 | ||
54 | #define S3C_ATA_CFG_IORDYEN 0x02 | ||
55 | |||
56 | #endif /* __ASM_PLAT_REGS_ATA_H */ | ||
diff --git a/arch/arm/plat-samsung/include/plat/regs-rtc.h b/arch/arm/plat-samsung/include/plat/regs-rtc.h index 65c190d142dd..30b7cc14cef5 100644 --- a/arch/arm/plat-samsung/include/plat/regs-rtc.h +++ b/arch/arm/plat-samsung/include/plat/regs-rtc.h | |||
@@ -14,6 +14,9 @@ | |||
14 | #define __ASM_ARCH_REGS_RTC_H __FILE__ | 14 | #define __ASM_ARCH_REGS_RTC_H __FILE__ |
15 | 15 | ||
16 | #define S3C2410_RTCREG(x) (x) | 16 | #define S3C2410_RTCREG(x) (x) |
17 | #define S3C2410_INTP S3C2410_RTCREG(0x30) | ||
18 | #define S3C2410_INTP_ALM (1 << 1) | ||
19 | #define S3C2410_INTP_TIC (1 << 0) | ||
17 | 20 | ||
18 | #define S3C2410_RTCCON S3C2410_RTCREG(0x40) | 21 | #define S3C2410_RTCCON S3C2410_RTCREG(0x40) |
19 | #define S3C2410_RTCCON_RTCEN (1<<0) | 22 | #define S3C2410_RTCCON_RTCEN (1<<0) |
diff --git a/arch/arm/plat-samsung/include/plat/regs-serial.h b/arch/arm/plat-samsung/include/plat/regs-serial.h index a6eba8496b24..788837e99cb3 100644 --- a/arch/arm/plat-samsung/include/plat/regs-serial.h +++ b/arch/arm/plat-samsung/include/plat/regs-serial.h | |||
@@ -259,6 +259,8 @@ struct s3c2410_uartcfg { | |||
259 | unsigned short flags; | 259 | unsigned short flags; |
260 | upf_t uart_flags; /* default uart flags */ | 260 | upf_t uart_flags; /* default uart flags */ |
261 | 261 | ||
262 | unsigned int has_fracval; | ||
263 | |||
262 | unsigned long ucon; /* value of ucon for port */ | 264 | unsigned long ucon; /* value of ucon for port */ |
263 | unsigned long ulcon; /* value of ulcon for port */ | 265 | unsigned long ulcon; /* value of ulcon for port */ |
264 | unsigned long ufcon; /* value of ufcon for port */ | 266 | unsigned long ufcon; /* value of ufcon for port */ |
diff --git a/arch/arm/plat-samsung/include/plat/sdhci.h b/arch/arm/plat-samsung/include/plat/sdhci.h index 016674fa20dd..30844c263d03 100644 --- a/arch/arm/plat-samsung/include/plat/sdhci.h +++ b/arch/arm/plat-samsung/include/plat/sdhci.h | |||
@@ -20,10 +20,31 @@ struct mmc_host; | |||
20 | struct mmc_card; | 20 | struct mmc_card; |
21 | struct mmc_ios; | 21 | struct mmc_ios; |
22 | 22 | ||
23 | enum cd_types { | ||
24 | S3C_SDHCI_CD_INTERNAL, /* use mmc internal CD line */ | ||
25 | S3C_SDHCI_CD_EXTERNAL, /* use external callback */ | ||
26 | S3C_SDHCI_CD_GPIO, /* use external gpio pin for CD line */ | ||
27 | S3C_SDHCI_CD_NONE, /* no CD line, use polling to detect card */ | ||
28 | S3C_SDHCI_CD_PERMANENT, /* no CD line, card permanently wired to host */ | ||
29 | }; | ||
30 | |||
23 | /** | 31 | /** |
24 | * struct s3c_sdhci_platdata() - Platform device data for Samsung SDHCI | 32 | * struct s3c_sdhci_platdata() - Platform device data for Samsung SDHCI |
25 | * @max_width: The maximum number of data bits supported. | 33 | * @max_width: The maximum number of data bits supported. |
26 | * @host_caps: Standard MMC host capabilities bit field. | 34 | * @host_caps: Standard MMC host capabilities bit field. |
35 | * @cd_type: Type of Card Detection method (see cd_types enum above) | ||
36 | * @ext_cd_init: Initialize external card detect subsystem. Called on | ||
37 | * sdhci-s3c driver probe when cd_type == S3C_SDHCI_CD_EXTERNAL. | ||
38 | * notify_func argument is a callback to the sdhci-s3c driver | ||
39 | * that triggers the card detection event. Callback arguments: | ||
40 | * dev is pointer to platform device of the host controller, | ||
41 | * state is new state of the card (0 - removed, 1 - inserted). | ||
42 | * @ext_cd_cleanup: Cleanup external card detect subsystem. Called on | ||
43 | * sdhci-s3c driver remove when cd_type == S3C_SDHCI_CD_EXTERNAL. | ||
44 | * notify_func argument is the same callback as for ext_cd_init. | ||
45 | * @ext_cd_gpio: gpio pin used for external CD line, valid only if | ||
46 | * cd_type == S3C_SDHCI_CD_GPIO | ||
47 | * @ext_cd_gpio_invert: invert values for external CD gpio line | ||
27 | * @cfg_gpio: Configure the GPIO for a specific card bit-width | 48 | * @cfg_gpio: Configure the GPIO for a specific card bit-width |
28 | * @cfg_card: Configure the interface for a specific card and speed. This | 49 | * @cfg_card: Configure the interface for a specific card and speed. This |
29 | * is necessary the controllers and/or GPIO blocks require the | 50 | * is necessary the controllers and/or GPIO blocks require the |
@@ -37,9 +58,17 @@ struct mmc_ios; | |||
37 | struct s3c_sdhci_platdata { | 58 | struct s3c_sdhci_platdata { |
38 | unsigned int max_width; | 59 | unsigned int max_width; |
39 | unsigned int host_caps; | 60 | unsigned int host_caps; |
61 | enum cd_types cd_type; | ||
40 | 62 | ||
41 | char **clocks; /* set of clock sources */ | 63 | char **clocks; /* set of clock sources */ |
42 | 64 | ||
65 | int ext_cd_gpio; | ||
66 | bool ext_cd_gpio_invert; | ||
67 | int (*ext_cd_init)(void (*notify_func)(struct platform_device *, | ||
68 | int state)); | ||
69 | int (*ext_cd_cleanup)(void (*notify_func)(struct platform_device *, | ||
70 | int state)); | ||
71 | |||
43 | void (*cfg_gpio)(struct platform_device *dev, int width); | 72 | void (*cfg_gpio)(struct platform_device *dev, int width); |
44 | void (*cfg_card)(struct platform_device *dev, | 73 | void (*cfg_card)(struct platform_device *dev, |
45 | void __iomem *regbase, | 74 | void __iomem *regbase, |
@@ -58,6 +87,7 @@ struct s3c_sdhci_platdata { | |||
58 | extern void s3c_sdhci0_set_platdata(struct s3c_sdhci_platdata *pd); | 87 | extern void s3c_sdhci0_set_platdata(struct s3c_sdhci_platdata *pd); |
59 | extern void s3c_sdhci1_set_platdata(struct s3c_sdhci_platdata *pd); | 88 | extern void s3c_sdhci1_set_platdata(struct s3c_sdhci_platdata *pd); |
60 | extern void s3c_sdhci2_set_platdata(struct s3c_sdhci_platdata *pd); | 89 | extern void s3c_sdhci2_set_platdata(struct s3c_sdhci_platdata *pd); |
90 | extern void s3c_sdhci3_set_platdata(struct s3c_sdhci_platdata *pd); | ||
61 | 91 | ||
62 | /* Default platform data, exported so that per-cpu initialisation can | 92 | /* Default platform data, exported so that per-cpu initialisation can |
63 | * set the correct one when there are more than one cpu type selected. | 93 | * set the correct one when there are more than one cpu type selected. |
@@ -66,6 +96,7 @@ extern void s3c_sdhci2_set_platdata(struct s3c_sdhci_platdata *pd); | |||
66 | extern struct s3c_sdhci_platdata s3c_hsmmc0_def_platdata; | 96 | extern struct s3c_sdhci_platdata s3c_hsmmc0_def_platdata; |
67 | extern struct s3c_sdhci_platdata s3c_hsmmc1_def_platdata; | 97 | extern struct s3c_sdhci_platdata s3c_hsmmc1_def_platdata; |
68 | extern struct s3c_sdhci_platdata s3c_hsmmc2_def_platdata; | 98 | extern struct s3c_sdhci_platdata s3c_hsmmc2_def_platdata; |
99 | extern struct s3c_sdhci_platdata s3c_hsmmc3_def_platdata; | ||
69 | 100 | ||
70 | /* Helper function availablity */ | 101 | /* Helper function availablity */ |
71 | 102 | ||
@@ -78,13 +109,13 @@ 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); | 109 | 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); | 110 | 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); | 111 | extern void s5pv210_setup_sdhci2_cfg_gpio(struct platform_device *, int w); |
112 | extern void s5pv210_setup_sdhci3_cfg_gpio(struct platform_device *, int w); | ||
81 | 113 | ||
82 | /* S3C6400 SDHCI setup */ | 114 | /* S3C64XX SDHCI setup */ |
83 | 115 | ||
84 | #ifdef CONFIG_S3C64XX_SETUP_SDHCI | 116 | #ifdef CONFIG_S3C64XX_SETUP_SDHCI |
85 | extern char *s3c64xx_hsmmc_clksrcs[4]; | 117 | extern char *s3c64xx_hsmmc_clksrcs[4]; |
86 | 118 | ||
87 | #ifdef CONFIG_S3C_DEV_HSMMC | ||
88 | extern void s3c6400_setup_sdhci_cfg_card(struct platform_device *dev, | 119 | extern void s3c6400_setup_sdhci_cfg_card(struct platform_device *dev, |
89 | void __iomem *r, | 120 | void __iomem *r, |
90 | struct mmc_ios *ios, | 121 | struct mmc_ios *ios, |
@@ -92,76 +123,62 @@ extern void s3c6400_setup_sdhci_cfg_card(struct platform_device *dev, | |||
92 | 123 | ||
93 | static inline void s3c6400_default_sdhci0(void) | 124 | static inline void s3c6400_default_sdhci0(void) |
94 | { | 125 | { |
126 | #ifdef CONFIG_S3C_DEV_HSMMC | ||
95 | s3c_hsmmc0_def_platdata.clocks = s3c64xx_hsmmc_clksrcs; | 127 | s3c_hsmmc0_def_platdata.clocks = s3c64xx_hsmmc_clksrcs; |
96 | s3c_hsmmc0_def_platdata.cfg_gpio = s3c64xx_setup_sdhci0_cfg_gpio; | 128 | s3c_hsmmc0_def_platdata.cfg_gpio = s3c64xx_setup_sdhci0_cfg_gpio; |
97 | s3c_hsmmc0_def_platdata.cfg_card = s3c6400_setup_sdhci_cfg_card; | 129 | s3c_hsmmc0_def_platdata.cfg_card = s3c6400_setup_sdhci_cfg_card; |
130 | #endif | ||
98 | } | 131 | } |
99 | 132 | ||
100 | #else | ||
101 | static inline void s3c6400_default_sdhci0(void) { } | ||
102 | #endif /* CONFIG_S3C_DEV_HSMMC */ | ||
103 | |||
104 | #ifdef CONFIG_S3C_DEV_HSMMC1 | ||
105 | static inline void s3c6400_default_sdhci1(void) | 133 | static inline void s3c6400_default_sdhci1(void) |
106 | { | 134 | { |
135 | #ifdef CONFIG_S3C_DEV_HSMMC1 | ||
107 | s3c_hsmmc1_def_platdata.clocks = s3c64xx_hsmmc_clksrcs; | 136 | s3c_hsmmc1_def_platdata.clocks = s3c64xx_hsmmc_clksrcs; |
108 | s3c_hsmmc1_def_platdata.cfg_gpio = s3c64xx_setup_sdhci1_cfg_gpio; | 137 | s3c_hsmmc1_def_platdata.cfg_gpio = s3c64xx_setup_sdhci1_cfg_gpio; |
109 | s3c_hsmmc1_def_platdata.cfg_card = s3c6400_setup_sdhci_cfg_card; | 138 | s3c_hsmmc1_def_platdata.cfg_card = s3c6400_setup_sdhci_cfg_card; |
139 | #endif | ||
110 | } | 140 | } |
111 | #else | ||
112 | static inline void s3c6400_default_sdhci1(void) { } | ||
113 | #endif /* CONFIG_S3C_DEV_HSMMC1 */ | ||
114 | 141 | ||
115 | #ifdef CONFIG_S3C_DEV_HSMMC2 | ||
116 | static inline void s3c6400_default_sdhci2(void) | 142 | static inline void s3c6400_default_sdhci2(void) |
117 | { | 143 | { |
144 | #ifdef CONFIG_S3C_DEV_HSMMC2 | ||
118 | s3c_hsmmc2_def_platdata.clocks = s3c64xx_hsmmc_clksrcs; | 145 | s3c_hsmmc2_def_platdata.clocks = s3c64xx_hsmmc_clksrcs; |
119 | s3c_hsmmc2_def_platdata.cfg_gpio = s3c64xx_setup_sdhci2_cfg_gpio; | 146 | s3c_hsmmc2_def_platdata.cfg_gpio = s3c64xx_setup_sdhci2_cfg_gpio; |
120 | s3c_hsmmc2_def_platdata.cfg_card = s3c6400_setup_sdhci_cfg_card; | 147 | s3c_hsmmc2_def_platdata.cfg_card = s3c6400_setup_sdhci_cfg_card; |
148 | #endif | ||
121 | } | 149 | } |
122 | #else | ||
123 | static inline void s3c6400_default_sdhci2(void) { } | ||
124 | #endif /* CONFIG_S3C_DEV_HSMMC2 */ | ||
125 | |||
126 | /* S3C6410 SDHCI setup */ | ||
127 | 150 | ||
128 | extern void s3c6410_setup_sdhci_cfg_card(struct platform_device *dev, | 151 | extern void s3c6410_setup_sdhci_cfg_card(struct platform_device *dev, |
129 | void __iomem *r, | 152 | void __iomem *r, |
130 | struct mmc_ios *ios, | 153 | struct mmc_ios *ios, |
131 | struct mmc_card *card); | 154 | struct mmc_card *card); |
132 | 155 | ||
133 | #ifdef CONFIG_S3C_DEV_HSMMC | ||
134 | static inline void s3c6410_default_sdhci0(void) | 156 | static inline void s3c6410_default_sdhci0(void) |
135 | { | 157 | { |
158 | #ifdef CONFIG_S3C_DEV_HSMMC | ||
136 | s3c_hsmmc0_def_platdata.clocks = s3c64xx_hsmmc_clksrcs; | 159 | s3c_hsmmc0_def_platdata.clocks = s3c64xx_hsmmc_clksrcs; |
137 | s3c_hsmmc0_def_platdata.cfg_gpio = s3c64xx_setup_sdhci0_cfg_gpio; | 160 | s3c_hsmmc0_def_platdata.cfg_gpio = s3c64xx_setup_sdhci0_cfg_gpio; |
138 | s3c_hsmmc0_def_platdata.cfg_card = s3c6410_setup_sdhci_cfg_card; | 161 | s3c_hsmmc0_def_platdata.cfg_card = s3c6410_setup_sdhci_cfg_card; |
162 | #endif | ||
139 | } | 163 | } |
140 | #else | ||
141 | static inline void s3c6410_default_sdhci0(void) { } | ||
142 | #endif /* CONFIG_S3C_DEV_HSMMC */ | ||
143 | 164 | ||
144 | #ifdef CONFIG_S3C_DEV_HSMMC1 | ||
145 | static inline void s3c6410_default_sdhci1(void) | 165 | static inline void s3c6410_default_sdhci1(void) |
146 | { | 166 | { |
167 | #ifdef CONFIG_S3C_DEV_HSMMC1 | ||
147 | s3c_hsmmc1_def_platdata.clocks = s3c64xx_hsmmc_clksrcs; | 168 | s3c_hsmmc1_def_platdata.clocks = s3c64xx_hsmmc_clksrcs; |
148 | s3c_hsmmc1_def_platdata.cfg_gpio = s3c64xx_setup_sdhci1_cfg_gpio; | 169 | s3c_hsmmc1_def_platdata.cfg_gpio = s3c64xx_setup_sdhci1_cfg_gpio; |
149 | s3c_hsmmc1_def_platdata.cfg_card = s3c6410_setup_sdhci_cfg_card; | 170 | s3c_hsmmc1_def_platdata.cfg_card = s3c6410_setup_sdhci_cfg_card; |
171 | #endif | ||
150 | } | 172 | } |
151 | #else | ||
152 | static inline void s3c6410_default_sdhci1(void) { } | ||
153 | #endif /* CONFIG_S3C_DEV_HSMMC1 */ | ||
154 | 173 | ||
155 | #ifdef CONFIG_S3C_DEV_HSMMC2 | ||
156 | static inline void s3c6410_default_sdhci2(void) | 174 | static inline void s3c6410_default_sdhci2(void) |
157 | { | 175 | { |
176 | #ifdef CONFIG_S3C_DEV_HSMMC2 | ||
158 | s3c_hsmmc2_def_platdata.clocks = s3c64xx_hsmmc_clksrcs; | 177 | s3c_hsmmc2_def_platdata.clocks = s3c64xx_hsmmc_clksrcs; |
159 | s3c_hsmmc2_def_platdata.cfg_gpio = s3c64xx_setup_sdhci2_cfg_gpio; | 178 | s3c_hsmmc2_def_platdata.cfg_gpio = s3c64xx_setup_sdhci2_cfg_gpio; |
160 | s3c_hsmmc2_def_platdata.cfg_card = s3c6410_setup_sdhci_cfg_card; | 179 | s3c_hsmmc2_def_platdata.cfg_card = s3c6410_setup_sdhci_cfg_card; |
180 | #endif | ||
161 | } | 181 | } |
162 | #else | ||
163 | static inline void s3c6410_default_sdhci2(void) { } | ||
164 | #endif /* CONFIG_S3C_DEV_HSMMC2 */ | ||
165 | 182 | ||
166 | #else | 183 | #else |
167 | static inline void s3c6410_default_sdhci0(void) { } | 184 | static inline void s3c6410_default_sdhci0(void) { } |
@@ -183,48 +200,42 @@ extern void s5pc100_setup_sdhci0_cfg_card(struct platform_device *dev, | |||
183 | struct mmc_ios *ios, | 200 | struct mmc_ios *ios, |
184 | struct mmc_card *card); | 201 | struct mmc_card *card); |
185 | 202 | ||
186 | #ifdef CONFIG_S3C_DEV_HSMMC | ||
187 | static inline void s5pc100_default_sdhci0(void) | 203 | static inline void s5pc100_default_sdhci0(void) |
188 | { | 204 | { |
205 | #ifdef CONFIG_S3C_DEV_HSMMC | ||
189 | s3c_hsmmc0_def_platdata.clocks = s5pc100_hsmmc_clksrcs; | 206 | s3c_hsmmc0_def_platdata.clocks = s5pc100_hsmmc_clksrcs; |
190 | s3c_hsmmc0_def_platdata.cfg_gpio = s5pc100_setup_sdhci0_cfg_gpio; | 207 | s3c_hsmmc0_def_platdata.cfg_gpio = s5pc100_setup_sdhci0_cfg_gpio; |
191 | s3c_hsmmc0_def_platdata.cfg_card = s5pc100_setup_sdhci0_cfg_card; | 208 | s3c_hsmmc0_def_platdata.cfg_card = s5pc100_setup_sdhci0_cfg_card; |
209 | #endif | ||
192 | } | 210 | } |
193 | #else | ||
194 | static inline void s5pc100_default_sdhci0(void) { } | ||
195 | #endif /* CONFIG_S3C_DEV_HSMMC */ | ||
196 | 211 | ||
197 | #ifdef CONFIG_S3C_DEV_HSMMC1 | ||
198 | static inline void s5pc100_default_sdhci1(void) | 212 | static inline void s5pc100_default_sdhci1(void) |
199 | { | 213 | { |
214 | #ifdef CONFIG_S3C_DEV_HSMMC1 | ||
200 | s3c_hsmmc1_def_platdata.clocks = s5pc100_hsmmc_clksrcs; | 215 | s3c_hsmmc1_def_platdata.clocks = s5pc100_hsmmc_clksrcs; |
201 | s3c_hsmmc1_def_platdata.cfg_gpio = s5pc100_setup_sdhci1_cfg_gpio; | 216 | s3c_hsmmc1_def_platdata.cfg_gpio = s5pc100_setup_sdhci1_cfg_gpio; |
202 | s3c_hsmmc1_def_platdata.cfg_card = s5pc100_setup_sdhci0_cfg_card; | 217 | s3c_hsmmc1_def_platdata.cfg_card = s5pc100_setup_sdhci0_cfg_card; |
218 | #endif | ||
203 | } | 219 | } |
204 | #else | ||
205 | static inline void s5pc100_default_sdhci1(void) { } | ||
206 | #endif /* CONFIG_S3C_DEV_HSMMC1 */ | ||
207 | 220 | ||
208 | #ifdef CONFIG_S3C_DEV_HSMMC2 | ||
209 | static inline void s5pc100_default_sdhci2(void) | 221 | static inline void s5pc100_default_sdhci2(void) |
210 | { | 222 | { |
223 | #ifdef CONFIG_S3C_DEV_HSMMC2 | ||
211 | s3c_hsmmc2_def_platdata.clocks = s5pc100_hsmmc_clksrcs; | 224 | s3c_hsmmc2_def_platdata.clocks = s5pc100_hsmmc_clksrcs; |
212 | s3c_hsmmc2_def_platdata.cfg_gpio = s5pc100_setup_sdhci2_cfg_gpio; | 225 | s3c_hsmmc2_def_platdata.cfg_gpio = s5pc100_setup_sdhci2_cfg_gpio; |
213 | s3c_hsmmc2_def_platdata.cfg_card = s5pc100_setup_sdhci0_cfg_card; | 226 | s3c_hsmmc2_def_platdata.cfg_card = s5pc100_setup_sdhci0_cfg_card; |
227 | #endif | ||
214 | } | 228 | } |
215 | #else | ||
216 | static inline void s5pc100_default_sdhci2(void) { } | ||
217 | #endif /* CONFIG_S3C_DEV_HSMMC1 */ | ||
218 | |||
219 | 229 | ||
220 | #else | 230 | #else |
221 | static inline void s5pc100_default_sdhci0(void) { } | 231 | static inline void s5pc100_default_sdhci0(void) { } |
222 | static inline void s5pc100_default_sdhci1(void) { } | 232 | static inline void s5pc100_default_sdhci1(void) { } |
223 | static inline void s5pc100_default_sdhci2(void) { } | 233 | static inline void s5pc100_default_sdhci2(void) { } |
234 | |||
224 | #endif /* CONFIG_S5PC100_SETUP_SDHCI */ | 235 | #endif /* CONFIG_S5PC100_SETUP_SDHCI */ |
225 | 236 | ||
237 | /* S5PV210 SDHCI setup */ | ||
226 | 238 | ||
227 | /* S5PC110 SDHCI setup */ | ||
228 | #ifdef CONFIG_S5PV210_SETUP_SDHCI | 239 | #ifdef CONFIG_S5PV210_SETUP_SDHCI |
229 | extern char *s5pv210_hsmmc_clksrcs[4]; | 240 | extern char *s5pv210_hsmmc_clksrcs[4]; |
230 | 241 | ||
@@ -233,46 +244,48 @@ extern void s5pv210_setup_sdhci_cfg_card(struct platform_device *dev, | |||
233 | struct mmc_ios *ios, | 244 | struct mmc_ios *ios, |
234 | struct mmc_card *card); | 245 | struct mmc_card *card); |
235 | 246 | ||
236 | #ifdef CONFIG_S3C_DEV_HSMMC | ||
237 | static inline void s5pv210_default_sdhci0(void) | 247 | static inline void s5pv210_default_sdhci0(void) |
238 | { | 248 | { |
249 | #ifdef CONFIG_S3C_DEV_HSMMC | ||
239 | s3c_hsmmc0_def_platdata.clocks = s5pv210_hsmmc_clksrcs; | 250 | s3c_hsmmc0_def_platdata.clocks = s5pv210_hsmmc_clksrcs; |
240 | s3c_hsmmc0_def_platdata.cfg_gpio = s5pv210_setup_sdhci0_cfg_gpio; | 251 | s3c_hsmmc0_def_platdata.cfg_gpio = s5pv210_setup_sdhci0_cfg_gpio; |
241 | s3c_hsmmc0_def_platdata.cfg_card = s5pv210_setup_sdhci_cfg_card; | 252 | s3c_hsmmc0_def_platdata.cfg_card = s5pv210_setup_sdhci_cfg_card; |
253 | #endif | ||
242 | } | 254 | } |
243 | #else | ||
244 | static inline void s5pv210_default_sdhci0(void) { } | ||
245 | #endif /* CONFIG_S3C_DEV_HSMMC */ | ||
246 | 255 | ||
247 | #ifdef CONFIG_S3C_DEV_HSMMC1 | ||
248 | static inline void s5pv210_default_sdhci1(void) | 256 | static inline void s5pv210_default_sdhci1(void) |
249 | { | 257 | { |
258 | #ifdef CONFIG_S3C_DEV_HSMMC1 | ||
250 | s3c_hsmmc1_def_platdata.clocks = s5pv210_hsmmc_clksrcs; | 259 | s3c_hsmmc1_def_platdata.clocks = s5pv210_hsmmc_clksrcs; |
251 | s3c_hsmmc1_def_platdata.cfg_gpio = s5pv210_setup_sdhci1_cfg_gpio; | 260 | s3c_hsmmc1_def_platdata.cfg_gpio = s5pv210_setup_sdhci1_cfg_gpio; |
252 | s3c_hsmmc1_def_platdata.cfg_card = s5pv210_setup_sdhci_cfg_card; | 261 | s3c_hsmmc1_def_platdata.cfg_card = s5pv210_setup_sdhci_cfg_card; |
262 | #endif | ||
253 | } | 263 | } |
254 | #else | ||
255 | static inline void s5pv210_default_sdhci1(void) { } | ||
256 | #endif /* CONFIG_S3C_DEV_HSMMC1 */ | ||
257 | 264 | ||
258 | #ifdef CONFIG_S3C_DEV_HSMMC2 | ||
259 | static inline void s5pv210_default_sdhci2(void) | 265 | static inline void s5pv210_default_sdhci2(void) |
260 | { | 266 | { |
267 | #ifdef CONFIG_S3C_DEV_HSMMC2 | ||
261 | s3c_hsmmc2_def_platdata.clocks = s5pv210_hsmmc_clksrcs; | 268 | s3c_hsmmc2_def_platdata.clocks = s5pv210_hsmmc_clksrcs; |
262 | s3c_hsmmc2_def_platdata.cfg_gpio = s5pv210_setup_sdhci2_cfg_gpio; | 269 | s3c_hsmmc2_def_platdata.cfg_gpio = s5pv210_setup_sdhci2_cfg_gpio; |
263 | s3c_hsmmc2_def_platdata.cfg_card = s5pv210_setup_sdhci_cfg_card; | 270 | s3c_hsmmc2_def_platdata.cfg_card = s5pv210_setup_sdhci_cfg_card; |
271 | #endif | ||
272 | } | ||
273 | |||
274 | static inline void s5pv210_default_sdhci3(void) | ||
275 | { | ||
276 | #ifdef CONFIG_S3C_DEV_HSMMC3 | ||
277 | s3c_hsmmc3_def_platdata.clocks = s5pv210_hsmmc_clksrcs; | ||
278 | s3c_hsmmc3_def_platdata.cfg_gpio = s5pv210_setup_sdhci3_cfg_gpio; | ||
279 | s3c_hsmmc3_def_platdata.cfg_card = s5pv210_setup_sdhci_cfg_card; | ||
280 | #endif | ||
264 | } | 281 | } |
265 | #else | ||
266 | static inline void s5pv210_default_sdhci2(void) { } | ||
267 | #endif /* CONFIG_S3C_DEV_HSMMC2 */ | ||
268 | 282 | ||
269 | #else | 283 | #else |
270 | static inline void s5pv210_default_sdhci0(void) { } | 284 | static inline void s5pv210_default_sdhci0(void) { } |
271 | static inline void s5pv210_default_sdhci1(void) { } | 285 | static inline void s5pv210_default_sdhci1(void) { } |
272 | static inline void s5pv210_default_sdhci2(void) { } | 286 | static inline void s5pv210_default_sdhci2(void) { } |
273 | #endif /* CONFIG_S5PC100_SETUP_SDHCI */ | 287 | static inline void s5pv210_default_sdhci3(void) { } |
274 | |||
275 | |||
276 | 288 | ||
289 | #endif /* CONFIG_S5PV210_SETUP_SDHCI */ | ||
277 | 290 | ||
278 | #endif /* __PLAT_S3C_SDHCI_H */ | 291 | #endif /* __PLAT_S3C_SDHCI_H */ |
diff --git a/arch/arm/plat-samsung/platformdata.c b/arch/arm/plat-samsung/platformdata.c new file mode 100644 index 000000000000..7cf2e1e3b20f --- /dev/null +++ b/arch/arm/plat-samsung/platformdata.c | |||
@@ -0,0 +1,37 @@ | |||
1 | /* linux/arch/arm/plat-samsung/platformdata.c | ||
2 | * | ||
3 | * Copyright 2010 Ben Dooks <ben-linux <at> fluff.org> | ||
4 | * | ||
5 | * Helper for platform data setting | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | */ | ||
11 | |||
12 | #include <linux/kernel.h> | ||
13 | #include <linux/string.h> | ||
14 | #include <linux/platform_device.h> | ||
15 | |||
16 | #include <plat/devs.h> | ||
17 | |||
18 | void __init *s3c_set_platdata(void *pd, size_t pdsize, | ||
19 | struct platform_device *pdev) | ||
20 | { | ||
21 | void *npd; | ||
22 | |||
23 | if (!pd) { | ||
24 | /* too early to use dev_name(), may not be registered */ | ||
25 | printk(KERN_ERR "%s: no platform data supplied\n", pdev->name); | ||
26 | return NULL; | ||
27 | } | ||
28 | |||
29 | npd = kmemdup(pd, pdsize, GFP_KERNEL); | ||
30 | if (!npd) { | ||
31 | printk(KERN_ERR "%s: cannot clone platform data\n", pdev->name); | ||
32 | return NULL; | ||
33 | } | ||
34 | |||
35 | pdev->dev.platform_data = npd; | ||
36 | return npd; | ||
37 | } | ||