diff options
author | Jonathan Cameron <jic23@cam.ac.uk> | 2011-05-18 15:42:16 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-05-20 01:15:01 +0200 |
commit | e7a2c3238345c88a668c26ec6790f19f4fa7a820 (patch) | |
tree | 91d06e62bf842d518e992d83fd8f98515544411b /drivers | |
parent | staging:iio:adc:ad7291 remove abuse of buffer events and replace with somethi... (diff) | |
download | linux-e7a2c3238345c88a668c26ec6790f19f4fa7a820.tar.xz linux-e7a2c3238345c88a668c26ec6790f19f4fa7a820.zip |
staging:iio:adc:adt7310 replace abuse of buffer events.
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/iio/adc/adt7310.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/drivers/staging/iio/adc/adt7310.c b/drivers/staging/iio/adc/adt7310.c index 2ade48537e97..e405fc311d4d 100644 --- a/drivers/staging/iio/adc/adt7310.c +++ b/drivers/staging/iio/adc/adt7310.c @@ -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; @@ -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; } |