]> git.ipfire.org Git - thirdparty/linux.git/commit
rtc: zynqmp: rework read_offset
authorTomas Melin <tomas.melin@vaisala.com>
Thu, 22 Jan 2026 13:53:47 +0000 (13:53 +0000)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Thu, 29 Jan 2026 15:44:37 +0000 (16:44 +0100)
commit0f9989443faec6ae8b8418ddf39f080c75a23c0d
tree29f6debde3ef522a73a4ac7d37d8fb312f254a59
parent83b9e5eb043710190f6461729fa2e05320a6594d
rtc: zynqmp: rework read_offset

read_offset() was using static frequency for determining
the tick offset. It was also using remainder from do_div()
operation as tick_mult value which caused the offset to be
incorrect.

At the same time, rework function to improve readability.
It is worth noting, that due to rounding errors, the offset
readback will differ slightly for positive and negative
calibration values.

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-3-d4edb966b499@vaisala.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
drivers/rtc/rtc-zynqmp.c