summaryrefslogtreecommitdiffstats
path: root/drivers/staging/iio/iio_simple_dummy.c
diff options
context:
space:
mode:
authorLars-Peter Clausen2014-11-26 18:55:11 +0100
committerJonathan Cameron2014-12-12 13:28:30 +0100
commit4ae03019923f7dd5785b69a513b74ccc1c3f7766 (patch)
treeb7e0e5bb1f7bf139e5499c71dd6e054c52ebf645 /drivers/staging/iio/iio_simple_dummy.c
parentstaging:iio:sca3000: Register same channels for device and buffer (diff)
downloadkernel-qcow2-linux-4ae03019923f7dd5785b69a513b74ccc1c3f7766.tar.gz
kernel-qcow2-linux-4ae03019923f7dd5785b69a513b74ccc1c3f7766.tar.xz
kernel-qcow2-linux-4ae03019923f7dd5785b69a513b74ccc1c3f7766.zip
staging:iio:dummy: Register same channels for device and buffer
In preparation for moving the buffer registration to the core make sure to register the same channel array for the device and the buffer. Currently the output voltage and the activity channels are not registered for the buffer, setting its scan index to -1 will make sure that it is skipped for the buffer. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/staging/iio/iio_simple_dummy.c')
-rw-r--r--drivers/staging/iio/iio_simple_dummy.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/staging/iio/iio_simple_dummy.c b/drivers/staging/iio/iio_simple_dummy.c
index 10a9e0882bbc..0b8611ac1003 100644
--- a/drivers/staging/iio/iio_simple_dummy.c
+++ b/drivers/staging/iio/iio_simple_dummy.c
@@ -239,6 +239,7 @@ static const struct iio_chan_spec iio_dummy_channels[] = {
{
.type = IIO_VOLTAGE,
.info_mask_separate = BIT(IIO_CHAN_INFO_RAW),
+ .scan_index = -1, /* No buffer support */
.output = 1,
.indexed = 1,
.channel = 0,
@@ -248,7 +249,7 @@ static const struct iio_chan_spec iio_dummy_channels[] = {
.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_ENABLE) |
BIT(IIO_CHAN_INFO_CALIBHEIGHT),
.info_mask_separate = BIT(IIO_CHAN_INFO_PROCESSED),
- .scan_index = -1,
+ .scan_index = -1, /* No buffer support */
#ifdef CONFIG_IIO_SIMPLE_DUMMY_EVENTS
.event_spec = &step_detect_event,
.num_event_specs = 1,
@@ -259,6 +260,7 @@ static const struct iio_chan_spec iio_dummy_channels[] = {
.modified = 1,
.channel2 = IIO_MOD_RUNNING,
.info_mask_separate = BIT(IIO_CHAN_INFO_PROCESSED),
+ .scan_index = -1, /* No buffer support */
#ifdef CONFIG_IIO_SIMPLE_DUMMY_EVENTS
.event_spec = &iio_running_event,
.num_event_specs = 1,
@@ -269,6 +271,7 @@ static const struct iio_chan_spec iio_dummy_channels[] = {
.modified = 1,
.channel2 = IIO_MOD_WALKING,
.info_mask_separate = BIT(IIO_CHAN_INFO_PROCESSED),
+ .scan_index = -1, /* No buffer support */
#ifdef CONFIG_IIO_SIMPLE_DUMMY_EVENTS
.event_spec = &iio_walking_event,
.num_event_specs = 1,
@@ -638,13 +641,7 @@ static int iio_dummy_probe(int index)
if (ret < 0)
goto error_free_device;
- /*
- * Configure buffered capture support and register the channels with the
- * buffer, but avoid the output channel being registered by reducing the
- * number of channels by 1.
- */
- ret = iio_simple_dummy_configure_buffer(indio_dev,
- iio_dummy_channels, 5);
+ ret = iio_simple_dummy_configure_buffer(indio_dev);
if (ret < 0)
goto error_unregister_events;