]> git.baikalelectronics.ru Git - kernel.git/commit
clocksource: sh_cmt: __clocksource_updatefreq_hz() update
authorMagnus Damm <damm@opensource.se>
Mon, 25 Apr 2011 13:32:11 +0000 (22:32 +0900)
committerPaul Mundt <lethal@linux-sh.org>
Mon, 23 May 2011 05:33:59 +0000 (14:33 +0900)
commitbccb9d2aec84eeba8a885a17ae8789e77963c946
treef2d8710c0e6abfb0f633935003bd532757a27f66
parenta6242e0946423dc70ae8cb442ee1c10d99481b2c
clocksource: sh_cmt: __clocksource_updatefreq_hz() update

This patch updates the clocksource part of the CMT driver
to make use of the __clocksource_updatefreq_hz() function.

Without this patch the old code uses clocksource_register()
together with a hack that assumes a never changing clock rate
(see clk_enable(), clk_get_rate() and clk_disable()).

The patch uses clocksource_register_hz() with 1 Hz as initial
value, then lets the ->enable() callback update the value
with __clocksource_updatefreq_hz() once the struct clk has
been enabled and the frequency is stable.

Signed-off-by: Magnus Damm <damm@opensource.se>
Acked-by: John Stultz <johnstul@us.ibm.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
drivers/clocksource/sh_cmt.c