Commit da4d3d6b authored by Alexandru Tachici's avatar Alexandru Tachici Committed by Jonathan Cameron
Browse files

iio: adc: ad-sigma-delta: Allow custom IRQ flags



Before this patch the ad_sigma_delta implementation hardcoded
the irq trigger type to low, assuming that all Sigma-Delta ADCs
have the same interrupt-type.

This patch allows all drivers using the ad_sigma_delta layer to set the
irq trigger type to the one specified in the datasheet.

Signed-off-by: default avatarAlexandru Tachici <alexandru.tachici@analog.com>
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent a4e6f40c
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -9,6 +9,7 @@
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/err.h>
#include <linux/interrupt.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/regulator/consumer.h>
@@ -224,6 +225,7 @@ static const struct ad_sigma_delta_info ad7124_sigma_delta_info = {
	.addr_shift = 0,
	.read_mask = BIT(6),
	.data_reg = AD7124_DATA,
	.irq_flags = IRQF_TRIGGER_LOW,
};

static int ad7124_set_channel_odr(struct ad7124_state *st,
+1 −0
Original line number Diff line number Diff line
@@ -203,6 +203,7 @@ static const struct ad_sigma_delta_info ad7780_sigma_delta_info = {
	.set_mode = ad7780_set_mode,
	.postprocess_sample = ad7780_postprocess_sample,
	.has_registers = false,
	.irq_flags = IRQF_TRIGGER_LOW,
};

#define AD7780_CHANNEL(bits, wordsize) \
+1 −0
Original line number Diff line number Diff line
@@ -205,6 +205,7 @@ static const struct ad_sigma_delta_info ad7791_sigma_delta_info = {
	.has_registers = true,
	.addr_shift = 4,
	.read_mask = BIT(3),
	.irq_flags = IRQF_TRIGGER_LOW,
};

static int ad7791_read_raw(struct iio_dev *indio_dev,
+1 −0
Original line number Diff line number Diff line
@@ -206,6 +206,7 @@ static const struct ad_sigma_delta_info ad7793_sigma_delta_info = {
	.has_registers = true,
	.addr_shift = 3,
	.read_mask = BIT(6),
	.irq_flags = IRQF_TRIGGER_LOW,
};

static const struct ad_sd_calib_data ad7793_calib_arr[6] = {
+1 −1
Original line number Diff line number Diff line
@@ -500,7 +500,7 @@ static int ad_sd_probe_trigger(struct iio_dev *indio_dev)

	ret = request_irq(sigma_delta->spi->irq,
			  ad_sd_data_rdy_trig_poll,
			  IRQF_TRIGGER_LOW,
			  sigma_delta->info->irq_flags,
			  indio_dev->name,
			  sigma_delta);
	if (ret)
Loading