#include "../ring_generic.h"
#include "../ring_sw.h"
#include "../trigger.h"
-#include "adc.h"
+#include "../trigger_consumer.h"
#include "ad7793.h"
static irqreturn_t ad7793_trigger_handler(int irq, void *p)
{
struct iio_poll_func *pf = p;
- struct iio_dev *indio_dev = pf->private_data;
+ struct iio_dev *indio_dev = pf->indio_dev;
struct iio_ring_buffer *ring = indio_dev->ring;
struct ad7793_state *st = iio_priv(indio_dev);
s64 dat64[2];
static void ad7793_ring_cleanup(struct iio_dev *indio_dev)
{
- /* ensure that the trigger has been detached */
- if (indio_dev->trig) {
- iio_put_trigger(indio_dev->trig);
- iio_trigger_dettach_poll_func(indio_dev->trig,
- indio_dev->pollfunc);
- }
iio_dealloc_pollfunc(indio_dev->pollfunc);
iio_sw_rb_free(indio_dev->ring);
}
if (ret)
goto error_unreg_ring;
- ret = iio_ring_buffer_register_ex(indio_dev->ring, 0,
+ ret = iio_ring_buffer_register_ex(indio_dev, 0,
indio_dev->channels,
indio_dev->num_channels);
if (ret)
return 0;
error_uninitialize_ring:
- iio_ring_buffer_unregister(indio_dev->ring);
+ iio_ring_buffer_unregister(indio_dev);
error_remove_trigger:
ad7793_remove_trigger(indio_dev);
error_unreg_ring:
struct iio_dev *indio_dev = spi_get_drvdata(spi);
struct ad7793_state *st = iio_priv(indio_dev);
- iio_ring_buffer_unregister(indio_dev->ring);
+ iio_ring_buffer_unregister(indio_dev);
ad7793_remove_trigger(indio_dev);
ad7793_ring_cleanup(indio_dev);