Re: [PATCH v4 1/1] rtc: nuvoton: Compatible with NCT3015Y-R and NCT3018Y-R
From: Alexandre Belloni
Date: Tue Aug 29 2023 - 10:22:52 EST
On 29/08/2023 21:35:36+0800, Minying Lin wrote:
> > Do you really have to check the part number every time you set the time?
> > I don't expect it to change once read in probe.
> >
> [Mia] Due to the 3018Y's topology, we need to set the TWO bit first to
> obtain the write time capability, but the 3015Y does not have this problem.
> Therefore, we use part number & TWO bit to determine whether we need to set
> the TWO bit first before set time.
>
Sure but why don't you store the info somewhere instead of reading it
from the RTC every time?
> >
> > > + if (part_num < 0) {
> > > + dev_dbg(&client->dev, "%s: Failed to read part info
> > reg.\n", __func__);
> > > + return part_num;
> > > + }
> > > +
> >
> > --
> > Alexandre Belloni, co-owner and COO, Bootlin
> > Embedded Linux and Kernel engineering
> > https://bootlin.com
> >
--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com