Re: [PATCH v8 1/7] mfd: Add core driver for Nuvoton NCT6694

From: Lee Jones
Date: Fri Apr 04 2025 - 10:22:32 EST


On Wed, 26 Mar 2025, Ming Yu wrote:

> Lee Jones <lee@xxxxxxxxxx> 於 2025年3月20日 週四 下午10:50寫道:
> >
> ...
> > > > > + MFD_CELL_BASIC("gpio-nct6694", NULL, NULL, 0, 0x1),
> > > >
> > > > IDs are usually given in base-10.
> > > >
> > >
> > > Fix it in v9.
> > >
> > > > Why are you manually adding the device IDs?
> > > >
> > > > PLATFORM_DEVID_AUTO doesn't work for you?
> > > >
> > >
> > > I need to manage these IDs to ensure that child devices can be
> > > properly utilized within their respective modules.
> >
> > How? Please explain.
> >
> > This numbering looks sequential and arbitrary.
> >
> > What does PLATFORM_DEVID_AUTO do differently such that it is not useful?
> >
>
> As far as I know, PLATFORM_DEVID_AUTO assigns dynamic IDs to devices,
> but I need fixed IDs.
> For example, the GPIO driver relies on these IDs to determine the
> group, allowing the firmware to identify which GPIO group to operate
> on through the API.

PLATFORM_DEVID_AUTO will allocate IDs 0 through 16, the same as you've
done here. These lines do not have any differentiating attributes, so
either way we are not allocating specific IDs to specific pieces of the
H/W. I still do not understand why you need to allocate them manually.

> > > > > + MFD_CELL_BASIC("gpio-nct6694", NULL, NULL, 0, 0x2),
> > > > > + MFD_CELL_BASIC("gpio-nct6694", NULL, NULL, 0, 0x3),
> > > > > + MFD_CELL_BASIC("gpio-nct6694", NULL, NULL, 0, 0x4),
> > > > > + MFD_CELL_BASIC("gpio-nct6694", NULL, NULL, 0, 0x5),
> > > > > + MFD_CELL_BASIC("gpio-nct6694", NULL, NULL, 0, 0x6),
> > > > > + MFD_CELL_BASIC("gpio-nct6694", NULL, NULL, 0, 0x7),
> > > > > + MFD_CELL_BASIC("gpio-nct6694", NULL, NULL, 0, 0x8),
> > > > > + MFD_CELL_BASIC("gpio-nct6694", NULL, NULL, 0, 0x9),
> > > > > + MFD_CELL_BASIC("gpio-nct6694", NULL, NULL, 0, 0xA),
> > > > > + MFD_CELL_BASIC("gpio-nct6694", NULL, NULL, 0, 0xB),
> > > > > + MFD_CELL_BASIC("gpio-nct6694", NULL, NULL, 0, 0xC),
> > > > > + MFD_CELL_BASIC("gpio-nct6694", NULL, NULL, 0, 0xD),
> > > > > + MFD_CELL_BASIC("gpio-nct6694", NULL, NULL, 0, 0xE),
> > > > > + MFD_CELL_BASIC("gpio-nct6694", NULL, NULL, 0, 0xF),
>
>
> Thanks,
> Ming

--
Lee Jones [李琼斯]