Skip to content

Commit

Permalink
staging:iio: remove broken support for multiple event interfaces.
Browse files Browse the repository at this point in the history
We don't have a use case for these.  Two drivers appeared to use them
but both report all events on the first.

V2: Remove now irrelevant comment.
V3: Include fixup for adc/ad7280a.c

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Jonathan Cameron authored and Greg Kroah-Hartman committed Sep 6, 2011
1 parent b387406 commit 5aa9618
Show file tree
Hide file tree
Showing 17 changed files with 127 additions and 159 deletions.
13 changes: 6 additions & 7 deletions drivers/staging/iio/accel/lis3l02dq_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ static irqreturn_t lis3l02dq_event_handler(int irq, void *private)
&t);

if (t & LIS3L02DQ_REG_WAKE_UP_SRC_INTERRUPT_Z_HIGH)
iio_push_event(indio_dev, 0,
iio_push_event(indio_dev,
IIO_MOD_EVENT_CODE(IIO_ACCEL,
0,
IIO_MOD_Z,
Expand All @@ -461,7 +461,7 @@ static irqreturn_t lis3l02dq_event_handler(int irq, void *private)
timestamp);

if (t & LIS3L02DQ_REG_WAKE_UP_SRC_INTERRUPT_Z_LOW)
iio_push_event(indio_dev, 0,
iio_push_event(indio_dev,
IIO_MOD_EVENT_CODE(IIO_ACCEL,
0,
IIO_MOD_Z,
Expand All @@ -470,7 +470,7 @@ static irqreturn_t lis3l02dq_event_handler(int irq, void *private)
timestamp);

if (t & LIS3L02DQ_REG_WAKE_UP_SRC_INTERRUPT_Y_HIGH)
iio_push_event(indio_dev, 0,
iio_push_event(indio_dev,
IIO_MOD_EVENT_CODE(IIO_ACCEL,
0,
IIO_MOD_Y,
Expand All @@ -479,7 +479,7 @@ static irqreturn_t lis3l02dq_event_handler(int irq, void *private)
timestamp);

if (t & LIS3L02DQ_REG_WAKE_UP_SRC_INTERRUPT_Y_LOW)
iio_push_event(indio_dev, 0,
iio_push_event(indio_dev,
IIO_MOD_EVENT_CODE(IIO_ACCEL,
0,
IIO_MOD_Y,
Expand All @@ -488,7 +488,7 @@ static irqreturn_t lis3l02dq_event_handler(int irq, void *private)
timestamp);

if (t & LIS3L02DQ_REG_WAKE_UP_SRC_INTERRUPT_X_HIGH)
iio_push_event(indio_dev, 0,
iio_push_event(indio_dev,
IIO_MOD_EVENT_CODE(IIO_ACCEL,
0,
IIO_MOD_X,
Expand All @@ -497,7 +497,7 @@ static irqreturn_t lis3l02dq_event_handler(int irq, void *private)
timestamp);

if (t & LIS3L02DQ_REG_WAKE_UP_SRC_INTERRUPT_X_LOW)
iio_push_event(indio_dev, 0,
iio_push_event(indio_dev,
IIO_MOD_EVENT_CODE(IIO_ACCEL,
0,
IIO_MOD_X,
Expand Down Expand Up @@ -651,7 +651,6 @@ static const struct attribute_group lis3l02dq_attribute_group = {
};

static const struct iio_info lis3l02dq_info = {
.num_interrupt_lines = 1,
.read_raw = &lis3l02dq_read_raw,
.write_raw = &lis3l02dq_write_raw,
.read_event_value = &lis3l02dq_read_thresh,
Expand Down
9 changes: 4 additions & 5 deletions drivers/staging/iio/accel/sca3000_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -815,7 +815,7 @@ static irqreturn_t sca3000_event_handler(int irq, void *private)
sca3000_ring_int_process(val, indio_dev->ring);

if (val & SCA3000_INT_STATUS_FREE_FALL)
iio_push_event(indio_dev, 0,
iio_push_event(indio_dev,
IIO_MOD_EVENT_CODE(IIO_ACCEL,
0,
IIO_MOD_X_AND_Y_AND_Z,
Expand All @@ -824,7 +824,7 @@ static irqreturn_t sca3000_event_handler(int irq, void *private)
last_timestamp);

if (val & SCA3000_INT_STATUS_Y_TRIGGER)
iio_push_event(indio_dev, 0,
iio_push_event(indio_dev,
IIO_MOD_EVENT_CODE(IIO_ACCEL,
0,
IIO_MOD_Y,
Expand All @@ -833,7 +833,7 @@ static irqreturn_t sca3000_event_handler(int irq, void *private)
last_timestamp);

if (val & SCA3000_INT_STATUS_X_TRIGGER)
iio_push_event(indio_dev, 0,
iio_push_event(indio_dev,
IIO_MOD_EVENT_CODE(IIO_ACCEL,
0,
IIO_MOD_X,
Expand All @@ -842,7 +842,7 @@ static irqreturn_t sca3000_event_handler(int irq, void *private)
last_timestamp);

if (val & SCA3000_INT_STATUS_Z_TRIGGER)
iio_push_event(indio_dev, 0,
iio_push_event(indio_dev,
IIO_MOD_EVENT_CODE(IIO_ACCEL,
0,
IIO_MOD_Z,
Expand Down Expand Up @@ -1103,7 +1103,6 @@ static int sca3000_clean_setup(struct sca3000_state *st)
static const struct iio_info sca3000_info = {
.attrs = &sca3000_attribute_group,
.read_raw = &sca3000_read_raw,
.num_interrupt_lines = 1,
.event_attrs = &sca3000_event_attribute_group,
.read_event_value = &sca3000_read_thresh,
.write_event_value = &sca3000_write_thresh,
Expand Down
21 changes: 12 additions & 9 deletions drivers/staging/iio/adc/ad7150.c
Original file line number Diff line number Diff line change
Expand Up @@ -653,30 +653,34 @@ static irqreturn_t ad7150_event_handler(int irq, void *private)

ad7150_i2c_read(chip, AD7150_STATUS, &int_status, 1);

if ((int_status & AD7150_STATUS_OUT1) && !(chip->old_state & AD7150_STATUS_OUT1))
iio_push_event(indio_dev, 0,
if ((int_status & AD7150_STATUS_OUT1) &&
!(chip->old_state & AD7150_STATUS_OUT1))
iio_push_event(indio_dev,
IIO_UNMOD_EVENT_CODE(IIO_IN,
0,
IIO_EV_TYPE_THRESH,
IIO_EV_DIR_RISING),
timestamp);
else if ((!(int_status & AD7150_STATUS_OUT1)) && (chip->old_state & AD7150_STATUS_OUT1))
iio_push_event(indio_dev, 0,
else if ((!(int_status & AD7150_STATUS_OUT1)) &&
(chip->old_state & AD7150_STATUS_OUT1))
iio_push_event(indio_dev,
IIO_UNMOD_EVENT_CODE(IIO_IN,
0,
IIO_EV_TYPE_THRESH,
IIO_EV_DIR_FALLING),
timestamp);

if ((int_status & AD7150_STATUS_OUT2) && !(chip->old_state & AD7150_STATUS_OUT2))
iio_push_event(indio_dev, 0,
if ((int_status & AD7150_STATUS_OUT2) &&
!(chip->old_state & AD7150_STATUS_OUT2))
iio_push_event(indio_dev,
IIO_UNMOD_EVENT_CODE(IIO_IN,
1,
IIO_EV_TYPE_THRESH,
IIO_EV_DIR_RISING),
timestamp);
else if ((!(int_status & AD7150_STATUS_OUT2)) && (chip->old_state & AD7150_STATUS_OUT2))
iio_push_event(indio_dev, 0,
else if ((!(int_status & AD7150_STATUS_OUT2)) &&
(chip->old_state & AD7150_STATUS_OUT2))
iio_push_event(indio_dev,
IIO_UNMOD_EVENT_CODE(IIO_IN,
1,
IIO_EV_TYPE_THRESH,
Expand Down Expand Up @@ -705,7 +709,6 @@ static struct attribute_group ad7150_event_attribute_group = {

static const struct iio_info ad7150_info = {
.attrs = &ad7150_attribute_group,
.num_interrupt_lines = 1,
.event_attrs = &ad7150_event_attribute_group,
.driver_module = THIS_MODULE,
};
Expand Down
9 changes: 4 additions & 5 deletions drivers/staging/iio/adc/ad7280a.c
Original file line number Diff line number Diff line change
Expand Up @@ -691,31 +691,31 @@ static irqreturn_t ad7280_event_handler(int irq, void *private)
if (((channels[i] >> 23) & 0xF) <= AD7280A_CELL_VOLTAGE_6) {
if (((channels[i] >> 11) & 0xFFF) >=
st->cell_threshhigh)
iio_push_event(dev_info, 0,
iio_push_event(dev_info,
IIO_UNMOD_EVENT_CODE(IIO_IN_DIFF,
0,
IIO_EV_TYPE_THRESH,
IIO_EV_DIR_RISING),
iio_get_time_ns());
else if (((channels[i] >> 11) & 0xFFF) <=
st->cell_threshlow)
iio_push_event(dev_info, 0,
iio_push_event(dev_info,
IIO_UNMOD_EVENT_CODE(IIO_IN_DIFF,
0,
IIO_EV_TYPE_THRESH,
IIO_EV_DIR_FALLING),
iio_get_time_ns());
} else {
if (((channels[i] >> 11) & 0xFFF) >= st->aux_threshhigh)
iio_push_event(dev_info, 0,
iio_push_event(dev_info,
IIO_UNMOD_EVENT_CODE(IIO_TEMP,
0,
IIO_EV_TYPE_THRESH,
IIO_EV_DIR_RISING),
iio_get_time_ns());
else if (((channels[i] >> 11) & 0xFFF) <=
st->aux_threshlow)
iio_push_event(dev_info, 0,
iio_push_event(dev_info,
IIO_UNMOD_EVENT_CODE(IIO_TEMP,
0,
IIO_EV_TYPE_THRESH,
Expand Down Expand Up @@ -809,7 +809,6 @@ static int ad7280_read_raw(struct iio_dev *dev_info,

static const struct iio_info ad7280_info = {
.read_raw = &ad7280_read_raw,
.num_interrupt_lines = 1,
.event_attrs = &ad7280_event_attrs_group,
.attrs = &ad7280_attrs_group,
.driver_module = THIS_MODULE,
Expand Down
13 changes: 6 additions & 7 deletions drivers/staging/iio/adc/ad7291.c
Original file line number Diff line number Diff line change
Expand Up @@ -479,28 +479,28 @@ static irqreturn_t ad7291_event_handler(int irq, void *private)
ad7291_i2c_write(chip, AD7291_COMMAND, command);

if (t_status & (1 << 0))
iio_push_event(indio_dev, 0,
iio_push_event(indio_dev,
IIO_UNMOD_EVENT_CODE(IIO_TEMP,
0,
IIO_EV_TYPE_THRESH,
IIO_EV_DIR_FALLING),
timestamp);
if (t_status & (1 << 1))
iio_push_event(indio_dev, 0,
iio_push_event(indio_dev,
IIO_UNMOD_EVENT_CODE(IIO_TEMP,
0,
IIO_EV_TYPE_THRESH,
IIO_EV_DIR_RISING),
timestamp);
if (t_status & (1 << 2))
iio_push_event(indio_dev, 0,
iio_push_event(indio_dev,
IIO_UNMOD_EVENT_CODE(IIO_TEMP,
0,
IIO_EV_TYPE_THRESH,
IIO_EV_DIR_FALLING),
timestamp);
if (t_status & (1 << 3))
iio_push_event(indio_dev, 0,
iio_push_event(indio_dev,
IIO_UNMOD_EVENT_CODE(IIO_TEMP,
0,
IIO_EV_TYPE_THRESH,
Expand All @@ -509,14 +509,14 @@ static irqreturn_t ad7291_event_handler(int irq, void *private)

for (i = 0; i < AD7291_VOLTAGE_LIMIT_COUNT*2; i += 2) {
if (v_status & (1 << i))
iio_push_event(indio_dev, 0,
iio_push_event(indio_dev,
IIO_UNMOD_EVENT_CODE(IIO_IN,
i/2,
IIO_EV_TYPE_THRESH,
IIO_EV_DIR_FALLING),
timestamp);
if (v_status & (1 << (i + 1)))
iio_push_event(indio_dev, 0,
iio_push_event(indio_dev,
IIO_UNMOD_EVENT_CODE(IIO_IN,
i/2,
IIO_EV_TYPE_THRESH,
Expand Down Expand Up @@ -780,7 +780,6 @@ static struct attribute_group ad7291_event_attribute_group = {

static const struct iio_info ad7291_info = {
.attrs = &ad7291_attribute_group,
.num_interrupt_lines = 1,
.event_attrs = &ad7291_event_attribute_group,
};

Expand Down
5 changes: 2 additions & 3 deletions drivers/staging/iio/adc/ad7745.c
Original file line number Diff line number Diff line change
Expand Up @@ -540,12 +540,12 @@ static irqreturn_t ad774x_event_handler(int irq, void *private)
ad774x_i2c_read(chip, AD774X_STATUS, &int_status, 1);

if (int_status & AD774X_STATUS_RDYCAP)
iio_push_event(indio_dev, 0,
iio_push_event(indio_dev,
IIO_EVENT_CODE_CAP_RDY,
iio_get_time_ns());

if (int_status & AD774X_STATUS_RDYVT)
iio_push_event(indio_dev, 0,
iio_push_event(indio_dev,
IIO_EVENT_CODE_VT_RDY,
iio_get_time_ns());

Expand All @@ -569,7 +569,6 @@ static struct attribute_group ad774x_event_attribute_group = {
static const struct iio_info ad774x_info = {
.attrs = &ad774x_event_attribute_group,
.event_attrs = &ad774x_event_attribute_group,
.num_interrupt_lines = 1,
.driver_module = THIS_MODULE,
};
/*
Expand Down
5 changes: 1 addition & 4 deletions drivers/staging/iio/adc/ad7816.c
Original file line number Diff line number Diff line change
Expand Up @@ -254,9 +254,7 @@ static const struct attribute_group ad7816_attribute_group = {

static irqreturn_t ad7816_event_handler(int irq, void *private)
{
iio_push_event(private, 0,
IIO_EVENT_CODE_AD7816_OTI,
iio_get_time_ns());
iio_push_event(private, IIO_EVENT_CODE_AD7816_OTI, iio_get_time_ns());
return IRQ_HANDLED;
}

Expand Down Expand Up @@ -334,7 +332,6 @@ static struct attribute_group ad7816_event_attribute_group = {

static const struct iio_info ad7816_info = {
.attrs = &ad7816_attribute_group,
.num_interrupt_lines = 1,
.event_attrs = &ad7816_event_attribute_group,
.driver_module = THIS_MODULE,
};
Expand Down
4 changes: 1 addition & 3 deletions drivers/staging/iio/adc/ad799x_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ static irqreturn_t ad799x_event_handler(int irq, void *private)

for (i = 0; i < 8; i++) {
if (status & (1 << i))
iio_push_event(indio_dev, 0,
iio_push_event(indio_dev,
i & 0x1 ?
IIO_UNMOD_EVENT_CODE(IIO_IN,
(i >> 1),
Expand Down Expand Up @@ -474,14 +474,12 @@ static const struct iio_info ad7991_info = {

static const struct iio_info ad7992_info = {
.read_raw = &ad799x_read_raw,
.num_interrupt_lines = 1,
.event_attrs = &ad7992_event_attrs_group,
.driver_module = THIS_MODULE,
};

static const struct iio_info ad7993_4_7_8_info = {
.read_raw = &ad799x_read_raw,
.num_interrupt_lines = 1,
.event_attrs = &ad7993_4_7_8_event_attrs_group,
.driver_module = THIS_MODULE,
};
Expand Down
7 changes: 3 additions & 4 deletions drivers/staging/iio/adc/adt7310.c
Original file line number Diff line number Diff line change
Expand Up @@ -400,19 +400,19 @@ static irqreturn_t adt7310_event_handler(int irq, void *private)
return ret;

if (status & ADT7310_STAT_T_HIGH)
iio_push_event(indio_dev, 0,
iio_push_event(indio_dev,
IIO_UNMOD_EVENT_CODE(IIO_TEMP, 0,
IIO_EV_TYPE_THRESH,
IIO_EV_DIR_RISING),
timestamp);
if (status & ADT7310_STAT_T_LOW)
iio_push_event(indio_dev, 0,
iio_push_event(indio_dev,
IIO_UNMOD_EVENT_CODE(IIO_TEMP, 0,
IIO_EV_TYPE_THRESH,
IIO_EV_DIR_FALLING),
timestamp);
if (status & ADT7310_STAT_T_CRIT)
iio_push_event(indio_dev, 0,
iio_push_event(indio_dev,
IIO_UNMOD_EVENT_CODE(IIO_TEMP, 0,
IIO_EV_TYPE_THRESH,
IIO_EV_DIR_RISING),
Expand Down Expand Up @@ -750,7 +750,6 @@ static struct attribute_group adt7310_event_attribute_group[ADT7310_IRQS] = {

static const struct iio_info adt7310_info = {
.attrs = &adt7310_attribute_group,
.num_interrupt_lines = ADT7310_IRQS,
.event_attrs = adt7310_event_attribute_group,
.driver_module = THIS_MODULE,
};
Expand Down
7 changes: 3 additions & 4 deletions drivers/staging/iio/adc/adt7410.c
Original file line number Diff line number Diff line change
Expand Up @@ -366,19 +366,19 @@ static irqreturn_t adt7410_event_handler(int irq, void *private)
return IRQ_HANDLED;

if (status & ADT7410_STAT_T_HIGH)
iio_push_event(indio_dev, 0,
iio_push_event(indio_dev,
IIO_UNMOD_EVENT_CODE(IIO_TEMP, 0,
IIO_EV_TYPE_THRESH,
IIO_EV_DIR_RISING),
timestamp);
if (status & ADT7410_STAT_T_LOW)
iio_push_event(indio_dev, 0,
iio_push_event(indio_dev,
IIO_UNMOD_EVENT_CODE(IIO_TEMP, 0,
IIO_EV_TYPE_THRESH,
IIO_EV_DIR_FALLING),
timestamp);
if (status & ADT7410_STAT_T_CRIT)
iio_push_event(indio_dev, 0,
iio_push_event(indio_dev,
IIO_UNMOD_EVENT_CODE(IIO_TEMP, 0,
IIO_EV_TYPE_THRESH,
IIO_EV_DIR_RISING),
Expand Down Expand Up @@ -717,7 +717,6 @@ static struct attribute_group adt7410_event_attribute_group[ADT7410_IRQS] = {

static const struct iio_info adt7410_info = {
.attrs = &adt7410_attribute_group,
.num_interrupt_lines = ADT7410_IRQS,
.event_attrs = adt7410_event_attribute_group,
.driver_module = THIS_MODULE,
};
Expand Down
Loading

0 comments on commit 5aa9618

Please sign in to comment.