Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1533703 > unrolled thread

Re: [RFC PATCH] rtc/nxp: add FTM alarm driver as the wakeup source

Started byAlexandre Belloni <alexandre.belloni@free-electrons.com>
First post2016-12-01 01:40 +0100
Last post2016-12-02 03:30 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [RFC PATCH] rtc/nxp: add FTM alarm driver as the wakeup source Alexandre Belloni <alexandre.belloni@free-electrons.com> - 2016-12-01 01:40 +0100
    RE: [RFC PATCH] rtc/nxp: add FTM alarm driver as the wakeup source Meng Yi <meng.yi@nxp.com> - 2016-12-02 03:30 +0100

#1533703 — Re: [RFC PATCH] rtc/nxp: add FTM alarm driver as the wakeup source

FromAlexandre Belloni <alexandre.belloni@free-electrons.com>
Date2016-12-01 01:40 +0100
SubjectRe: [RFC PATCH] rtc/nxp: add FTM alarm driver as the wakeup source
Message-ID<sJnzP-4We-5@gated-at.bofh.it>
On 02/11/2016 at 08:23:32 +0000, Meng Yi wrote :
> > +
> > +static int ftm_alarm_irq_enable(struct device *dev, unsigned int
> > +enabled) {
> > +	if (enabled)
> > +		ftm_irq_enable(true);
> > +	else
> > +		ftm_irq_enable(false);
> > +
> > +	return 0;
> > +}
> > +
> > +static int nxp_ftm_rtc_read_time(struct device *dev, struct rtc_time
> > +*tm) {
> > +	struct timeval time;
> > +	unsigned long local_time;
> > +
> > +	do_gettimeofday(&time);
> > +	local_time = (u32)(time.tv_sec - (sys_tz.tz_minuteswest * 60));
> > +	rtc_time_to_tm(local_time, tm);
> > +
> > +	return 0;
> > +}
> > +
> 
> This is not really getting time from the RTC since FTM is not a RTC device,
> But we need to get the time to setup alarm, so we are using system time for now.
> Anybody have better idea?
> 

No, that seems fine to me. I'll review the rest of the driver.


-- 
Alexandre Belloni, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

[toc] | [next] | [standalone]


#1534619

FromMeng Yi <meng.yi@nxp.com>
Date2016-12-02 03:30 +0100
Message-ID<sJLLP-5MM-1@gated-at.bofh.it>
In reply to#1533703
> > > +
> > > +static int nxp_ftm_rtc_read_time(struct device *dev, struct
> > > +rtc_time
> > > +*tm) {
> > > +	struct timeval time;
> > > +	unsigned long local_time;
> > > +
> > > +	do_gettimeofday(&time);
> > > +	local_time = (u32)(time.tv_sec - (sys_tz.tz_minuteswest * 60));
> > > +	rtc_time_to_tm(local_time, tm);
> > > +
> > > +	return 0;
> > > +}
> > > +
> >
> > This is not really getting time from the RTC since FTM is not a RTC
> > device, But we need to get the time to setup alarm, so we are using system
> time for now.
> > Anybody have better idea?
> >
> 
> No, that seems fine to me. I'll review the rest of the driver.

Thanks for your review, any feedback is welcomed!

> 
> 
> --
> Alexandre Belloni, Free Electrons
> Embedded Linux and Kernel engineering
> http://free-electrons.com

Meng

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web