diff options
Diffstat (limited to 'arch/arm/mach-s5pv210/common.c')
-rw-r--r-- | arch/arm/mach-s5pv210/common.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/arch/arm/mach-s5pv210/common.c b/arch/arm/mach-s5pv210/common.c index 023f1a796a9c..26027a29b8a1 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,30 @@ 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 | |||
160 | void __init samsung_set_timer_source(unsigned int event, unsigned int source) | ||
161 | { | ||
162 | s5pv210_pwm_variant.output_mask = BIT(SAMSUNG_PWM_NUM) - 1; | ||
163 | s5pv210_pwm_variant.output_mask &= ~(BIT(event) | BIT(source)); | ||
164 | } | ||
165 | |||
166 | void __init samsung_timer_init(void) | ||
167 | { | ||
168 | unsigned int timer_irqs[SAMSUNG_PWM_NUM] = { | ||
169 | IRQ_TIMER0_VIC, IRQ_TIMER1_VIC, IRQ_TIMER2_VIC, | ||
170 | IRQ_TIMER3_VIC, IRQ_TIMER4_VIC, | ||
171 | }; | ||
172 | |||
173 | samsung_pwm_clocksource_init(S3C_VA_TIMER, | ||
174 | timer_irqs, &s5pv210_pwm_variant); | ||
175 | } | ||
176 | |||
151 | /* | 177 | /* |
152 | * s5pv210_map_io | 178 | * s5pv210_map_io |
153 | * | 179 | * |
@@ -165,6 +191,8 @@ void __init s5pv210_init_io(struct map_desc *mach_desc, int size) | |||
165 | s5p_init_cpu(S5P_VA_CHIPID); | 191 | s5p_init_cpu(S5P_VA_CHIPID); |
166 | 192 | ||
167 | s3c_init_cpu(samsung_cpu_id, cpu_ids, ARRAY_SIZE(cpu_ids)); | 193 | s3c_init_cpu(samsung_cpu_id, cpu_ids, ARRAY_SIZE(cpu_ids)); |
194 | |||
195 | samsung_pwm_set_platdata(&s5pv210_pwm_variant); | ||
168 | } | 196 | } |
169 | 197 | ||
170 | void __init s5pv210_map_io(void) | 198 | void __init s5pv210_map_io(void) |