Skip to content

Commit

Permalink
staging:iio:adc:adt7310 replace abuse of buffer events.
Browse files Browse the repository at this point in the history
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Jonathan Cameron authored and Greg Kroah-Hartman committed May 19, 2011
1 parent b206c3b commit e7a2c32
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions drivers/staging/iio/adc/adt7310.c
Original file line number Diff line number Diff line change
Expand Up @@ -387,14 +387,6 @@ static const struct attribute_group adt7310_attribute_group = {
.attrs = adt7310_attributes,
};

/*
* temperature bound events
*/

#define IIO_EVENT_CODE_ADT7310_ABOVE_ALARM IIO_BUFFER_EVENT_CODE(0)
#define IIO_EVENT_CODE_ADT7310_BELLOW_ALARM IIO_BUFFER_EVENT_CODE(1)
#define IIO_EVENT_CODE_ADT7310_ABOVE_CRIT IIO_BUFFER_EVENT_CODE(2)

static irqreturn_t adt7310_event_handler(int irq, void *private)
{
struct iio_dev *indio_dev = private;
Expand All @@ -409,15 +401,21 @@ static irqreturn_t adt7310_event_handler(int irq, void *private)

if (status & ADT7310_STAT_T_HIGH)
iio_push_event(indio_dev, 0,
IIO_EVENT_CODE_ADT7310_ABOVE_ALARM,
timestamp);
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_EVENT_CODE_ADT7310_BELLOW_ALARM,
timestamp);
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_EVENT_CODE_ADT7310_ABOVE_CRIT,
IIO_UNMOD_EVENT_CODE(IIO_TEMP, 0,
IIO_EV_TYPE_THRESH,
IIO_EV_DIR_RISING),
timestamp);
return IRQ_HANDLED;
}
Expand Down

0 comments on commit e7a2c32

Please sign in to comment.