Re: [PATCH v5 02/11] mfd: Add max7360 support

Mathieu Dubois-Briand
2025-03-25T16:26:16Z

On Wed Mar 19, 2025 at 12:10 PM CET, Andy Shevchenko wrote:
> On Tue, Mar 18, 2025 at 05:26:18PM +0100, mathieu.dubois-briand@bootlin.com wrote:
> > From: Kamel Bouhara <kamel.bouhara@bootlin.com>
> > + ret = max7360_mask_irqs(regmap);
> > + if (ret)
> > + return dev_err_probe(dev, ret, "Could not mask interrupts\n");
>
> Hmm... As far as I can read this masks GPIO interrups. Does it do anything
> else? If it's covered by the GPIO/pin control drivers, one want probably to
> see that to be done there in the respective callback (init_hw_irq or alike,
> I don't remember the name by heart).
>

Hum, I'm not sure I can do that.

So the "inti" interrupt line is shared across the GPIO and the rotary
encoder functionalities.

On reset, GPIO interrupts are not masked. This means, if we do the
masking in the GPIO driver and the GPIO driver is not loaded but the
rotary encoder driver is, the rotary encoder driver might get a lot of
spurious interrupts.

So I believe it makes sense to mask the interrupts here, setting the
chip in a sane configuration, whatever child drivers are present.

Any thought about that?

--
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering