Re: [PATCH v4 09/15] rtc: rzn1: Dynamically calculate synchronization delay based on clock rate

Wolfram Sang <[email protected]>
Newsgroups org.kernel.vger.linux-renesas-soc,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-kernel,org.kernel.vger.linux-rtc
Message-ID <aoWqxdIpvTP8zoOX@shikoro>
On Wed, Aug 19, 2026 at 11:39:20AM +0100, Prabhakar wrote:
> From: Lad Prabhakar <[email protected]>
> 
> Replace the hardcoded hardware synchronization delays with a calculated
> time window derived from the operating sub-clock frequency.
> 
> The driver currently hardcodes microsecond ranges assuming a fixed
> sub-clock frequency of 32.768 kHz. Newer SoC variants, such as the
> RZ/T2H, drive this hardware block using a much faster clock rate
> (~195.3 kHz). Hardcoding these wait windows forces faster blocks to
> over-sleep, introducing unnecessary delays during clock initialization
> and register configuration.
> 
> Calculate the duration of the required clock cycles in microseconds based
> on the runtime clock rate, and store this value in the driver private
> structure to adjust the usleep_range() and readl_poll_timeout() boundaries
> dynamically.
> 
> Signed-off-by: Lad Prabhakar <[email protected]>

Reviewed-by: Wolfram Sang <[email protected]>
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEEOZGx6rniZ1Gk92RdFA3kzBSgKbYFAmqFqsUACgkQFA3kzBSg
KbZOhQ/+OY9Bs8UorEFJzw5Frq4e5XZAk7OR/yVPNLRp80JPXpnP2Y5dbFCRG+5j
aGiwliOSbJkxJb1XITplfEUXcYOL6E5buEyUBGiG9jWo2RY7gfq9Lda2sIW/0Pwx
ygEpuGauclElmjGkDCHYO8iVw+K5+Iew68zYJ/5AECmVVVfHroVcgH8LyLnLvNsN
V3Qgbr/WZeKC1LnwEBpvGUPebEQlgvitz08ZF1adhssRInAwT2NtYKjZl1Ltsp8d
EkHlSwEY1NuhF3bltnmClEYIFqd8wA+Ci0ueAAxz1g6+W7nQ5vvg7JAZ36uhCuh5
y8BD2K3V6nTGffqpZI+oP10mb7VQiHpzZ4Jv2CM2HBmgZ+U6JDPpahvXdxytoDbD
tIyj1hBFlYZ37/gaN798El0BOX0b0OPsYCppcQ7i3tHPgdXlCSLfXgoW0sLKLn2S
hc6PBGkk7Ek9+2UZwe4Xl3QEPX/b7+w/6Gk1G/JSzSUPNUhs2regTMsZbRDLgirZ
zWlR2M+dQWw8cMNDEiFKCPvnvShOAZTA3cOazpSY8THY2yIg1LT2dUEru9KuZBE6
nsCoOzNT5fCfictfeW+zqwyvvHAf6n1VSXaZa40NZeyxGZc5LaYwAGenTh4RChTU
deBtPtshL1xp0xw5RoJk8vW4HvyoX3bkKFUWrwWJYLRvGSFaCRk=
=orpP
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.