rtc: puv3: switch to rtc_time64_to_tm/rtc_tm_to_time64
Call the 64bit versions of rtc_tm time conversion. Link: https://lore.kernel.org/r/20200306010240.40056-2-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
This commit is contained in:
parent
a04b3b965f
commit
0155b54774
@ -85,7 +85,7 @@ static int puv3_rtc_setpie(struct device *dev, int enabled)
|
|||||||
/* Time read/write */
|
/* Time read/write */
|
||||||
static int puv3_rtc_gettime(struct device *dev, struct rtc_time *rtc_tm)
|
static int puv3_rtc_gettime(struct device *dev, struct rtc_time *rtc_tm)
|
||||||
{
|
{
|
||||||
rtc_time_to_tm(readl(RTC_RCNR), rtc_tm);
|
rtc_time64_to_tm(readl(RTC_RCNR), rtc_tm);
|
||||||
|
|
||||||
dev_dbg(dev, "read time %ptRr\n", rtc_tm);
|
dev_dbg(dev, "read time %ptRr\n", rtc_tm);
|
||||||
|
|
||||||
@ -94,12 +94,9 @@ static int puv3_rtc_gettime(struct device *dev, struct rtc_time *rtc_tm)
|
|||||||
|
|
||||||
static int puv3_rtc_settime(struct device *dev, struct rtc_time *tm)
|
static int puv3_rtc_settime(struct device *dev, struct rtc_time *tm)
|
||||||
{
|
{
|
||||||
unsigned long rtc_count = 0;
|
|
||||||
|
|
||||||
dev_dbg(dev, "set time %ptRr\n", tm);
|
dev_dbg(dev, "set time %ptRr\n", tm);
|
||||||
|
|
||||||
rtc_tm_to_time(tm, &rtc_count);
|
writel(rtc_tm_to_time64(tm), RTC_RCNR);
|
||||||
writel(rtc_count, RTC_RCNR);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -108,7 +105,7 @@ static int puv3_rtc_getalarm(struct device *dev, struct rtc_wkalrm *alrm)
|
|||||||
{
|
{
|
||||||
struct rtc_time *alm_tm = &alrm->time;
|
struct rtc_time *alm_tm = &alrm->time;
|
||||||
|
|
||||||
rtc_time_to_tm(readl(RTC_RTAR), alm_tm);
|
rtc_time64_to_tm(readl(RTC_RTAR), alm_tm);
|
||||||
|
|
||||||
alrm->enabled = readl(RTC_RTSR) & RTC_RTSR_ALE;
|
alrm->enabled = readl(RTC_RTSR) & RTC_RTSR_ALE;
|
||||||
|
|
||||||
@ -120,12 +117,10 @@ static int puv3_rtc_getalarm(struct device *dev, struct rtc_wkalrm *alrm)
|
|||||||
static int puv3_rtc_setalarm(struct device *dev, struct rtc_wkalrm *alrm)
|
static int puv3_rtc_setalarm(struct device *dev, struct rtc_wkalrm *alrm)
|
||||||
{
|
{
|
||||||
struct rtc_time *tm = &alrm->time;
|
struct rtc_time *tm = &alrm->time;
|
||||||
unsigned long rtcalarm_count = 0;
|
|
||||||
|
|
||||||
dev_dbg(dev, "set alarm: %d, %ptRr\n", alrm->enabled, tm);
|
dev_dbg(dev, "set alarm: %d, %ptRr\n", alrm->enabled, tm);
|
||||||
|
|
||||||
rtc_tm_to_time(tm, &rtcalarm_count);
|
writel(rtc_tm_to_time64(tm), RTC_RTAR);
|
||||||
writel(rtcalarm_count, RTC_RTAR);
|
|
||||||
|
|
||||||
puv3_rtc_setaie(dev, alrm->enabled);
|
puv3_rtc_setaie(dev, alrm->enabled);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user