[RFT PATCH v2 06/14] gpio: regmap: add helpers to add a regmap-irq chip
Andy Shevchenko
andriy.shevchenko at linux.intel.com
Fri Nov 27 10:43:03 PST 2026
On Fri, Nov 27, 2026 at 03:52:23PM +0100, Michael Walle wrote:
> The most common use-case is to use regmap-irq together with gpio-regmap.
> To make life easier for that and to avoid code duplication, add helpers
> to create and attach a regmap-irq domain. These helpers are intended to
> be called by the new .create_irq_domain() callback.
>
> gpio_regmap_add_irq_chip() locks the GPIO line while its interrupt is
> requested. This assumes that the hwirq numbers match the GPIO offsets.
> If a driver doesn't follow that, there is one without the locking called
> gpio_regmap_add_irq_chip_nolock().
Hmm... Can't we simply have a boolean flag instead in GPIO regmap configuration
and just distinguish it inside the common helper?
...
> +/**
> + * gpio_regmap_add_irq_chip_nolock() - Add a regmap-irq chip without line locking
> + * @gpio: gpio_regmap device
> + * @irq: the parent interrupt
> + * @irq_flags: the IRQF_ flags to use for @irq
> + * @chip: the regmap-irq chip description
> + *
> + * Same as gpio_regmap_add_irq_chip() but doesn't lock the GPIO lines.
> + * Can be used if the hwirq numbers of the regmap-irq chip don't match
> + * the GPIO offsets.
> + *
> + * Return: irq_domain or an ERR_PTR() error value.
Okay, this might justify returning error pointer, but irq_domain_create_*()
shadows that with NULL, which questions the usefulness of it (the error code).
I'm fine with either approach but still tend towards using
irq_domain_create_*() helpers instead their open coded variants.
On the other hand there is no much win, especially if you replace
info = {};
info.XXX = ...;
... = irq_domain_instantiate(&info);
with direct assignment as it's done inside irq_domain_create_*(),
> + */
--
With Best Regards,
Andy Shevchenko
More information about the linux-arm-kernel
mailing list