diff options
author | Jonathan Cameron <jic23@cam.ac.uk> | 2010-07-11 16:39:17 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-07-22 11:38:29 -0700 |
commit | 43c11b4373f6fcaf8ce02ea5ea95d764edd87040 (patch) | |
tree | fdb5f438aefd85b6e1f83ff3c25624cf43886915 /drivers/staging/iio/gyro | |
parent | ad577f8da9e469a88d24c37a8ec2314c12162256 (diff) |
staging: iio: Make extensive use of iio_sw_ring_preenable
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Acked-by: Barry Song <21cnbao@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/iio/gyro')
-rw-r--r-- | drivers/staging/iio/gyro/adis16260_ring.c | 29 |
1 files changed, 2 insertions, 27 deletions
diff --git a/drivers/staging/iio/gyro/adis16260_ring.c b/drivers/staging/iio/gyro/adis16260_ring.c index 94b4515c20f9..9ef7f9080dcd 100644 --- a/drivers/staging/iio/gyro/adis16260_ring.c +++ b/drivers/staging/iio/gyro/adis16260_ring.c @@ -142,32 +142,6 @@ static void adis16260_trigger_bh_to_ring(struct work_struct *work_s) return; } -static int adis16260_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 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 adis16260_unconfigure_ring(struct iio_dev *indio_dev) { kfree(indio_dev->pollfunc); @@ -199,7 +173,8 @@ int adis16260_configure_ring(struct iio_dev *indio_dev) indio_dev->ring = ring; /* Effectively select the ring buffer implementation */ iio_ring_sw_register_funcs(&ring->access); - ring->preenable = &adis16260_data_rdy_ring_preenable; + ring->bpe = 2; + ring->preenable = &iio_sw_ring_preenable; ring->postenable = &iio_triggered_ring_postenable; ring->predisable = &iio_triggered_ring_predisable; ring->owner = THIS_MODULE; |