|
@@ -147,34 +147,6 @@ static void adis16209_trigger_bh_to_ring(struct work_struct *work_s)
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
-/* in these circumstances is it better to go with unaligned packing and
|
|
|
|
- * deal with the cost?*/
|
|
|
|
-static int adis16209_data_rdy_ring_preenable(struct iio_dev *indio_dev)
|
|
|
|
-{
|
|
|
|
- size_t size;
|
|
|
|
- dev_dbg(&indio_dev->dev, "%s\n", __func__);
|
|
|
|
- /* Check if there are any scan elements enabled, if not fail*/
|
|
|
|
- if (!(indio_dev->scan_count || indio_dev->scan_timestamp))
|
|
|
|
- return -EINVAL;
|
|
|
|
-
|
|
|
|
- if (indio_dev->ring->access.set_bpd) {
|
|
|
|
- if (indio_dev->scan_timestamp)
|
|
|
|
- if (indio_dev->scan_count)
|
|
|
|
- /* Timestamp (aligned to s64) and data */
|
|
|
|
- size = (((indio_dev->scan_count * sizeof(s16))
|
|
|
|
- + sizeof(s64) - 1)
|
|
|
|
- & ~(sizeof(s64) - 1))
|
|
|
|
- + sizeof(s64);
|
|
|
|
- else /* Timestamp only */
|
|
|
|
- size = sizeof(s64);
|
|
|
|
- else /* Data only */
|
|
|
|
- size = indio_dev->scan_count*sizeof(s16);
|
|
|
|
- indio_dev->ring->access.set_bpd(indio_dev->ring, size);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- return 0;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
void adis16209_unconfigure_ring(struct iio_dev *indio_dev)
|
|
void adis16209_unconfigure_ring(struct iio_dev *indio_dev)
|
|
{
|
|
{
|
|
kfree(indio_dev->pollfunc);
|
|
kfree(indio_dev->pollfunc);
|
|
@@ -209,7 +181,8 @@ int adis16209_configure_ring(struct iio_dev *indio_dev)
|
|
indio_dev->ring = ring;
|
|
indio_dev->ring = ring;
|
|
/* Effectively select the ring buffer implementation */
|
|
/* Effectively select the ring buffer implementation */
|
|
iio_ring_sw_register_funcs(&ring->access);
|
|
iio_ring_sw_register_funcs(&ring->access);
|
|
- ring->preenable = &adis16209_data_rdy_ring_preenable;
|
|
|
|
|
|
+ ring->bpe = 2;
|
|
|
|
+ ring->preenable = &iio_sw_ring_preenable;
|
|
ring->postenable = &iio_triggered_ring_postenable;
|
|
ring->postenable = &iio_triggered_ring_postenable;
|
|
ring->predisable = &iio_triggered_ring_predisable;
|
|
ring->predisable = &iio_triggered_ring_predisable;
|
|
ring->owner = THIS_MODULE;
|
|
ring->owner = THIS_MODULE;
|