aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/Kconfig6
-rw-r--r--arch/arm/configs/s5p64x0_defconfig2
-rw-r--r--arch/arm/configs/s5pv210_defconfig2
-rw-r--r--arch/arm/mach-exynos4/Kconfig5
-rw-r--r--arch/arm/mach-exynos4/Makefile1
-rw-r--r--arch/arm/mach-exynos4/cpu.c7
-rw-r--r--arch/arm/mach-exynos4/include/mach/irqs.h5
-rw-r--r--arch/arm/mach-exynos4/include/mach/map.h9
-rw-r--r--arch/arm/mach-exynos4/include/mach/regs-clock.h4
-rw-r--r--arch/arm/mach-exynos4/include/mach/regs-pmu.h5
-rw-r--r--arch/arm/mach-exynos4/setup-fimc.c44
-rw-r--r--arch/arm/mach-s3c2440/mach-gta02.c71
-rw-r--r--arch/arm/mach-s3c64xx/Kconfig5
-rw-r--r--arch/arm/mach-s3c64xx/mach-smdk6410.c46
-rw-r--r--arch/arm/mach-s5p64x0/Kconfig4
-rw-r--r--arch/arm/mach-s5p64x0/mach-smdk6440.c47
-rw-r--r--arch/arm/mach-s5p64x0/mach-smdk6450.c47
-rw-r--r--arch/arm/mach-s5pc100/Kconfig1
-rw-r--r--arch/arm/mach-s5pc100/mach-smdkc100.c48
-rw-r--r--arch/arm/mach-s5pv210/Kconfig7
-rw-r--r--arch/arm/mach-s5pv210/Makefile1
-rw-r--r--arch/arm/mach-s5pv210/include/mach/regs-clock.h5
-rw-r--r--arch/arm/mach-s5pv210/mach-aquila.c56
-rw-r--r--arch/arm/mach-s5pv210/mach-goni.c107
-rw-r--r--arch/arm/mach-s5pv210/mach-smdkc110.c4
-rw-r--r--arch/arm/mach-s5pv210/mach-smdkv210.c47
-rw-r--r--arch/arm/mach-s5pv210/mach-torbreck.c4
-rw-r--r--arch/arm/mach-s5pv210/setup-fimc.c43
-rw-r--r--arch/arm/plat-s3c24xx/Kconfig7
-rw-r--r--arch/arm/plat-s5p/Kconfig15
-rw-r--r--arch/arm/plat-s5p/Makefile3
-rw-r--r--arch/arm/plat-s5p/dev-csis0.c2
-rw-r--r--arch/arm/plat-s5p/dev-csis1.c2
-rw-r--r--arch/arm/plat-s5p/dev-fimc3.c43
-rw-r--r--arch/arm/plat-s5p/include/plat/camport.h28
-rw-r--r--arch/arm/plat-s5p/include/plat/csis.h28
-rw-r--r--arch/arm/plat-s5p/include/plat/mipi_csis.h43
-rw-r--r--arch/arm/plat-s5p/include/plat/s5p-time.h40
-rw-r--r--arch/arm/plat-s5p/s5p-time.c448
-rw-r--r--arch/arm/plat-s5p/setup-mipiphy.c63
-rw-r--r--arch/arm/plat-samsung/Kconfig13
-rw-r--r--arch/arm/plat-samsung/Makefile1
-rw-r--r--arch/arm/plat-samsung/dev-pwm.c53
-rw-r--r--arch/arm/plat-samsung/include/plat/devs.h1
-rw-r--r--arch/arm/plat-samsung/include/plat/fimc-core.h5
-rw-r--r--arch/arm/plat-samsung/pwm.c33
46 files changed, 1275 insertions, 186 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index b4db99bb4f85..eed07eac3a5f 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -715,7 +715,8 @@ config ARCH_S5P64X0
715 select GENERIC_GPIO 715 select GENERIC_GPIO
716 select HAVE_CLK 716 select HAVE_CLK
717 select HAVE_S3C2410_WATCHDOG if WATCHDOG 717 select HAVE_S3C2410_WATCHDOG if WATCHDOG
718 select ARCH_USES_GETTIMEOFFSET 718 select GENERIC_CLOCKEVENTS
719 select HAVE_SCHED_CLOCK
719 select HAVE_S3C2410_I2C if I2C 720 select HAVE_S3C2410_I2C if I2C
720 select HAVE_S3C_RTC if RTC_CLASS 721 select HAVE_S3C_RTC if RTC_CLASS
721 help 722 help
@@ -753,7 +754,8 @@ config ARCH_S5PV210
753 select HAVE_CLK 754 select HAVE_CLK
754 select ARM_L1_CACHE_SHIFT_6 755 select ARM_L1_CACHE_SHIFT_6
755 select ARCH_HAS_CPUFREQ 756 select ARCH_HAS_CPUFREQ
756 select ARCH_USES_GETTIMEOFFSET 757 select GENERIC_CLOCKEVENTS
758 select HAVE_SCHED_CLOCK
757 select HAVE_S3C2410_I2C if I2C 759 select HAVE_S3C2410_I2C if I2C
758 select HAVE_S3C_RTC if RTC_CLASS 760 select HAVE_S3C_RTC if RTC_CLASS
759 select HAVE_S3C2410_WATCHDOG if WATCHDOG 761 select HAVE_S3C2410_WATCHDOG if WATCHDOG
diff --git a/arch/arm/configs/s5p64x0_defconfig b/arch/arm/configs/s5p64x0_defconfig
index 2993ecd35145..ad6b61b0bd11 100644
--- a/arch/arm/configs/s5p64x0_defconfig
+++ b/arch/arm/configs/s5p64x0_defconfig
@@ -10,6 +10,8 @@ CONFIG_S3C_BOOT_ERROR_RESET=y
10CONFIG_S3C_LOWLEVEL_UART_PORT=1 10CONFIG_S3C_LOWLEVEL_UART_PORT=1
11CONFIG_MACH_SMDK6440=y 11CONFIG_MACH_SMDK6440=y
12CONFIG_MACH_SMDK6450=y 12CONFIG_MACH_SMDK6450=y
13CONFIG_NO_HZ=y
14CONFIG_HIGH_RES_TIMERS=y
13CONFIG_CPU_32v6K=y 15CONFIG_CPU_32v6K=y
14CONFIG_AEABI=y 16CONFIG_AEABI=y
15CONFIG_CMDLINE="root=/dev/ram0 rw ramdisk=8192 initrd=0x20800000,8M console=ttySAC1,115200 init=/linuxrc" 17CONFIG_CMDLINE="root=/dev/ram0 rw ramdisk=8192 initrd=0x20800000,8M console=ttySAC1,115200 init=/linuxrc"
diff --git a/arch/arm/configs/s5pv210_defconfig b/arch/arm/configs/s5pv210_defconfig
index 0488a1eb4d7d..fa989902236d 100644
--- a/arch/arm/configs/s5pv210_defconfig
+++ b/arch/arm/configs/s5pv210_defconfig
@@ -13,6 +13,8 @@ CONFIG_MACH_AQUILA=y
13CONFIG_MACH_GONI=y 13CONFIG_MACH_GONI=y
14CONFIG_MACH_SMDKC110=y 14CONFIG_MACH_SMDKC110=y
15CONFIG_MACH_SMDKV210=y 15CONFIG_MACH_SMDKV210=y
16CONFIG_NO_HZ=y
17CONFIG_HIGH_RES_TIMERS=y
16CONFIG_VMSPLIT_2G=y 18CONFIG_VMSPLIT_2G=y
17CONFIG_PREEMPT=y 19CONFIG_PREEMPT=y
18CONFIG_AEABI=y 20CONFIG_AEABI=y
diff --git a/arch/arm/mach-exynos4/Kconfig b/arch/arm/mach-exynos4/Kconfig
index 82195a9a4c61..8d7398fdd05c 100644
--- a/arch/arm/mach-exynos4/Kconfig
+++ b/arch/arm/mach-exynos4/Kconfig
@@ -76,6 +76,11 @@ config EXYNOS4_SETUP_SDHCI_GPIO
76 help 76 help
77 Common setup code for SDHCI gpio. 77 Common setup code for SDHCI gpio.
78 78
79config EXYNOS4_SETUP_FIMC
80 bool
81 help
82 Common setup code for the camera interfaces.
83
79# machine support 84# machine support
80 85
81menu "EXYNOS4 Machines" 86menu "EXYNOS4 Machines"
diff --git a/arch/arm/mach-exynos4/Makefile b/arch/arm/mach-exynos4/Makefile
index 991a4c5f4677..9473adbb6c19 100644
--- a/arch/arm/mach-exynos4/Makefile
+++ b/arch/arm/mach-exynos4/Makefile
@@ -42,6 +42,7 @@ obj-y += dev-audio.o
42obj-$(CONFIG_EXYNOS4_DEV_PD) += dev-pd.o 42obj-$(CONFIG_EXYNOS4_DEV_PD) += dev-pd.o
43obj-$(CONFIG_EXYNOS4_DEV_SYSMMU) += dev-sysmmu.o 43obj-$(CONFIG_EXYNOS4_DEV_SYSMMU) += dev-sysmmu.o
44 44
45obj-$(CONFIG_EXYNOS4_SETUP_FIMC) += setup-fimc.o
45obj-$(CONFIG_EXYNOS4_SETUP_I2C1) += setup-i2c1.o 46obj-$(CONFIG_EXYNOS4_SETUP_I2C1) += setup-i2c1.o
46obj-$(CONFIG_EXYNOS4_SETUP_I2C2) += setup-i2c2.o 47obj-$(CONFIG_EXYNOS4_SETUP_I2C2) += setup-i2c2.o
47obj-$(CONFIG_EXYNOS4_SETUP_I2C3) += setup-i2c3.o 48obj-$(CONFIG_EXYNOS4_SETUP_I2C3) += setup-i2c3.o
diff --git a/arch/arm/mach-exynos4/cpu.c b/arch/arm/mach-exynos4/cpu.c
index 479dfa1951c8..793011391943 100644
--- a/arch/arm/mach-exynos4/cpu.c
+++ b/arch/arm/mach-exynos4/cpu.c
@@ -21,6 +21,8 @@
21#include <plat/clock.h> 21#include <plat/clock.h>
22#include <plat/exynos4.h> 22#include <plat/exynos4.h>
23#include <plat/sdhci.h> 23#include <plat/sdhci.h>
24#include <plat/devs.h>
25#include <plat/fimc-core.h>
24 26
25#include <mach/regs-irq.h> 27#include <mach/regs-irq.h>
26 28
@@ -120,6 +122,11 @@ void __init exynos4_map_io(void)
120 exynos4_default_sdhci1(); 122 exynos4_default_sdhci1();
121 exynos4_default_sdhci2(); 123 exynos4_default_sdhci2();
122 exynos4_default_sdhci3(); 124 exynos4_default_sdhci3();
125
126 s3c_fimc_setname(0, "exynos4-fimc");
127 s3c_fimc_setname(1, "exynos4-fimc");
128 s3c_fimc_setname(2, "exynos4-fimc");
129 s3c_fimc_setname(3, "exynos4-fimc");
123} 130}
124 131
125void __init exynos4_init_clocks(int xtal) 132void __init exynos4_init_clocks(int xtal)
diff --git a/arch/arm/mach-exynos4/include/mach/irqs.h b/arch/arm/mach-exynos4/include/mach/irqs.h
index e3556d45c75b..1db1de8e3e81 100644
--- a/arch/arm/mach-exynos4/include/mach/irqs.h
+++ b/arch/arm/mach-exynos4/include/mach/irqs.h
@@ -108,6 +108,11 @@
108#define IRQ_MIPI_CSIS0 COMBINER_IRQ(30, 0) 108#define IRQ_MIPI_CSIS0 COMBINER_IRQ(30, 0)
109#define IRQ_MIPI_CSIS1 COMBINER_IRQ(30, 1) 109#define IRQ_MIPI_CSIS1 COMBINER_IRQ(30, 1)
110 110
111#define IRQ_FIMC0 COMBINER_IRQ(32, 0)
112#define IRQ_FIMC1 COMBINER_IRQ(32, 1)
113#define IRQ_FIMC2 COMBINER_IRQ(33, 0)
114#define IRQ_FIMC3 COMBINER_IRQ(33, 1)
115
111#define IRQ_ONENAND_AUDI COMBINER_IRQ(34, 0) 116#define IRQ_ONENAND_AUDI COMBINER_IRQ(34, 0)
112 117
113#define IRQ_MCT_L1 COMBINER_IRQ(35, 3) 118#define IRQ_MCT_L1 COMBINER_IRQ(35, 3)
diff --git a/arch/arm/mach-exynos4/include/mach/map.h b/arch/arm/mach-exynos4/include/mach/map.h
index 89ab6f75776c..4f50b07a376a 100644
--- a/arch/arm/mach-exynos4/include/mach/map.h
+++ b/arch/arm/mach-exynos4/include/mach/map.h
@@ -25,6 +25,11 @@
25 25
26#define EXYNOS4_PA_SYSRAM 0x02020000 26#define EXYNOS4_PA_SYSRAM 0x02020000
27 27
28#define EXYNOS4_PA_FIMC0 0x11800000
29#define EXYNOS4_PA_FIMC1 0x11810000
30#define EXYNOS4_PA_FIMC2 0x11820000
31#define EXYNOS4_PA_FIMC3 0x11830000
32
28#define EXYNOS4_PA_I2S0 0x03830000 33#define EXYNOS4_PA_I2S0 0x03830000
29#define EXYNOS4_PA_I2S1 0xE3100000 34#define EXYNOS4_PA_I2S1 0xE3100000
30#define EXYNOS4_PA_I2S2 0xE2A00000 35#define EXYNOS4_PA_I2S2 0xE2A00000
@@ -120,6 +125,10 @@
120#define S3C_PA_WDT EXYNOS4_PA_WATCHDOG 125#define S3C_PA_WDT EXYNOS4_PA_WATCHDOG
121 126
122#define S5P_PA_CHIPID EXYNOS4_PA_CHIPID 127#define S5P_PA_CHIPID EXYNOS4_PA_CHIPID
128#define S5P_PA_FIMC0 EXYNOS4_PA_FIMC0
129#define S5P_PA_FIMC1 EXYNOS4_PA_FIMC1
130#define S5P_PA_FIMC2 EXYNOS4_PA_FIMC2
131#define S5P_PA_FIMC3 EXYNOS4_PA_FIMC3
123#define S5P_PA_MIPI_CSIS0 EXYNOS4_PA_MIPI_CSIS0 132#define S5P_PA_MIPI_CSIS0 EXYNOS4_PA_MIPI_CSIS0
124#define S5P_PA_MIPI_CSIS1 EXYNOS4_PA_MIPI_CSIS1 133#define S5P_PA_MIPI_CSIS1 EXYNOS4_PA_MIPI_CSIS1
125#define S5P_PA_ONENAND EXYNOS4_PA_ONENAND 134#define S5P_PA_ONENAND EXYNOS4_PA_ONENAND
diff --git a/arch/arm/mach-exynos4/include/mach/regs-clock.h b/arch/arm/mach-exynos4/include/mach/regs-clock.h
index 084c3f05c093..c91f93054589 100644
--- a/arch/arm/mach-exynos4/include/mach/regs-clock.h
+++ b/arch/arm/mach-exynos4/include/mach/regs-clock.h
@@ -178,7 +178,9 @@
178#define S5P_CLKDIV_BUS_GPLR_SHIFT (4) 178#define S5P_CLKDIV_BUS_GPLR_SHIFT (4)
179#define S5P_CLKDIV_BUS_GPLR_MASK (0x7 << S5P_CLKDIV_BUS_GPLR_SHIFT) 179#define S5P_CLKDIV_BUS_GPLR_MASK (0x7 << S5P_CLKDIV_BUS_GPLR_SHIFT)
180 180
181/* Compatibility defines */ 181/* Compatibility defines and inclusion */
182
183#include <mach/regs-pmu.h>
182 184
183#define S5P_EPLL_CON S5P_EPLL_CON0 185#define S5P_EPLL_CON S5P_EPLL_CON0
184 186
diff --git a/arch/arm/mach-exynos4/include/mach/regs-pmu.h b/arch/arm/mach-exynos4/include/mach/regs-pmu.h
index 84aa17bd4dd8..fa1da9451689 100644
--- a/arch/arm/mach-exynos4/include/mach/regs-pmu.h
+++ b/arch/arm/mach-exynos4/include/mach/regs-pmu.h
@@ -33,6 +33,11 @@
33#define S5P_EINT_WAKEUP_MASK S5P_PMUREG(0x0604) 33#define S5P_EINT_WAKEUP_MASK S5P_PMUREG(0x0604)
34#define S5P_WAKEUP_MASK S5P_PMUREG(0x0608) 34#define S5P_WAKEUP_MASK S5P_PMUREG(0x0608)
35 35
36#define S5P_MIPI_DPHY_CONTROL(n) S5P_PMUREG(0x0710 + (n) * 4)
37#define S5P_MIPI_DPHY_ENABLE (1 << 0)
38#define S5P_MIPI_DPHY_SRESETN (1 << 1)
39#define S5P_MIPI_DPHY_MRESETN (1 << 2)
40
36#define S5P_INFORM0 S5P_PMUREG(0x0800) 41#define S5P_INFORM0 S5P_PMUREG(0x0800)
37#define S5P_INFORM1 S5P_PMUREG(0x0804) 42#define S5P_INFORM1 S5P_PMUREG(0x0804)
38#define S5P_INFORM2 S5P_PMUREG(0x0808) 43#define S5P_INFORM2 S5P_PMUREG(0x0808)
diff --git a/arch/arm/mach-exynos4/setup-fimc.c b/arch/arm/mach-exynos4/setup-fimc.c
new file mode 100644
index 000000000000..6a45078d9d12
--- /dev/null
+++ b/arch/arm/mach-exynos4/setup-fimc.c
@@ -0,0 +1,44 @@
1/*
2 * Copyright (C) 2011 Samsung Electronics Co., Ltd.
3 *
4 * Exynos4 camera interface GPIO configuration.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#include <linux/gpio.h>
12#include <plat/gpio-cfg.h>
13#include <plat/camport.h>
14
15int exynos4_fimc_setup_gpio(enum s5p_camport_id id)
16{
17 u32 gpio8, gpio5;
18 u32 sfn;
19 int ret;
20
21 switch (id) {
22 case S5P_CAMPORT_A:
23 gpio8 = EXYNOS4_GPJ0(0); /* PCLK, VSYNC, HREF, DATA[0:4] */
24 gpio5 = EXYNOS4_GPJ1(0); /* DATA[5:7], CLKOUT, FIELD */
25 sfn = S3C_GPIO_SFN(2);
26 break;
27
28 case S5P_CAMPORT_B:
29 gpio8 = EXYNOS4_GPE0(0); /* DATA[0:7] */
30 gpio5 = EXYNOS4_GPE1(0); /* PCLK, VSYNC, HREF, CLKOUT, FIELD */
31 sfn = S3C_GPIO_SFN(3);
32 break;
33
34 default:
35 WARN(1, "Wrong camport id: %d\n", id);
36 return -EINVAL;
37 }
38
39 ret = s3c_gpio_cfgall_range(gpio8, 8, sfn, S3C_GPIO_PULL_UP);
40 if (ret)
41 return ret;
42
43 return s3c_gpio_cfgall_range(gpio5, 5, sfn, S3C_GPIO_PULL_UP);
44}
diff --git a/arch/arm/mach-s3c2440/mach-gta02.c b/arch/arm/mach-s3c2440/mach-gta02.c
index 9f2c14ec7181..d217ef3cd86a 100644
--- a/arch/arm/mach-s3c2440/mach-gta02.c
+++ b/arch/arm/mach-s3c2440/mach-gta02.c
@@ -58,6 +58,9 @@
58#include <linux/mfd/pcf50633/pmic.h> 58#include <linux/mfd/pcf50633/pmic.h>
59#include <linux/mfd/pcf50633/backlight.h> 59#include <linux/mfd/pcf50633/backlight.h>
60 60
61#include <linux/input.h>
62#include <linux/gpio_keys.h>
63
61#include <asm/mach/arch.h> 64#include <asm/mach/arch.h>
62#include <asm/mach/map.h> 65#include <asm/mach/map.h>
63#include <asm/mach/irq.h> 66#include <asm/mach/irq.h>
@@ -86,6 +89,8 @@
86#include <plat/udc.h> 89#include <plat/udc.h>
87#include <plat/gpio-cfg.h> 90#include <plat/gpio-cfg.h>
88#include <plat/iic.h> 91#include <plat/iic.h>
92#include <plat/ts.h>
93
89 94
90static struct pcf50633 *gta02_pcf; 95static struct pcf50633 *gta02_pcf;
91 96
@@ -280,9 +285,6 @@ struct pcf50633_platform_data gta02_pcf_pdata = {
280 .valid_modes_mask = REGULATOR_MODE_NORMAL, 285 .valid_modes_mask = REGULATOR_MODE_NORMAL,
281 .always_on = 1, 286 .always_on = 1,
282 .apply_uV = 1, 287 .apply_uV = 1,
283 .state_mem = {
284 .enabled = 1,
285 },
286 }, 288 },
287 }, 289 },
288 [PCF50633_REGULATOR_DOWN1] = { 290 [PCF50633_REGULATOR_DOWN1] = {
@@ -301,9 +303,6 @@ struct pcf50633_platform_data gta02_pcf_pdata = {
301 .valid_modes_mask = REGULATOR_MODE_NORMAL, 303 .valid_modes_mask = REGULATOR_MODE_NORMAL,
302 .apply_uV = 1, 304 .apply_uV = 1,
303 .always_on = 1, 305 .always_on = 1,
304 .state_mem = {
305 .enabled = 1,
306 },
307 }, 306 },
308 }, 307 },
309 [PCF50633_REGULATOR_HCLDO] = { 308 [PCF50633_REGULATOR_HCLDO] = {
@@ -311,8 +310,8 @@ struct pcf50633_platform_data gta02_pcf_pdata = {
311 .min_uV = 2000000, 310 .min_uV = 2000000,
312 .max_uV = 3300000, 311 .max_uV = 3300000,
313 .valid_modes_mask = REGULATOR_MODE_NORMAL, 312 .valid_modes_mask = REGULATOR_MODE_NORMAL,
314 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE, 313 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
315 .always_on = 1, 314 REGULATOR_CHANGE_STATUS,
316 }, 315 },
317 }, 316 },
318 [PCF50633_REGULATOR_LDO1] = { 317 [PCF50633_REGULATOR_LDO1] = {
@@ -320,10 +319,8 @@ struct pcf50633_platform_data gta02_pcf_pdata = {
320 .min_uV = 3300000, 319 .min_uV = 3300000,
321 .max_uV = 3300000, 320 .max_uV = 3300000,
322 .valid_modes_mask = REGULATOR_MODE_NORMAL, 321 .valid_modes_mask = REGULATOR_MODE_NORMAL,
322 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
323 .apply_uV = 1, 323 .apply_uV = 1,
324 .state_mem = {
325 .enabled = 0,
326 },
327 }, 324 },
328 }, 325 },
329 [PCF50633_REGULATOR_LDO2] = { 326 [PCF50633_REGULATOR_LDO2] = {
@@ -347,6 +344,7 @@ struct pcf50633_platform_data gta02_pcf_pdata = {
347 .min_uV = 3200000, 344 .min_uV = 3200000,
348 .max_uV = 3200000, 345 .max_uV = 3200000,
349 .valid_modes_mask = REGULATOR_MODE_NORMAL, 346 .valid_modes_mask = REGULATOR_MODE_NORMAL,
347 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
350 .apply_uV = 1, 348 .apply_uV = 1,
351 }, 349 },
352 }, 350 },
@@ -355,10 +353,8 @@ struct pcf50633_platform_data gta02_pcf_pdata = {
355 .min_uV = 3000000, 353 .min_uV = 3000000,
356 .max_uV = 3000000, 354 .max_uV = 3000000,
357 .valid_modes_mask = REGULATOR_MODE_NORMAL, 355 .valid_modes_mask = REGULATOR_MODE_NORMAL,
356 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
358 .apply_uV = 1, 357 .apply_uV = 1,
359 .state_mem = {
360 .enabled = 1,
361 },
362 }, 358 },
363 }, 359 },
364 [PCF50633_REGULATOR_LDO6] = { 360 [PCF50633_REGULATOR_LDO6] = {
@@ -373,9 +369,6 @@ struct pcf50633_platform_data gta02_pcf_pdata = {
373 .min_uV = 1800000, 369 .min_uV = 1800000,
374 .max_uV = 1800000, 370 .max_uV = 1800000,
375 .valid_modes_mask = REGULATOR_MODE_NORMAL, 371 .valid_modes_mask = REGULATOR_MODE_NORMAL,
376 .state_mem = {
377 .enabled = 1,
378 },
379 }, 372 },
380 }, 373 },
381 374
@@ -489,6 +482,43 @@ static struct s3c2410_hcd_info gta02_usb_info __initdata = {
489 }, 482 },
490}; 483};
491 484
485/* Touchscreen */
486static struct s3c2410_ts_mach_info gta02_ts_info = {
487 .delay = 10000,
488 .presc = 0xff, /* slow as we can go */
489 .oversampling_shift = 2,
490};
491
492/* Buttons */
493static struct gpio_keys_button gta02_buttons[] = {
494 {
495 .gpio = GTA02_GPIO_AUX_KEY,
496 .code = KEY_PHONE,
497 .desc = "Aux",
498 .type = EV_KEY,
499 .debounce_interval = 100,
500 },
501 {
502 .gpio = GTA02_GPIO_HOLD_KEY,
503 .code = KEY_PAUSE,
504 .desc = "Hold",
505 .type = EV_KEY,
506 .debounce_interval = 100,
507 },
508};
509
510static struct gpio_keys_platform_data gta02_buttons_pdata = {
511 .buttons = gta02_buttons,
512 .nbuttons = ARRAY_SIZE(gta02_buttons),
513};
514
515static struct platform_device gta02_buttons_device = {
516 .name = "gpio-keys",
517 .id = -1,
518 .dev = {
519 .platform_data = &gta02_buttons_pdata,
520 },
521};
492 522
493static void __init gta02_map_io(void) 523static void __init gta02_map_io(void)
494{ 524{
@@ -509,7 +539,11 @@ static struct platform_device *gta02_devices[] __initdata = {
509 &gta02_nor_flash, 539 &gta02_nor_flash,
510 &s3c24xx_pwm_device, 540 &s3c24xx_pwm_device,
511 &s3c_device_iis, 541 &s3c_device_iis,
542 &samsung_asoc_dma,
512 &s3c_device_i2c0, 543 &s3c_device_i2c0,
544 &gta02_buttons_device,
545 &s3c_device_adc,
546 &s3c_device_ts,
513}; 547};
514 548
515/* These guys DO need to be children of PMU. */ 549/* These guys DO need to be children of PMU. */
@@ -559,6 +593,7 @@ static void __init gta02_machine_init(void)
559#endif 593#endif
560 594
561 s3c24xx_udc_set_platdata(&gta02_udc_cfg); 595 s3c24xx_udc_set_platdata(&gta02_udc_cfg);
596 s3c24xx_ts_set_platdata(&gta02_ts_info);
562 s3c_ohci_set_platdata(&gta02_usb_info); 597 s3c_ohci_set_platdata(&gta02_usb_info);
563 s3c_nand_set_platdata(&gta02_nand_info); 598 s3c_nand_set_platdata(&gta02_nand_info);
564 s3c_i2c0_set_platdata(NULL); 599 s3c_i2c0_set_platdata(NULL);
@@ -567,6 +602,8 @@ static void __init gta02_machine_init(void)
567 602
568 platform_add_devices(gta02_devices, ARRAY_SIZE(gta02_devices)); 603 platform_add_devices(gta02_devices, ARRAY_SIZE(gta02_devices));
569 pm_power_off = gta02_poweroff; 604 pm_power_off = gta02_poweroff;
605
606 regulator_has_full_constraints();
570} 607}
571 608
572 609
diff --git a/arch/arm/mach-s3c64xx/Kconfig b/arch/arm/mach-s3c64xx/Kconfig
index 579d2f0f4dd0..e4177e22557b 100644
--- a/arch/arm/mach-s3c64xx/Kconfig
+++ b/arch/arm/mach-s3c64xx/Kconfig
@@ -143,6 +143,7 @@ config MACH_SMDK6410
143 select S3C_DEV_USB_HSOTG 143 select S3C_DEV_USB_HSOTG
144 select S3C_DEV_WDT 144 select S3C_DEV_WDT
145 select SAMSUNG_DEV_KEYPAD 145 select SAMSUNG_DEV_KEYPAD
146 select SAMSUNG_DEV_PWM
146 select HAVE_S3C2410_WATCHDOG if WATCHDOG 147 select HAVE_S3C2410_WATCHDOG if WATCHDOG
147 select S3C64XX_SETUP_SDHCI 148 select S3C64XX_SETUP_SDHCI
148 select S3C64XX_SETUP_I2C1 149 select S3C64XX_SETUP_I2C1
@@ -231,7 +232,7 @@ config MACH_HMT
231 select S3C_DEV_NAND 232 select S3C_DEV_NAND
232 select S3C_DEV_USB_HOST 233 select S3C_DEV_USB_HOST
233 select S3C64XX_SETUP_FB_24BPP 234 select S3C64XX_SETUP_FB_24BPP
234 select HAVE_PWM 235 select SAMSUNG_DEV_PWM
235 help 236 help
236 Machine support for the Airgoo HMT 237 Machine support for the Airgoo HMT
237 238
@@ -249,8 +250,8 @@ config MACH_SMARTQ
249 select S3C64XX_SETUP_SDHCI 250 select S3C64XX_SETUP_SDHCI
250 select S3C64XX_SETUP_FB_24BPP 251 select S3C64XX_SETUP_FB_24BPP
251 select SAMSUNG_DEV_ADC 252 select SAMSUNG_DEV_ADC
253 select SAMSUNG_DEV_PWM
252 select SAMSUNG_DEV_TS 254 select SAMSUNG_DEV_TS
253 select HAVE_PWM
254 help 255 help
255 Shared machine support for SmartQ 5/7 256 Shared machine support for SmartQ 5/7
256 257
diff --git a/arch/arm/mach-s3c64xx/mach-smdk6410.c b/arch/arm/mach-s3c64xx/mach-smdk6410.c
index a80a3163dd30..686a4f270b12 100644
--- a/arch/arm/mach-s3c64xx/mach-smdk6410.c
+++ b/arch/arm/mach-s3c64xx/mach-smdk6410.c
@@ -29,6 +29,7 @@
29#include <linux/smsc911x.h> 29#include <linux/smsc911x.h>
30#include <linux/regulator/fixed.h> 30#include <linux/regulator/fixed.h>
31#include <linux/regulator/machine.h> 31#include <linux/regulator/machine.h>
32#include <linux/pwm_backlight.h>
32 33
33#ifdef CONFIG_SMDK6410_WM1190_EV1 34#ifdef CONFIG_SMDK6410_WM1190_EV1
34#include <linux/mfd/wm8350/core.h> 35#include <linux/mfd/wm8350/core.h>
@@ -49,6 +50,7 @@
49#include <mach/hardware.h> 50#include <mach/hardware.h>
50#include <mach/regs-fb.h> 51#include <mach/regs-fb.h>
51#include <mach/map.h> 52#include <mach/map.h>
53#include <mach/gpio-bank-f.h>
52 54
53#include <asm/irq.h> 55#include <asm/irq.h>
54#include <asm/mach-types.h> 56#include <asm/mach-types.h>
@@ -119,7 +121,6 @@ static void smdk6410_lcd_power_set(struct plat_lcd_data *pd,
119{ 121{
120 if (power) { 122 if (power) {
121 gpio_direction_output(S3C64XX_GPF(13), 1); 123 gpio_direction_output(S3C64XX_GPF(13), 1);
122 gpio_direction_output(S3C64XX_GPF(15), 1);
123 124
124 /* fire nRESET on power up */ 125 /* fire nRESET on power up */
125 gpio_direction_output(S3C64XX_GPN(5), 0); 126 gpio_direction_output(S3C64XX_GPN(5), 0);
@@ -127,7 +128,6 @@ static void smdk6410_lcd_power_set(struct plat_lcd_data *pd,
127 gpio_direction_output(S3C64XX_GPN(5), 1); 128 gpio_direction_output(S3C64XX_GPN(5), 1);
128 msleep(1); 129 msleep(1);
129 } else { 130 } else {
130 gpio_direction_output(S3C64XX_GPF(15), 0);
131 gpio_direction_output(S3C64XX_GPF(13), 0); 131 gpio_direction_output(S3C64XX_GPF(13), 0);
132 } 132 }
133} 133}
@@ -270,6 +270,45 @@ static struct samsung_keypad_platdata smdk6410_keypad_data __initdata = {
270 .cols = 8, 270 .cols = 8,
271}; 271};
272 272
273static int smdk6410_backlight_init(struct device *dev)
274{
275 int ret;
276
277 ret = gpio_request(S3C64XX_GPF(15), "Backlight");
278 if (ret) {
279 printk(KERN_ERR "failed to request GPF for PWM-OUT1\n");
280 return ret;
281 }
282
283 /* Configure GPIO pin with S3C64XX_GPF15_PWM_TOUT1 */
284 s3c_gpio_cfgpin(S3C64XX_GPF(15), S3C_GPIO_SFN(2));
285
286 return 0;
287}
288
289static void smdk6410_backlight_exit(struct device *dev)
290{
291 s3c_gpio_cfgpin(S3C64XX_GPF(15), S3C_GPIO_OUTPUT);
292 gpio_free(S3C64XX_GPF(15));
293}
294
295static struct platform_pwm_backlight_data smdk6410_backlight_data = {
296 .pwm_id = 1,
297 .max_brightness = 255,
298 .dft_brightness = 255,
299 .pwm_period_ns = 78770,
300 .init = smdk6410_backlight_init,
301 .exit = smdk6410_backlight_exit,
302};
303
304static struct platform_device smdk6410_backlight_device = {
305 .name = "pwm-backlight",
306 .dev = {
307 .parent = &s3c_device_timer[1].dev,
308 .platform_data = &smdk6410_backlight_data,
309 },
310};
311
273static struct map_desc smdk6410_iodesc[] = {}; 312static struct map_desc smdk6410_iodesc[] = {};
274 313
275static struct platform_device *smdk6410_devices[] __initdata = { 314static struct platform_device *smdk6410_devices[] __initdata = {
@@ -299,6 +338,8 @@ static struct platform_device *smdk6410_devices[] __initdata = {
299 &s3c_device_rtc, 338 &s3c_device_rtc,
300 &s3c_device_ts, 339 &s3c_device_ts,
301 &s3c_device_wdt, 340 &s3c_device_wdt,
341 &s3c_device_timer[1],
342 &smdk6410_backlight_device,
302}; 343};
303 344
304#ifdef CONFIG_REGULATOR 345#ifdef CONFIG_REGULATOR
@@ -694,7 +735,6 @@ static void __init smdk6410_machine_init(void)
694 735
695 gpio_request(S3C64XX_GPN(5), "LCD power"); 736 gpio_request(S3C64XX_GPN(5), "LCD power");
696 gpio_request(S3C64XX_GPF(13), "LCD power"); 737 gpio_request(S3C64XX_GPF(13), "LCD power");
697 gpio_request(S3C64XX_GPF(15), "LCD power");
698 738
699 i2c_register_board_info(0, i2c_devs0, ARRAY_SIZE(i2c_devs0)); 739 i2c_register_board_info(0, i2c_devs0, ARRAY_SIZE(i2c_devs0));
700 i2c_register_board_info(1, i2c_devs1, ARRAY_SIZE(i2c_devs1)); 740 i2c_register_board_info(1, i2c_devs1, ARRAY_SIZE(i2c_devs1));
diff --git a/arch/arm/mach-s5p64x0/Kconfig b/arch/arm/mach-s5p64x0/Kconfig
index 164d2783d381..017af4c4293c 100644
--- a/arch/arm/mach-s5p64x0/Kconfig
+++ b/arch/arm/mach-s5p64x0/Kconfig
@@ -10,12 +10,14 @@ if ARCH_S5P64X0
10config CPU_S5P6440 10config CPU_S5P6440
11 bool 11 bool
12 select S3C_PL330_DMA 12 select S3C_PL330_DMA
13 select S5P_HRT
13 help 14 help
14 Enable S5P6440 CPU support 15 Enable S5P6440 CPU support
15 16
16config CPU_S5P6450 17config CPU_S5P6450
17 bool 18 bool
18 select S3C_PL330_DMA 19 select S3C_PL330_DMA
20 select S5P_HRT
19 help 21 help
20 Enable S5P6450 CPU support 22 Enable S5P6450 CPU support
21 23
@@ -34,6 +36,7 @@ config MACH_SMDK6440
34 select S3C_DEV_WDT 36 select S3C_DEV_WDT
35 select S3C64XX_DEV_SPI 37 select S3C64XX_DEV_SPI
36 select SAMSUNG_DEV_ADC 38 select SAMSUNG_DEV_ADC
39 select SAMSUNG_DEV_PWM
37 select SAMSUNG_DEV_TS 40 select SAMSUNG_DEV_TS
38 select S5P64X0_SETUP_I2C1 41 select S5P64X0_SETUP_I2C1
39 help 42 help
@@ -47,6 +50,7 @@ config MACH_SMDK6450
47 select S3C_DEV_WDT 50 select S3C_DEV_WDT
48 select S3C64XX_DEV_SPI 51 select S3C64XX_DEV_SPI
49 select SAMSUNG_DEV_ADC 52 select SAMSUNG_DEV_ADC
53 select SAMSUNG_DEV_PWM
50 select SAMSUNG_DEV_TS 54 select SAMSUNG_DEV_TS
51 select S5P64X0_SETUP_I2C1 55 select S5P64X0_SETUP_I2C1
52 help 56 help
diff --git a/arch/arm/mach-s5p64x0/mach-smdk6440.c b/arch/arm/mach-s5p64x0/mach-smdk6440.c
index e5beb84e2393..2d559f10fd47 100644
--- a/arch/arm/mach-s5p64x0/mach-smdk6440.c
+++ b/arch/arm/mach-s5p64x0/mach-smdk6440.c
@@ -22,6 +22,7 @@
22#include <linux/module.h> 22#include <linux/module.h>
23#include <linux/clk.h> 23#include <linux/clk.h>
24#include <linux/gpio.h> 24#include <linux/gpio.h>
25#include <linux/pwm_backlight.h>
25 26
26#include <asm/mach/arch.h> 27#include <asm/mach/arch.h>
27#include <asm/mach/map.h> 28#include <asm/mach/map.h>
@@ -32,6 +33,7 @@
32#include <mach/map.h> 33#include <mach/map.h>
33#include <mach/regs-clock.h> 34#include <mach/regs-clock.h>
34#include <mach/i2c.h> 35#include <mach/i2c.h>
36#include <mach/regs-gpio.h>
35 37
36#include <plat/regs-serial.h> 38#include <plat/regs-serial.h>
37#include <plat/gpio-cfg.h> 39#include <plat/gpio-cfg.h>
@@ -43,6 +45,7 @@
43#include <plat/pll.h> 45#include <plat/pll.h>
44#include <plat/adc.h> 46#include <plat/adc.h>
45#include <plat/ts.h> 47#include <plat/ts.h>
48#include <plat/s5p-time.h>
46 49
47#define SMDK6440_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ 50#define SMDK6440_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
48 S3C2410_UCON_RXILEVEL | \ 51 S3C2410_UCON_RXILEVEL | \
@@ -88,6 +91,45 @@ static struct s3c2410_uartcfg smdk6440_uartcfgs[] __initdata = {
88 }, 91 },
89}; 92};
90 93
94static int smdk6440_backlight_init(struct device *dev)
95{
96 int ret;
97
98 ret = gpio_request(S5P6440_GPF(15), "Backlight");
99 if (ret) {
100 printk(KERN_ERR "failed to request GPF for PWM-OUT1\n");
101 return ret;
102 }
103
104 /* Configure GPIO pin with S5P6440_GPF15_PWM_TOUT1 */
105 s3c_gpio_cfgpin(S5P6440_GPF(15), S3C_GPIO_SFN(2));
106
107 return 0;
108}
109
110static void smdk6440_backlight_exit(struct device *dev)
111{
112 s3c_gpio_cfgpin(S5P6440_GPF(15), S3C_GPIO_OUTPUT);
113 gpio_free(S5P6440_GPF(15));
114}
115
116static struct platform_pwm_backlight_data smdk6440_backlight_data = {
117 .pwm_id = 1,
118 .max_brightness = 255,
119 .dft_brightness = 255,
120 .pwm_period_ns = 78770,
121 .init = smdk6440_backlight_init,
122 .exit = smdk6440_backlight_exit,
123};
124
125static struct platform_device smdk6440_backlight_device = {
126 .name = "pwm-backlight",
127 .dev = {
128 .parent = &s3c_device_timer[1].dev,
129 .platform_data = &smdk6440_backlight_data,
130 },
131};
132
91static struct platform_device *smdk6440_devices[] __initdata = { 133static struct platform_device *smdk6440_devices[] __initdata = {
92 &s3c_device_adc, 134 &s3c_device_adc,
93 &s3c_device_rtc, 135 &s3c_device_rtc,
@@ -97,6 +139,8 @@ static struct platform_device *smdk6440_devices[] __initdata = {
97 &s3c_device_wdt, 139 &s3c_device_wdt,
98 &samsung_asoc_dma, 140 &samsung_asoc_dma,
99 &s5p6440_device_iis, 141 &s5p6440_device_iis,
142 &s3c_device_timer[1],
143 &smdk6440_backlight_device,
100}; 144};
101 145
102static struct s3c2410_platform_i2c s5p6440_i2c0_data __initdata = { 146static struct s3c2410_platform_i2c s5p6440_i2c0_data __initdata = {
@@ -136,6 +180,7 @@ static void __init smdk6440_map_io(void)
136 s5p_init_io(NULL, 0, S5P64X0_SYS_ID); 180 s5p_init_io(NULL, 0, S5P64X0_SYS_ID);
137 s3c24xx_init_clocks(12000000); 181 s3c24xx_init_clocks(12000000);
138 s3c24xx_init_uarts(smdk6440_uartcfgs, ARRAY_SIZE(smdk6440_uartcfgs)); 182 s3c24xx_init_uarts(smdk6440_uartcfgs, ARRAY_SIZE(smdk6440_uartcfgs));
183 s5p_set_timer_source(S5P_PWM3, S5P_PWM4);
139} 184}
140 185
141static void __init smdk6440_machine_init(void) 186static void __init smdk6440_machine_init(void)
@@ -159,5 +204,5 @@ MACHINE_START(SMDK6440, "SMDK6440")
159 .init_irq = s5p6440_init_irq, 204 .init_irq = s5p6440_init_irq,
160 .map_io = smdk6440_map_io, 205 .map_io = smdk6440_map_io,
161 .init_machine = smdk6440_machine_init, 206 .init_machine = smdk6440_machine_init,
162 .timer = &s3c24xx_timer, 207 .timer = &s5p_timer,
163MACHINE_END 208MACHINE_END
diff --git a/arch/arm/mach-s5p64x0/mach-smdk6450.c b/arch/arm/mach-s5p64x0/mach-smdk6450.c
index 3a20de0a9264..d19c4690ee97 100644
--- a/arch/arm/mach-s5p64x0/mach-smdk6450.c
+++ b/arch/arm/mach-s5p64x0/mach-smdk6450.c
@@ -22,6 +22,7 @@
22#include <linux/module.h> 22#include <linux/module.h>
23#include <linux/clk.h> 23#include <linux/clk.h>
24#include <linux/gpio.h> 24#include <linux/gpio.h>
25#include <linux/pwm_backlight.h>
25 26
26#include <asm/mach/arch.h> 27#include <asm/mach/arch.h>
27#include <asm/mach/map.h> 28#include <asm/mach/map.h>
@@ -32,6 +33,7 @@
32#include <mach/map.h> 33#include <mach/map.h>
33#include <mach/regs-clock.h> 34#include <mach/regs-clock.h>
34#include <mach/i2c.h> 35#include <mach/i2c.h>
36#include <mach/regs-gpio.h>
35 37
36#include <plat/regs-serial.h> 38#include <plat/regs-serial.h>
37#include <plat/gpio-cfg.h> 39#include <plat/gpio-cfg.h>
@@ -43,6 +45,7 @@
43#include <plat/pll.h> 45#include <plat/pll.h>
44#include <plat/adc.h> 46#include <plat/adc.h>
45#include <plat/ts.h> 47#include <plat/ts.h>
48#include <plat/s5p-time.h>
46 49
47#define SMDK6450_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ 50#define SMDK6450_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
48 S3C2410_UCON_RXILEVEL | \ 51 S3C2410_UCON_RXILEVEL | \
@@ -106,6 +109,45 @@ static struct s3c2410_uartcfg smdk6450_uartcfgs[] __initdata = {
106#endif 109#endif
107}; 110};
108 111
112static int smdk6450_backlight_init(struct device *dev)
113{
114 int ret;
115
116 ret = gpio_request(S5P6450_GPF(15), "Backlight");
117 if (ret) {
118 printk(KERN_ERR "failed to request GPF for PWM-OUT1\n");
119 return ret;
120 }
121
122 /* Configure GPIO pin with S5P6450_GPF15_PWM_TOUT1 */
123 s3c_gpio_cfgpin(S5P6450_GPF(15), S3C_GPIO_SFN(2));
124
125 return 0;
126}
127
128static void smdk6450_backlight_exit(struct device *dev)
129{
130 s3c_gpio_cfgpin(S5P6450_GPF(15), S3C_GPIO_OUTPUT);
131 gpio_free(S5P6450_GPF(15));
132}
133
134static struct platform_pwm_backlight_data smdk6450_backlight_data = {
135 .pwm_id = 1,
136 .max_brightness = 255,
137 .dft_brightness = 255,
138 .pwm_period_ns = 78770,
139 .init = smdk6450_backlight_init,
140 .exit = smdk6450_backlight_exit,
141};
142
143static struct platform_device smdk6450_backlight_device = {
144 .name = "pwm-backlight",
145 .dev = {
146 .parent = &s3c_device_timer[1].dev,
147 .platform_data = &smdk6450_backlight_data,
148 },
149};
150
109static struct platform_device *smdk6450_devices[] __initdata = { 151static struct platform_device *smdk6450_devices[] __initdata = {
110 &s3c_device_adc, 152 &s3c_device_adc,
111 &s3c_device_rtc, 153 &s3c_device_rtc,
@@ -115,6 +157,8 @@ static struct platform_device *smdk6450_devices[] __initdata = {
115 &s3c_device_wdt, 157 &s3c_device_wdt,
116 &samsung_asoc_dma, 158 &samsung_asoc_dma,
117 &s5p6450_device_iis0, 159 &s5p6450_device_iis0,
160 &s3c_device_timer[1],
161 &smdk6450_backlight_device,
118 /* s5p6450_device_spi0 will be added */ 162 /* s5p6450_device_spi0 will be added */
119}; 163};
120 164
@@ -155,6 +199,7 @@ static void __init smdk6450_map_io(void)
155 s5p_init_io(NULL, 0, S5P64X0_SYS_ID); 199 s5p_init_io(NULL, 0, S5P64X0_SYS_ID);
156 s3c24xx_init_clocks(19200000); 200 s3c24xx_init_clocks(19200000);
157 s3c24xx_init_uarts(smdk6450_uartcfgs, ARRAY_SIZE(smdk6450_uartcfgs)); 201 s3c24xx_init_uarts(smdk6450_uartcfgs, ARRAY_SIZE(smdk6450_uartcfgs));
202 s5p_set_timer_source(S5P_PWM3, S5P_PWM4);
158} 203}
159 204
160static void __init smdk6450_machine_init(void) 205static void __init smdk6450_machine_init(void)
@@ -178,5 +223,5 @@ MACHINE_START(SMDK6450, "SMDK6450")
178 .init_irq = s5p6450_init_irq, 223 .init_irq = s5p6450_init_irq,
179 .map_io = smdk6450_map_io, 224 .map_io = smdk6450_map_io,
180 .init_machine = smdk6450_machine_init, 225 .init_machine = smdk6450_machine_init,
181 .timer = &s3c24xx_timer, 226 .timer = &s5p_timer,
182MACHINE_END 227MACHINE_END
diff --git a/arch/arm/mach-s5pc100/Kconfig b/arch/arm/mach-s5pc100/Kconfig
index b8fbf2fcba6f..608722ff4f28 100644
--- a/arch/arm/mach-s5pc100/Kconfig
+++ b/arch/arm/mach-s5pc100/Kconfig
@@ -58,6 +58,7 @@ config MACH_SMDKC100
58 select SAMSUNG_DEV_ADC 58 select SAMSUNG_DEV_ADC
59 select SAMSUNG_DEV_IDE 59 select SAMSUNG_DEV_IDE
60 select SAMSUNG_DEV_KEYPAD 60 select SAMSUNG_DEV_KEYPAD
61 select SAMSUNG_DEV_PWM
61 select SAMSUNG_DEV_TS 62 select SAMSUNG_DEV_TS
62 select S5PC100_SETUP_FB_24BPP 63 select S5PC100_SETUP_FB_24BPP
63 select S5PC100_SETUP_I2C1 64 select S5PC100_SETUP_I2C1
diff --git a/arch/arm/mach-s5pc100/mach-smdkc100.c b/arch/arm/mach-s5pc100/mach-smdkc100.c
index dd192a27524d..0525cb3ef406 100644
--- a/arch/arm/mach-s5pc100/mach-smdkc100.c
+++ b/arch/arm/mach-s5pc100/mach-smdkc100.c
@@ -23,12 +23,15 @@
23#include <linux/fb.h> 23#include <linux/fb.h>
24#include <linux/delay.h> 24#include <linux/delay.h>
25#include <linux/input.h> 25#include <linux/input.h>
26#include <linux/pwm_backlight.h>
26 27
27#include <asm/mach/arch.h> 28#include <asm/mach/arch.h>
28#include <asm/mach/map.h> 29#include <asm/mach/map.h>
29 30
30#include <mach/map.h> 31#include <mach/map.h>
31#include <mach/regs-fb.h> 32#include <mach/regs-fb.h>
33#include <mach/regs-gpio.h>
34
32#include <video/platform_lcd.h> 35#include <video/platform_lcd.h>
33 36
34#include <asm/irq.h> 37#include <asm/irq.h>
@@ -107,9 +110,6 @@ static struct i2c_board_info i2c_devs1[] __initdata = {
107static void smdkc100_lcd_power_set(struct plat_lcd_data *pd, 110static void smdkc100_lcd_power_set(struct plat_lcd_data *pd,
108 unsigned int power) 111 unsigned int power)
109{ 112{
110 /* backlight */
111 gpio_direction_output(S5PC100_GPD(0), power);
112
113 if (power) { 113 if (power) {
114 /* module reset */ 114 /* module reset */
115 gpio_direction_output(S5PC100_GPH0(6), 1); 115 gpio_direction_output(S5PC100_GPH0(6), 1);
@@ -179,6 +179,45 @@ static struct samsung_keypad_platdata smdkc100_keypad_data __initdata = {
179 .cols = 8, 179 .cols = 8,
180}; 180};
181 181
182static int smdkc100_backlight_init(struct device *dev)
183{
184 int ret;
185
186 ret = gpio_request(S5PC100_GPD(0), "Backlight");
187 if (ret) {
188 printk(KERN_ERR "failed to request GPF for PWM-OUT0\n");
189 return ret;
190 }
191
192 /* Configure GPIO pin with S5PC100_GPD_TOUT_0 */
193 s3c_gpio_cfgpin(S5PC100_GPD(0), S3C_GPIO_SFN(2));
194
195 return 0;
196}
197
198static void smdkc100_backlight_exit(struct device *dev)
199{
200 s3c_gpio_cfgpin(S5PC100_GPD(0), S3C_GPIO_OUTPUT);
201 gpio_free(S5PC100_GPD(0));
202}
203
204static struct platform_pwm_backlight_data smdkc100_backlight_data = {
205 .pwm_id = 0,
206 .max_brightness = 255,
207 .dft_brightness = 255,
208 .pwm_period_ns = 78770,
209 .init = smdkc100_backlight_init,
210 .exit = smdkc100_backlight_exit,
211};
212
213static struct platform_device smdkc100_backlight_device = {
214 .name = "pwm-backlight",
215 .dev = {
216 .parent = &s3c_device_timer[0].dev,
217 .platform_data = &smdkc100_backlight_data,
218 },
219};
220
182static struct platform_device *smdkc100_devices[] __initdata = { 221static struct platform_device *smdkc100_devices[] __initdata = {
183 &s3c_device_adc, 222 &s3c_device_adc,
184 &s3c_device_cfcon, 223 &s3c_device_cfcon,
@@ -200,6 +239,8 @@ static struct platform_device *smdkc100_devices[] __initdata = {
200 &s5p_device_fimc1, 239 &s5p_device_fimc1,
201 &s5p_device_fimc2, 240 &s5p_device_fimc2,
202 &s5pc100_device_spdif, 241 &s5pc100_device_spdif,
242 &s3c_device_timer[0],
243 &smdkc100_backlight_device,
203}; 244};
204 245
205static struct s3c2410_ts_mach_info s3c_ts_platform __initdata = { 246static struct s3c2410_ts_mach_info s3c_ts_platform __initdata = {
@@ -233,7 +274,6 @@ static void __init smdkc100_machine_init(void)
233 s5pc100_spdif_setup_gpio(S5PC100_SPDIF_GPD); 274 s5pc100_spdif_setup_gpio(S5PC100_SPDIF_GPD);
234 275
235 /* LCD init */ 276 /* LCD init */
236 gpio_request(S5PC100_GPD(0), "GPD");
237 gpio_request(S5PC100_GPH0(6), "GPH0"); 277 gpio_request(S5PC100_GPH0(6), "GPH0");
238 smdkc100_lcd_power_set(&smdkc100_lcd_power_data, 0); 278 smdkc100_lcd_power_set(&smdkc100_lcd_power_data, 0);
239 platform_add_devices(smdkc100_devices, ARRAY_SIZE(smdkc100_devices)); 279 platform_add_devices(smdkc100_devices, ARRAY_SIZE(smdkc100_devices));
diff --git a/arch/arm/mach-s5pv210/Kconfig b/arch/arm/mach-s5pv210/Kconfig
index 53aabef1e9ce..37b5a97594a5 100644
--- a/arch/arm/mach-s5pv210/Kconfig
+++ b/arch/arm/mach-s5pv210/Kconfig
@@ -13,6 +13,7 @@ config CPU_S5PV210
13 bool 13 bool
14 select S3C_PL330_DMA 14 select S3C_PL330_DMA
15 select S5P_EXT_INT 15 select S5P_EXT_INT
16 select S5P_HRT
16 select S5PV210_PM if PM 17 select S5PV210_PM if PM
17 help 18 help
18 Enable S5PV210 CPU support 19 Enable S5PV210 CPU support
@@ -53,6 +54,11 @@ config S5PV210_SETUP_SDHCI_GPIO
53 help 54 help
54 Common setup code for SDHCI gpio. 55 Common setup code for SDHCI gpio.
55 56
57config S5PV210_SETUP_FIMC
58 bool
59 help
60 Common setup code for the camera interfaces.
61
56menu "S5PC110 Machines" 62menu "S5PC110 Machines"
57 63
58config MACH_AQUILA 64config MACH_AQUILA
@@ -130,6 +136,7 @@ config MACH_SMDKV210
130 select SAMSUNG_DEV_ADC 136 select SAMSUNG_DEV_ADC
131 select SAMSUNG_DEV_IDE 137 select SAMSUNG_DEV_IDE
132 select SAMSUNG_DEV_KEYPAD 138 select SAMSUNG_DEV_KEYPAD
139 select SAMSUNG_DEV_PWM
133 select SAMSUNG_DEV_TS 140 select SAMSUNG_DEV_TS
134 select S5PV210_SETUP_FB_24BPP 141 select S5PV210_SETUP_FB_24BPP
135 select S5PV210_SETUP_I2C1 142 select S5PV210_SETUP_I2C1
diff --git a/arch/arm/mach-s5pv210/Makefile b/arch/arm/mach-s5pv210/Makefile
index ff1a0db57a2f..11f17907b4e8 100644
--- a/arch/arm/mach-s5pv210/Makefile
+++ b/arch/arm/mach-s5pv210/Makefile
@@ -31,6 +31,7 @@ obj-y += dev-audio.o
31obj-$(CONFIG_S3C64XX_DEV_SPI) += dev-spi.o 31obj-$(CONFIG_S3C64XX_DEV_SPI) += dev-spi.o
32 32
33obj-$(CONFIG_S5PV210_SETUP_FB_24BPP) += setup-fb-24bpp.o 33obj-$(CONFIG_S5PV210_SETUP_FB_24BPP) += setup-fb-24bpp.o
34obj-$(CONFIG_S5PV210_SETUP_FIMC) += setup-fimc.o
34obj-$(CONFIG_S5PV210_SETUP_I2C1) += setup-i2c1.o 35obj-$(CONFIG_S5PV210_SETUP_I2C1) += setup-i2c1.o
35obj-$(CONFIG_S5PV210_SETUP_I2C2) += setup-i2c2.o 36obj-$(CONFIG_S5PV210_SETUP_I2C2) += setup-i2c2.o
36obj-$(CONFIG_S5PV210_SETUP_IDE) += setup-ide.o 37obj-$(CONFIG_S5PV210_SETUP_IDE) += setup-ide.o
diff --git a/arch/arm/mach-s5pv210/include/mach/regs-clock.h b/arch/arm/mach-s5pv210/include/mach/regs-clock.h
index 4c45b74def5f..78925c516346 100644
--- a/arch/arm/mach-s5pv210/include/mach/regs-clock.h
+++ b/arch/arm/mach-s5pv210/include/mach/regs-clock.h
@@ -146,6 +146,10 @@
146#define S5P_OM_STAT S5P_CLKREG(0xE100) 146#define S5P_OM_STAT S5P_CLKREG(0xE100)
147#define S5P_USB_PHY_CONTROL S5P_CLKREG(0xE80C) 147#define S5P_USB_PHY_CONTROL S5P_CLKREG(0xE80C)
148#define S5P_DAC_CONTROL S5P_CLKREG(0xE810) 148#define S5P_DAC_CONTROL S5P_CLKREG(0xE810)
149#define S5P_MIPI_DPHY_CONTROL(x) S5P_CLKREG(0xE814)
150#define S5P_MIPI_DPHY_ENABLE (1 << 0)
151#define S5P_MIPI_DPHY_SRESETN (1 << 1)
152#define S5P_MIPI_DPHY_MRESETN (1 << 2)
149 153
150#define S5P_INFORM0 S5P_CLKREG(0xF000) 154#define S5P_INFORM0 S5P_CLKREG(0xF000)
151#define S5P_INFORM1 S5P_CLKREG(0xF004) 155#define S5P_INFORM1 S5P_CLKREG(0xF004)
@@ -161,7 +165,6 @@
161#define S5P_MDNIE_SEL S5P_CLKREG(0x7008) 165#define S5P_MDNIE_SEL S5P_CLKREG(0x7008)
162#define S5P_MIPI_PHY_CON0 S5P_CLKREG(0x7200) 166#define S5P_MIPI_PHY_CON0 S5P_CLKREG(0x7200)
163#define S5P_MIPI_PHY_CON1 S5P_CLKREG(0x7204) 167#define S5P_MIPI_PHY_CON1 S5P_CLKREG(0x7204)
164#define S5P_MIPI_DPHY_CONTROL S5P_CLKREG(0xE814)
165 168
166#define S5P_IDLE_CFG_TL_MASK (3 << 30) 169#define S5P_IDLE_CFG_TL_MASK (3 << 30)
167#define S5P_IDLE_CFG_TM_MASK (3 << 28) 170#define S5P_IDLE_CFG_TM_MASK (3 << 28)
diff --git a/arch/arm/mach-s5pv210/mach-aquila.c b/arch/arm/mach-s5pv210/mach-aquila.c
index 557add4fc56c..4e1d8ff5ae59 100644
--- a/arch/arm/mach-s5pv210/mach-aquila.c
+++ b/arch/arm/mach-s5pv210/mach-aquila.c
@@ -39,6 +39,7 @@
39#include <plat/fb.h> 39#include <plat/fb.h>
40#include <plat/fimc-core.h> 40#include <plat/fimc-core.h>
41#include <plat/sdhci.h> 41#include <plat/sdhci.h>
42#include <plat/s5p-time.h>
42 43
43/* Following are default values for UCON, ULCON and UFCON UART registers */ 44/* Following are default values for UCON, ULCON and UFCON UART registers */
44#define AQUILA_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ 45#define AQUILA_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
@@ -296,13 +297,11 @@ static struct regulator_init_data aquila_ldo17_data = {
296}; 297};
297 298
298/* BUCK */ 299/* BUCK */
299static struct regulator_consumer_supply buck1_consumer[] = { 300static struct regulator_consumer_supply buck1_consumer =
300 { .supply = "vddarm", }, 301 REGULATOR_SUPPLY("vddarm", NULL);
301};
302 302
303static struct regulator_consumer_supply buck2_consumer[] = { 303static struct regulator_consumer_supply buck2_consumer =
304 { .supply = "vddint", }, 304 REGULATOR_SUPPLY("vddint", NULL);
305};
306 305
307static struct regulator_init_data aquila_buck1_data = { 306static struct regulator_init_data aquila_buck1_data = {
308 .constraints = { 307 .constraints = {
@@ -313,8 +312,8 @@ static struct regulator_init_data aquila_buck1_data = {
313 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE | 312 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
314 REGULATOR_CHANGE_STATUS, 313 REGULATOR_CHANGE_STATUS,
315 }, 314 },
316 .num_consumer_supplies = ARRAY_SIZE(buck1_consumer), 315 .num_consumer_supplies = 1,
317 .consumer_supplies = buck1_consumer, 316 .consumer_supplies = &buck1_consumer,
318}; 317};
319 318
320static struct regulator_init_data aquila_buck2_data = { 319static struct regulator_init_data aquila_buck2_data = {
@@ -326,8 +325,8 @@ static struct regulator_init_data aquila_buck2_data = {
326 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE | 325 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
327 REGULATOR_CHANGE_STATUS, 326 REGULATOR_CHANGE_STATUS,
328 }, 327 },
329 .num_consumer_supplies = ARRAY_SIZE(buck2_consumer), 328 .num_consumer_supplies = 1,
330 .consumer_supplies = buck2_consumer, 329 .consumer_supplies = &buck2_consumer,
331}; 330};
332 331
333static struct regulator_init_data aquila_buck3_data = { 332static struct regulator_init_data aquila_buck3_data = {
@@ -391,26 +390,14 @@ static struct max8998_platform_data aquila_max8998_pdata = {
391#endif 390#endif
392 391
393static struct regulator_consumer_supply wm8994_fixed_voltage0_supplies[] = { 392static struct regulator_consumer_supply wm8994_fixed_voltage0_supplies[] = {
394 { 393 REGULATOR_SUPPLY("DBVDD", "5-001a"),
395 .dev_name = "5-001a", 394 REGULATOR_SUPPLY("AVDD2", "5-001a"),
396 .supply = "DBVDD", 395 REGULATOR_SUPPLY("CPVDD", "5-001a"),
397 }, {
398 .dev_name = "5-001a",
399 .supply = "AVDD2",
400 }, {
401 .dev_name = "5-001a",
402 .supply = "CPVDD",
403 },
404}; 396};
405 397
406static struct regulator_consumer_supply wm8994_fixed_voltage1_supplies[] = { 398static struct regulator_consumer_supply wm8994_fixed_voltage1_supplies[] = {
407 { 399 REGULATOR_SUPPLY("SPKVDD1", "5-001a"),
408 .dev_name = "5-001a", 400 REGULATOR_SUPPLY("SPKVDD2", "5-001a"),
409 .supply = "SPKVDD1",
410 }, {
411 .dev_name = "5-001a",
412 .supply = "SPKVDD2",
413 },
414}; 401};
415 402
416static struct regulator_init_data wm8994_fixed_voltage0_init_data = { 403static struct regulator_init_data wm8994_fixed_voltage0_init_data = {
@@ -459,15 +446,11 @@ static struct platform_device wm8994_fixed_voltage1 = {
459 }, 446 },
460}; 447};
461 448
462static struct regulator_consumer_supply wm8994_avdd1_supply = { 449static struct regulator_consumer_supply wm8994_avdd1_supply =
463 .dev_name = "5-001a", 450 REGULATOR_SUPPLY("AVDD1", "5-001a");
464 .supply = "AVDD1",
465};
466 451
467static struct regulator_consumer_supply wm8994_dcvdd_supply = { 452static struct regulator_consumer_supply wm8994_dcvdd_supply =
468 .dev_name = "5-001a", 453 REGULATOR_SUPPLY("DCVDD", "5-001a");
469 .supply = "DCVDD",
470};
471 454
472static struct regulator_init_data wm8994_ldo1_data = { 455static struct regulator_init_data wm8994_ldo1_data = {
473 .constraints = { 456 .constraints = {
@@ -664,6 +647,7 @@ static void __init aquila_map_io(void)
664 s5p_init_io(NULL, 0, S5P_VA_CHIPID); 647 s5p_init_io(NULL, 0, S5P_VA_CHIPID);
665 s3c24xx_init_clocks(24000000); 648 s3c24xx_init_clocks(24000000);
666 s3c24xx_init_uarts(aquila_uartcfgs, ARRAY_SIZE(aquila_uartcfgs)); 649 s3c24xx_init_uarts(aquila_uartcfgs, ARRAY_SIZE(aquila_uartcfgs));
650 s5p_set_timer_source(S5P_PWM3, S5P_PWM4);
667} 651}
668 652
669static void __init aquila_machine_init(void) 653static void __init aquila_machine_init(void)
@@ -698,5 +682,5 @@ MACHINE_START(AQUILA, "Aquila")
698 .init_irq = s5pv210_init_irq, 682 .init_irq = s5pv210_init_irq,
699 .map_io = aquila_map_io, 683 .map_io = aquila_map_io,
700 .init_machine = aquila_machine_init, 684 .init_machine = aquila_machine_init,
701 .timer = &s3c24xx_timer, 685 .timer = &s5p_timer,
702MACHINE_END 686MACHINE_END
diff --git a/arch/arm/mach-s5pv210/mach-goni.c b/arch/arm/mach-s5pv210/mach-goni.c
index 056f5c769b0a..243291722c66 100644
--- a/arch/arm/mach-s5pv210/mach-goni.c
+++ b/arch/arm/mach-s5pv210/mach-goni.c
@@ -45,6 +45,7 @@
45#include <plat/keypad.h> 45#include <plat/keypad.h>
46#include <plat/sdhci.h> 46#include <plat/sdhci.h>
47#include <plat/clock.h> 47#include <plat/clock.h>
48#include <plat/s5p-time.h>
48 49
49/* Following are default values for UCON, ULCON and UFCON UART registers */ 50/* Following are default values for UCON, ULCON and UFCON UART registers */
50#define GONI_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ 51#define GONI_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
@@ -108,6 +109,8 @@ static struct s3c_fb_pd_win goni_fb_win0 = {
108 }, 109 },
109 .max_bpp = 32, 110 .max_bpp = 32,
110 .default_bpp = 16, 111 .default_bpp = 16,
112 .virtual_x = 480,
113 .virtual_y = 2 * 800,
111}; 114};
112 115
113static struct s3c_fb_platdata goni_lcd_pdata __initdata = { 116static struct s3c_fb_platdata goni_lcd_pdata __initdata = {
@@ -269,10 +272,30 @@ static void __init goni_tsp_init(void)
269/* MAX8998 regulators */ 272/* MAX8998 regulators */
270#if defined(CONFIG_REGULATOR_MAX8998) || defined(CONFIG_REGULATOR_MAX8998_MODULE) 273#if defined(CONFIG_REGULATOR_MAX8998) || defined(CONFIG_REGULATOR_MAX8998_MODULE)
271 274
275static struct regulator_consumer_supply goni_ldo3_consumers[] = {
276 REGULATOR_SUPPLY("vusb_a", "s3c-hsotg"),
277};
278
272static struct regulator_consumer_supply goni_ldo5_consumers[] = { 279static struct regulator_consumer_supply goni_ldo5_consumers[] = {
273 REGULATOR_SUPPLY("vmmc", "s3c-sdhci.0"), 280 REGULATOR_SUPPLY("vmmc", "s3c-sdhci.0"),
274}; 281};
275 282
283static struct regulator_consumer_supply goni_ldo8_consumers[] = {
284 REGULATOR_SUPPLY("vusb_d", "s3c-hsotg"),
285};
286
287static struct regulator_consumer_supply goni_ldo11_consumers[] = {
288 REGULATOR_SUPPLY("vddio", "0-0030"), /* "CAM_IO_2.8V" */
289};
290
291static struct regulator_consumer_supply goni_ldo13_consumers[] = {
292 REGULATOR_SUPPLY("vdda", "0-0030"), /* "CAM_A_2.8V" */
293};
294
295static struct regulator_consumer_supply goni_ldo14_consumers[] = {
296 REGULATOR_SUPPLY("vdd_core", "0-0030"), /* "CAM_CIF_1.8V" */
297};
298
276static struct regulator_init_data goni_ldo2_data = { 299static struct regulator_init_data goni_ldo2_data = {
277 .constraints = { 300 .constraints = {
278 .name = "VALIVE_1.1V", 301 .name = "VALIVE_1.1V",
@@ -292,8 +315,10 @@ static struct regulator_init_data goni_ldo3_data = {
292 .min_uV = 1100000, 315 .min_uV = 1100000,
293 .max_uV = 1100000, 316 .max_uV = 1100000,
294 .apply_uV = 1, 317 .apply_uV = 1,
295 .always_on = 1, 318 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
296 }, 319 },
320 .num_consumer_supplies = ARRAY_SIZE(goni_ldo3_consumers),
321 .consumer_supplies = goni_ldo3_consumers,
297}; 322};
298 323
299static struct regulator_init_data goni_ldo4_data = { 324static struct regulator_init_data goni_ldo4_data = {
@@ -311,6 +336,7 @@ static struct regulator_init_data goni_ldo5_data = {
311 .min_uV = 2800000, 336 .min_uV = 2800000,
312 .max_uV = 2800000, 337 .max_uV = 2800000,
313 .apply_uV = 1, 338 .apply_uV = 1,
339 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
314 }, 340 },
315 .num_consumer_supplies = ARRAY_SIZE(goni_ldo5_consumers), 341 .num_consumer_supplies = ARRAY_SIZE(goni_ldo5_consumers),
316 .consumer_supplies = goni_ldo5_consumers, 342 .consumer_supplies = goni_ldo5_consumers,
@@ -341,8 +367,10 @@ static struct regulator_init_data goni_ldo8_data = {
341 .min_uV = 3300000, 367 .min_uV = 3300000,
342 .max_uV = 3300000, 368 .max_uV = 3300000,
343 .apply_uV = 1, 369 .apply_uV = 1,
344 .always_on = 1, 370 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
345 }, 371 },
372 .num_consumer_supplies = ARRAY_SIZE(goni_ldo8_consumers),
373 .consumer_supplies = goni_ldo8_consumers,
346}; 374};
347 375
348static struct regulator_init_data goni_ldo9_data = { 376static struct regulator_init_data goni_ldo9_data = {
@@ -351,7 +379,6 @@ static struct regulator_init_data goni_ldo9_data = {
351 .min_uV = 2800000, 379 .min_uV = 2800000,
352 .max_uV = 2800000, 380 .max_uV = 2800000,
353 .apply_uV = 1, 381 .apply_uV = 1,
354 .always_on = 1,
355 }, 382 },
356}; 383};
357 384
@@ -371,8 +398,10 @@ static struct regulator_init_data goni_ldo11_data = {
371 .min_uV = 2800000, 398 .min_uV = 2800000,
372 .max_uV = 2800000, 399 .max_uV = 2800000,
373 .apply_uV = 1, 400 .apply_uV = 1,
374 .always_on = 1, 401 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
375 }, 402 },
403 .num_consumer_supplies = ARRAY_SIZE(goni_ldo11_consumers),
404 .consumer_supplies = goni_ldo11_consumers,
376}; 405};
377 406
378static struct regulator_init_data goni_ldo12_data = { 407static struct regulator_init_data goni_ldo12_data = {
@@ -381,7 +410,6 @@ static struct regulator_init_data goni_ldo12_data = {
381 .min_uV = 1200000, 410 .min_uV = 1200000,
382 .max_uV = 1200000, 411 .max_uV = 1200000,
383 .apply_uV = 1, 412 .apply_uV = 1,
384 .always_on = 1,
385 }, 413 },
386}; 414};
387 415
@@ -391,8 +419,10 @@ static struct regulator_init_data goni_ldo13_data = {
391 .min_uV = 2800000, 419 .min_uV = 2800000,
392 .max_uV = 2800000, 420 .max_uV = 2800000,
393 .apply_uV = 1, 421 .apply_uV = 1,
394 .always_on = 1, 422 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
395 }, 423 },
424 .num_consumer_supplies = ARRAY_SIZE(goni_ldo13_consumers),
425 .consumer_supplies = goni_ldo13_consumers,
396}; 426};
397 427
398static struct regulator_init_data goni_ldo14_data = { 428static struct regulator_init_data goni_ldo14_data = {
@@ -401,8 +431,10 @@ static struct regulator_init_data goni_ldo14_data = {
401 .min_uV = 1800000, 431 .min_uV = 1800000,
402 .max_uV = 1800000, 432 .max_uV = 1800000,
403 .apply_uV = 1, 433 .apply_uV = 1,
404 .always_on = 1, 434 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
405 }, 435 },
436 .num_consumer_supplies = ARRAY_SIZE(goni_ldo14_consumers),
437 .consumer_supplies = goni_ldo14_consumers,
406}; 438};
407 439
408static struct regulator_init_data goni_ldo15_data = { 440static struct regulator_init_data goni_ldo15_data = {
@@ -411,7 +443,6 @@ static struct regulator_init_data goni_ldo15_data = {
411 .min_uV = 3300000, 443 .min_uV = 3300000,
412 .max_uV = 3300000, 444 .max_uV = 3300000,
413 .apply_uV = 1, 445 .apply_uV = 1,
414 .always_on = 1,
415 }, 446 },
416}; 447};
417 448
@@ -421,7 +452,6 @@ static struct regulator_init_data goni_ldo16_data = {
421 .min_uV = 1800000, 452 .min_uV = 1800000,
422 .max_uV = 1800000, 453 .max_uV = 1800000,
423 .apply_uV = 1, 454 .apply_uV = 1,
424 .always_on = 1,
425 }, 455 },
426}; 456};
427 457
@@ -436,13 +466,11 @@ static struct regulator_init_data goni_ldo17_data = {
436}; 466};
437 467
438/* BUCK */ 468/* BUCK */
439static struct regulator_consumer_supply buck1_consumer[] = { 469static struct regulator_consumer_supply buck1_consumer =
440 { .supply = "vddarm", }, 470 REGULATOR_SUPPLY("vddarm", NULL);
441};
442 471
443static struct regulator_consumer_supply buck2_consumer[] = { 472static struct regulator_consumer_supply buck2_consumer =
444 { .supply = "vddint", }, 473 REGULATOR_SUPPLY("vddint", NULL);
445};
446 474
447static struct regulator_init_data goni_buck1_data = { 475static struct regulator_init_data goni_buck1_data = {
448 .constraints = { 476 .constraints = {
@@ -453,8 +481,8 @@ static struct regulator_init_data goni_buck1_data = {
453 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE | 481 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
454 REGULATOR_CHANGE_STATUS, 482 REGULATOR_CHANGE_STATUS,
455 }, 483 },
456 .num_consumer_supplies = ARRAY_SIZE(buck1_consumer), 484 .num_consumer_supplies = 1,
457 .consumer_supplies = buck1_consumer, 485 .consumer_supplies = &buck1_consumer,
458}; 486};
459 487
460static struct regulator_init_data goni_buck2_data = { 488static struct regulator_init_data goni_buck2_data = {
@@ -466,8 +494,8 @@ static struct regulator_init_data goni_buck2_data = {
466 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE | 494 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
467 REGULATOR_CHANGE_STATUS, 495 REGULATOR_CHANGE_STATUS,
468 }, 496 },
469 .num_consumer_supplies = ARRAY_SIZE(buck2_consumer), 497 .num_consumer_supplies = 1,
470 .consumer_supplies = buck2_consumer, 498 .consumer_supplies = &buck2_consumer,
471}; 499};
472 500
473static struct regulator_init_data goni_buck3_data = { 501static struct regulator_init_data goni_buck3_data = {
@@ -531,26 +559,14 @@ static struct max8998_platform_data goni_max8998_pdata = {
531#endif 559#endif
532 560
533static struct regulator_consumer_supply wm8994_fixed_voltage0_supplies[] = { 561static struct regulator_consumer_supply wm8994_fixed_voltage0_supplies[] = {
534 { 562 REGULATOR_SUPPLY("DBVDD", "5-001a"),
535 .dev_name = "5-001a", 563 REGULATOR_SUPPLY("AVDD2", "5-001a"),
536 .supply = "DBVDD", 564 REGULATOR_SUPPLY("CPVDD", "5-001a"),
537 }, {
538 .dev_name = "5-001a",
539 .supply = "AVDD2",
540 }, {
541 .dev_name = "5-001a",
542 .supply = "CPVDD",
543 },
544}; 565};
545 566
546static struct regulator_consumer_supply wm8994_fixed_voltage1_supplies[] = { 567static struct regulator_consumer_supply wm8994_fixed_voltage1_supplies[] = {
547 { 568 REGULATOR_SUPPLY("SPKVDD1", "5-001a"),
548 .dev_name = "5-001a", 569 REGULATOR_SUPPLY("SPKVDD2", "5-001a"),
549 .supply = "SPKVDD1",
550 }, {
551 .dev_name = "5-001a",
552 .supply = "SPKVDD2",
553 },
554}; 570};
555 571
556static struct regulator_init_data wm8994_fixed_voltage0_init_data = { 572static struct regulator_init_data wm8994_fixed_voltage0_init_data = {
@@ -599,15 +615,11 @@ static struct platform_device wm8994_fixed_voltage1 = {
599 }, 615 },
600}; 616};
601 617
602static struct regulator_consumer_supply wm8994_avdd1_supply = { 618static struct regulator_consumer_supply wm8994_avdd1_supply =
603 .dev_name = "5-001a", 619 REGULATOR_SUPPLY("AVDD1", "5-001a");
604 .supply = "AVDD1",
605};
606 620
607static struct regulator_consumer_supply wm8994_dcvdd_supply = { 621static struct regulator_consumer_supply wm8994_dcvdd_supply =
608 .dev_name = "5-001a", 622 REGULATOR_SUPPLY("DCVDD", "5-001a");
609 .supply = "DCVDD",
610};
611 623
612static struct regulator_init_data wm8994_ldo1_data = { 624static struct regulator_init_data wm8994_ldo1_data = {
613 .constraints = { 625 .constraints = {
@@ -794,6 +806,7 @@ static struct platform_device *goni_devices[] __initdata = {
794 &goni_i2c_gpio5, 806 &goni_i2c_gpio5,
795 &mmc2_fixed_voltage, 807 &mmc2_fixed_voltage,
796 &goni_device_gpiokeys, 808 &goni_device_gpiokeys,
809 &s3c_device_i2c0,
797 &s5p_device_fimc0, 810 &s5p_device_fimc0,
798 &s5p_device_fimc1, 811 &s5p_device_fimc1,
799 &s5p_device_fimc2, 812 &s5p_device_fimc2,
@@ -823,6 +836,7 @@ static void __init goni_map_io(void)
823 s5p_init_io(NULL, 0, S5P_VA_CHIPID); 836 s5p_init_io(NULL, 0, S5P_VA_CHIPID);
824 s3c24xx_init_clocks(24000000); 837 s3c24xx_init_clocks(24000000);
825 s3c24xx_init_uarts(goni_uartcfgs, ARRAY_SIZE(goni_uartcfgs)); 838 s3c24xx_init_uarts(goni_uartcfgs, ARRAY_SIZE(goni_uartcfgs));
839 s5p_set_timer_source(S5P_PWM3, S5P_PWM4);
826} 840}
827 841
828static void __init goni_machine_init(void) 842static void __init goni_machine_init(void)
@@ -830,6 +844,9 @@ static void __init goni_machine_init(void)
830 /* Radio: call before I2C 1 registeration */ 844 /* Radio: call before I2C 1 registeration */
831 goni_radio_init(); 845 goni_radio_init();
832 846
847 /* I2C0 */
848 s3c_i2c0_set_platdata(NULL);
849
833 /* I2C1 */ 850 /* I2C1 */
834 s3c_i2c1_set_platdata(NULL); 851 s3c_i2c1_set_platdata(NULL);
835 i2c_register_board_info(1, i2c1_devs, ARRAY_SIZE(i2c1_devs)); 852 i2c_register_board_info(1, i2c1_devs, ARRAY_SIZE(i2c1_devs));
@@ -873,5 +890,5 @@ MACHINE_START(GONI, "GONI")
873 .init_irq = s5pv210_init_irq, 890 .init_irq = s5pv210_init_irq,
874 .map_io = goni_map_io, 891 .map_io = goni_map_io,
875 .init_machine = goni_machine_init, 892 .init_machine = goni_machine_init,
876 .timer = &s3c24xx_timer, 893 .timer = &s5p_timer,
877MACHINE_END 894MACHINE_END
diff --git a/arch/arm/mach-s5pv210/mach-smdkc110.c b/arch/arm/mach-s5pv210/mach-smdkc110.c
index ce11a02eabf3..6c412c8ceccc 100644
--- a/arch/arm/mach-s5pv210/mach-smdkc110.c
+++ b/arch/arm/mach-s5pv210/mach-smdkc110.c
@@ -30,6 +30,7 @@
30#include <plat/ata.h> 30#include <plat/ata.h>
31#include <plat/iic.h> 31#include <plat/iic.h>
32#include <plat/pm.h> 32#include <plat/pm.h>
33#include <plat/s5p-time.h>
33 34
34/* Following are default values for UCON, ULCON and UFCON UART registers */ 35/* Following are default values for UCON, ULCON and UFCON UART registers */
35#define SMDKC110_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ 36#define SMDKC110_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
@@ -111,6 +112,7 @@ static void __init smdkc110_map_io(void)
111 s5p_init_io(NULL, 0, S5P_VA_CHIPID); 112 s5p_init_io(NULL, 0, S5P_VA_CHIPID);
112 s3c24xx_init_clocks(24000000); 113 s3c24xx_init_clocks(24000000);
113 s3c24xx_init_uarts(smdkv210_uartcfgs, ARRAY_SIZE(smdkv210_uartcfgs)); 114 s3c24xx_init_uarts(smdkv210_uartcfgs, ARRAY_SIZE(smdkv210_uartcfgs));
115 s5p_set_timer_source(S5P_PWM3, S5P_PWM4);
114} 116}
115 117
116static void __init smdkc110_machine_init(void) 118static void __init smdkc110_machine_init(void)
@@ -138,5 +140,5 @@ MACHINE_START(SMDKC110, "SMDKC110")
138 .init_irq = s5pv210_init_irq, 140 .init_irq = s5pv210_init_irq,
139 .map_io = smdkc110_map_io, 141 .map_io = smdkc110_map_io,
140 .init_machine = smdkc110_machine_init, 142 .init_machine = smdkc110_machine_init,
141 .timer = &s3c24xx_timer, 143 .timer = &s5p_timer,
142MACHINE_END 144MACHINE_END
diff --git a/arch/arm/mach-s5pv210/mach-smdkv210.c b/arch/arm/mach-s5pv210/mach-smdkv210.c
index bc9fdb52a020..bc08ac42e7cc 100644
--- a/arch/arm/mach-s5pv210/mach-smdkv210.c
+++ b/arch/arm/mach-s5pv210/mach-smdkv210.c
@@ -18,6 +18,7 @@
18#include <linux/fb.h> 18#include <linux/fb.h>
19#include <linux/gpio.h> 19#include <linux/gpio.h>
20#include <linux/delay.h> 20#include <linux/delay.h>
21#include <linux/pwm_backlight.h>
21 22
22#include <asm/mach/arch.h> 23#include <asm/mach/arch.h>
23#include <asm/mach/map.h> 24#include <asm/mach/map.h>
@@ -43,6 +44,8 @@
43#include <plat/keypad.h> 44#include <plat/keypad.h>
44#include <plat/pm.h> 45#include <plat/pm.h>
45#include <plat/fb.h> 46#include <plat/fb.h>
47#include <plat/gpio-cfg.h>
48#include <plat/s5p-time.h>
46 49
47/* Following are default values for UCON, ULCON and UFCON UART registers */ 50/* Following are default values for UCON, ULCON and UFCON UART registers */
48#define SMDKV210_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ 51#define SMDKV210_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
@@ -208,6 +211,45 @@ static struct s3c_fb_platdata smdkv210_lcd0_pdata __initdata = {
208 .setup_gpio = s5pv210_fb_gpio_setup_24bpp, 211 .setup_gpio = s5pv210_fb_gpio_setup_24bpp,
209}; 212};
210 213
214static int smdkv210_backlight_init(struct device *dev)
215{
216 int ret;
217
218 ret = gpio_request(S5PV210_GPD0(3), "Backlight");
219 if (ret) {
220 printk(KERN_ERR "failed to request GPD for PWM-OUT 3\n");
221 return ret;
222 }
223
224 /* Configure GPIO pin with S5PV210_GPD_0_3_TOUT_3 */
225 s3c_gpio_cfgpin(S5PV210_GPD0(3), S3C_GPIO_SFN(2));
226
227 return 0;
228}
229
230static void smdkv210_backlight_exit(struct device *dev)
231{
232 s3c_gpio_cfgpin(S5PV210_GPD0(3), S3C_GPIO_OUTPUT);
233 gpio_free(S5PV210_GPD0(3));
234}
235
236static struct platform_pwm_backlight_data smdkv210_backlight_data = {
237 .pwm_id = 3,
238 .max_brightness = 255,
239 .dft_brightness = 255,
240 .pwm_period_ns = 78770,
241 .init = smdkv210_backlight_init,
242 .exit = smdkv210_backlight_exit,
243};
244
245static struct platform_device smdkv210_backlight_device = {
246 .name = "pwm-backlight",
247 .dev = {
248 .parent = &s3c_device_timer[3].dev,
249 .platform_data = &smdkv210_backlight_data,
250 },
251};
252
211static struct platform_device *smdkv210_devices[] __initdata = { 253static struct platform_device *smdkv210_devices[] __initdata = {
212 &s3c_device_adc, 254 &s3c_device_adc,
213 &s3c_device_cfcon, 255 &s3c_device_cfcon,
@@ -229,6 +271,8 @@ static struct platform_device *smdkv210_devices[] __initdata = {
229 &samsung_device_keypad, 271 &samsung_device_keypad,
230 &smdkv210_dm9000, 272 &smdkv210_dm9000,
231 &smdkv210_lcd_lte480wv, 273 &smdkv210_lcd_lte480wv,
274 &s3c_device_timer[3],
275 &smdkv210_backlight_device,
232}; 276};
233 277
234static void __init smdkv210_dm9000_init(void) 278static void __init smdkv210_dm9000_init(void)
@@ -272,6 +316,7 @@ static void __init smdkv210_map_io(void)
272 s5p_init_io(NULL, 0, S5P_VA_CHIPID); 316 s5p_init_io(NULL, 0, S5P_VA_CHIPID);
273 s3c24xx_init_clocks(24000000); 317 s3c24xx_init_clocks(24000000);
274 s3c24xx_init_uarts(smdkv210_uartcfgs, ARRAY_SIZE(smdkv210_uartcfgs)); 318 s3c24xx_init_uarts(smdkv210_uartcfgs, ARRAY_SIZE(smdkv210_uartcfgs));
319 s5p_set_timer_source(S5P_PWM2, S5P_PWM4);
275} 320}
276 321
277static void __init smdkv210_machine_init(void) 322static void __init smdkv210_machine_init(void)
@@ -306,5 +351,5 @@ MACHINE_START(SMDKV210, "SMDKV210")
306 .init_irq = s5pv210_init_irq, 351 .init_irq = s5pv210_init_irq,
307 .map_io = smdkv210_map_io, 352 .map_io = smdkv210_map_io,
308 .init_machine = smdkv210_machine_init, 353 .init_machine = smdkv210_machine_init,
309 .timer = &s3c24xx_timer, 354 .timer = &s5p_timer,
310MACHINE_END 355MACHINE_END
diff --git a/arch/arm/mach-s5pv210/mach-torbreck.c b/arch/arm/mach-s5pv210/mach-torbreck.c
index 043c938806b0..925fc0dc6252 100644
--- a/arch/arm/mach-s5pv210/mach-torbreck.c
+++ b/arch/arm/mach-s5pv210/mach-torbreck.c
@@ -27,6 +27,7 @@
27#include <plat/devs.h> 27#include <plat/devs.h>
28#include <plat/cpu.h> 28#include <plat/cpu.h>
29#include <plat/iic.h> 29#include <plat/iic.h>
30#include <plat/s5p-time.h>
30 31
31/* Following are default values for UCON, ULCON and UFCON UART registers */ 32/* Following are default values for UCON, ULCON and UFCON UART registers */
32#define TORBRECK_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ 33#define TORBRECK_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
@@ -104,6 +105,7 @@ static void __init torbreck_map_io(void)
104 s5p_init_io(NULL, 0, S5P_VA_CHIPID); 105 s5p_init_io(NULL, 0, S5P_VA_CHIPID);
105 s3c24xx_init_clocks(24000000); 106 s3c24xx_init_clocks(24000000);
106 s3c24xx_init_uarts(torbreck_uartcfgs, ARRAY_SIZE(torbreck_uartcfgs)); 107 s3c24xx_init_uarts(torbreck_uartcfgs, ARRAY_SIZE(torbreck_uartcfgs));
108 s5p_set_timer_source(S5P_PWM3, S5P_PWM4);
107} 109}
108 110
109static void __init torbreck_machine_init(void) 111static void __init torbreck_machine_init(void)
@@ -127,5 +129,5 @@ MACHINE_START(TORBRECK, "TORBRECK")
127 .init_irq = s5pv210_init_irq, 129 .init_irq = s5pv210_init_irq,
128 .map_io = torbreck_map_io, 130 .map_io = torbreck_map_io,
129 .init_machine = torbreck_machine_init, 131 .init_machine = torbreck_machine_init,
130 .timer = &s3c24xx_timer, 132 .timer = &s5p_timer,
131MACHINE_END 133MACHINE_END
diff --git a/arch/arm/mach-s5pv210/setup-fimc.c b/arch/arm/mach-s5pv210/setup-fimc.c
new file mode 100644
index 000000000000..54cc5b11be0b
--- /dev/null
+++ b/arch/arm/mach-s5pv210/setup-fimc.c
@@ -0,0 +1,43 @@
1/*
2 * Copyright (C) 2011 Samsung Electronics Co., Ltd.
3 *
4 * S5PV210 camera interface GPIO configuration.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#include <linux/gpio.h>
12#include <plat/gpio-cfg.h>
13#include <plat/camport.h>
14
15int s5pv210_fimc_setup_gpio(enum s5p_camport_id id)
16{
17 u32 gpio8, gpio5;
18 int ret;
19
20 switch (id) {
21 case S5P_CAMPORT_A:
22 gpio8 = S5PV210_GPE0(0);
23 gpio5 = S5PV210_GPE1(0);
24 break;
25
26 case S5P_CAMPORT_B:
27 gpio8 = S5PV210_GPJ0(0);
28 gpio5 = S5PV210_GPJ1(0);
29 break;
30
31 default:
32 WARN(1, "Wrong camport id: %d\n", id);
33 return -EINVAL;
34 }
35
36 ret = s3c_gpio_cfgall_range(gpio8, 8, S3C_GPIO_SFN(2),
37 S3C_GPIO_PULL_UP);
38 if (ret)
39 return ret;
40
41 return s3c_gpio_cfgall_range(gpio5, 5, S3C_GPIO_SFN(2),
42 S3C_GPIO_PULL_UP);
43}
diff --git a/arch/arm/plat-s3c24xx/Kconfig b/arch/arm/plat-s3c24xx/Kconfig
index eb105e61c746..d9c4096ebf45 100644
--- a/arch/arm/plat-s3c24xx/Kconfig
+++ b/arch/arm/plat-s3c24xx/Kconfig
@@ -56,13 +56,6 @@ config S3C24XX_DCLK
56 help 56 help
57 Clock code for supporting DCLK/CLKOUT on S3C24XX architectures 57 Clock code for supporting DCLK/CLKOUT on S3C24XX architectures
58 58
59config S3C24XX_PWM
60 bool "PWM device support"
61 select HAVE_PWM
62 help
63 Support for exporting the PWM timer blocks via the pwm device
64 system.
65
66# gpio configurations 59# gpio configurations
67 60
68config S3C24XX_GPIO_EXTRA 61config S3C24XX_GPIO_EXTRA
diff --git a/arch/arm/plat-s5p/Kconfig b/arch/arm/plat-s5p/Kconfig
index 6390ac728b35..849229716586 100644
--- a/arch/arm/plat-s5p/Kconfig
+++ b/arch/arm/plat-s5p/Kconfig
@@ -37,6 +37,11 @@ config S5P_GPIO_INT
37 help 37 help
38 Common code for the GPIO interrupts (other than external interrupts.) 38 Common code for the GPIO interrupts (other than external interrupts.)
39 39
40config S5P_HRT
41 bool
42 help
43 Use the High Resolution timer support
44
40comment "System MMU" 45comment "System MMU"
41 46
42config S5P_SYSTEM_MMU 47config S5P_SYSTEM_MMU
@@ -60,6 +65,11 @@ config S5P_DEV_FIMC2
60 help 65 help
61 Compile in platform device definitions for FIMC controller 2 66 Compile in platform device definitions for FIMC controller 2
62 67
68config S5P_DEV_FIMC3
69 bool
70 help
71 Compile in platform device definitions for FIMC controller 3
72
63config S5P_DEV_ONENAND 73config S5P_DEV_ONENAND
64 bool 74 bool
65 help 75 help
@@ -74,3 +84,8 @@ config S5P_DEV_CSIS1
74 bool 84 bool
75 help 85 help
76 Compile in platform device definitions for MIPI-CSIS channel 1 86 Compile in platform device definitions for MIPI-CSIS channel 1
87
88config S5P_SETUP_MIPIPHY
89 bool
90 help
91 Compile in common setup code for MIPI-CSIS and MIPI-DSIM devices
diff --git a/arch/arm/plat-s5p/Makefile b/arch/arm/plat-s5p/Makefile
index 4bd5cf908977..42afff7f60be 100644
--- a/arch/arm/plat-s5p/Makefile
+++ b/arch/arm/plat-s5p/Makefile
@@ -22,12 +22,15 @@ obj-$(CONFIG_S5P_GPIO_INT) += irq-gpioint.o
22obj-$(CONFIG_S5P_SYSTEM_MMU) += sysmmu.o 22obj-$(CONFIG_S5P_SYSTEM_MMU) += sysmmu.o
23obj-$(CONFIG_PM) += pm.o 23obj-$(CONFIG_PM) += pm.o
24obj-$(CONFIG_PM) += irq-pm.o 24obj-$(CONFIG_PM) += irq-pm.o
25obj-$(CONFIG_S5P_HRT) += s5p-time.o
25 26
26# devices 27# devices
27 28
28obj-$(CONFIG_S5P_DEV_FIMC0) += dev-fimc0.o 29obj-$(CONFIG_S5P_DEV_FIMC0) += dev-fimc0.o
29obj-$(CONFIG_S5P_DEV_FIMC1) += dev-fimc1.o 30obj-$(CONFIG_S5P_DEV_FIMC1) += dev-fimc1.o
30obj-$(CONFIG_S5P_DEV_FIMC2) += dev-fimc2.o 31obj-$(CONFIG_S5P_DEV_FIMC2) += dev-fimc2.o
32obj-$(CONFIG_S5P_DEV_FIMC3) += dev-fimc3.o
31obj-$(CONFIG_S5P_DEV_ONENAND) += dev-onenand.o 33obj-$(CONFIG_S5P_DEV_ONENAND) += dev-onenand.o
32obj-$(CONFIG_S5P_DEV_CSIS0) += dev-csis0.o 34obj-$(CONFIG_S5P_DEV_CSIS0) += dev-csis0.o
33obj-$(CONFIG_S5P_DEV_CSIS1) += dev-csis1.o 35obj-$(CONFIG_S5P_DEV_CSIS1) += dev-csis1.o
36obj-$(CONFIG_S5P_SETUP_MIPIPHY) += setup-mipiphy.o
diff --git a/arch/arm/plat-s5p/dev-csis0.c b/arch/arm/plat-s5p/dev-csis0.c
index dfab1c85f54f..e3aabef5e347 100644
--- a/arch/arm/plat-s5p/dev-csis0.c
+++ b/arch/arm/plat-s5p/dev-csis0.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2010 Samsung Electronics 2 * Copyright (C) 2010-2011 Samsung Electronics Co., Ltd.
3 * 3 *
4 * S5P series device definition for MIPI-CSIS channel 0 4 * S5P series device definition for MIPI-CSIS channel 0
5 * 5 *
diff --git a/arch/arm/plat-s5p/dev-csis1.c b/arch/arm/plat-s5p/dev-csis1.c
index e3053f27fbbf..08b91b580207 100644
--- a/arch/arm/plat-s5p/dev-csis1.c
+++ b/arch/arm/plat-s5p/dev-csis1.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2010 Samsung Electronics 2 * Copyright (C) 2010-2011 Samsung Electronics Co., Ltd.
3 * 3 *
4 * S5P series device definition for MIPI-CSIS channel 1 4 * S5P series device definition for MIPI-CSIS channel 1
5 * 5 *
diff --git a/arch/arm/plat-s5p/dev-fimc3.c b/arch/arm/plat-s5p/dev-fimc3.c
new file mode 100644
index 000000000000..ef31beca386c
--- /dev/null
+++ b/arch/arm/plat-s5p/dev-fimc3.c
@@ -0,0 +1,43 @@
1/* linux/arch/arm/plat-s5p/dev-fimc3.c
2 *
3 * Copyright (c) 2010 Samsung Electronics
4 *
5 * Base S5P FIMC3 resource and device definitions
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/dma-mapping.h>
14#include <linux/platform_device.h>
15#include <linux/interrupt.h>
16#include <linux/ioport.h>
17#include <mach/map.h>
18
19static struct resource s5p_fimc3_resource[] = {
20 [0] = {
21 .start = S5P_PA_FIMC3,
22 .end = S5P_PA_FIMC3 + SZ_4K - 1,
23 .flags = IORESOURCE_MEM,
24 },
25 [1] = {
26 .start = IRQ_FIMC3,
27 .end = IRQ_FIMC3,
28 .flags = IORESOURCE_IRQ,
29 },
30};
31
32static u64 s5p_fimc3_dma_mask = DMA_BIT_MASK(32);
33
34struct platform_device s5p_device_fimc3 = {
35 .name = "s5p-fimc",
36 .id = 3,
37 .num_resources = ARRAY_SIZE(s5p_fimc3_resource),
38 .resource = s5p_fimc3_resource,
39 .dev = {
40 .dma_mask = &s5p_fimc3_dma_mask,
41 .coherent_dma_mask = DMA_BIT_MASK(32),
42 },
43};
diff --git a/arch/arm/plat-s5p/include/plat/camport.h b/arch/arm/plat-s5p/include/plat/camport.h
new file mode 100644
index 000000000000..71688c8ba288
--- /dev/null
+++ b/arch/arm/plat-s5p/include/plat/camport.h
@@ -0,0 +1,28 @@
1/*
2 * Copyright (C) 2011 Samsung Electronics Co., Ltd.
3 *
4 * S5P series camera interface helper functions
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef PLAT_S5P_CAMPORT_H_
12#define PLAT_S5P_CAMPORT_H_ __FILE__
13
14enum s5p_camport_id {
15 S5P_CAMPORT_A,
16 S5P_CAMPORT_B,
17};
18
19/*
20 * The helper functions to configure GPIO for the camera parallel bus.
21 * The camera port can be multiplexed with any FIMC entity, even multiple
22 * FIMC entities are allowed to be attached to a single port simultaneously.
23 * These functions are to be used in the board setup code.
24 */
25int s5pv210_fimc_setup_gpio(enum s5p_camport_id id);
26int exynos4_fimc_setup_gpio(enum s5p_camport_id id);
27
28#endif
diff --git a/arch/arm/plat-s5p/include/plat/csis.h b/arch/arm/plat-s5p/include/plat/csis.h
deleted file mode 100644
index 51e308c7981d..000000000000
--- a/arch/arm/plat-s5p/include/plat/csis.h
+++ /dev/null
@@ -1,28 +0,0 @@
1/*
2 * Copyright (C) 2010 Samsung Electronics
3 *
4 * S5P series MIPI CSI slave device support
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef PLAT_S5P_CSIS_H_
12#define PLAT_S5P_CSIS_H_ __FILE__
13
14/**
15 * struct s5p_platform_mipi_csis - platform data for MIPI-CSIS
16 * @clk_rate: bus clock frequency
17 * @lanes: number of data lanes used
18 * @alignment: data alignment in bits
19 * @hs_settle: HS-RX settle time
20 */
21struct s5p_platform_mipi_csis {
22 unsigned long clk_rate;
23 u8 lanes;
24 u8 alignment;
25 u8 hs_settle;
26};
27
28#endif /* PLAT_S5P_CSIS_H_ */
diff --git a/arch/arm/plat-s5p/include/plat/mipi_csis.h b/arch/arm/plat-s5p/include/plat/mipi_csis.h
new file mode 100644
index 000000000000..9bd254c5ed22
--- /dev/null
+++ b/arch/arm/plat-s5p/include/plat/mipi_csis.h
@@ -0,0 +1,43 @@
1/*
2 * Copyright (C) 2010-2011 Samsung Electronics Co., Ltd.
3 *
4 * S5P series MIPI CSI slave device support
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef PLAT_S5P_MIPI_CSIS_H_
12#define PLAT_S5P_MIPI_CSIS_H_ __FILE__
13
14struct platform_device;
15
16/**
17 * struct s5p_platform_mipi_csis - platform data for S5P MIPI-CSIS driver
18 * @clk_rate: bus clock frequency
19 * @lanes: number of data lanes used
20 * @alignment: data alignment in bits
21 * @hs_settle: HS-RX settle time
22 * @fixed_phy_vdd: false to enable external D-PHY regulator management in the
23 * driver or true in case this regulator has no enable function
24 * @phy_enable: pointer to a callback controlling D-PHY enable/reset
25 */
26struct s5p_platform_mipi_csis {
27 unsigned long clk_rate;
28 u8 lanes;
29 u8 alignment;
30 u8 hs_settle;
31 bool fixed_phy_vdd;
32 int (*phy_enable)(struct platform_device *pdev, bool on);
33};
34
35/**
36 * s5p_csis_phy_enable - global MIPI-CSI receiver D-PHY control
37 * @pdev: MIPI-CSIS platform device
38 * @on: true to enable D-PHY and deassert its reset
39 * false to disable D-PHY
40 */
41int s5p_csis_phy_enable(struct platform_device *pdev, bool on);
42
43#endif /* PLAT_S5P_MIPI_CSIS_H_ */
diff --git a/arch/arm/plat-s5p/include/plat/s5p-time.h b/arch/arm/plat-s5p/include/plat/s5p-time.h
new file mode 100644
index 000000000000..575e88109db8
--- /dev/null
+++ b/arch/arm/plat-s5p/include/plat/s5p-time.h
@@ -0,0 +1,40 @@
1/* linux/arch/arm/plat-s5p/include/plat/s5p-time.h
2 *
3 * Copyright 2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * Header file for s5p time support
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_S5P_TIME_H
14#define __ASM_PLAT_S5P_TIME_H __FILE__
15
16/* S5P HR-Timer Clock mode */
17enum s5p_timer_mode {
18 S5P_PWM0,
19 S5P_PWM1,
20 S5P_PWM2,
21 S5P_PWM3,
22 S5P_PWM4,
23};
24
25struct s5p_timer_source {
26 unsigned int event_id;
27 unsigned int source_id;
28};
29
30/* Be able to sleep for atleast 4 seconds (usually more) */
31#define S5PTIMER_MIN_RANGE 4
32
33#define TCNT_MAX 0xffffffff
34#define NON_PERIODIC 0
35#define PERIODIC 1
36
37extern void __init s5p_set_timer_source(enum s5p_timer_mode event,
38 enum s5p_timer_mode source);
39extern struct sys_timer s5p_timer;
40#endif /* __ASM_PLAT_S5P_TIME_H */
diff --git a/arch/arm/plat-s5p/s5p-time.c b/arch/arm/plat-s5p/s5p-time.c
new file mode 100644
index 000000000000..8090403eec0f
--- /dev/null
+++ b/arch/arm/plat-s5p/s5p-time.c
@@ -0,0 +1,448 @@
1/* linux/arch/arm/plat-s5p/s5p-time.c
2 *
3 * Copyright (c) 2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * S5P - Common hr-timer support
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/sched.h>
14#include <linux/interrupt.h>
15#include <linux/irq.h>
16#include <linux/err.h>
17#include <linux/clk.h>
18#include <linux/clockchips.h>
19#include <linux/platform_device.h>
20
21#include <asm/smp_twd.h>
22#include <asm/mach/time.h>
23#include <asm/mach/arch.h>
24#include <asm/mach/map.h>
25#include <asm/sched_clock.h>
26
27#include <mach/map.h>
28#include <plat/devs.h>
29#include <plat/regs-timer.h>
30#include <plat/s5p-time.h>
31
32static struct clk *tin_event;
33static struct clk *tin_source;
34static struct clk *tdiv_event;
35static struct clk *tdiv_source;
36static struct clk *timerclk;
37static struct s5p_timer_source timer_source;
38static unsigned long clock_count_per_tick;
39static void s5p_timer_resume(void);
40
41static void s5p_time_stop(enum s5p_timer_mode mode)
42{
43 unsigned long tcon;
44
45 tcon = __raw_readl(S3C2410_TCON);
46
47 switch (mode) {
48 case S5P_PWM0:
49 tcon &= ~S3C2410_TCON_T0START;
50 break;
51
52 case S5P_PWM1:
53 tcon &= ~S3C2410_TCON_T1START;
54 break;
55
56 case S5P_PWM2:
57 tcon &= ~S3C2410_TCON_T2START;
58 break;
59
60 case S5P_PWM3:
61 tcon &= ~S3C2410_TCON_T3START;
62 break;
63
64 case S5P_PWM4:
65 tcon &= ~S3C2410_TCON_T4START;
66 break;
67
68 default:
69 printk(KERN_ERR "Invalid Timer %d\n", mode);
70 break;
71 }
72 __raw_writel(tcon, S3C2410_TCON);
73}
74
75static void s5p_time_setup(enum s5p_timer_mode mode, unsigned long tcnt)
76{
77 unsigned long tcon;
78
79 tcon = __raw_readl(S3C2410_TCON);
80
81 tcnt--;
82
83 switch (mode) {
84 case S5P_PWM0:
85 tcon &= ~(0x0f << 0);
86 tcon |= S3C2410_TCON_T0MANUALUPD;
87 break;
88
89 case S5P_PWM1:
90 tcon &= ~(0x0f << 8);
91 tcon |= S3C2410_TCON_T1MANUALUPD;
92 break;
93
94 case S5P_PWM2:
95 tcon &= ~(0x0f << 12);
96 tcon |= S3C2410_TCON_T2MANUALUPD;
97 break;
98
99 case S5P_PWM3:
100 tcon &= ~(0x0f << 16);
101 tcon |= S3C2410_TCON_T3MANUALUPD;
102 break;
103
104 case S5P_PWM4:
105 tcon &= ~(0x07 << 20);
106 tcon |= S3C2410_TCON_T4MANUALUPD;
107 break;
108
109 default:
110 printk(KERN_ERR "Invalid Timer %d\n", mode);
111 break;
112 }
113
114 __raw_writel(tcnt, S3C2410_TCNTB(mode));
115 __raw_writel(tcnt, S3C2410_TCMPB(mode));
116 __raw_writel(tcon, S3C2410_TCON);
117}
118
119static void s5p_time_start(enum s5p_timer_mode mode, bool periodic)
120{
121 unsigned long tcon;
122
123 tcon = __raw_readl(S3C2410_TCON);
124
125 switch (mode) {
126 case S5P_PWM0:
127 tcon |= S3C2410_TCON_T0START;
128 tcon &= ~S3C2410_TCON_T0MANUALUPD;
129
130 if (periodic)
131 tcon |= S3C2410_TCON_T0RELOAD;
132 else
133 tcon &= ~S3C2410_TCON_T0RELOAD;
134 break;
135
136 case S5P_PWM1:
137 tcon |= S3C2410_TCON_T1START;
138 tcon &= ~S3C2410_TCON_T1MANUALUPD;
139
140 if (periodic)
141 tcon |= S3C2410_TCON_T1RELOAD;
142 else
143 tcon &= ~S3C2410_TCON_T1RELOAD;
144 break;
145
146 case S5P_PWM2:
147 tcon |= S3C2410_TCON_T2START;
148 tcon &= ~S3C2410_TCON_T2MANUALUPD;
149
150 if (periodic)
151 tcon |= S3C2410_TCON_T2RELOAD;
152 else
153 tcon &= ~S3C2410_TCON_T2RELOAD;
154 break;
155
156 case S5P_PWM3:
157 tcon |= S3C2410_TCON_T3START;
158 tcon &= ~S3C2410_TCON_T3MANUALUPD;
159
160 if (periodic)
161 tcon |= S3C2410_TCON_T3RELOAD;
162 else
163 tcon &= ~S3C2410_TCON_T3RELOAD;
164 break;
165
166 case S5P_PWM4:
167 tcon |= S3C2410_TCON_T4START;
168 tcon &= ~S3C2410_TCON_T4MANUALUPD;
169
170 if (periodic)
171 tcon |= S3C2410_TCON_T4RELOAD;
172 else
173 tcon &= ~S3C2410_TCON_T4RELOAD;
174 break;
175
176 default:
177 printk(KERN_ERR "Invalid Timer %d\n", mode);
178 break;
179 }
180 __raw_writel(tcon, S3C2410_TCON);
181}
182
183static int s5p_set_next_event(unsigned long cycles,
184 struct clock_event_device *evt)
185{
186 s5p_time_setup(timer_source.event_id, cycles);
187 s5p_time_start(timer_source.event_id, NON_PERIODIC);
188
189 return 0;
190}
191
192static void s5p_set_mode(enum clock_event_mode mode,
193 struct clock_event_device *evt)
194{
195 s5p_time_stop(timer_source.event_id);
196
197 switch (mode) {
198 case CLOCK_EVT_MODE_PERIODIC:
199 s5p_time_setup(timer_source.event_id, clock_count_per_tick);
200 s5p_time_start(timer_source.event_id, PERIODIC);
201 break;
202
203 case CLOCK_EVT_MODE_ONESHOT:
204 break;
205
206 case CLOCK_EVT_MODE_UNUSED:
207 case CLOCK_EVT_MODE_SHUTDOWN:
208 break;
209
210 case CLOCK_EVT_MODE_RESUME:
211 s5p_timer_resume();
212 break;
213 }
214}
215
216static void s5p_timer_resume(void)
217{
218 /* event timer restart */
219 s5p_time_setup(timer_source.event_id, clock_count_per_tick);
220 s5p_time_start(timer_source.event_id, PERIODIC);
221
222 /* source timer restart */
223 s5p_time_setup(timer_source.source_id, TCNT_MAX);
224 s5p_time_start(timer_source.source_id, PERIODIC);
225}
226
227void __init s5p_set_timer_source(enum s5p_timer_mode event,
228 enum s5p_timer_mode source)
229{
230 s3c_device_timer[event].dev.bus = &platform_bus_type;
231 s3c_device_timer[source].dev.bus = &platform_bus_type;
232
233 timer_source.event_id = event;
234 timer_source.source_id = source;
235}
236
237static struct clock_event_device time_event_device = {
238 .name = "s5p_event_timer",
239 .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
240 .rating = 200,
241 .set_next_event = s5p_set_next_event,
242 .set_mode = s5p_set_mode,
243};
244
245static irqreturn_t s5p_clock_event_isr(int irq, void *dev_id)
246{
247 struct clock_event_device *evt = dev_id;
248
249 evt->event_handler(evt);
250
251 return IRQ_HANDLED;
252}
253
254static struct irqaction s5p_clock_event_irq = {
255 .name = "s5p_time_irq",
256 .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
257 .handler = s5p_clock_event_isr,
258 .dev_id = &time_event_device,
259};
260
261static void __init s5p_clockevent_init(void)
262{
263 unsigned long pclk;
264 unsigned long clock_rate;
265 unsigned int irq_number;
266 struct clk *tscaler;
267
268 pclk = clk_get_rate(timerclk);
269
270 tscaler = clk_get_parent(tdiv_event);
271
272 clk_set_rate(tscaler, pclk / 2);
273 clk_set_rate(tdiv_event, pclk / 2);
274 clk_set_parent(tin_event, tdiv_event);
275
276 clock_rate = clk_get_rate(tin_event);
277 clock_count_per_tick = clock_rate / HZ;
278
279 clockevents_calc_mult_shift(&time_event_device,
280 clock_rate, S5PTIMER_MIN_RANGE);
281 time_event_device.max_delta_ns =
282 clockevent_delta2ns(-1, &time_event_device);
283 time_event_device.min_delta_ns =
284 clockevent_delta2ns(1, &time_event_device);
285
286 time_event_device.cpumask = cpumask_of(0);
287 clockevents_register_device(&time_event_device);
288
289 irq_number = timer_source.event_id + IRQ_TIMER0;
290 setup_irq(irq_number, &s5p_clock_event_irq);
291}
292
293static cycle_t s5p_timer_read(struct clocksource *cs)
294{
295 unsigned long offset = 0;
296
297 switch (timer_source.source_id) {
298 case S5P_PWM0:
299 case S5P_PWM1:
300 case S5P_PWM2:
301 case S5P_PWM3:
302 offset = (timer_source.source_id * 0x0c) + 0x14;
303 break;
304
305 case S5P_PWM4:
306 offset = 0x40;
307 break;
308
309 default:
310 printk(KERN_ERR "Invalid Timer %d\n", timer_source.source_id);
311 return 0;
312 }
313
314 return (cycle_t) ~__raw_readl(S3C_TIMERREG(offset));
315}
316
317/*
318 * Override the global weak sched_clock symbol with this
319 * local implementation which uses the clocksource to get some
320 * better resolution when scheduling the kernel. We accept that
321 * this wraps around for now, since it is just a relative time
322 * stamp. (Inspired by U300 implementation.)
323 */
324static DEFINE_CLOCK_DATA(cd);
325
326unsigned long long notrace sched_clock(void)
327{
328 u32 cyc;
329 unsigned long offset = 0;
330
331 switch (timer_source.source_id) {
332 case S5P_PWM0:
333 case S5P_PWM1:
334 case S5P_PWM2:
335 case S5P_PWM3:
336 offset = (timer_source.source_id * 0x0c) + 0x14;
337 break;
338
339 case S5P_PWM4:
340 offset = 0x40;
341 break;
342
343 default:
344 printk(KERN_ERR "Invalid Timer %d\n", timer_source.source_id);
345 return 0;
346 }
347
348 cyc = ~__raw_readl(S3C_TIMERREG(offset));
349 return cyc_to_sched_clock(&cd, cyc, (u32)~0);
350}
351
352static void notrace s5p_update_sched_clock(void)
353{
354 u32 cyc;
355 unsigned long offset = 0;
356
357 switch (timer_source.source_id) {
358 case S5P_PWM0:
359 case S5P_PWM1:
360 case S5P_PWM2:
361 case S5P_PWM3:
362 offset = (timer_source.source_id * 0x0c) + 0x14;
363 break;
364
365 case S5P_PWM4:
366 offset = 0x40;
367 break;
368
369 default:
370 printk(KERN_ERR "Invalid Timer %d\n", timer_source.source_id);
371 }
372
373 cyc = ~__raw_readl(S3C_TIMERREG(offset));
374 update_sched_clock(&cd, cyc, (u32)~0);
375}
376
377struct clocksource time_clocksource = {
378 .name = "s5p_clocksource_timer",
379 .rating = 250,
380 .read = s5p_timer_read,
381 .mask = CLOCKSOURCE_MASK(32),
382 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
383};
384
385static void __init s5p_clocksource_init(void)
386{
387 unsigned long pclk;
388 unsigned long clock_rate;
389
390 pclk = clk_get_rate(timerclk);
391
392 clk_set_rate(tdiv_source, pclk / 2);
393 clk_set_parent(tin_source, tdiv_source);
394
395 clock_rate = clk_get_rate(tin_source);
396
397 init_sched_clock(&cd, s5p_update_sched_clock, 32, clock_rate);
398
399 s5p_time_setup(timer_source.source_id, TCNT_MAX);
400 s5p_time_start(timer_source.source_id, PERIODIC);
401
402 if (clocksource_register_hz(&time_clocksource, clock_rate))
403 panic("%s: can't register clocksource\n", time_clocksource.name);
404}
405
406static void __init s5p_timer_resources(void)
407{
408
409 unsigned long event_id = timer_source.event_id;
410 unsigned long source_id = timer_source.source_id;
411
412 timerclk = clk_get(NULL, "timers");
413 if (IS_ERR(timerclk))
414 panic("failed to get timers clock for timer");
415
416 clk_enable(timerclk);
417
418 tin_event = clk_get(&s3c_device_timer[event_id].dev, "pwm-tin");
419 if (IS_ERR(tin_event))
420 panic("failed to get pwm-tin clock for event timer");
421
422 tdiv_event = clk_get(&s3c_device_timer[event_id].dev, "pwm-tdiv");
423 if (IS_ERR(tdiv_event))
424 panic("failed to get pwm-tdiv clock for event timer");
425
426 clk_enable(tin_event);
427
428 tin_source = clk_get(&s3c_device_timer[source_id].dev, "pwm-tin");
429 if (IS_ERR(tin_source))
430 panic("failed to get pwm-tin clock for source timer");
431
432 tdiv_source = clk_get(&s3c_device_timer[source_id].dev, "pwm-tdiv");
433 if (IS_ERR(tdiv_source))
434 panic("failed to get pwm-tdiv clock for source timer");
435
436 clk_enable(tin_source);
437}
438
439static void __init s5p_timer_init(void)
440{
441 s5p_timer_resources();
442 s5p_clockevent_init();
443 s5p_clocksource_init();
444}
445
446struct sys_timer s5p_timer = {
447 .init = s5p_timer_init,
448};
diff --git a/arch/arm/plat-s5p/setup-mipiphy.c b/arch/arm/plat-s5p/setup-mipiphy.c
new file mode 100644
index 000000000000..683c466c0e6a
--- /dev/null
+++ b/arch/arm/plat-s5p/setup-mipiphy.c
@@ -0,0 +1,63 @@
1/*
2 * Copyright (C) 2011 Samsung Electronics Co., Ltd.
3 *
4 * S5P - Helper functions for MIPI-CSIS and MIPI-DSIM D-PHY control
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#include <linux/kernel.h>
12#include <linux/platform_device.h>
13#include <linux/io.h>
14#include <linux/spinlock.h>
15#include <mach/regs-clock.h>
16
17static int __s5p_mipi_phy_control(struct platform_device *pdev,
18 bool on, u32 reset)
19{
20 static DEFINE_SPINLOCK(lock);
21 void __iomem *addr;
22 unsigned long flags;
23 int pid;
24 u32 cfg;
25
26 if (!pdev)
27 return -EINVAL;
28
29 pid = (pdev->id == -1) ? 0 : pdev->id;
30
31 if (pid != 0 && pid != 1)
32 return -EINVAL;
33
34 addr = S5P_MIPI_DPHY_CONTROL(pid);
35
36 spin_lock_irqsave(&lock, flags);
37
38 cfg = __raw_readl(addr);
39 cfg = on ? (cfg | reset) : (cfg & ~reset);
40 __raw_writel(cfg, addr);
41
42 if (on) {
43 cfg |= S5P_MIPI_DPHY_ENABLE;
44 } else if (!(cfg & (S5P_MIPI_DPHY_SRESETN |
45 S5P_MIPI_DPHY_MRESETN) & ~reset)) {
46 cfg &= ~S5P_MIPI_DPHY_ENABLE;
47 }
48
49 __raw_writel(cfg, addr);
50 spin_unlock_irqrestore(&lock, flags);
51
52 return 0;
53}
54
55int s5p_csis_phy_enable(struct platform_device *pdev, bool on)
56{
57 return __s5p_mipi_phy_control(pdev, on, S5P_MIPI_DPHY_SRESETN);
58}
59
60int s5p_dsim_phy_enable(struct platform_device *pdev, bool on)
61{
62 return __s5p_mipi_phy_control(pdev, on, S5P_MIPI_DPHY_MRESETN);
63}
diff --git a/arch/arm/plat-samsung/Kconfig b/arch/arm/plat-samsung/Kconfig
index 32be05cf82a3..be72100b81b4 100644
--- a/arch/arm/plat-samsung/Kconfig
+++ b/arch/arm/plat-samsung/Kconfig
@@ -273,6 +273,19 @@ config SAMSUNG_DEV_KEYPAD
273 help 273 help
274 Compile in platform device definitions for keypad 274 Compile in platform device definitions for keypad
275 275
276config SAMSUNG_DEV_PWM
277 bool
278 default y if ARCH_S3C2410
279 help
280 Compile in platform device definition for PWM Timer
281
282config S3C24XX_PWM
283 bool "PWM device support"
284 select HAVE_PWM
285 help
286 Support for exporting the PWM timer blocks via the pwm device
287 system
288
276# DMA 289# DMA
277 290
278config S3C_DMA 291config S3C_DMA
diff --git a/arch/arm/plat-samsung/Makefile b/arch/arm/plat-samsung/Makefile
index 29932f88a8d6..e9de58a2e294 100644
--- a/arch/arm/plat-samsung/Makefile
+++ b/arch/arm/plat-samsung/Makefile
@@ -59,6 +59,7 @@ obj-$(CONFIG_SAMSUNG_DEV_ADC) += dev-adc.o
59obj-$(CONFIG_SAMSUNG_DEV_IDE) += dev-ide.o 59obj-$(CONFIG_SAMSUNG_DEV_IDE) += dev-ide.o
60obj-$(CONFIG_SAMSUNG_DEV_TS) += dev-ts.o 60obj-$(CONFIG_SAMSUNG_DEV_TS) += dev-ts.o
61obj-$(CONFIG_SAMSUNG_DEV_KEYPAD) += dev-keypad.o 61obj-$(CONFIG_SAMSUNG_DEV_KEYPAD) += dev-keypad.o
62obj-$(CONFIG_SAMSUNG_DEV_PWM) += dev-pwm.o
62 63
63# DMA support 64# DMA support
64 65
diff --git a/arch/arm/plat-samsung/dev-pwm.c b/arch/arm/plat-samsung/dev-pwm.c
new file mode 100644
index 000000000000..dab47b0e1900
--- /dev/null
+++ b/arch/arm/plat-samsung/dev-pwm.c
@@ -0,0 +1,53 @@
1/* linux/arch/arm/plat-samsung/dev-pwm.c
2 *
3 * Copyright (c) 2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
5 *
6 * Copyright (c) 2007 Ben Dooks
7 * Copyright (c) 2008 Simtec Electronics
8 * Ben Dooks <ben@simtec.co.uk>, <ben-linux@fluff.org>
9 *
10 * S3C series device definition for the PWM timer
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License version 2 as
14 * published by the Free Software Foundation.
15 */
16
17#include <linux/kernel.h>
18#include <linux/platform_device.h>
19
20#include <mach/irqs.h>
21
22#include <plat/devs.h>
23
24#define TIMER_RESOURCE_SIZE (1)
25
26#define TIMER_RESOURCE(_tmr, _irq) \
27 (struct resource [TIMER_RESOURCE_SIZE]) { \
28 [0] = { \
29 .start = _irq, \
30 .end = _irq, \
31 .flags = IORESOURCE_IRQ \
32 } \
33 }
34
35#define DEFINE_S3C_TIMER(_tmr_no, _irq) \
36 .name = "s3c24xx-pwm", \
37 .id = _tmr_no, \
38 .num_resources = TIMER_RESOURCE_SIZE, \
39 .resource = TIMER_RESOURCE(_tmr_no, _irq), \
40
41/*
42 * since we already have an static mapping for the timer,
43 * we do not bother setting any IO resource for the base.
44 */
45
46struct platform_device s3c_device_timer[] = {
47 [0] = { DEFINE_S3C_TIMER(0, IRQ_TIMER0) },
48 [1] = { DEFINE_S3C_TIMER(1, IRQ_TIMER1) },
49 [2] = { DEFINE_S3C_TIMER(2, IRQ_TIMER2) },
50 [3] = { DEFINE_S3C_TIMER(3, IRQ_TIMER3) },
51 [4] = { DEFINE_S3C_TIMER(4, IRQ_TIMER4) },
52};
53EXPORT_SYMBOL(s3c_device_timer);
diff --git a/arch/arm/plat-samsung/include/plat/devs.h b/arch/arm/plat-samsung/include/plat/devs.h
index e2b3ab997cff..7231ccf89ebb 100644
--- a/arch/arm/plat-samsung/include/plat/devs.h
+++ b/arch/arm/plat-samsung/include/plat/devs.h
@@ -136,6 +136,7 @@ extern struct platform_device samsung_device_keypad;
136extern struct platform_device s5p_device_fimc0; 136extern struct platform_device s5p_device_fimc0;
137extern struct platform_device s5p_device_fimc1; 137extern struct platform_device s5p_device_fimc1;
138extern struct platform_device s5p_device_fimc2; 138extern struct platform_device s5p_device_fimc2;
139extern struct platform_device s5p_device_fimc3;
139 140
140extern struct platform_device s5p_device_mipi_csis0; 141extern struct platform_device s5p_device_mipi_csis0;
141extern struct platform_device s5p_device_mipi_csis1; 142extern struct platform_device s5p_device_mipi_csis1;
diff --git a/arch/arm/plat-samsung/include/plat/fimc-core.h b/arch/arm/plat-samsung/include/plat/fimc-core.h
index 81a3bfeeccad..945a99d59563 100644
--- a/arch/arm/plat-samsung/include/plat/fimc-core.h
+++ b/arch/arm/plat-samsung/include/plat/fimc-core.h
@@ -38,6 +38,11 @@ static inline void s3c_fimc_setname(int id, char *name)
38 s5p_device_fimc2.name = name; 38 s5p_device_fimc2.name = name;
39 break; 39 break;
40#endif 40#endif
41#ifdef CONFIG_S5P_DEV_FIMC3
42 case 3:
43 s5p_device_fimc3.name = name;
44 break;
45#endif
41 } 46 }
42} 47}
43 48
diff --git a/arch/arm/plat-samsung/pwm.c b/arch/arm/plat-samsung/pwm.c
index 2eeb49fa056d..f37457c52064 100644
--- a/arch/arm/plat-samsung/pwm.c
+++ b/arch/arm/plat-samsung/pwm.c
@@ -20,10 +20,8 @@
20#include <linux/io.h> 20#include <linux/io.h>
21#include <linux/pwm.h> 21#include <linux/pwm.h>
22 22
23#include <mach/irqs.h>
24#include <mach/map.h> 23#include <mach/map.h>
25 24
26#include <plat/devs.h>
27#include <plat/regs-timer.h> 25#include <plat/regs-timer.h>
28 26
29struct pwm_device { 27struct pwm_device {
@@ -47,37 +45,6 @@ struct pwm_device {
47 45
48static struct clk *clk_scaler[2]; 46static struct clk *clk_scaler[2];
49 47
50/* Standard setup for a timer block. */
51
52#define TIMER_RESOURCE_SIZE (1)
53
54#define TIMER_RESOURCE(_tmr, _irq) \
55 (struct resource [TIMER_RESOURCE_SIZE]) { \
56 [0] = { \
57 .start = _irq, \
58 .end = _irq, \
59 .flags = IORESOURCE_IRQ \
60 } \
61 }
62
63#define DEFINE_S3C_TIMER(_tmr_no, _irq) \
64 .name = "s3c24xx-pwm", \
65 .id = _tmr_no, \
66 .num_resources = TIMER_RESOURCE_SIZE, \
67 .resource = TIMER_RESOURCE(_tmr_no, _irq), \
68
69/* since we already have an static mapping for the timer, we do not
70 * bother setting any IO resource for the base.
71 */
72
73struct platform_device s3c_device_timer[] = {
74 [0] = { DEFINE_S3C_TIMER(0, IRQ_TIMER0) },
75 [1] = { DEFINE_S3C_TIMER(1, IRQ_TIMER1) },
76 [2] = { DEFINE_S3C_TIMER(2, IRQ_TIMER2) },
77 [3] = { DEFINE_S3C_TIMER(3, IRQ_TIMER3) },
78 [4] = { DEFINE_S3C_TIMER(4, IRQ_TIMER4) },
79};
80
81static inline int pwm_is_tdiv(struct pwm_device *pwm) 48static inline int pwm_is_tdiv(struct pwm_device *pwm)
82{ 49{
83 return clk_get_parent(pwm->clk) == pwm->clk_div; 50 return clk_get_parent(pwm->clk) == pwm->clk_div;