lkml.org 
[lkml]   [2014]   [Jun]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v8 2/7] clocksource: Add support for the Mediatek SoCs
On Wed, 11 Jun 2014, Matthias Brugger wrote:
> +static void mtk_clkevt_mode(enum clock_event_mode mode,
> + struct clock_event_device *clk)
> +{
> + struct mtk_clock_event_device *evt = to_mtk_clk(clk);
> +
> + mtk_clkevt_time_stop(evt, GPT_CLK_EVT);
> +
> + switch (mode) {
> + case CLOCK_EVT_MODE_PERIODIC:
> + mtk_clkevt_time_setup(evt, evt->ticks_per_jiffy, GPT_CLK_EVT);
> + mtk_clkevt_time_start(evt, true, GPT_CLK_EVT);
> + break;
> + case CLOCK_EVT_MODE_ONESHOT:
> + mtk_clkevt_time_start(evt, false, GPT_CLK_EVT);

Why start the timer here? The code will call set next event right away.

> + break;
> + case CLOCK_EVT_MODE_UNUSED:
> + case CLOCK_EVT_MODE_SHUTDOWN:
> + default:
> + /* No more interrupts will occur as source is disabled */
> + break;
> + }
> +}

Looks good otherwise.

Thanks,

tglx


\
 
 \ /
  Last update: 2014-06-11 21:01    [W:0.064 / U:0.164 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site