[PATCH 3/3] clocksource: Add Freescale FlexTimer Module (FTM) timer support

2014-04-21 Thread Xiubo Li
The Freescale FlexTimer Module time reference is a 16-bit counter that can be used as an unsigned or signed increase counter. CNTIN defines the starting value of the count and MOD defines the final value of the count. The value of CNTIN is loaded into the FTM counter, and the counter increments un

RE: [RFC][PATCH 3/3] clocksource: Add Freescale FlexTimer Module (FTM) timer support

2014-04-17 Thread li.xi...@freescale.com
> > + freq = clk_get_rate(ftm_clk); > > + > > + calc_closest_cound_cyc(freq); > > + > > + BUG_ON(ftm_clocksource_init(freq)); > > + > > + BUG_ON(ftm_clockevent_init(freq, irq)); > > +} > > +CLOCKSOURCE_OF_DECLARE(vf610, "fsl,vf610-ftm-timer", ftm_timer_init); > > > I am not a big fan of t

RE: [RFC][PATCH 3/3] clocksource: Add Freescale FlexTimer Module (FTM) timer support

2014-04-17 Thread li.xi...@freescale.com
> > Here using the FTM0 as clock event device and the FTM1 as clock > > source device. > > As it is a new driver, please add a more elaborated description of the > timer. > Please see the next version. > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include >

Re: [RFC][PATCH 3/3] clocksource: Add Freescale FlexTimer Module (FTM) timer support

2014-04-17 Thread Daniel Lezcano
On 04/16/2014 04:19 AM, Xiubo Li wrote: The Freescale FlexTimer Module time reference is a 16-bit counter that can be used as an unsigned or signed counter.one 16-bits increase counter. Here using the FTM0 as clock event device and the FTM1 as clock source device. As it is a new driver, please

RE: [RFC][PATCH 3/3] clocksource: Add Freescale FlexTimer Module (FTM) timer support

2014-04-15 Thread li.xi...@freescale.com
[...] > > +static void ftm_set_mode(enum clock_event_mode mode, > > + struct clock_event_device *evt) > > +{ > > + switch (mode) { > > + case CLOCK_EVT_MODE_PERIODIC: > > + ftm_set_next_event(peroidic_cyc, evt); > > + break; > > + default: > > +

RE: [RFC][PATCH 3/3] clocksource: Add Freescale FlexTimer Module (FTM) timer support

2014-04-15 Thread dongsheng.w...@freescale.com
..@vger.kernel.org; linux-arm-ker...@lists.infradead.org; linux- > ker...@vger.kernel.org; Xiubo Li-B47053 > Subject: [RFC][PATCH 3/3] clocksource: Add Freescale FlexTimer Module (FTM) > timer support > > The Freescale FlexTimer Module time reference is a 16-bit counter > that

[RFC][PATCH 3/3] clocksource: Add Freescale FlexTimer Module (FTM) timer support

2014-04-15 Thread Xiubo Li
The Freescale FlexTimer Module time reference is a 16-bit counter that can be used as an unsigned or signed counter.one 16-bits increase counter. Here using the FTM0 as clock event device and the FTM1 as clock source device. Signed-off-by: Xiubo Li Cc: Shawn Guo Cc: Jingchang Lu --- drivers/c