iio: adis: handle devices that cannot unmask the drdy pin
authorNuno Sá <nuno.sa@analog.com>
Fri, 3 Sep 2021 14:14:20 +0000 (16:14 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Tue, 19 Oct 2021 07:27:34 +0000 (08:27 +0100)
commit31fa357ac809affd9f9a7d0b5d1991951e16beec
treed3e73050dea1fe8ddf157001298af48c942d59ea
parentb600bd7eb333554518b4dd36b882b2ae58a5149e
iio: adis: handle devices that cannot unmask the drdy pin

Some devices can't mask/unmask the data ready pin and in those cases
each driver was just calling '{dis}enable_irq()' to control the trigger
state. This change, moves that handling into the library by introducing
a new boolean in the data structure that tells the library that the
device cannot unmask the pin.

On top of controlling the trigger state, we can also use this flag to
automatically request the IRQ with 'IRQF_NO_AUTOEN' in case it is set.
So far, all users of the library want to start operation with IRQs/DRDY
pin disabled so it should be fairly safe to do this inside the library.

Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20210903141423.517028-3-nuno.sa@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/imu/adis.c
drivers/iio/imu/adis_trigger.c
include/linux/iio/imu/adis.h