aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Cameron <jic23@cam.ac.uk>2011-05-18 09:42:17 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2011-05-19 19:15:01 -0400
commitd1ab8552cda68dd100cf113cba7bc37e653ad886 (patch)
treeae8c69d911fb3f39e15bba9de8fcad137f483bae
parente7a2c3238345c88a668c26ec6790f19f4fa7a820 (diff)
staging:iio:adc:adt7410 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/adt7410.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/drivers/staging/iio/adc/adt7410.c b/drivers/staging/iio/adc/adt7410.c
index c102b42e94f1..85b5c1acc631 100644
--- a/drivers/staging/iio/adc/adt7410.c
+++ b/drivers/staging/iio/adc/adt7410.c
@@ -355,14 +355,6 @@ static const struct attribute_group adt7410_attribute_group = {
355 .attrs = adt7410_attributes, 355 .attrs = adt7410_attributes,
356}; 356};
357 357
358/*
359 * temperature bound events
360 */
361
362#define IIO_EVENT_CODE_ADT7410_ABOVE_ALARM IIO_BUFFER_EVENT_CODE(0)
363#define IIO_EVENT_CODE_ADT7410_BELLOW_ALARM IIO_BUFFER_EVENT_CODE(1)
364#define IIO_EVENT_CODE_ADT7410_ABOVE_CRIT IIO_BUFFER_EVENT_CODE(2)
365
366static irqreturn_t adt7410_event_handler(int irq, void *private) 358static irqreturn_t adt7410_event_handler(int irq, void *private)
367{ 359{
368 struct iio_dev *indio_dev = private; 360 struct iio_dev *indio_dev = private;
@@ -375,16 +367,22 @@ static irqreturn_t adt7410_event_handler(int irq, void *private)
375 367
376 if (status & ADT7410_STAT_T_HIGH) 368 if (status & ADT7410_STAT_T_HIGH)
377 iio_push_event(indio_dev, 0, 369 iio_push_event(indio_dev, 0,
378 IIO_EVENT_CODE_ADT7410_ABOVE_ALARM, 370 IIO_UNMOD_EVENT_CODE(IIO_TEMP, 0,
379 timestamp); 371 IIO_EV_TYPE_THRESH,
372 IIO_EV_DIR_RISING),
373 timestamp);
380 if (status & ADT7410_STAT_T_LOW) 374 if (status & ADT7410_STAT_T_LOW)
381 iio_push_event(indio_dev, 0, 375 iio_push_event(indio_dev, 0,
382 IIO_EVENT_CODE_ADT7410_BELLOW_ALARM, 376 IIO_UNMOD_EVENT_CODE(IIO_TEMP, 0,
383 timestamp); 377 IIO_EV_TYPE_THRESH,
378 IIO_EV_DIR_FALLING),
379 timestamp);
384 if (status & ADT7410_STAT_T_CRIT) 380 if (status & ADT7410_STAT_T_CRIT)
385 iio_push_event(indio_dev, 0, 381 iio_push_event(indio_dev, 0,
386 IIO_EVENT_CODE_ADT7410_ABOVE_CRIT, 382 IIO_UNMOD_EVENT_CODE(IIO_TEMP, 0,
387 timestamp); 383 IIO_EV_TYPE_THRESH,
384 IIO_EV_DIR_RISING),
385 timestamp);
388 386
389 return IRQ_HANDLED; 387 return IRQ_HANDLED;
390} 388}