staging:iio:in kernel users: Add a data field for channel specific info.
authorJonathan Cameron <jic23@kernel.org>
Sat, 30 Jun 2012 19:06:00 +0000 (20:06 +0100)
committerJonathan Cameron <jic23@kernel.org>
Sat, 10 Nov 2012 10:17:27 +0000 (10:17 +0000)
Used to allow information about a given channel mapping to be passed
through from board files to the consumer drivers.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/inkern.c
include/linux/iio/consumer.h
include/linux/iio/machine.h

index b394621d362cb54da7b7e303499cb79bde339472..d55e98fb300ec18cfd96b37830dfd7b6bbedb326 100644 (file)
@@ -203,6 +203,7 @@ struct iio_channel *iio_channel_get_all(const char *name)
                if (name && strcmp(name, c->map->consumer_dev_name) != 0)
                        continue;
                chans[mapind].indio_dev = c->indio_dev;
+               chans[mapind].data = c->map->consumer_data;
                chans[mapind].channel =
                        iio_chan_spec_from_name(chans[mapind].indio_dev,
                                                c->map->adc_channel_label);
index e875bcf0478f541fc086bdf112800383c1843bdf..57efee63a6daa9074bd8a5d3f5c64128a8899e05 100644 (file)
@@ -18,10 +18,12 @@ struct iio_chan_spec;
  * struct iio_channel - everything needed for a consumer to use a channel
  * @indio_dev:         Device on which the channel exists.
  * @channel:           Full description of the channel.
+ * @data:              Data about the channel used by consumer.
  */
 struct iio_channel {
        struct iio_dev *indio_dev;
        const struct iio_chan_spec *channel;
+       void *data;
 };
 
 /**
index 809a3f08d5a5c6ff9141ba2c5f2af830c4d3fbbf..1601a2a63a7291f4267fd280d461702d4521f357 100644 (file)
  * @consumer_dev_name: Name to uniquely identify the consumer device.
  * @consumer_channel:  Unique name used to identify the channel on the
  *                     consumer side.
+ * @consumer_data:     Data about the channel for use by the consumer driver.
  */
 struct iio_map {
        const char *adc_channel_label;
        const char *consumer_dev_name;
        const char *consumer_channel;
+       void *consumer_data;
 };
 
 #endif