Re: [PATCH v4 13/15] rtc: rzn1: Add OF match data to gate SUBU register access
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 | <aobjCr7ZtpLmL3VP@ninjato> |
On Wed, Aug 19, 2026 at 11:39:24AM +0100, Prabhakar wrote: > From: Lad Prabhakar <[email protected]> > > The RZ/N1 RTC driver selects SCMP mode only when an optional xtal clock > is provided at a valid rate other than 32768 Hz. Without an xtal clock, > or when it runs at 32768 Hz, the driver uses SUBU mode. > > However, the RTCA0SUBU register used by SUBU mode is not present on all > SoCs that integrate a similar variant of the RTC block. Allowing SUBU > mode on those variants would expose RTC offset operations that access a > non-existent register. > > Add OF match data to describe whether the RTC supports the SUBU register. > Reject probe with -EOPNOTSUPP when SUBU mode would be selected on a > variant without SUBU support. > > Signed-off-by: Lad Prabhakar <[email protected]> Suggested-by: Wolfram Sang <[email protected]> I still think, this code needs a change: 454 if (rate != 32768) 455 scmp_val = RZN1_RTC_CTL0_SLSB_SCMP; if (rate != 32768 || !data->has_subu) otherwise having a xtal with 32768 on a SCMP-only device will not be accepted despite it should work. Haven't checked if that could simplify your later has_subu-check or not.
signature.asc
(application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEOZGx6rniZ1Gk92RdFA3kzBSgKbYFAmqG4wYACgkQFA3kzBSg KbbT3g//eDPd2vocikzCHllx9NDlhDYNBdNzSLAnbdJV+Fyazo96+R+WS5lQG13X Du2S1c+EWvJzzAwhM2shDnJBTsWAl1RLkRhDsP7XQ+CyRygbrVV8vvCxvtwZGQVG oIFHhZd0srm6lHKQJZvyHUz8su37Gib2rbuQMH6720GuVqU2b6sNuLnc1VoCgV2U n1v6ooNrVoEoHgccI7b6j/+DVcSHWWP0Qigj/R23yQ3Jzt5Jvz0aV828yRXk9KHX taiw1xHhIjDZnCwKNQ8ymTXk/lX92Cj0c1JUhy4LJMpeaB/7u5VQpcWkGFryR7bU iuUIEZFIpV+fhCYFQZqrDM/R10nX6Scnf1eIHPzz55GoAjP4YSUbIspOZuSeg2nS gOCO/uribzeQvTObAFpfr0AHWW1Q4p+Ki+/jY8NlJpc9u+cJmBL70d/0/3OhvrLs S9U6eBDZn6wnxrfG8MYYs1ZQh9tcFVpFdOXO9spdZD9Z80zC4Fk+/DtHdBF/jqgv SWdyHguq74w/SnSxKVkfv9VSU9CHFrBofWtRj4kwxKdOaZ+a+70DTMwIvFPzM/Ye tqfHWApbIfPykcm29F0X37ctaLL3jyZ02/gYgJytMUCXKX4RmHblE5vrQT7evice eBIwObAKldiHzKY6yZ7nAky/R0n26To/KTwy/IOTYqD+OgU+yeM= =Nnnz -----END PGP SIGNATURE-----