diff options
| author | Tom Rini <[email protected]> | 2026-07-29 14:51:17 -0600 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2026-07-29 14:51:17 -0600 |
| commit | 06c49ce4f1870718321bb502671c2ed0a42fd15e (patch) | |
| tree | 27ffc023643743e95cdee010c4ba3d692aa829ce | |
| parent | f6a37207b84342441ed8af4226cd85048931cc61 (diff) | |
| parent | 9811c57b2e01398c6f8ba29a63d93edd4ffe6482 (diff) | |
Merge patch series "rtc: pcf8563: HYM8563 support and unreliable-time reporting"
Daniel Golle <[email protected]> says:
The Haoyu HYM8563, found for example on the Radxa ROCK 5B, is a clone of
the NXP PCF8563 with an identical timekeeping register layout, but the
pcf8563 driver does not match its compatible used in upstream DT.
Boards fitted with it end up without DM_RTC and, as a consequence,
without usable EFI GetTime and SetTime runtime services. On top of
that, when the chip reports that the time may be unreliable after a
supply voltage drop, the driver returns a bare -1, which callers
interpret as -EPERM rather than as invalid data.
This series makes the existing driver serve the HYM8563 and lets callers
distinguish an unreliable time from a permission problem.
The driver gains the additional compatible string and returns -EINVAL
when the voltage-low flag is set, matching the rv3032 driver and the
behaviour of the Linux driver for the same chips.
Link: https://lore.kernel.org/r/[email protected]
| -rw-r--r-- | drivers/rtc/pcf8563.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/rtc/pcf8563.c b/drivers/rtc/pcf8563.c index 03bef68051b..b20666e8b4a 100644 --- a/drivers/rtc/pcf8563.c +++ b/drivers/rtc/pcf8563.c @@ -16,6 +16,7 @@ #include <log.h> #include <rtc.h> #include <i2c.h> +#include <linux/errno.h> #if !CONFIG_IS_ENABLED(DM_RTC) static uchar rtc_read (uchar reg); @@ -144,7 +145,7 @@ static int pcf8563_rtc_get(struct udevice *dev, struct rtc_time *tmp) if (sec & 0x80) { puts("### Warning: RTC Low Voltage - date/time not reliable\n"); - rel = -1; + rel = -EINVAL; } tmp->tm_sec = bcd2bin(sec & 0x7F); @@ -213,6 +214,7 @@ static const struct rtc_ops pcf8563_rtc_ops = { static const struct udevice_id pcf8563_rtc_ids[] = { { .compatible = "nxp,pcf8563" }, + { .compatible = "haoyu,hym8563" }, { } }; |
