public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: "Viguera, Javier" <Javier.Viguera@digi.com>
Cc: "u-boot@lists.denx.de" <u-boot@lists.denx.de>
Subject: Re: [PATCH] rtc: rv3028: fix PORF flag not being cleared
Date: Tue, 7 Apr 2026 09:45:11 -0600	[thread overview]
Message-ID: <20260407154511.GZ41863@bill-the-cat> (raw)
In-Reply-To: <BLAPR10MB5156AD27BEA53C46BB17EE08E05AA@BLAPR10MB5156.namprd10.prod.outlook.com>

[-- Attachment #1: Type: text/plain, Size: 2068 bytes --]

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@konsulko.com <trini@konsulko.com>; u-boot@lists.denx.de <u-boot@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@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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

      reply	other threads:[~2026-04-07 15:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-10 12:20 [PATCH] rtc: rv3028: fix PORF flag not being cleared Javier Viguera
2026-04-07 13:15 ` Viguera, Javier
2026-04-07 15:45   ` Tom Rini [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260407154511.GZ41863@bill-the-cat \
    --to=trini@konsulko.com \
    --cc=Javier.Viguera@digi.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox