#include <linux/slab.h>
#include <linux/types.h>
#include <linux/err.h>
+#include <linux/module.h>
#include "../iio.h"
#include "../sysfs.h"
-
#include "../ring_generic.h"
-#include "adc.h"
+
#include "ad799x.h"
/*
mutex_lock(&dev_info->mlock);
if (iio_ring_enabled(dev_info))
ret = ad799x_single_channel_from_ring(st,
- 1 << chan->address);
+ chan->address);
else
ret = ad799x_scan_direct(st, chan->address);
mutex_unlock(&dev_info->mlock);
for (i = 0; i < 8; i++) {
if (status & (1 << i))
- iio_push_event(indio_dev, 0,
+ iio_push_event(indio_dev,
i & 0x1 ?
- IIO_EVENT_CODE_IN_HIGH_THRESH(i >> 1) :
- IIO_EVENT_CODE_IN_LOW_THRESH(i >> 1),
+ IIO_UNMOD_EVENT_CODE(IIO_IN,
+ (i >> 1),
+ IIO_EV_TYPE_THRESH,
+ IIO_EV_DIR_RISING) :
+ IIO_UNMOD_EVENT_CODE(IIO_IN,
+ (i >> 1),
+ IIO_EV_TYPE_THRESH,
+ IIO_EV_DIR_FALLING),
iio_get_time_ns());
}
static struct attribute_group ad7993_4_7_8_event_attrs_group = {
.attrs = ad7993_4_7_8_event_attributes,
+ .name = "events",
};
static struct attribute *ad7992_event_attributes[] = {
static struct attribute_group ad7992_event_attrs_group = {
.attrs = ad7992_event_attributes,
+ .name = "events",
};
static const struct iio_info ad7991_info = {
static const struct iio_info ad7992_info = {
.read_raw = &ad799x_read_raw,
- .num_interrupt_lines = 1,
.event_attrs = &ad7992_event_attrs_group,
.driver_module = THIS_MODULE,
};
static const struct iio_info ad7993_4_7_8_info = {
.read_raw = &ad799x_read_raw,
- .num_interrupt_lines = 1,
.event_attrs = &ad7993_4_7_8_event_attrs_group,
.driver_module = THIS_MODULE,
};
goto error_cleanup_ring;
regdone = 1;
- ret = iio_ring_buffer_register_ex(indio_dev->ring, 0,
- indio_dev->channels,
- indio_dev->num_channels);
+ ret = iio_ring_buffer_register(indio_dev,
+ indio_dev->channels,
+ indio_dev->num_channels);
if (ret)
goto error_cleanup_ring;
if (client->irq > 0)
free_irq(client->irq, indio_dev);
- iio_ring_buffer_unregister(indio_dev->ring);
+ iio_ring_buffer_unregister(indio_dev);
ad799x_ring_cleanup(indio_dev);
if (!IS_ERR(st->reg)) {
regulator_disable(st->reg);