Commit 3199fc3d authored by Alexandre Belloni's avatar Alexandre Belloni

rtc: zynqmp: let the core handle range

Let the core handle the RTC range instead of open coding it.
Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
parent b8541798
...@@ -49,7 +49,6 @@ ...@@ -49,7 +49,6 @@
#define RTC_CALIB_DEF 0x198233 #define RTC_CALIB_DEF 0x198233
#define RTC_CALIB_MASK 0x1FFFFF #define RTC_CALIB_MASK 0x1FFFFF
#define RTC_SEC_MAX_VAL 0xFFFFFFFF
struct xlnx_rtc_dev { struct xlnx_rtc_dev {
struct rtc_device *rtc; struct rtc_device *rtc;
...@@ -71,9 +70,6 @@ static int xlnx_rtc_set_time(struct device *dev, struct rtc_time *tm) ...@@ -71,9 +70,6 @@ static int xlnx_rtc_set_time(struct device *dev, struct rtc_time *tm)
*/ */
new_time = rtc_tm_to_time64(tm) + 1; new_time = rtc_tm_to_time64(tm) + 1;
if (new_time > RTC_SEC_MAX_VAL)
return -EINVAL;
/* /*
* Writing into calibration register will clear the Tick Counter and * Writing into calibration register will clear the Tick Counter and
* force the next second to be signaled exactly in 1 second period * force the next second to be signaled exactly in 1 second period
...@@ -154,9 +150,6 @@ static int xlnx_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) ...@@ -154,9 +150,6 @@ static int xlnx_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
alarm_time = rtc_tm_to_time64(&alrm->time); alarm_time = rtc_tm_to_time64(&alrm->time);
if (alarm_time > RTC_SEC_MAX_VAL)
return -EINVAL;
writel((u32)alarm_time, (xrtcdev->reg_base + RTC_ALRM)); writel((u32)alarm_time, (xrtcdev->reg_base + RTC_ALRM));
xlnx_rtc_alarm_irq_enable(dev, alrm->enabled); xlnx_rtc_alarm_irq_enable(dev, alrm->enabled);
...@@ -227,6 +220,7 @@ static int xlnx_rtc_probe(struct platform_device *pdev) ...@@ -227,6 +220,7 @@ static int xlnx_rtc_probe(struct platform_device *pdev)
return PTR_ERR(xrtcdev->rtc); return PTR_ERR(xrtcdev->rtc);
xrtcdev->rtc->ops = &xlnx_rtc_ops; xrtcdev->rtc->ops = &xlnx_rtc_ops;
xrtcdev->rtc->range_max = U32_MAX;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment