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

set_offset was using remainder of do_div as tick_mult which resulted in
wrong offset. Calibration value also assumed builtin calibration default.
Update fract_offset to correctly calculate the value for
negative offset and replace the for loop with division.

Tested-by: Harini T <harini.t@amd.com>
Signed-off-by: Tomas Melin <tomas.melin@vaisala.com>
Reviewed-by: Harini T <harini.t@amd.com>
Acked-by: Michal Simek <michal.simek@amd.com>
Link: https://patch.msgid.link/20260122-zynqmp-rtc-updates-v4-4-d4edb966b499@vaisala.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
drivers/rtc/rtc-zynqmp.c