]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
staging:iio:cdc:ad7150: Simplify event handling by only using rising direction.
authorJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 14 Mar 2021 18:14:54 +0000 (18:14 +0000)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Wed, 7 Apr 2021 07:36:36 +0000 (08:36 +0100)
The event line is active high and not maskable within the device.
It indicates current state directly.

The device supports separate rising and falling thresholds so rather
than trying to using each bound to detect in both directions just use
IRQF_TRIGGER_RISING.  If a user wants to detect the value falling
back below the threshold, then set the falling threshold appropriately.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Link: https://lore.kernel.org/r/20210314181511.531414-8-jic23@kernel.org
drivers/staging/iio/cdc/ad7150.c

index 539beed1a511d8b3440ab78400a558e5a34f3d02..34e6afe52f0ef897ee4e5fd2981693ef84de1d87 100644 (file)
@@ -603,7 +603,6 @@ static int ad7150_probe(struct i2c_client *client,
                                                NULL,
                                                &ad7150_event_handler,
                                                IRQF_TRIGGER_RISING |
-                                               IRQF_TRIGGER_FALLING |
                                                IRQF_ONESHOT,
                                                "ad7150_irq1",
                                                indio_dev);