Re: [PATCH v3 3/4] iio: accel: mma8452: Only apply trigger type when not set by firmware

From: Esben Haabendal

Date: Wed Aug 12 2026 - 09:30:50 EST


"Andy Shevchenko" <andriy.shevchenko@xxxxxxxxx> writes:

> On Wed, Aug 05, 2026 at 09:21:37AM +0200, Esben Haabendal wrote:
>> Instead of unconditionally overriding the trigger type, it is better to
>> only apply a default when no trigger type is set by firmware. This should
>> be reasonably backward compatible, and should only potentially cause
>> problems if systems exist where firmware specifies an incorrect trigger
>> type. With a bit of luck, there are no such systems.
>
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxx>
>
> ...
>
>> if (client->irq) {
>> + unsigned long irq_flags;
>> +
>> + irq_flags = irq_get_trigger_type(client->irq);
>> + if (irq_flags == IRQ_TYPE_NONE)
>> + irq_flags = IRQF_TRIGGER_LOW;
>
> I would even add info message or so that FW lacks of the proper IRQ type.
> But it's up to you, most of the code that I saw and does something similar
> does not print anything in this case.

I agree. That seems like a nice improvement. I will add that for v4.

>> + irq_flags |= IRQF_ONESHOT;
>> ret = request_threaded_irq(client->irq, NULL, mma8452_interrupt,
>> - IRQF_TRIGGER_LOW | IRQF_ONESHOT,
>> - client->name, indio_dev);
>> + irq_flags, client->name, indio_dev);

/Esben