[PATCH] rtc: rv3028: fix PORF flag not being cleared

Tom Rini trini at konsulko.com
Tue Apr 7 17:45:11 CEST 2026


On Tue, Apr 07, 2026 at 01:15:49PM +0000, Viguera, Javier wrote:

> Hi Tom,
> 
> Any comment for this patch?

Thanks for the ping. I had mis-identified it as a rockchip patch (for
clearly wrong now reasons). I'll take a look soon.

> 
> --
> Regards,
> Javier Viguera
> ________________________________
> From: Viguera, Javier
> Sent: Tuesday, March 10, 2026 13:20
> To: trini at konsulko.com <trini at konsulko.com>; u-boot at lists.denx.de <u-boot at lists.denx.de>
> Subject: [PATCH] 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 <javier.viguera at digi.com>
> ---
>  drivers/rtc/rv3028.c | 9 +--------
>  1 file changed, 1 insertion(+), 8 deletions(-)
> 
> Based on Linux driver:
> https://elixir.bootlin.com/linux/v6.19.6/source/drivers/rtc/rtc-rv3028.c#L338
> 
> diff --git a/drivers/rtc/rv3028.c b/drivers/rtc/rv3028.c
> index b14d2a246ffc..4e05ef8de2a2 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)

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20260407/0e23b1f0/attachment.sig>


More information about the U-Boot mailing list