aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorKukjin Kim <kgene.kim@samsung.com>2011-02-14 02:13:27 -0500
committerKukjin Kim <kgene.kim@samsung.com>2011-02-21 23:51:15 -0500
commit3c31336dc5b7ea5b6d6168a8c38c46dd54d65e95 (patch)
tree05f14adeefd2303320eac8dabf2f5cfb4dcce954 /arch
parentc81a24ff8f4efda02ffaa0c3170155550bcae339 (diff)
ARM: EXYNOS4: Update Timer part
This patch updates Timer part of EXYNOS4 according to the change of ARCH name, EXYNOS4. Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-exynos4/include/mach/pwm-clock.h (renamed from arch/arm/mach-s5pv310/include/mach/pwm-clock.h)8
-rw-r--r--arch/arm/mach-exynos4/localtimer.c (renamed from arch/arm/mach-s5pv310/localtimer.c)2
-rw-r--r--arch/arm/mach-exynos4/time.c (renamed from arch/arm/mach-s5pv310/time.c)64
3 files changed, 37 insertions, 37 deletions
diff --git a/arch/arm/mach-s5pv310/include/mach/pwm-clock.h b/arch/arm/mach-exynos4/include/mach/pwm-clock.h
index 7e6da2701088..8e12090287bb 100644
--- a/arch/arm/mach-s5pv310/include/mach/pwm-clock.h
+++ b/arch/arm/mach-exynos4/include/mach/pwm-clock.h
@@ -1,7 +1,7 @@
1/* linux/arch/arm/mach-s5pv310/include/mach/pwm-clock.h 1/* linux/arch/arm/mach-exynos4/include/mach/pwm-clock.h
2 * 2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd. 3 * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/ 4 * http://www.samsung.com
5 * 5 *
6 * Copyright 2008 Openmoko, Inc. 6 * Copyright 2008 Openmoko, Inc.
7 * Copyright 2008 Simtec Electronics 7 * Copyright 2008 Simtec Electronics
@@ -10,7 +10,7 @@
10 * 10 *
11 * Based on arch/arm/mach-s3c64xx/include/mach/pwm-clock.h 11 * Based on arch/arm/mach-s3c64xx/include/mach/pwm-clock.h
12 * 12 *
13 * S5PV310 - pwm clock and timer support 13 * EXYNOS4 - pwm clock and timer support
14 * 14 *
15 * This program is free software; you can redistribute it and/or modify 15 * This program is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License version 2 as 16 * it under the terms of the GNU General Public License version 2 as
diff --git a/arch/arm/mach-s5pv310/localtimer.c b/arch/arm/mach-exynos4/localtimer.c
index 2784036cd8b1..2a2993ae8d86 100644
--- a/arch/arm/mach-s5pv310/localtimer.c
+++ b/arch/arm/mach-exynos4/localtimer.c
@@ -1,4 +1,4 @@
1/* linux/arch/arm/mach-s5pv310/localtimer.c 1/* linux/arch/arm/mach-exynos4/localtimer.c
2 * 2 *
3 * Cloned from linux/arch/arm/mach-realview/localtimer.c 3 * Cloned from linux/arch/arm/mach-realview/localtimer.c
4 * 4 *
diff --git a/arch/arm/mach-s5pv310/time.c b/arch/arm/mach-exynos4/time.c
index b262d4615331..e30ac7043095 100644
--- a/arch/arm/mach-s5pv310/time.c
+++ b/arch/arm/mach-exynos4/time.c
@@ -1,9 +1,9 @@
1/* linux/arch/arm/mach-s5pv310/time.c 1/* linux/arch/arm/mach-exynos4/time.c
2 * 2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd. 3 * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com 4 * http://www.samsung.com
5 * 5 *
6 * S5PV310 (and compatible) HRT support 6 * EXYNOS4 (and compatible) HRT support
7 * PWM 2/4 is used for this feature 7 * PWM 2/4 is used for this feature
8 * 8 *
9 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
@@ -33,7 +33,7 @@ static struct clk *tdiv2;
33static struct clk *tdiv4; 33static struct clk *tdiv4;
34static struct clk *timerclk; 34static struct clk *timerclk;
35 35
36static void s5pv310_pwm_stop(unsigned int pwm_id) 36static void exynos4_pwm_stop(unsigned int pwm_id)
37{ 37{
38 unsigned long tcon; 38 unsigned long tcon;
39 39
@@ -52,7 +52,7 @@ static void s5pv310_pwm_stop(unsigned int pwm_id)
52 __raw_writel(tcon, S3C2410_TCON); 52 __raw_writel(tcon, S3C2410_TCON);
53} 53}
54 54
55static void s5pv310_pwm_init(unsigned int pwm_id, unsigned long tcnt) 55static void exynos4_pwm_init(unsigned int pwm_id, unsigned long tcnt)
56{ 56{
57 unsigned long tcon; 57 unsigned long tcon;
58 58
@@ -86,7 +86,7 @@ static void s5pv310_pwm_init(unsigned int pwm_id, unsigned long tcnt)
86 } 86 }
87} 87}
88 88
89static inline void s5pv310_pwm_start(unsigned int pwm_id, bool periodic) 89static inline void exynos4_pwm_start(unsigned int pwm_id, bool periodic)
90{ 90{
91 unsigned long tcon; 91 unsigned long tcon;
92 92
@@ -117,23 +117,23 @@ static inline void s5pv310_pwm_start(unsigned int pwm_id, bool periodic)
117 __raw_writel(tcon, S3C2410_TCON); 117 __raw_writel(tcon, S3C2410_TCON);
118} 118}
119 119
120static int s5pv310_pwm_set_next_event(unsigned long cycles, 120static int exynos4_pwm_set_next_event(unsigned long cycles,
121 struct clock_event_device *evt) 121 struct clock_event_device *evt)
122{ 122{
123 s5pv310_pwm_init(2, cycles); 123 exynos4_pwm_init(2, cycles);
124 s5pv310_pwm_start(2, 0); 124 exynos4_pwm_start(2, 0);
125 return 0; 125 return 0;
126} 126}
127 127
128static void s5pv310_pwm_set_mode(enum clock_event_mode mode, 128static void exynos4_pwm_set_mode(enum clock_event_mode mode,
129 struct clock_event_device *evt) 129 struct clock_event_device *evt)
130{ 130{
131 s5pv310_pwm_stop(2); 131 exynos4_pwm_stop(2);
132 132
133 switch (mode) { 133 switch (mode) {
134 case CLOCK_EVT_MODE_PERIODIC: 134 case CLOCK_EVT_MODE_PERIODIC:
135 s5pv310_pwm_init(2, clock_count_per_tick); 135 exynos4_pwm_init(2, clock_count_per_tick);
136 s5pv310_pwm_start(2, 1); 136 exynos4_pwm_start(2, 1);
137 break; 137 break;
138 case CLOCK_EVT_MODE_ONESHOT: 138 case CLOCK_EVT_MODE_ONESHOT:
139 break; 139 break;
@@ -149,11 +149,11 @@ static struct clock_event_device pwm_event_device = {
149 .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, 149 .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
150 .rating = 200, 150 .rating = 200,
151 .shift = 32, 151 .shift = 32,
152 .set_next_event = s5pv310_pwm_set_next_event, 152 .set_next_event = exynos4_pwm_set_next_event,
153 .set_mode = s5pv310_pwm_set_mode, 153 .set_mode = exynos4_pwm_set_mode,
154}; 154};
155 155
156irqreturn_t s5pv310_clock_event_isr(int irq, void *dev_id) 156irqreturn_t exynos4_clock_event_isr(int irq, void *dev_id)
157{ 157{
158 struct clock_event_device *evt = &pwm_event_device; 158 struct clock_event_device *evt = &pwm_event_device;
159 159
@@ -162,13 +162,13 @@ irqreturn_t s5pv310_clock_event_isr(int irq, void *dev_id)
162 return IRQ_HANDLED; 162 return IRQ_HANDLED;
163} 163}
164 164
165static struct irqaction s5pv310_clock_event_irq = { 165static struct irqaction exynos4_clock_event_irq = {
166 .name = "pwm_timer2_irq", 166 .name = "pwm_timer2_irq",
167 .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL, 167 .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
168 .handler = s5pv310_clock_event_isr, 168 .handler = exynos4_clock_event_isr,
169}; 169};
170 170
171static void __init s5pv310_clockevent_init(void) 171static void __init exynos4_clockevent_init(void)
172{ 172{
173 unsigned long pclk; 173 unsigned long pclk;
174 unsigned long clock_rate; 174 unsigned long clock_rate;
@@ -198,10 +198,10 @@ static void __init s5pv310_clockevent_init(void)
198 pwm_event_device.cpumask = cpumask_of(0); 198 pwm_event_device.cpumask = cpumask_of(0);
199 clockevents_register_device(&pwm_event_device); 199 clockevents_register_device(&pwm_event_device);
200 200
201 setup_irq(IRQ_TIMER2, &s5pv310_clock_event_irq); 201 setup_irq(IRQ_TIMER2, &exynos4_clock_event_irq);
202} 202}
203 203
204static cycle_t s5pv310_pwm4_read(struct clocksource *cs) 204static cycle_t exynos4_pwm4_read(struct clocksource *cs)
205{ 205{
206 return (cycle_t) ~__raw_readl(S3C_TIMERREG(0x40)); 206 return (cycle_t) ~__raw_readl(S3C_TIMERREG(0x40));
207} 207}
@@ -209,12 +209,12 @@ static cycle_t s5pv310_pwm4_read(struct clocksource *cs)
209struct clocksource pwm_clocksource = { 209struct clocksource pwm_clocksource = {
210 .name = "pwm_timer4", 210 .name = "pwm_timer4",
211 .rating = 250, 211 .rating = 250,
212 .read = s5pv310_pwm4_read, 212 .read = exynos4_pwm4_read,
213 .mask = CLOCKSOURCE_MASK(32), 213 .mask = CLOCKSOURCE_MASK(32),
214 .flags = CLOCK_SOURCE_IS_CONTINUOUS , 214 .flags = CLOCK_SOURCE_IS_CONTINUOUS ,
215}; 215};
216 216
217static void __init s5pv310_clocksource_init(void) 217static void __init exynos4_clocksource_init(void)
218{ 218{
219 unsigned long pclk; 219 unsigned long pclk;
220 unsigned long clock_rate; 220 unsigned long clock_rate;
@@ -226,14 +226,14 @@ static void __init s5pv310_clocksource_init(void)
226 226
227 clock_rate = clk_get_rate(tin4); 227 clock_rate = clk_get_rate(tin4);
228 228
229 s5pv310_pwm_init(4, ~0); 229 exynos4_pwm_init(4, ~0);
230 s5pv310_pwm_start(4, 1); 230 exynos4_pwm_start(4, 1);
231 231
232 if (clocksource_register_hz(&pwm_clocksource, clock_rate)) 232 if (clocksource_register_hz(&pwm_clocksource, clock_rate))
233 panic("%s: can't register clocksource\n", pwm_clocksource.name); 233 panic("%s: can't register clocksource\n", pwm_clocksource.name);
234} 234}
235 235
236static void __init s5pv310_timer_resources(void) 236static void __init exynos4_timer_resources(void)
237{ 237{
238 struct platform_device tmpdev; 238 struct platform_device tmpdev;
239 239
@@ -267,17 +267,17 @@ static void __init s5pv310_timer_resources(void)
267 clk_enable(tin4); 267 clk_enable(tin4);
268} 268}
269 269
270static void __init s5pv310_timer_init(void) 270static void __init exynos4_timer_init(void)
271{ 271{
272#ifdef CONFIG_LOCAL_TIMERS 272#ifdef CONFIG_LOCAL_TIMERS
273 twd_base = S5P_VA_TWD; 273 twd_base = S5P_VA_TWD;
274#endif 274#endif
275 275
276 s5pv310_timer_resources(); 276 exynos4_timer_resources();
277 s5pv310_clockevent_init(); 277 exynos4_clockevent_init();
278 s5pv310_clocksource_init(); 278 exynos4_clocksource_init();
279} 279}
280 280
281struct sys_timer s5pv310_timer = { 281struct sys_timer exynos4_timer = {
282 .init = s5pv310_timer_init, 282 .init = exynos4_timer_init,
283}; 283};