diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-07-25 15:38:42 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-07-25 15:38:42 -0400 |
commit | ae4c42e4e4d76d003f8ca551fe1aef93ff9a4b21 (patch) | |
tree | 2bff2e4f4456077e7d7c589c8c28824f12dfa21c /arch/arm/plat-s5p | |
parent | dd58ecba48edf14be1a5f70120fcd3002277a74a (diff) | |
parent | ab2a0e0d135490729e384c1826d118f92e88cae8 (diff) |
Merge branch 'next/cleanup' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/linux-arm-soc
* 'next/cleanup' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/linux-arm-soc: (133 commits)
ARM: EXYNOS4: Change devname for FIMD clkdev
ARM: S3C64XX: Cleanup mach/regs-fb.h from mach-s3c64xx
ARM: S5PV210: Cleanup mach/regs-fb.h from mach-s5pv210
ARM: S5PC100: Cleanup mach/regs-fb.h from mach-s5pc100
ARM: S3C24XX: Use generic s3c_set_platdata for devices
ARM: S3C64XX: Use generic s3c_set_platdata for OneNAND
ARM: SAMSUNG: Use generic s3c_set_platdata for NAND
ARM: SAMSUNG: Use generic s3c_set_platdata for USB OHCI
ARM: SAMSUNG: Use generic s3c_set_platdata for HWMON
ARM: SAMSUNG: Use generic s3c_set_platdata for FB
ARM: SAMSUNG: Use generic s3c_set_platdata for TS
ARM: S3C64XX: Add PWM backlight support on SMDK6410
ARM: S5P64X0: Add PWM backlight support on SMDK6450
ARM: S5P64X0: Add PWM backlight support on SMDK6440
ARM: S5PC100: Add PWM backlight support on SMDKC100
ARM: S5PV210: Add PWM backlight support on SMDKV210
ARM: EXYNOS4: Add PWM backlight support on SMDKC210
ARM: EXYNOS4: Add PWM backlight support on SMDKV310
ARM: SAMSUNG: Create a common infrastructure for PWM backlight support
clocksource: convert 32-bit down counting clocksource on S5PV210/S5P64X0
...
Fix up trivial conflict in arch/arm/mach-imx/mach-scb9328.c
Diffstat (limited to 'arch/arm/plat-s5p')
-rw-r--r-- | arch/arm/plat-s5p/clock.c | 35 | ||||
-rw-r--r-- | arch/arm/plat-s5p/include/plat/s5p-clock.h | 5 | ||||
-rw-r--r-- | arch/arm/plat-s5p/s5p-time.c | 29 |
3 files changed, 52 insertions, 17 deletions
diff --git a/arch/arm/plat-s5p/clock.c b/arch/arm/plat-s5p/clock.c index 8d081d968c58..02af235298e2 100644 --- a/arch/arm/plat-s5p/clock.c +++ b/arch/arm/plat-s5p/clock.c | |||
@@ -168,6 +168,41 @@ unsigned long s5p_epll_get_rate(struct clk *clk) | |||
168 | return clk->rate; | 168 | return clk->rate; |
169 | } | 169 | } |
170 | 170 | ||
171 | int s5p_spdif_set_rate(struct clk *clk, unsigned long rate) | ||
172 | { | ||
173 | struct clk *pclk; | ||
174 | int ret; | ||
175 | |||
176 | pclk = clk_get_parent(clk); | ||
177 | if (IS_ERR(pclk)) | ||
178 | return -EINVAL; | ||
179 | |||
180 | ret = pclk->ops->set_rate(pclk, rate); | ||
181 | clk_put(pclk); | ||
182 | |||
183 | return ret; | ||
184 | } | ||
185 | |||
186 | unsigned long s5p_spdif_get_rate(struct clk *clk) | ||
187 | { | ||
188 | struct clk *pclk; | ||
189 | int rate; | ||
190 | |||
191 | pclk = clk_get_parent(clk); | ||
192 | if (IS_ERR(pclk)) | ||
193 | return -EINVAL; | ||
194 | |||
195 | rate = pclk->ops->get_rate(clk); | ||
196 | clk_put(pclk); | ||
197 | |||
198 | return rate; | ||
199 | } | ||
200 | |||
201 | struct clk_ops s5p_sclk_spdif_ops = { | ||
202 | .set_rate = s5p_spdif_set_rate, | ||
203 | .get_rate = s5p_spdif_get_rate, | ||
204 | }; | ||
205 | |||
171 | static struct clk *s5p_clks[] __initdata = { | 206 | static struct clk *s5p_clks[] __initdata = { |
172 | &clk_ext_xtal_mux, | 207 | &clk_ext_xtal_mux, |
173 | &clk_48m, | 208 | &clk_48m, |
diff --git a/arch/arm/plat-s5p/include/plat/s5p-clock.h b/arch/arm/plat-s5p/include/plat/s5p-clock.h index 2b6dcff8ab2b..769b5bdfb046 100644 --- a/arch/arm/plat-s5p/include/plat/s5p-clock.h +++ b/arch/arm/plat-s5p/include/plat/s5p-clock.h | |||
@@ -47,4 +47,9 @@ extern int s5p_gatectrl(void __iomem *reg, struct clk *clk, int enable); | |||
47 | extern int s5p_epll_enable(struct clk *clk, int enable); | 47 | extern int s5p_epll_enable(struct clk *clk, int enable); |
48 | extern unsigned long s5p_epll_get_rate(struct clk *clk); | 48 | extern unsigned long s5p_epll_get_rate(struct clk *clk); |
49 | 49 | ||
50 | /* SPDIF clk operations common for S5PC100/V210/C110 and Exynos4 */ | ||
51 | extern int s5p_spdif_set_rate(struct clk *clk, unsigned long rate); | ||
52 | extern unsigned long s5p_spdif_get_rate(struct clk *clk); | ||
53 | |||
54 | extern struct clk_ops s5p_sclk_spdif_ops; | ||
50 | #endif /* __ASM_PLAT_S5P_CLOCK_H */ | 55 | #endif /* __ASM_PLAT_S5P_CLOCK_H */ |
diff --git a/arch/arm/plat-s5p/s5p-time.c b/arch/arm/plat-s5p/s5p-time.c index 612934c48b0d..c833e7b57599 100644 --- a/arch/arm/plat-s5p/s5p-time.c +++ b/arch/arm/plat-s5p/s5p-time.c | |||
@@ -314,13 +314,6 @@ static void __iomem *s5p_timer_reg(void) | |||
314 | return S3C_TIMERREG(offset); | 314 | return S3C_TIMERREG(offset); |
315 | } | 315 | } |
316 | 316 | ||
317 | static cycle_t s5p_timer_read(struct clocksource *cs) | ||
318 | { | ||
319 | void __iomem *reg = s5p_timer_reg(); | ||
320 | |||
321 | return (cycle_t) (reg ? ~__raw_readl(reg) : 0); | ||
322 | } | ||
323 | |||
324 | /* | 317 | /* |
325 | * Override the global weak sched_clock symbol with this | 318 | * Override the global weak sched_clock symbol with this |
326 | * local implementation which uses the clocksource to get some | 319 | * local implementation which uses the clocksource to get some |
@@ -350,14 +343,6 @@ static void notrace s5p_update_sched_clock(void) | |||
350 | update_sched_clock(&cd, ~__raw_readl(reg), (u32)~0); | 343 | update_sched_clock(&cd, ~__raw_readl(reg), (u32)~0); |
351 | } | 344 | } |
352 | 345 | ||
353 | struct clocksource time_clocksource = { | ||
354 | .name = "s5p_clocksource_timer", | ||
355 | .rating = 250, | ||
356 | .read = s5p_timer_read, | ||
357 | .mask = CLOCKSOURCE_MASK(32), | ||
358 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, | ||
359 | }; | ||
360 | |||
361 | static void __init s5p_clocksource_init(void) | 346 | static void __init s5p_clocksource_init(void) |
362 | { | 347 | { |
363 | unsigned long pclk; | 348 | unsigned long pclk; |
@@ -375,8 +360,9 @@ static void __init s5p_clocksource_init(void) | |||
375 | 360 | ||
376 | init_sched_clock(&cd, s5p_update_sched_clock, 32, clock_rate); | 361 | init_sched_clock(&cd, s5p_update_sched_clock, 32, clock_rate); |
377 | 362 | ||
378 | if (clocksource_register_hz(&time_clocksource, clock_rate)) | 363 | if (clocksource_mmio_init(s5p_timer_reg(), "s5p_clocksource_timer", |
379 | panic("%s: can't register clocksource\n", time_clocksource.name); | 364 | clock_rate, 250, 32, clocksource_mmio_readl_down)) |
365 | panic("s5p_clocksource_timer: can't register clocksource\n"); | ||
380 | } | 366 | } |
381 | 367 | ||
382 | static void __init s5p_timer_resources(void) | 368 | static void __init s5p_timer_resources(void) |
@@ -384,6 +370,7 @@ static void __init s5p_timer_resources(void) | |||
384 | 370 | ||
385 | unsigned long event_id = timer_source.event_id; | 371 | unsigned long event_id = timer_source.event_id; |
386 | unsigned long source_id = timer_source.source_id; | 372 | unsigned long source_id = timer_source.source_id; |
373 | char devname[15]; | ||
387 | 374 | ||
388 | timerclk = clk_get(NULL, "timers"); | 375 | timerclk = clk_get(NULL, "timers"); |
389 | if (IS_ERR(timerclk)) | 376 | if (IS_ERR(timerclk)) |
@@ -391,6 +378,10 @@ static void __init s5p_timer_resources(void) | |||
391 | 378 | ||
392 | clk_enable(timerclk); | 379 | clk_enable(timerclk); |
393 | 380 | ||
381 | sprintf(devname, "s3c24xx-pwm.%lu", event_id); | ||
382 | s3c_device_timer[event_id].id = event_id; | ||
383 | s3c_device_timer[event_id].dev.init_name = devname; | ||
384 | |||
394 | tin_event = clk_get(&s3c_device_timer[event_id].dev, "pwm-tin"); | 385 | tin_event = clk_get(&s3c_device_timer[event_id].dev, "pwm-tin"); |
395 | if (IS_ERR(tin_event)) | 386 | if (IS_ERR(tin_event)) |
396 | panic("failed to get pwm-tin clock for event timer"); | 387 | panic("failed to get pwm-tin clock for event timer"); |
@@ -401,6 +392,10 @@ static void __init s5p_timer_resources(void) | |||
401 | 392 | ||
402 | clk_enable(tin_event); | 393 | clk_enable(tin_event); |
403 | 394 | ||
395 | sprintf(devname, "s3c24xx-pwm.%lu", source_id); | ||
396 | s3c_device_timer[source_id].id = source_id; | ||
397 | s3c_device_timer[source_id].dev.init_name = devname; | ||
398 | |||
404 | tin_source = clk_get(&s3c_device_timer[source_id].dev, "pwm-tin"); | 399 | tin_source = clk_get(&s3c_device_timer[source_id].dev, "pwm-tin"); |
405 | if (IS_ERR(tin_source)) | 400 | if (IS_ERR(tin_source)) |
406 | panic("failed to get pwm-tin clock for source timer"); | 401 | panic("failed to get pwm-tin clock for source timer"); |