diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2010-08-16 13:42:58 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2010-08-16 13:42:58 -0400 |
commit | e4862f2f6f5653dfb67f3ba2b6f0bc74516ed51a (patch) | |
tree | 1db5a0540a4eecfad9b7daee476b985e82ddc810 /arch/arm/plat-samsung | |
parent | ec62dbd7eb8e3dddb221da89ecbcea0fc3dee8c1 (diff) | |
parent | b2c1e07b81a126e5846dfc3d36f559d861df59f4 (diff) |
Merge branch 'for-2.6.36' into for-2.6.37
Fairly simple conflicts, the most serious ones are the i.MX ones which I
suspect now need another rename.
Conflicts:
arch/arm/mach-mx2/clock_imx27.c
arch/arm/mach-mx2/devices.c
arch/arm/mach-omap2/board-rx51-peripherals.c
arch/arm/mach-omap2/board-zoom2.c
sound/soc/fsl/mpc5200_dma.c
sound/soc/fsl/mpc5200_dma.h
sound/soc/fsl/mpc8610_hpcd.c
sound/soc/pxa/spitz.c
Diffstat (limited to 'arch/arm/plat-samsung')
28 files changed, 684 insertions, 144 deletions
diff --git a/arch/arm/plat-samsung/Kconfig b/arch/arm/plat-samsung/Kconfig index 2753fb3e4f73..7c0bde781167 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 | 9 | depends on PLAT_S3C24XX || ARCH_S3C64XX || PLAT_S5P |
10 | select NO_IOPORT | 10 | select NO_IOPORT |
11 | default y | 11 | default y |
12 | help | 12 | help |
@@ -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/clock.c b/arch/arm/plat-samsung/clock.c index 8bf79f3efdfb..90a20512d68d 100644 --- a/arch/arm/plat-samsung/clock.c +++ b/arch/arm/plat-samsung/clock.c | |||
@@ -391,7 +391,7 @@ void __init s3c_disable_clocks(struct clk *clkp, int nr_clks) | |||
391 | (clkp->enable)(clkp, 0); | 391 | (clkp->enable)(clkp, 0); |
392 | } | 392 | } |
393 | 393 | ||
394 | /* initalise all the clocks */ | 394 | /* initialise all the clocks */ |
395 | 395 | ||
396 | int __init s3c24xx_register_baseclocks(unsigned long xtal) | 396 | int __init s3c24xx_register_baseclocks(unsigned long xtal) |
397 | { | 397 | { |
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 9ea6786d459d..a9fecd615de4 100644 --- a/arch/arm/plat-samsung/include/plat/devs.h +++ b/arch/arm/plat-samsung/include/plat/devs.h | |||
@@ -56,6 +56,8 @@ extern struct platform_device s3c_device_hwmon; | |||
56 | extern struct platform_device s3c_device_hsmmc0; | 56 | extern struct platform_device s3c_device_hsmmc0; |
57 | extern struct platform_device s3c_device_hsmmc1; | 57 | extern struct platform_device s3c_device_hsmmc1; |
58 | extern struct platform_device s3c_device_hsmmc2; | 58 | extern struct platform_device s3c_device_hsmmc2; |
59 | extern struct platform_device s3c_device_hsmmc3; | ||
60 | extern struct platform_device s3c_device_cfcon; | ||
59 | 61 | ||
60 | extern struct platform_device s3c_device_spi0; | 62 | extern struct platform_device s3c_device_spi0; |
61 | extern struct platform_device s3c_device_spi1; | 63 | extern struct platform_device s3c_device_spi1; |
@@ -102,6 +104,12 @@ extern struct platform_device s5pc100_device_iis0; | |||
102 | extern struct platform_device s5pc100_device_iis1; | 104 | extern struct platform_device s5pc100_device_iis1; |
103 | extern struct platform_device s5pc100_device_iis2; | 105 | extern struct platform_device s5pc100_device_iis2; |
104 | 106 | ||
107 | extern struct platform_device samsung_device_keypad; | ||
108 | |||
109 | extern struct platform_device s5p_device_fimc0; | ||
110 | extern struct platform_device s5p_device_fimc1; | ||
111 | extern struct platform_device s5p_device_fimc2; | ||
112 | |||
105 | /* s3c2440 specific devices */ | 113 | /* s3c2440 specific devices */ |
106 | 114 | ||
107 | #ifdef CONFIG_CPU_S3C2440 | 115 | #ifdef CONFIG_CPU_S3C2440 |
@@ -110,3 +118,15 @@ extern struct platform_device s3c_device_camif; | |||
110 | extern struct platform_device s3c_device_ac97; | 118 | extern struct platform_device s3c_device_ac97; |
111 | 119 | ||
112 | #endif | 120 | #endif |
121 | |||
122 | /** | ||
123 | * s3c_set_platdata() - helper for setting platform data | ||
124 | * @pd: The default platform data for this device. | ||
125 | * @pdsize: The size of the platform data. | ||
126 | * @pdev: Pointer to the device to fill in. | ||
127 | * | ||
128 | * This helper replaces a number of calls that copy and then set the | ||
129 | * platform data of the device. | ||
130 | */ | ||
131 | extern void *s3c_set_platdata(void *pd, size_t pdsize, | ||
132 | struct platform_device *pdev); | ||
diff --git a/arch/arm/plat-samsung/include/plat/fb-core.h b/arch/arm/plat-samsung/include/plat/fb-core.h new file mode 100644 index 000000000000..bca383efcf6d --- /dev/null +++ b/arch/arm/plat-samsung/include/plat/fb-core.h | |||
@@ -0,0 +1,29 @@ | |||
1 | /* | ||
2 | * arch/arm/plat-samsung/include/plat/fb-core.h | ||
3 | * | ||
4 | * Copyright 2010 Samsung Electronics Co., Ltd. | ||
5 | * Pawel Osciak <p.osciak@samsung.com> | ||
6 | * | ||
7 | * Samsung framebuffer 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 | #ifndef __ASM_PLAT_FB_CORE_H | ||
14 | #define __ASM_PLAT_FB_CORE_H __FILE__ | ||
15 | |||
16 | /* | ||
17 | * These functions are only for use with the core support code, such as | ||
18 | * the CPU-specific initialization code. | ||
19 | */ | ||
20 | |||
21 | /* Re-define device name depending on support. */ | ||
22 | static inline void s3c_fb_setname(char *name) | ||
23 | { | ||
24 | #ifdef CONFIG_S3C_DEV_FB | ||
25 | s3c_device_fb.name = name; | ||
26 | #endif | ||
27 | } | ||
28 | |||
29 | #endif /* __ASM_PLAT_FB_CORE_H */ | ||
diff --git a/arch/arm/plat-samsung/include/plat/fb.h b/arch/arm/plat-samsung/include/plat/fb.h index 27d3b497b55b..cb3ca3adc685 100644 --- a/arch/arm/plat-samsung/include/plat/fb.h +++ b/arch/arm/plat-samsung/include/plat/fb.h | |||
@@ -42,6 +42,7 @@ struct s3c_fb_pd_win { | |||
42 | * @setup_gpio: Setup the external GPIO pins to the right state to transfer | 42 | * @setup_gpio: Setup the external GPIO pins to the right state to transfer |
43 | * the data from the display system to the connected display | 43 | * the data from the display system to the connected display |
44 | * device. | 44 | * device. |
45 | * @default_win: default window layer number to be used for UI layer. | ||
45 | * @vidcon0: The base vidcon0 values to control the panel data format. | 46 | * @vidcon0: The base vidcon0 values to control the panel data format. |
46 | * @vidcon1: The base vidcon1 values to control the panel data output. | 47 | * @vidcon1: The base vidcon1 values to control the panel data output. |
47 | * @win: The setup data for each hardware window, or NULL for unused. | 48 | * @win: The setup data for each hardware window, or NULL for unused. |
@@ -58,6 +59,8 @@ struct s3c_fb_platdata { | |||
58 | 59 | ||
59 | struct s3c_fb_pd_win *win[S3C_FB_MAX_WIN]; | 60 | struct s3c_fb_pd_win *win[S3C_FB_MAX_WIN]; |
60 | 61 | ||
62 | u32 default_win; | ||
63 | |||
61 | u32 vidcon0; | 64 | u32 vidcon0; |
62 | u32 vidcon1; | 65 | u32 vidcon1; |
63 | }; | 66 | }; |
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 new file mode 100644 index 000000000000..b59a6483cd8a --- /dev/null +++ b/arch/arm/plat-samsung/include/plat/keypad.h | |||
@@ -0,0 +1,56 @@ | |||
1 | /* | ||
2 | * Samsung Platform - Keypad platform data definitions | ||
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 | #ifndef __PLAT_SAMSUNG_KEYPAD_H | ||
14 | #define __PLAT_SAMSUNG_KEYPAD_H | ||
15 | |||
16 | #include <linux/input/matrix_keypad.h> | ||
17 | |||
18 | #define SAMSUNG_MAX_ROWS 8 | ||
19 | #define SAMSUNG_MAX_COLS 8 | ||
20 | |||
21 | /** | ||
22 | * struct samsung_keypad_platdata - Platform device data for Samsung Keypad. | ||
23 | * @keymap_data: pointer to &matrix_keymap_data. | ||
24 | * @rows: number of keypad row supported. | ||
25 | * @cols: number of keypad col supported. | ||
26 | * @no_autorepeat: disable key autorepeat. | ||
27 | * @wakeup: controls whether the device should be set up as wakeup source. | ||
28 | * @cfg_gpio: configure the GPIO. | ||
29 | * | ||
30 | * Initialisation data specific to either the machine or the platform | ||
31 | * for the device driver to use or call-back when configuring gpio. | ||
32 | */ | ||
33 | struct samsung_keypad_platdata { | ||
34 | const struct matrix_keymap_data *keymap_data; | ||
35 | unsigned int rows; | ||
36 | unsigned int cols; | ||
37 | bool no_autorepeat; | ||
38 | bool wakeup; | ||
39 | |||
40 | void (*cfg_gpio)(unsigned int rows, unsigned int cols); | ||
41 | }; | ||
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 | |||
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-fb-v4.h b/arch/arm/plat-samsung/include/plat/regs-fb-v4.h index 0f43599248ad..4c3647f80057 100644 --- a/arch/arm/plat-samsung/include/plat/regs-fb-v4.h +++ b/arch/arm/plat-samsung/include/plat/regs-fb-v4.h | |||
@@ -40,16 +40,10 @@ | |||
40 | 40 | ||
41 | /* OSD1 and OSD4 do not have register D */ | 41 | /* OSD1 and OSD4 do not have register D */ |
42 | 42 | ||
43 | #define VIDOSD_A(_win) (0x40 + ((_win) * 16)) | 43 | #define VIDOSD_BASE (0x40) |
44 | #define VIDOSD_B(_win) (0x44 + ((_win) * 16)) | ||
45 | #define VIDOSD_C(_win) (0x48 + ((_win) * 16)) | ||
46 | #define VIDOSD_D(_win) (0x4C + ((_win) * 16)) | ||
47 | |||
48 | 44 | ||
49 | #define VIDINTCON0 (0x130) | 45 | #define VIDINTCON0 (0x130) |
50 | 46 | ||
51 | #define WxKEYCONy(_win, _con) ((0x140 + ((_win) * 8)) + ((_con) * 4)) | ||
52 | |||
53 | /* WINCONx */ | 47 | /* WINCONx */ |
54 | 48 | ||
55 | #define WINCONx_CSCWIDTH_MASK (0x3 << 26) | 49 | #define WINCONx_CSCWIDTH_MASK (0x3 << 26) |
@@ -143,76 +137,6 @@ | |||
143 | #define WPALCON_W2PAL_16BPP_A555 (1 << 6) | 137 | #define WPALCON_W2PAL_16BPP_A555 (1 << 6) |
144 | 138 | ||
145 | 139 | ||
146 | /* system specific implementation code for palette sizes, and other | ||
147 | * information that changes depending on which architecture is being | ||
148 | * compiled. | ||
149 | */ | ||
150 | |||
151 | /* return true if window _win has OSD register D */ | ||
152 | #define s3c_fb_has_osd_d(_win) ((_win) != 4 && (_win) != 0) | ||
153 | |||
154 | static inline unsigned int s3c_fb_win_pal_size(unsigned int win) | ||
155 | { | ||
156 | if (win < 2) | ||
157 | return 256; | ||
158 | if (win < 4) | ||
159 | return 16; | ||
160 | if (win == 4) | ||
161 | return 4; | ||
162 | |||
163 | BUG(); /* shouldn't get here */ | ||
164 | } | ||
165 | |||
166 | static inline int s3c_fb_validate_win_bpp(unsigned int win, unsigned int bpp) | ||
167 | { | ||
168 | /* all windows can do 1/2 bpp */ | ||
169 | |||
170 | if ((bpp == 25 || bpp == 19) && win == 0) | ||
171 | return 0; /* win 0 does not have 19 or 25bpp modes */ | ||
172 | |||
173 | if (bpp == 4 && win == 4) | ||
174 | return 0; | ||
175 | |||
176 | if (bpp == 8 && (win >= 3)) | ||
177 | return 0; /* win 3/4 cannot do 8bpp in any mode */ | ||
178 | |||
179 | return 1; | ||
180 | } | ||
181 | |||
182 | static inline int s3c_fb_pal_is16(unsigned int window) | ||
183 | { | ||
184 | return window > 1; | ||
185 | } | ||
186 | |||
187 | struct s3c_fb_palette { | ||
188 | struct fb_bitfield r; | ||
189 | struct fb_bitfield g; | ||
190 | struct fb_bitfield b; | ||
191 | struct fb_bitfield a; | ||
192 | }; | ||
193 | |||
194 | static inline void s3c_fb_init_palette(unsigned int window, | ||
195 | struct s3c_fb_palette *palette) | ||
196 | { | ||
197 | if (window < 2) { | ||
198 | /* Windows 0/1 are 8/8/8 or A/8/8/8 */ | ||
199 | palette->r.offset = 16; | ||
200 | palette->r.length = 8; | ||
201 | palette->g.offset = 8; | ||
202 | palette->g.length = 8; | ||
203 | palette->b.offset = 0; | ||
204 | palette->b.length = 8; | ||
205 | } else { | ||
206 | /* currently we assume RGB 5/6/5 */ | ||
207 | palette->r.offset = 11; | ||
208 | palette->r.length = 5; | ||
209 | palette->g.offset = 5; | ||
210 | palette->g.length = 6; | ||
211 | palette->b.offset = 0; | ||
212 | palette->b.length = 5; | ||
213 | } | ||
214 | } | ||
215 | |||
216 | /* Notes on per-window bpp settings | 140 | /* Notes on per-window bpp settings |
217 | * | 141 | * |
218 | * Value Win0 Win1 Win2 Win3 Win 4 | 142 | * Value Win0 Win1 Win2 Win3 Win 4 |
diff --git a/arch/arm/plat-samsung/include/plat/regs-fb.h b/arch/arm/plat-samsung/include/plat/regs-fb.h index 0ef806e50344..8f39aa5b26ea 100644 --- a/arch/arm/plat-samsung/include/plat/regs-fb.h +++ b/arch/arm/plat-samsung/include/plat/regs-fb.h | |||
@@ -112,6 +112,13 @@ | |||
112 | #define VIDCON2_ORGYCbCr (1 << 8) | 112 | #define VIDCON2_ORGYCbCr (1 << 8) |
113 | #define VIDCON2_YUVORDCrCb (1 << 7) | 113 | #define VIDCON2_YUVORDCrCb (1 << 7) |
114 | 114 | ||
115 | /* PRTCON (S3C6410, S5PC100) | ||
116 | * Might not be present in the S3C6410 documentation, | ||
117 | * but tests prove it's there almost for sure; shouldn't hurt in any case. | ||
118 | */ | ||
119 | #define PRTCON (0x0c) | ||
120 | #define PRTCON_PROTECT (1 << 11) | ||
121 | |||
115 | /* VIDTCON0 */ | 122 | /* VIDTCON0 */ |
116 | 123 | ||
117 | #define VIDTCON0_VBPDE_MASK (0xff << 24) | 124 | #define VIDTCON0_VBPDE_MASK (0xff << 24) |
@@ -173,6 +180,7 @@ | |||
173 | #define WINCONx_BITSWP (1 << 18) | 180 | #define WINCONx_BITSWP (1 << 18) |
174 | #define WINCONx_BYTSWP (1 << 17) | 181 | #define WINCONx_BYTSWP (1 << 17) |
175 | #define WINCONx_HAWSWP (1 << 16) | 182 | #define WINCONx_HAWSWP (1 << 16) |
183 | #define WINCONx_WSWP (1 << 15) | ||
176 | #define WINCONx_BURSTLEN_MASK (0x3 << 9) | 184 | #define WINCONx_BURSTLEN_MASK (0x3 << 9) |
177 | #define WINCONx_BURSTLEN_SHIFT (9) | 185 | #define WINCONx_BURSTLEN_SHIFT (9) |
178 | #define WINCONx_BURSTLEN_16WORD (0x0 << 9) | 186 | #define WINCONx_BURSTLEN_16WORD (0x0 << 9) |
@@ -212,6 +220,13 @@ | |||
212 | #define WINCON1_BPPMODE_25BPP_A1888 (0xd << 2) | 220 | #define WINCON1_BPPMODE_25BPP_A1888 (0xd << 2) |
213 | #define WINCON1_BPPMODE_28BPP_A4888 (0xd << 2) | 221 | #define WINCON1_BPPMODE_28BPP_A4888 (0xd << 2) |
214 | 222 | ||
223 | /* S5PV210 */ | ||
224 | #define SHADOWCON (0x34) | ||
225 | #define SHADOWCON_WINx_PROTECT(_win) (1 << (10 + (_win))) | ||
226 | /* DMA channels (all windows) */ | ||
227 | #define SHADOWCON_CHx_ENABLE(_win) (1 << (_win)) | ||
228 | /* Local input channels (windows 0-2) */ | ||
229 | #define SHADOWCON_CHx_LOCAL_ENABLE(_win) (1 << (5 + (_win))) | ||
215 | 230 | ||
216 | #define VIDOSDxA_TOPLEFT_X_MASK (0x7ff << 11) | 231 | #define VIDOSDxA_TOPLEFT_X_MASK (0x7ff << 11) |
217 | #define VIDOSDxA_TOPLEFT_X_SHIFT (11) | 232 | #define VIDOSDxA_TOPLEFT_X_SHIFT (11) |
@@ -291,11 +306,12 @@ | |||
291 | #define VIDINTCON0_FRAMESEL0_ACTIVE (0x2 << 15) | 306 | #define VIDINTCON0_FRAMESEL0_ACTIVE (0x2 << 15) |
292 | #define VIDINTCON0_FRAMESEL0_FRONTPORCH (0x3 << 15) | 307 | #define VIDINTCON0_FRAMESEL0_FRONTPORCH (0x3 << 15) |
293 | 308 | ||
294 | #define VIDINTCON0_FRAMESEL1 (1 << 14) | 309 | #define VIDINTCON0_FRAMESEL1 (1 << 13) |
295 | #define VIDINTCON0_FRAMESEL1_NONE (0x0 << 14) | 310 | #define VIDINTCON0_FRAMESEL1_MASK (0x3 << 13) |
296 | #define VIDINTCON0_FRAMESEL1_BACKPORCH (0x1 << 14) | 311 | #define VIDINTCON0_FRAMESEL1_NONE (0x0 << 13) |
297 | #define VIDINTCON0_FRAMESEL1_VSYNC (0x2 << 14) | 312 | #define VIDINTCON0_FRAMESEL1_BACKPORCH (0x1 << 13) |
298 | #define VIDINTCON0_FRAMESEL1_FRONTPORCH (0x3 << 14) | 313 | #define VIDINTCON0_FRAMESEL1_VSYNC (0x2 << 13) |
314 | #define VIDINTCON0_FRAMESEL1_FRONTPORCH (0x3 << 13) | ||
299 | 315 | ||
300 | #define VIDINTCON0_INT_FRAME (1 << 12) | 316 | #define VIDINTCON0_INT_FRAME (1 << 12) |
301 | #define VIDINTCON0_FIFIOSEL_MASK (0x7f << 5) | 317 | #define VIDINTCON0_FIFIOSEL_MASK (0x7f << 5) |
@@ -321,6 +337,10 @@ | |||
321 | #define VIDINTCON1_INT_FIFO (1 << 0) | 337 | #define VIDINTCON1_INT_FIFO (1 << 0) |
322 | 338 | ||
323 | /* Window colour-key control registers */ | 339 | /* Window colour-key control registers */ |
340 | #define WKEYCON (0x140) /* 6410,V210 */ | ||
341 | |||
342 | #define WKEYCON0 (0x00) | ||
343 | #define WKEYCON1 (0x04) | ||
324 | 344 | ||
325 | #define WxKEYCON0_KEYBL_EN (1 << 26) | 345 | #define WxKEYCON0_KEYBL_EN (1 << 26) |
326 | #define WxKEYCON0_KEYEN_F (1 << 25) | 346 | #define WxKEYCON0_KEYEN_F (1 << 25) |
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/regs-usb-hsotg.h b/arch/arm/plat-samsung/include/plat/regs-usb-hsotg.h index 8d18d9d4d148..dc90f5ede88f 100644 --- a/arch/arm/plat-samsung/include/plat/regs-usb-hsotg.h +++ b/arch/arm/plat-samsung/include/plat/regs-usb-hsotg.h | |||
@@ -226,6 +226,7 @@ | |||
226 | 226 | ||
227 | #define S3C_DIEPMSK S3C_HSOTG_REG(0x810) | 227 | #define S3C_DIEPMSK S3C_HSOTG_REG(0x810) |
228 | 228 | ||
229 | #define S3C_DIEPMSK_TxFIFOEmpty (1 << 7) | ||
229 | #define S3C_DIEPMSK_INEPNakEffMsk (1 << 6) | 230 | #define S3C_DIEPMSK_INEPNakEffMsk (1 << 6) |
230 | #define S3C_DIEPMSK_INTknEPMisMsk (1 << 5) | 231 | #define S3C_DIEPMSK_INTknEPMisMsk (1 << 5) |
231 | #define S3C_DIEPMSK_INTknTXFEmpMsk (1 << 4) | 232 | #define S3C_DIEPMSK_INTknTXFEmpMsk (1 << 4) |
@@ -371,6 +372,7 @@ | |||
371 | 372 | ||
372 | #define S3C_DIEPDMA(_a) S3C_HSOTG_REG(0x914 + ((_a) * 0x20)) | 373 | #define S3C_DIEPDMA(_a) S3C_HSOTG_REG(0x914 + ((_a) * 0x20)) |
373 | #define S3C_DOEPDMA(_a) S3C_HSOTG_REG(0xB14 + ((_a) * 0x20)) | 374 | #define S3C_DOEPDMA(_a) S3C_HSOTG_REG(0xB14 + ((_a) * 0x20)) |
375 | #define S3C_DTXFSTS(_a) S3C_HSOTG_REG(0x918 + ((_a) * 0x20)) | ||
374 | 376 | ||
375 | #define S3C_EPFIFO(_a) S3C_HSOTG_REG(0x1000 + ((_a) * 0x1000)) | 377 | #define S3C_EPFIFO(_a) S3C_HSOTG_REG(0x1000 + ((_a) * 0x1000)) |
376 | 378 | ||
diff --git a/arch/arm/plat-samsung/include/plat/sdhci.h b/arch/arm/plat-samsung/include/plat/sdhci.h index 13f9fb20900a..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,82 +123,70 @@ 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) { } |
168 | static inline void s3c6410_default_sdhci1(void) { } | 185 | static inline void s3c6410_default_sdhci1(void) { } |
186 | static inline void s3c6410_default_sdhci2(void) { } | ||
169 | static inline void s3c6400_default_sdhci0(void) { } | 187 | static inline void s3c6400_default_sdhci0(void) { } |
170 | static inline void s3c6400_default_sdhci1(void) { } | 188 | static inline void s3c6400_default_sdhci1(void) { } |
189 | static inline void s3c6400_default_sdhci2(void) { } | ||
171 | 190 | ||
172 | #endif /* CONFIG_S3C64XX_SETUP_SDHCI */ | 191 | #endif /* CONFIG_S3C64XX_SETUP_SDHCI */ |
173 | 192 | ||
@@ -181,48 +200,42 @@ extern void s5pc100_setup_sdhci0_cfg_card(struct platform_device *dev, | |||
181 | struct mmc_ios *ios, | 200 | struct mmc_ios *ios, |
182 | struct mmc_card *card); | 201 | struct mmc_card *card); |
183 | 202 | ||
184 | #ifdef CONFIG_S3C_DEV_HSMMC | ||
185 | static inline void s5pc100_default_sdhci0(void) | 203 | static inline void s5pc100_default_sdhci0(void) |
186 | { | 204 | { |
205 | #ifdef CONFIG_S3C_DEV_HSMMC | ||
187 | s3c_hsmmc0_def_platdata.clocks = s5pc100_hsmmc_clksrcs; | 206 | s3c_hsmmc0_def_platdata.clocks = s5pc100_hsmmc_clksrcs; |
188 | s3c_hsmmc0_def_platdata.cfg_gpio = s5pc100_setup_sdhci0_cfg_gpio; | 207 | s3c_hsmmc0_def_platdata.cfg_gpio = s5pc100_setup_sdhci0_cfg_gpio; |
189 | 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 | ||
190 | } | 210 | } |
191 | #else | ||
192 | static inline void s5pc100_default_sdhci0(void) { } | ||
193 | #endif /* CONFIG_S3C_DEV_HSMMC */ | ||
194 | 211 | ||
195 | #ifdef CONFIG_S3C_DEV_HSMMC1 | ||
196 | static inline void s5pc100_default_sdhci1(void) | 212 | static inline void s5pc100_default_sdhci1(void) |
197 | { | 213 | { |
214 | #ifdef CONFIG_S3C_DEV_HSMMC1 | ||
198 | s3c_hsmmc1_def_platdata.clocks = s5pc100_hsmmc_clksrcs; | 215 | s3c_hsmmc1_def_platdata.clocks = s5pc100_hsmmc_clksrcs; |
199 | s3c_hsmmc1_def_platdata.cfg_gpio = s5pc100_setup_sdhci1_cfg_gpio; | 216 | s3c_hsmmc1_def_platdata.cfg_gpio = s5pc100_setup_sdhci1_cfg_gpio; |
200 | 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 | ||
201 | } | 219 | } |
202 | #else | ||
203 | static inline void s5pc100_default_sdhci1(void) { } | ||
204 | #endif /* CONFIG_S3C_DEV_HSMMC1 */ | ||
205 | 220 | ||
206 | #ifdef CONFIG_S3C_DEV_HSMMC2 | ||
207 | static inline void s5pc100_default_sdhci2(void) | 221 | static inline void s5pc100_default_sdhci2(void) |
208 | { | 222 | { |
223 | #ifdef CONFIG_S3C_DEV_HSMMC2 | ||
209 | s3c_hsmmc2_def_platdata.clocks = s5pc100_hsmmc_clksrcs; | 224 | s3c_hsmmc2_def_platdata.clocks = s5pc100_hsmmc_clksrcs; |
210 | s3c_hsmmc2_def_platdata.cfg_gpio = s5pc100_setup_sdhci2_cfg_gpio; | 225 | s3c_hsmmc2_def_platdata.cfg_gpio = s5pc100_setup_sdhci2_cfg_gpio; |
211 | 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 | ||
212 | } | 228 | } |
213 | #else | ||
214 | static inline void s5pc100_default_sdhci2(void) { } | ||
215 | #endif /* CONFIG_S3C_DEV_HSMMC1 */ | ||
216 | |||
217 | 229 | ||
218 | #else | 230 | #else |
219 | static inline void s5pc100_default_sdhci0(void) { } | 231 | static inline void s5pc100_default_sdhci0(void) { } |
220 | static inline void s5pc100_default_sdhci1(void) { } | 232 | static inline void s5pc100_default_sdhci1(void) { } |
221 | static inline void s5pc100_default_sdhci2(void) { } | 233 | static inline void s5pc100_default_sdhci2(void) { } |
234 | |||
222 | #endif /* CONFIG_S5PC100_SETUP_SDHCI */ | 235 | #endif /* CONFIG_S5PC100_SETUP_SDHCI */ |
223 | 236 | ||
237 | /* S5PV210 SDHCI setup */ | ||
224 | 238 | ||
225 | /* S5PC110 SDHCI setup */ | ||
226 | #ifdef CONFIG_S5PV210_SETUP_SDHCI | 239 | #ifdef CONFIG_S5PV210_SETUP_SDHCI |
227 | extern char *s5pv210_hsmmc_clksrcs[4]; | 240 | extern char *s5pv210_hsmmc_clksrcs[4]; |
228 | 241 | ||
@@ -231,46 +244,48 @@ extern void s5pv210_setup_sdhci_cfg_card(struct platform_device *dev, | |||
231 | struct mmc_ios *ios, | 244 | struct mmc_ios *ios, |
232 | struct mmc_card *card); | 245 | struct mmc_card *card); |
233 | 246 | ||
234 | #ifdef CONFIG_S3C_DEV_HSMMC | ||
235 | static inline void s5pv210_default_sdhci0(void) | 247 | static inline void s5pv210_default_sdhci0(void) |
236 | { | 248 | { |
249 | #ifdef CONFIG_S3C_DEV_HSMMC | ||
237 | s3c_hsmmc0_def_platdata.clocks = s5pv210_hsmmc_clksrcs; | 250 | s3c_hsmmc0_def_platdata.clocks = s5pv210_hsmmc_clksrcs; |
238 | s3c_hsmmc0_def_platdata.cfg_gpio = s5pv210_setup_sdhci0_cfg_gpio; | 251 | s3c_hsmmc0_def_platdata.cfg_gpio = s5pv210_setup_sdhci0_cfg_gpio; |
239 | 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 | ||
240 | } | 254 | } |
241 | #else | ||
242 | static inline void s5pc100_default_sdhci0(void) { } | ||
243 | #endif /* CONFIG_S3C_DEV_HSMMC */ | ||
244 | 255 | ||
245 | #ifdef CONFIG_S3C_DEV_HSMMC1 | ||
246 | static inline void s5pv210_default_sdhci1(void) | 256 | static inline void s5pv210_default_sdhci1(void) |
247 | { | 257 | { |
258 | #ifdef CONFIG_S3C_DEV_HSMMC1 | ||
248 | s3c_hsmmc1_def_platdata.clocks = s5pv210_hsmmc_clksrcs; | 259 | s3c_hsmmc1_def_platdata.clocks = s5pv210_hsmmc_clksrcs; |
249 | s3c_hsmmc1_def_platdata.cfg_gpio = s5pv210_setup_sdhci1_cfg_gpio; | 260 | s3c_hsmmc1_def_platdata.cfg_gpio = s5pv210_setup_sdhci1_cfg_gpio; |
250 | 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 | ||
251 | } | 263 | } |
252 | #else | ||
253 | static inline void s5pv210_default_sdhci1(void) { } | ||
254 | #endif /* CONFIG_S3C_DEV_HSMMC1 */ | ||
255 | 264 | ||
256 | #ifdef CONFIG_S3C_DEV_HSMMC2 | ||
257 | static inline void s5pv210_default_sdhci2(void) | 265 | static inline void s5pv210_default_sdhci2(void) |
258 | { | 266 | { |
267 | #ifdef CONFIG_S3C_DEV_HSMMC2 | ||
259 | s3c_hsmmc2_def_platdata.clocks = s5pv210_hsmmc_clksrcs; | 268 | s3c_hsmmc2_def_platdata.clocks = s5pv210_hsmmc_clksrcs; |
260 | s3c_hsmmc2_def_platdata.cfg_gpio = s5pv210_setup_sdhci2_cfg_gpio; | 269 | s3c_hsmmc2_def_platdata.cfg_gpio = s5pv210_setup_sdhci2_cfg_gpio; |
261 | 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 | ||
262 | } | 281 | } |
263 | #else | ||
264 | static inline void s5pv210_default_sdhci2(void) { } | ||
265 | #endif /* CONFIG_S3C_DEV_HSMMC2 */ | ||
266 | 282 | ||
267 | #else | 283 | #else |
268 | static inline void s5pv210_default_sdhci0(void) { } | 284 | static inline void s5pv210_default_sdhci0(void) { } |
269 | static inline void s5pv210_default_sdhci1(void) { } | 285 | static inline void s5pv210_default_sdhci1(void) { } |
270 | static inline void s5pv210_default_sdhci2(void) { } | 286 | static inline void s5pv210_default_sdhci2(void) { } |
271 | #endif /* CONFIG_S5PC100_SETUP_SDHCI */ | 287 | static inline void s5pv210_default_sdhci3(void) { } |
272 | |||
273 | |||
274 | 288 | ||
289 | #endif /* CONFIG_S5PV210_SETUP_SDHCI */ | ||
275 | 290 | ||
276 | #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 | } | ||