[PATCH v3 06/15] ARM: mxs: Add timer support
Lothar Waßmann
LW at KARO-electronics.de
Wed Dec 8 03:30:39 EST 2010
Hi,
Shawn Guo writes:
> Freescale MXS-based SoCs implement timer support in block TIMROT.
> There are two versions of TIMROT. The v1 on MX23 only gets 16 bits
> counter and has no match function. The v2 on MX28 extends the
> counter to 32 bits and add the match function.
>
> As the result, we need two instances of timers with v1 for better
> implementation, one for clock_event and another for clocksource.
> Otherwise, get_cycles may get imprecise result after long time
> cumulating. With v2, one instance can serve two purposes well.
>
> Signed-off-by: Shawn Guo <shawn.guo at freescale.com>
> ---
> Changes for v3:
> - Use term clock_event over next_event and clocksource over get_cycles
> - Split BV_TIMROT_TIMCTRLn_SELECT__32KHZ_XTAL into two definitions for v1 and v2 respectively
> - Turn timrot_get_cycles() into timrotv1_get_cycles() and timrotv2_get_cycles()
> - Turn timrot_set_next_event() into timrotv1_set_next_event() and timrotv2_set_next_event()
> - Skip flag IRQF_DISABLED
> - Remove unncessary IRQ disabling in mxs_set_mode()
> - Change shift of clocksource_mxs to 17
>
> Changes for v2:
> - Fix a bug in timrot_set_next_event(). It should read
> HW_TIMROT_RUNNING_COUNTn to get the current counts.
>
> arch/arm/mach-mxs/timer.c | 276 +++++++++++++++++++++++++++++++++++++++++++++
> 1 files changed, 276 insertions(+), 0 deletions(-)
> create mode 100644 arch/arm/mach-mxs/timer.c
>
> diff --git a/arch/arm/mach-mxs/timer.c b/arch/arm/mach-mxs/timer.c
> new file mode 100644
> index 0000000..b0e7ffe
> --- /dev/null
> +++ b/arch/arm/mach-mxs/timer.c
[...]
> + switch (mode) {
> + case CLOCK_EVT_MODE_PERIODIC:
> + printk(KERN_ERR "mxs_set_mode: Periodic mode is not "
> + "supported for MXS-based\n");
>
Please do not line wrap message strings. Also, if you want the
function name to appear in the message, use __func__ or __FUNCTION__.
That way the name is always correct even if the function is renamed or
the printk() statement is copied to a different function.
Lothar Waßmann
--
___________________________________________________________
Ka-Ro electronics GmbH | Pascalstraße 22 | D - 52076 Aachen
Phone: +49 2408 1402-0 | Fax: +49 2408 1402-10
Geschäftsführer: Matthias Kaussen
Handelsregistereintrag: Amtsgericht Aachen, HRB 4996
www.karo-electronics.de | info at karo-electronics.de
___________________________________________________________
More information about the linux-arm-kernel
mailing list