diff options
Diffstat (limited to 'arch/arm/mach-s5p64x0/common.c')
-rw-r--r-- | arch/arm/mach-s5p64x0/common.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/arch/arm/mach-s5p64x0/common.c b/arch/arm/mach-s5p64x0/common.c index dfdfdc320ce7..42e14f2e7ca7 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,30 @@ 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 | |||
169 | void __init samsung_set_timer_source(unsigned int event, unsigned int source) | ||
170 | { | ||
171 | s5p64x0_pwm_variant.output_mask = BIT(SAMSUNG_PWM_NUM) - 1; | ||
172 | s5p64x0_pwm_variant.output_mask &= ~(BIT(event) | BIT(source)); | ||
173 | } | ||
174 | |||
175 | void __init samsung_timer_init(void) | ||
176 | { | ||
177 | unsigned int timer_irqs[SAMSUNG_PWM_NUM] = { | ||
178 | IRQ_TIMER0_VIC, IRQ_TIMER1_VIC, IRQ_TIMER2_VIC, | ||
179 | IRQ_TIMER3_VIC, IRQ_TIMER4_VIC, | ||
180 | }; | ||
181 | |||
182 | samsung_pwm_clocksource_init(S3C_VA_TIMER, | ||
183 | timer_irqs, &s5p64x0_pwm_variant); | ||
184 | } | ||
185 | |||
160 | /* | 186 | /* |
161 | * s5p64x0_map_io | 187 | * s5p64x0_map_io |
162 | * | 188 | * |
@@ -176,6 +202,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)); | 202 | s3c_init_cpu(samsung_cpu_id, cpu_ids, ARRAY_SIZE(cpu_ids)); |
177 | samsung_wdt_reset_init(S3C_VA_WATCHDOG); | 203 | samsung_wdt_reset_init(S3C_VA_WATCHDOG); |
178 | 204 | ||
205 | samsung_pwm_set_platdata(&s5p64x0_pwm_variant); | ||
179 | } | 206 | } |
180 | 207 | ||
181 | void __init s5p6440_map_io(void) | 208 | void __init s5p6440_map_io(void) |