diff options
author | Jonathan Cameron <jic23@kernel.org> | 2012-06-30 15:06:00 -0400 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2012-11-10 05:17:27 -0500 |
commit | 0464415dd21785aa8e8b12dbc939fcb5ca52f464 (patch) | |
tree | 36a5fff19aebcf8aa5eeff66ac8d8473a01765e8 | |
parent | 84b36ce5f79c01f792c623f14e92ed86cdccb42f (diff) |
staging:iio:in kernel users: Add a data field for channel specific info.
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>
-rw-r--r-- | drivers/iio/inkern.c | 1 | ||||
-rw-r--r-- | include/linux/iio/consumer.h | 2 | ||||
-rw-r--r-- | include/linux/iio/machine.h | 2 |
3 files changed, 5 insertions, 0 deletions
diff --git a/drivers/iio/inkern.c b/drivers/iio/inkern.c index b394621d362c..d55e98fb300e 100644 --- a/drivers/iio/inkern.c +++ b/drivers/iio/inkern.c | |||
@@ -203,6 +203,7 @@ struct iio_channel *iio_channel_get_all(const char *name) | |||
203 | if (name && strcmp(name, c->map->consumer_dev_name) != 0) | 203 | if (name && strcmp(name, c->map->consumer_dev_name) != 0) |
204 | continue; | 204 | continue; |
205 | chans[mapind].indio_dev = c->indio_dev; | 205 | chans[mapind].indio_dev = c->indio_dev; |
206 | chans[mapind].data = c->map->consumer_data; | ||
206 | chans[mapind].channel = | 207 | chans[mapind].channel = |
207 | iio_chan_spec_from_name(chans[mapind].indio_dev, | 208 | iio_chan_spec_from_name(chans[mapind].indio_dev, |
208 | c->map->adc_channel_label); | 209 | c->map->adc_channel_label); |
diff --git a/include/linux/iio/consumer.h b/include/linux/iio/consumer.h index e875bcf0478f..57efee63a6da 100644 --- a/include/linux/iio/consumer.h +++ b/include/linux/iio/consumer.h | |||
@@ -18,10 +18,12 @@ struct iio_chan_spec; | |||
18 | * struct iio_channel - everything needed for a consumer to use a channel | 18 | * struct iio_channel - everything needed for a consumer to use a channel |
19 | * @indio_dev: Device on which the channel exists. | 19 | * @indio_dev: Device on which the channel exists. |
20 | * @channel: Full description of the channel. | 20 | * @channel: Full description of the channel. |
21 | * @data: Data about the channel used by consumer. | ||
21 | */ | 22 | */ |
22 | struct iio_channel { | 23 | struct iio_channel { |
23 | struct iio_dev *indio_dev; | 24 | struct iio_dev *indio_dev; |
24 | const struct iio_chan_spec *channel; | 25 | const struct iio_chan_spec *channel; |
26 | void *data; | ||
25 | }; | 27 | }; |
26 | 28 | ||
27 | /** | 29 | /** |
diff --git a/include/linux/iio/machine.h b/include/linux/iio/machine.h index 809a3f08d5a5..1601a2a63a72 100644 --- a/include/linux/iio/machine.h +++ b/include/linux/iio/machine.h | |||
@@ -19,11 +19,13 @@ | |||
19 | * @consumer_dev_name: Name to uniquely identify the consumer device. | 19 | * @consumer_dev_name: Name to uniquely identify the consumer device. |
20 | * @consumer_channel: Unique name used to identify the channel on the | 20 | * @consumer_channel: Unique name used to identify the channel on the |
21 | * consumer side. | 21 | * consumer side. |
22 | * @consumer_data: Data about the channel for use by the consumer driver. | ||
22 | */ | 23 | */ |
23 | struct iio_map { | 24 | struct iio_map { |
24 | const char *adc_channel_label; | 25 | const char *adc_channel_label; |
25 | const char *consumer_dev_name; | 26 | const char *consumer_dev_name; |
26 | const char *consumer_channel; | 27 | const char *consumer_channel; |
28 | void *consumer_data; | ||
27 | }; | 29 | }; |
28 | 30 | ||
29 | #endif | 31 | #endif |