diff options
author | Jonathan Cameron <jic23@cam.ac.uk> | 2011-05-18 09:42:16 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-05-19 19:15:01 -0400 |
commit | e7a2c3238345c88a668c26ec6790f19f4fa7a820 (patch) | |
tree | 91d06e62bf842d518e992d83fd8f98515544411b | |
parent | b206c3bbb4eda4f82c3396c0cc3a4443ffc166c5 (diff) |
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>
-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 = { | |||
387 | .attrs = adt7310_attributes, | 387 | .attrs = adt7310_attributes, |
388 | }; | 388 | }; |
389 | 389 | ||
390 | /* | ||
391 | * temperature bound events | ||
392 | */ | ||
393 | |||
394 | #define IIO_EVENT_CODE_ADT7310_ABOVE_ALARM IIO_BUFFER_EVENT_CODE(0) | ||
395 | #define IIO_EVENT_CODE_ADT7310_BELLOW_ALARM IIO_BUFFER_EVENT_CODE(1) | ||
396 | #define IIO_EVENT_CODE_ADT7310_ABOVE_CRIT IIO_BUFFER_EVENT_CODE(2) | ||
397 | |||
398 | static irqreturn_t adt7310_event_handler(int irq, void *private) | 390 | static irqreturn_t adt7310_event_handler(int irq, void *private) |
399 | { | 391 | { |
400 | struct iio_dev *indio_dev = private; | 392 | struct iio_dev *indio_dev = private; |
@@ -409,15 +401,21 @@ static irqreturn_t adt7310_event_handler(int irq, void *private) | |||
409 | 401 | ||
410 | if (status & ADT7310_STAT_T_HIGH) | 402 | if (status & ADT7310_STAT_T_HIGH) |
411 | iio_push_event(indio_dev, 0, | 403 | iio_push_event(indio_dev, 0, |
412 | IIO_EVENT_CODE_ADT7310_ABOVE_ALARM, | 404 | IIO_UNMOD_EVENT_CODE(IIO_TEMP, 0, |
413 | timestamp); | 405 | IIO_EV_TYPE_THRESH, |
406 | IIO_EV_DIR_RISING), | ||
407 | timestamp); | ||
414 | if (status & ADT7310_STAT_T_LOW) | 408 | if (status & ADT7310_STAT_T_LOW) |
415 | iio_push_event(indio_dev, 0, | 409 | iio_push_event(indio_dev, 0, |
416 | IIO_EVENT_CODE_ADT7310_BELLOW_ALARM, | 410 | IIO_UNMOD_EVENT_CODE(IIO_TEMP, 0, |
417 | timestamp); | 411 | IIO_EV_TYPE_THRESH, |
412 | IIO_EV_DIR_FALLING), | ||
413 | timestamp); | ||
418 | if (status & ADT7310_STAT_T_CRIT) | 414 | if (status & ADT7310_STAT_T_CRIT) |
419 | iio_push_event(indio_dev, 0, | 415 | iio_push_event(indio_dev, 0, |
420 | IIO_EVENT_CODE_ADT7310_ABOVE_CRIT, | 416 | IIO_UNMOD_EVENT_CODE(IIO_TEMP, 0, |
417 | IIO_EV_TYPE_THRESH, | ||
418 | IIO_EV_DIR_RISING), | ||
421 | timestamp); | 419 | timestamp); |
422 | return IRQ_HANDLED; | 420 | return IRQ_HANDLED; |
423 | } | 421 | } |