Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 249851
b: refs/heads/master
c: d1ab855
h: refs/heads/master
i:
  249849: 01c71f5
  249847: 5eb4291
v: v3
  • Loading branch information
Jonathan Cameron authored and Greg Kroah-Hartman committed May 19, 2011
1 parent eb32106 commit 749dcb8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e7a2c3238345c88a668c26ec6790f19f4fa7a820
refs/heads/master: d1ab8552cda68dd100cf113cba7bc37e653ad886
26 changes: 12 additions & 14 deletions trunk/drivers/staging/iio/adc/adt7410.c
Original file line number Diff line number Diff line change
Expand Up @@ -355,14 +355,6 @@ static const struct attribute_group adt7410_attribute_group = {
.attrs = adt7410_attributes,
};

/*
* temperature bound events
*/

#define IIO_EVENT_CODE_ADT7410_ABOVE_ALARM IIO_BUFFER_EVENT_CODE(0)
#define IIO_EVENT_CODE_ADT7410_BELLOW_ALARM IIO_BUFFER_EVENT_CODE(1)
#define IIO_EVENT_CODE_ADT7410_ABOVE_CRIT IIO_BUFFER_EVENT_CODE(2)

static irqreturn_t adt7410_event_handler(int irq, void *private)
{
struct iio_dev *indio_dev = private;
Expand All @@ -375,16 +367,22 @@ static irqreturn_t adt7410_event_handler(int irq, void *private)

if (status & ADT7410_STAT_T_HIGH)
iio_push_event(indio_dev, 0,
IIO_EVENT_CODE_ADT7410_ABOVE_ALARM,
timestamp);
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_EVENT_CODE_ADT7410_BELLOW_ALARM,
timestamp);
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_EVENT_CODE_ADT7410_ABOVE_CRIT,
timestamp);
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 749dcb8

Please sign in to comment.