Re: [PATCH v1 1/2] mfd: mt6397: Add new bit definitions for RTC_BBPU register

From: Giorgi Tchankvetadze
Date: Mon Aug 11 2025 - 07:21:52 EST


Cc: Krzysztof Kozlowski <krzk@xxxxxxxxxx>,
linux-mediatek@xxxxxxxxxxxxxxxxxxx,
linux-rtc@xxxxxxxxxxxxxxx,
linux-kernel@xxxxxxxxxxxxxxx

Shunxi,

Can you confirm whether `RTC_BBPU_PWREN` (bit 0),
`RTC_BBPU_CLR` (bit 1) and `RTC_BBPU_RESET_AL` (bit 3) are documented
in the MT6397 datasheet (please cite section/page)? They look like
standard RTC controls (power enable, clear/reset, alarm reset) and
might be useful to include, but I agree with Krzysztof that adding
definitions with no users can accumulate technical debt.

Suggestion: either
- add the definitions when a driver actually needs them, or
- keep them now but add a short rationale in the commit message
(datasheet reference + intended use) so future reviewers understand
why they exist.

Also: please split cosmetic whitespace fixes (RTC_BBPU_KEY) into a
separate patch to make review/merge easier.

Thanks for the patch; I’m following the thread.

— Giorgi


On Mon, Aug 11, 2025 at 3:03 PM Krzysztof Kozlowski <krzk@xxxxxxxxxx> wrote:
>
> On 11/08/2025 10:15, ot_shunxi.zhang@xxxxxxxxxxxx wrote:
> > From: Shunxi Zhang <ot_shunxi.zhang@xxxxxxxxxxxx>
> >
> > This patch adds new bit definitions for the RTC_BBPU register in the
>
> Why? There is no user of these. Don't add useless defines.
>
> > mt6397 RTC header file. The following bit definitions are introduced:
>
> Hm?
>
> >
> > Signed-off-by: Shunxi Zhang <ot_shunxi.zhang@xxxxxxxxxxxx>
> > ---
> > include/linux/mfd/mt6397/rtc.h | 5 ++++-
> > 1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/include/linux/mfd/mt6397/rtc.h b/include/linux/mfd/mt6397/rtc.h
> > index 27883af44f87..001cef6b7302 100644
> > --- a/include/linux/mfd/mt6397/rtc.h
> > +++ b/include/linux/mfd/mt6397/rtc.h
> > @@ -15,8 +15,11 @@
> > #include <linux/rtc.h>
> >
> > #define RTC_BBPU 0x0000
> > +#define RTC_BBPU_PWREN BIT(0)
> > +#define RTC_BBPU_CLR BIT(1)
> > +#define RTC_BBPU_RESET_AL BIT(3)
> > #define RTC_BBPU_CBUSY BIT(6)
> > -#define RTC_BBPU_KEY (0x43 << 8)
> > +#define RTC_BBPU_KEY (0x43 << 8)
>
>
> Why?
>
>
>
> Best regards,
> Krzysztof
>