summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas Melin <tomas.melin@vaisala.com>2026-01-22 16:53:45 +0300
committerAlexandre Belloni <alexandre.belloni@bootlin.com>2026-01-29 18:44:37 +0300
commit2724fb4d429cbb724dcb6fa17953040918ebe3a2 (patch)
tree9fd25a1ef1a7489e184b382a9033fcd266a673b4
parent1932db202c9326747c6046959284992ab4124bac (diff)
downloadlinux-2724fb4d429cbb724dcb6fa17953040918ebe3a2.tar.xz
rtc: zynqmp: correct frequency value
Fix calibration value in case a clock reference is provided. The actual calibration value written into register is frequency - 1. Reviewed-by: Harini T <harini.t@amd.com> Tested-by: Harini T <harini.t@amd.com> Signed-off-by: Tomas Melin <tomas.melin@vaisala.com> Acked-by: Michal Simek <michal.simek@amd.com> Link: https://patch.msgid.link/20260122-zynqmp-rtc-updates-v4-1-d4edb966b499@vaisala.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-rw-r--r--drivers/rtc/rtc-zynqmp.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/rtc/rtc-zynqmp.c b/drivers/rtc/rtc-zynqmp.c
index 3baa2b481d9f..856bc1678e7d 100644
--- a/drivers/rtc/rtc-zynqmp.c
+++ b/drivers/rtc/rtc-zynqmp.c
@@ -345,7 +345,10 @@ static int xlnx_rtc_probe(struct platform_device *pdev)
&xrtcdev->freq);
if (ret)
xrtcdev->freq = RTC_CALIB_DEF;
+ } else {
+ xrtcdev->freq--;
}
+
ret = readl(xrtcdev->reg_base + RTC_CALIB_RD);
if (!ret)
writel(xrtcdev->freq, (xrtcdev->reg_base + RTC_CALIB_WR));