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

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,

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,

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 linux/clk.h +#include linux/clockchips.h +#include linux/clocksource.h +#include

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 those BUG_ON every

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
> -Original Message- > From: Xiubo Li [mailto:li.xi...@freescale.com] > Sent: Wednesday, April 16, 2014 10:20 AM > To: daniel.lezc...@linaro.org; t...@linutronix.de; shawn@linaro.org; Lu > Jingchang-B35083; Jin Zhengxiong-R64188; Wang Dongsheng-B40534 > Cc:

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

2014-04-15 Thread dongsheng.w...@freescale.com
-Original Message- From: Xiubo Li [mailto:li.xi...@freescale.com] Sent: Wednesday, April 16, 2014 10:20 AM To: daniel.lezc...@linaro.org; t...@linutronix.de; shawn@linaro.org; Lu Jingchang-B35083; Jin Zhengxiong-R64188; Wang Dongsheng-B40534 Cc: devicet...@vger.kernel.org;

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: + break;