Re: [PATCH 2/2] iio: accel: mma8452: Allow open drain interrupt pin configuration
From: Andy Shevchenko
Date: Wed Jul 15 2026 - 04:45:10 EST
On Wed, Jul 15, 2026 at 10:07:39AM +0200, Esben Haabendal wrote:
> When sharing interrupt line with other chips, the interrupt pin most
> likely needs to be configured in open-drain mode instead of push-pull.
> If this is needed, you must add drive-open-drain property to the
> device-tree.
...
> if (client->irq) {
> ret = request_threaded_irq(client->irq, NULL, mma8452_interrupt,
> - IRQF_TRIGGER_LOW | IRQF_ONESHOT,
> + IRQF_TRIGGER_LOW | IRQF_ONESHOT |
> + data->open_drain ? IRQF_SHARED : 0,
> client->name, indio_dev);
Why do we care? The (hidden) problem this will have in the future is that
the IRQ core will splat a warning in case that other shared IRQs might be
configured with different flags. Putting that flag conditionally makes it
a mine field for the users. Instead just unconditionally add that flag and
we will get reports as soon as there will be a user that shares the same
interrupt pin with some other devices which drivers do not use the same
settings.
Also setting to _LOW in the flags unconditionally is a (historic) bug.
The problem is that we might not fix it without breaking the existing
users which omit that flag in DT.
--
With Best Regards,
Andy Shevchenko