Re: [PATCH v2 2/3] rtc: Add Cortina Systems CS7542 RTC driver

From: Alexandre Belloni

Date: Mon Nov 23 2026 - 17:08:18 EST


On 24/11/2026 01:00:59+0300, Fil Dunsky wrote:
> Thanks for the review. I have sent v3:
>
> https://lore.kernel.org/all/20261124-b4-cs7542-rtc-v3-0-53902bfbe0ae@xxxxxxxxx/
>
> Probe now leaves the enable/reset state alone. read_time returns EINVAL
> when RTCEN is clear or CLKRST is set, and only set_time enables the clock
> and clears its reset state after programming a known time. I removed
> the redundant rtc_valid_tm call, the two probe messages and the ALARM
> feature clearing.
>
> I also checked the year field and the calendar on Almond+. The vendor
> register definition gives BCDYEAR bits 15:0 to year data, with bits 31:16
> reserved. Using a separate RAM-only range fixture, the hardware passed
> 2099 to 2100, February 28 to March 1 in both 2100 and 2200, and February
> 28 to February 29 in 2400. Century carries into 2200 and 2400 passed too.
> The 1970 and 2038 first-second/boundary checks, year 2000 leap day, and
> 9999-12-31 23:59:58 to 23:59:59 also passed. I therefore changed the
> advertised range to 1970-9999. These are specific boundary tests, not a
> hardware sweep of every year.

So why not 0 to 9999?

>
> An exact-driver RAM run separately checked reprobe with RTCEN disabled
> and CLKRST set: probe preserved control, reads returned EINVAL, and
> setting current UTC enabled the RTC and resumed counting. Each run
> restored current UTC before returning to installed OpenWrt, then I
> verified restoration again from fresh host UTC. Firmware was not flashed.
> Full independent ARM built-in/module builds and source tests passed.
>
> Thanks,
> Fil

--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com