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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 Dec 2022 12:14:29 +0000 (13:14 +0100)
commitde3e358912ec8fb6dbbf9c53c6c8ca7f4f68647e
tree15b54ebbd33ff401845f590579dba2386c257418
parent994243de7a6160688aa3a3f00379f093ac1aada6
iio: adis: handle devices that cannot unmask the drdy pin

[ Upstream commit 31fa357ac809affd9f9a7d0b5d1991951e16beec ]

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>
Stable-dep-of: 99c05e4283a1 ("iio: adis: add '__adis_enable_irq()' implementation")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/iio/imu/adis.c
drivers/iio/imu/adis_trigger.c
include/linux/iio/imu/adis.h