Re: [PATCH v1] mfd: core: Support auxiliary device

From: Andy Shevchenko
Date: Thu Apr 03 2025 - 10:24:52 EST


On Thu, Apr 03, 2025 at 05:16:51PM +0300, Andy Shevchenko wrote:
> On Thu, Apr 03, 2025 at 03:02:47PM +0100, Greg KH wrote:
> > On Thu, Apr 03, 2025 at 04:30:53PM +0530, Raag Jadav wrote:

...

> > > 2. Should we allow auxiliary drivers to manage their own resources
> > > (MEM, IO, IRQ etc)?
> >
> > The resources are all shared by the "parent" device, that's what makes
> > aux drivers work, they need to handle this as there is no unique way to
> > carve up the resources here.
> >
> > So I don't know how you would do this, sorry.
>
> I think we should simply enforce the requirement that MFD on AUX bus must use
> regmap. This will solve the serialisation and common access to the resources.

That said, make an additional API call like

dev_mfd_add_aux_devices() which should enforce new infrastructure and convert
drivers one by one. Also with that you may add a warning to the existing (PCI)
drivers that are using old API

if (dev_is_pci(parent))
dev_warn(parent, "Uses old API, please switch to ...\n");

--
With Best Regards,
Andy Shevchenko