[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aAPBHBplhmZ_D0jC@smile.fi.intel.com>
Date: Sat, 19 Apr 2025 18:28:28 +0300
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Raag Jadav <raag.jadav@...el.com>
Cc: gregkh@...uxfoundation.org, david.m.ertman@...el.com,
ira.weiny@...el.com, lee@...nel.org,
mika.westerberg@...ux.intel.com, heikki.krogerus@...ux.intel.com,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3] mfd: core: Support auxiliary device
On Fri, Apr 18, 2025 at 06:04:33PM +0530, Raag Jadav wrote:
> Extend MFD subsystem to support auxiliary child device. This is useful
> for MFD usecases where parent device is on a discoverable bus and doesn't
> fit into the platform device criteria. Purpose of this implementation is
> to provide discoverable MFDs just enough infrastructure to register
> independent child devices with their own memory and interrupt resources
> without abusing the platform device.
>
> Current support is limited to just PCI type MFDs, but this can be further
> extended to support other types like USB in the future.
> create mode 100644 include/linux/mfd/aux.h
...
> config MFD_CORE
> tristate
> + select AUXILIARY_BUS
> select IRQ_DOMAIN
> default n
Can be dropped. It's the default 'default' and with user invisible
configuration, it makes even less sense.
...
> +/*
> + * Common structure between MFD parent and auxiliary child device.
> + * To be used by leaf drivers to access child device resources.
> + */
> +struct mfd_aux_device {
> + struct auxiliary_device auxdev;
> + struct resource mem;
> + struct resource irq;
> + /* Place holder for other types */
> + struct resource ext;
I don't like it. It's no-scalable solution, just make it VLA. Each resource
already has type in case one needs to extract an exact one, also this won't
work in case of the two resources for memory or IRQ needed.
> +};
...
> +/* TODO: Convert the platform device abusers and remove this flag */
> +#define MFD_AUX_TYPE BIT(31)
Yeah, LKP wants this to be signed... Or 'id' to be unsigned.
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists