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

Andy Shevchenko
2025-03-25T16:40:39Z

On Tue, Mar 25, 2025 at 05:26:12PM +0100, Mathieu Dubois-Briand wrote:
> 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?

Okay, this makes sense. I forgot if you have any comment in the code
(probably not if I asked the question), but in any case the above can
be added on top of the function explaining this.

--
With Best Regards,
Andy Shevchenko