diff options
| author | Javier Viguera <[email protected]> | 2026-03-10 13:20:07 +0100 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2026-04-13 15:24:24 -0600 |
| commit | c8afe949d3dd5b2a2adb0e4f476372f2df8512de (patch) | |
| tree | 4a47840dc10a1584f8e59686ea3907e90e72497d | |
| parent | e2fa3e570f83ab0f9ce667ddaec9dc738bcf05b9 (diff) | |
rtc: rv3028: fix PORF flag not being cleared
The current code sets RV3028_STATUS_PORF instead of clearing it, so the
flag remains asserted. Use dm_i2c_reg_clrset() to clear the bit.
Signed-off-by: Javier Viguera <[email protected]>
| -rw-r--r-- | drivers/rtc/rv3028.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/drivers/rtc/rv3028.c b/drivers/rtc/rv3028.c index b14d2a246ff..4e05ef8de2a 100644 --- a/drivers/rtc/rv3028.c +++ b/drivers/rtc/rv3028.c @@ -130,7 +130,6 @@ static int rv3028_rtc_get(struct udevice *dev, struct rtc_time *tm) static int rv3028_rtc_set(struct udevice *dev, const struct rtc_time *tm) { u8 regs[RTC_RV3028_LEN]; - u8 status; int ret; debug("%s: %4d-%02d-%02d (wday=%d( %2d:%02d:%02d\n", @@ -157,13 +156,7 @@ static int rv3028_rtc_set(struct udevice *dev, const struct rtc_time *tm) return ret; } - ret = dm_i2c_read(dev, RV3028_STATUS, &status, 1); - if (ret < 0) { - printf("%s: error reading RTC status: %x\n", __func__, ret); - return -EIO; - } - status |= RV3028_STATUS_PORF; - return dm_i2c_write(dev, RV3028_STATUS, &status, 1); + return dm_i2c_reg_clrset(dev, RV3028_STATUS, RV3028_STATUS_PORF, 0); } static int rv3028_rtc_reset(struct udevice *dev) |
