Re: [PATCH v3 08/12] 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 <aoQ4nMR-NeV3FFz9@ninjato>
> -		/* Wait for the counter to stop: two 32k clock cycles */
> -		usleep_range(61, 100);
> +		/* Wait for the counter to stop: two RTC_PCLK clock cycles */
> +		usleep_range(rtc->sync_time, rtc->sync_time + 100);

Hmm, 100 seems more arbitrary here than in the original code? Maybe 2 *
sync_time like below?

> @@ -444,12 +445,20 @@ static int rzn1_rtc_probe(struct platform_device *pdev)
>  			scmp_val = RZN1_RTC_CTL0_SLSB_SCMP;
>  	}
>  
> +	/*
> +	 * The internal clock counter operates in synchronization with the
> +	 * RTC_PCLK clock. Calculate the duration of two RTC_PCLK clock
> +	 * cycles in microseconds required for operations to complete.
> +	 */

Too wordy, this is enough IMHO:

/* Calculate the duration of two RTC_PCLK clock cycles */

Rest looks good.
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEEOZGx6rniZ1Gk92RdFA3kzBSgKbYFAmqEOJwACgkQFA3kzBSg
KbataA//Yf+2NLeqnhZfKJmbr5z5abrTuxN1FXS3uVqY/kCQIpPeJ7n3V6xzZkqp
gWKGMmlp29O6nRvWhUJnMpVokdvW3+UBmbQ21wgDh2YXyuAMcjEbuc3hXJPWhuWu
uVhBoY5AMAyEDtrFRxZuRIorDwI/+lcQgLu4z3njvfQD2iwXlIAQ+1rXRtRdp8Wv
jlILModlFe8VxnRKWeuUn2bUDj/D9ftIyOOhV0crHg/NJR1bl/tTpJTfrTsy7Flb
eqR/aRGcz4OmZ51MAc/UyZak8N2S1FnbLG0Gam2+wxx9f8jlqnmawAoRv/l9jixL
MYKSZXmHPNrgzz4s2jAhAbfQ8wHO8GF0XPaEXngRzl066AYvyrplWTKR+a9sb8On
BWUQtcWBVYpWKz7m9ShRbhXIxonD+LCaBDYWIA6xJf4s8w3AxNekOnCL7stppk0W
4aADgDCw51F96wyry72W4XihfdM9yR+Gby9hJVl8eJ+fF7H9j0+BCDKrM9h8ODc/
rSkuMXKTbMVYveRiMzDiaRyphpo/pAkm3sN06GxSm8r1lkhX1P3TgQuzBowodInB
30BbOKWmM3Iuwc+aJw3THw7xL/jSUTKmz4Q/wbUjakNd/LprZwl9EwfVrQuPfQIv
euNCz9p2zux8VqYfQg5hirndIIn+PKsPTflNPKWrkWWOu3xbiWc=
=i3HC
-----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.