[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <DB6PR0401MB263163BD3E6AF420934DC6FAECA00@DB6PR0401MB2631.eurprd04.prod.outlook.com>
Date: Wed, 2 Nov 2016 08:23:32 +0000
From: Meng Yi <meng.yi@....com>
To: Meng Yi <meng.yi@....com>,
"a.zummo@...ertech.it" <a.zummo@...ertech.it>,
"alexandre.belloni@...e-electrons.com"
<alexandre.belloni@...e-electrons.com>
CC: "rtc-linux@...glegroups.com" <rtc-linux@...glegroups.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [RFC PATCH] rtc/nxp: add FTM alarm driver as the wakeup source
> +
> +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?
Meng
Powered by blists - more mailing lists