[RFT PATCH 06/13] gpio: max7360: create the regmap-irq chip from the gpio-regmap callback

Michael Walle mwalle at kernel.org
Fri Nov 27 00:59:45 PST 2026


On Thu Nov 26, 2026 at 9:43 PM CET, Andy Shevchenko wrote:
> On Thu, Nov 26, 2026 at 04:35:17PM +0100, Michael Walle wrote:
>> Use the new gpio_regmap_add_irq_chip() helper to create the regmap-irq
>> domain.
>
> ...
>
>> +struct max7360_gpio {
>> +	struct device *dev;
>> +	struct regmap *regmap;
>> +};
>
> Why do we need both? Is regmap created with difference 'dev'?

Because the regmap is fetched from the parent, i.e the MFD. But the
callback still needs the GPIO device for allocations.

I wanted to keep the change as simple as possible and just moved the
whole init section over. But it's even simpler to just set up
everything in probe and then just call gpio_regmap_add_irq_chip() in
the callback, though that brings more fields to struct max7360. But
it makes the code a nicer example.

-michael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 297 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20261127/3877c88f/attachment.sig>


More information about the linux-arm-kernel mailing list