diff options
author | Tomasz Figa <t.figa@samsung.com> | 2013-04-12 15:17:22 -0400 |
---|---|---|
committer | Tomasz Figa <tomasz.figa@gmail.com> | 2013-08-05 19:21:46 -0400 |
commit | 1c161fd0d453ff63c8bb3a703d46d10ac5eba7a4 (patch) | |
tree | 9e97777321ec67219ca9cc42b4ad593b0593da86 | |
parent | 95e43d4640b9891482c46470389fe8bf7267079d (diff) |
ARM: SAMSUNG: Set PWM platform data
This patch adds PWM platform data needed for legacy (non-DT) platforms
to handle SoC-specific bits of the PWM/timer block.
Signed-off-by: Tomasz Figa <t.figa@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Tested-by: Heiko Stuebner <heiko@sntech.de>
Tested-by: Mark Brown <broonie@linaro.org>
Tested-by: Sylwester Nawrocki <sylvester.nawrocki@gmail.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
-rw-r--r-- | arch/arm/mach-s3c24xx/common.c | 11 | ||||
-rw-r--r-- | arch/arm/mach-s3c64xx/common.c | 11 | ||||
-rw-r--r-- | arch/arm/mach-s5p64x0/common.c | 10 | ||||
-rw-r--r-- | arch/arm/mach-s5pc100/common.c | 11 | ||||
-rw-r--r-- | arch/arm/mach-s5pv210/common.c | 11 |
5 files changed, 54 insertions, 0 deletions
diff --git a/arch/arm/mach-s3c24xx/common.c b/arch/arm/mach-s3c24xx/common.c index c157103ed8eb..e5e7d7dee6f2 100644 --- a/arch/arm/mach-s3c24xx/common.c +++ b/arch/arm/mach-s3c24xx/common.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <linux/interrupt.h> | 27 | #include <linux/interrupt.h> |
28 | #include <linux/ioport.h> | 28 | #include <linux/ioport.h> |
29 | #include <linux/serial_core.h> | 29 | #include <linux/serial_core.h> |
30 | #include <clocksource/samsung_pwm.h> | ||
30 | #include <linux/platform_device.h> | 31 | #include <linux/platform_device.h> |
31 | #include <linux/delay.h> | 32 | #include <linux/delay.h> |
32 | #include <linux/io.h> | 33 | #include <linux/io.h> |
@@ -49,6 +50,7 @@ | |||
49 | #include <plat/clock.h> | 50 | #include <plat/clock.h> |
50 | #include <plat/cpu-freq.h> | 51 | #include <plat/cpu-freq.h> |
51 | #include <plat/pll.h> | 52 | #include <plat/pll.h> |
53 | #include <plat/pwm-core.h> | ||
52 | 54 | ||
53 | #include "common.h" | 55 | #include "common.h" |
54 | 56 | ||
@@ -216,6 +218,13 @@ static void s3c24xx_default_idle(void) | |||
216 | S3C2410_CLKCON); | 218 | S3C2410_CLKCON); |
217 | } | 219 | } |
218 | 220 | ||
221 | static struct samsung_pwm_variant s3c24xx_pwm_variant = { | ||
222 | .bits = 16, | ||
223 | .div_base = 1, | ||
224 | .has_tint_cstat = false, | ||
225 | .tclk_mask = (1 << 4), | ||
226 | }; | ||
227 | |||
219 | void __init s3c24xx_init_io(struct map_desc *mach_desc, int size) | 228 | void __init s3c24xx_init_io(struct map_desc *mach_desc, int size) |
220 | { | 229 | { |
221 | arm_pm_idle = s3c24xx_default_idle; | 230 | arm_pm_idle = s3c24xx_default_idle; |
@@ -232,6 +241,8 @@ void __init s3c24xx_init_io(struct map_desc *mach_desc, int size) | |||
232 | s3c24xx_init_cpu(); | 241 | s3c24xx_init_cpu(); |
233 | 242 | ||
234 | s3c_init_cpu(samsung_cpu_id, cpu_ids, ARRAY_SIZE(cpu_ids)); | 243 | s3c_init_cpu(samsung_cpu_id, cpu_ids, ARRAY_SIZE(cpu_ids)); |
244 | |||
245 | samsung_pwm_set_platdata(&s3c24xx_pwm_variant); | ||
235 | } | 246 | } |
236 | 247 | ||
237 | /* Serial port registrations */ | 248 | /* Serial port registrations */ |
diff --git a/arch/arm/mach-s3c64xx/common.c b/arch/arm/mach-s3c64xx/common.c index 3f62e467b129..ca05e61f401c 100644 --- a/arch/arm/mach-s3c64xx/common.c +++ b/arch/arm/mach-s3c64xx/common.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <linux/irq.h> | 27 | #include <linux/irq.h> |
28 | #include <linux/gpio.h> | 28 | #include <linux/gpio.h> |
29 | #include <linux/irqchip/arm-vic.h> | 29 | #include <linux/irqchip/arm-vic.h> |
30 | #include <clocksource/samsung_pwm.h> | ||
30 | 31 | ||
31 | #include <asm/mach/arch.h> | 32 | #include <asm/mach/arch.h> |
32 | #include <asm/mach/map.h> | 33 | #include <asm/mach/map.h> |
@@ -43,6 +44,7 @@ | |||
43 | #include <plat/gpio-cfg.h> | 44 | #include <plat/gpio-cfg.h> |
44 | #include <plat/irq-uart.h> | 45 | #include <plat/irq-uart.h> |
45 | #include <plat/irq-vic-timer.h> | 46 | #include <plat/irq-vic-timer.h> |
47 | #include <plat/pwm-core.h> | ||
46 | #include <plat/regs-irqtype.h> | 48 | #include <plat/regs-irqtype.h> |
47 | #include <plat/regs-serial.h> | 49 | #include <plat/regs-serial.h> |
48 | #include <plat/watchdog-reset.h> | 50 | #include <plat/watchdog-reset.h> |
@@ -149,6 +151,13 @@ static struct device s3c64xx_dev = { | |||
149 | .bus = &s3c64xx_subsys, | 151 | .bus = &s3c64xx_subsys, |
150 | }; | 152 | }; |
151 | 153 | ||
154 | static struct samsung_pwm_variant s3c64xx_pwm_variant = { | ||
155 | .bits = 32, | ||
156 | .div_base = 0, | ||
157 | .has_tint_cstat = true, | ||
158 | .tclk_mask = (1 << 7) | (1 << 6) | (1 << 5), | ||
159 | }; | ||
160 | |||
152 | /* read cpu identification code */ | 161 | /* read cpu identification code */ |
153 | 162 | ||
154 | void __init s3c64xx_init_io(struct map_desc *mach_desc, int size) | 163 | void __init s3c64xx_init_io(struct map_desc *mach_desc, int size) |
@@ -161,6 +170,8 @@ void __init s3c64xx_init_io(struct map_desc *mach_desc, int size) | |||
161 | s3c64xx_init_cpu(); | 170 | s3c64xx_init_cpu(); |
162 | 171 | ||
163 | s3c_init_cpu(samsung_cpu_id, cpu_ids, ARRAY_SIZE(cpu_ids)); | 172 | s3c_init_cpu(samsung_cpu_id, cpu_ids, ARRAY_SIZE(cpu_ids)); |
173 | |||
174 | samsung_pwm_set_platdata(&s3c64xx_pwm_variant); | ||
164 | } | 175 | } |
165 | 176 | ||
166 | static __init int s3c64xx_dev_init(void) | 177 | static __init int s3c64xx_dev_init(void) |
diff --git a/arch/arm/mach-s5p64x0/common.c b/arch/arm/mach-s5p64x0/common.c index dfdfdc320ce7..49687f277108 100644 --- a/arch/arm/mach-s5p64x0/common.c +++ b/arch/arm/mach-s5p64x0/common.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/io.h> | 19 | #include <linux/io.h> |
20 | #include <linux/device.h> | 20 | #include <linux/device.h> |
21 | #include <linux/serial_core.h> | 21 | #include <linux/serial_core.h> |
22 | #include <clocksource/samsung_pwm.h> | ||
22 | #include <linux/platform_device.h> | 23 | #include <linux/platform_device.h> |
23 | #include <linux/sched.h> | 24 | #include <linux/sched.h> |
24 | #include <linux/dma-mapping.h> | 25 | #include <linux/dma-mapping.h> |
@@ -47,6 +48,7 @@ | |||
47 | #include <plat/fb-core.h> | 48 | #include <plat/fb-core.h> |
48 | #include <plat/spi-core.h> | 49 | #include <plat/spi-core.h> |
49 | #include <plat/gpio-cfg.h> | 50 | #include <plat/gpio-cfg.h> |
51 | #include <plat/pwm-core.h> | ||
50 | #include <plat/regs-irqtype.h> | 52 | #include <plat/regs-irqtype.h> |
51 | #include <plat/regs-serial.h> | 53 | #include <plat/regs-serial.h> |
52 | #include <plat/watchdog-reset.h> | 54 | #include <plat/watchdog-reset.h> |
@@ -157,6 +159,13 @@ static void s5p64x0_idle(void) | |||
157 | cpu_do_idle(); | 159 | cpu_do_idle(); |
158 | } | 160 | } |
159 | 161 | ||
162 | static struct samsung_pwm_variant s5p64x0_pwm_variant = { | ||
163 | .bits = 32, | ||
164 | .div_base = 0, | ||
165 | .has_tint_cstat = true, | ||
166 | .tclk_mask = 0, | ||
167 | }; | ||
168 | |||
160 | /* | 169 | /* |
161 | * s5p64x0_map_io | 170 | * s5p64x0_map_io |
162 | * | 171 | * |
@@ -176,6 +185,7 @@ void __init s5p64x0_init_io(struct map_desc *mach_desc, int size) | |||
176 | s3c_init_cpu(samsung_cpu_id, cpu_ids, ARRAY_SIZE(cpu_ids)); | 185 | s3c_init_cpu(samsung_cpu_id, cpu_ids, ARRAY_SIZE(cpu_ids)); |
177 | samsung_wdt_reset_init(S3C_VA_WATCHDOG); | 186 | samsung_wdt_reset_init(S3C_VA_WATCHDOG); |
178 | 187 | ||
188 | samsung_pwm_set_platdata(&s5p64x0_pwm_variant); | ||
179 | } | 189 | } |
180 | 190 | ||
181 | void __init s5p6440_map_io(void) | 191 | void __init s5p6440_map_io(void) |
diff --git a/arch/arm/mach-s5pc100/common.c b/arch/arm/mach-s5pc100/common.c index 4bdfecf6d024..e0600afc587e 100644 --- a/arch/arm/mach-s5pc100/common.c +++ b/arch/arm/mach-s5pc100/common.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/io.h> | 22 | #include <linux/io.h> |
23 | #include <linux/device.h> | 23 | #include <linux/device.h> |
24 | #include <linux/serial_core.h> | 24 | #include <linux/serial_core.h> |
25 | #include <clocksource/samsung_pwm.h> | ||
25 | #include <linux/platform_device.h> | 26 | #include <linux/platform_device.h> |
26 | #include <linux/sched.h> | 27 | #include <linux/sched.h> |
27 | #include <linux/reboot.h> | 28 | #include <linux/reboot.h> |
@@ -46,6 +47,7 @@ | |||
46 | #include <plat/fb-core.h> | 47 | #include <plat/fb-core.h> |
47 | #include <plat/iic-core.h> | 48 | #include <plat/iic-core.h> |
48 | #include <plat/onenand-core.h> | 49 | #include <plat/onenand-core.h> |
50 | #include <plat/pwm-core.h> | ||
49 | #include <plat/spi-core.h> | 51 | #include <plat/spi-core.h> |
50 | #include <plat/regs-serial.h> | 52 | #include <plat/regs-serial.h> |
51 | #include <plat/watchdog-reset.h> | 53 | #include <plat/watchdog-reset.h> |
@@ -132,6 +134,13 @@ static struct map_desc s5pc100_iodesc[] __initdata = { | |||
132 | } | 134 | } |
133 | }; | 135 | }; |
134 | 136 | ||
137 | static struct samsung_pwm_variant s5pc100_pwm_variant = { | ||
138 | .bits = 32, | ||
139 | .div_base = 0, | ||
140 | .has_tint_cstat = true, | ||
141 | .tclk_mask = (1 << 5), | ||
142 | }; | ||
143 | |||
135 | /* | 144 | /* |
136 | * s5pc100_map_io | 145 | * s5pc100_map_io |
137 | * | 146 | * |
@@ -149,6 +158,8 @@ void __init s5pc100_init_io(struct map_desc *mach_desc, int size) | |||
149 | s5p_init_cpu(S5P_VA_CHIPID); | 158 | s5p_init_cpu(S5P_VA_CHIPID); |
150 | 159 | ||
151 | s3c_init_cpu(samsung_cpu_id, cpu_ids, ARRAY_SIZE(cpu_ids)); | 160 | s3c_init_cpu(samsung_cpu_id, cpu_ids, ARRAY_SIZE(cpu_ids)); |
161 | |||
162 | samsung_pwm_set_platdata(&s5pc100_pwm_variant); | ||
152 | } | 163 | } |
153 | 164 | ||
154 | void __init s5pc100_map_io(void) | 165 | void __init s5pc100_map_io(void) |
diff --git a/arch/arm/mach-s5pv210/common.c b/arch/arm/mach-s5pv210/common.c index 023f1a796a9c..306b29aa58bc 100644 --- a/arch/arm/mach-s5pv210/common.c +++ b/arch/arm/mach-s5pv210/common.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/clk.h> | 19 | #include <linux/clk.h> |
20 | #include <linux/io.h> | 20 | #include <linux/io.h> |
21 | #include <linux/device.h> | 21 | #include <linux/device.h> |
22 | #include <clocksource/samsung_pwm.h> | ||
22 | #include <linux/platform_device.h> | 23 | #include <linux/platform_device.h> |
23 | #include <linux/sched.h> | 24 | #include <linux/sched.h> |
24 | #include <linux/dma-mapping.h> | 25 | #include <linux/dma-mapping.h> |
@@ -42,6 +43,7 @@ | |||
42 | #include <plat/fimc-core.h> | 43 | #include <plat/fimc-core.h> |
43 | #include <plat/iic-core.h> | 44 | #include <plat/iic-core.h> |
44 | #include <plat/keypad-core.h> | 45 | #include <plat/keypad-core.h> |
46 | #include <plat/pwm-core.h> | ||
45 | #include <plat/tv-core.h> | 47 | #include <plat/tv-core.h> |
46 | #include <plat/spi-core.h> | 48 | #include <plat/spi-core.h> |
47 | #include <plat/regs-serial.h> | 49 | #include <plat/regs-serial.h> |
@@ -148,6 +150,13 @@ void s5pv210_restart(enum reboot_mode mode, const char *cmd) | |||
148 | __raw_writel(0x1, S5P_SWRESET); | 150 | __raw_writel(0x1, S5P_SWRESET); |
149 | } | 151 | } |
150 | 152 | ||
153 | static struct samsung_pwm_variant s5pv210_pwm_variant = { | ||
154 | .bits = 32, | ||
155 | .div_base = 0, | ||
156 | .has_tint_cstat = true, | ||
157 | .tclk_mask = (1 << 5), | ||
158 | }; | ||
159 | |||
151 | /* | 160 | /* |
152 | * s5pv210_map_io | 161 | * s5pv210_map_io |
153 | * | 162 | * |
@@ -165,6 +174,8 @@ void __init s5pv210_init_io(struct map_desc *mach_desc, int size) | |||
165 | s5p_init_cpu(S5P_VA_CHIPID); | 174 | s5p_init_cpu(S5P_VA_CHIPID); |
166 | 175 | ||
167 | s3c_init_cpu(samsung_cpu_id, cpu_ids, ARRAY_SIZE(cpu_ids)); | 176 | s3c_init_cpu(samsung_cpu_id, cpu_ids, ARRAY_SIZE(cpu_ids)); |
177 | |||
178 | samsung_pwm_set_platdata(&s5pv210_pwm_variant); | ||
168 | } | 179 | } |
169 | 180 | ||
170 | void __init s5pv210_map_io(void) | 181 | void __init s5pv210_map_io(void) |