Skip to content

Commit 0464415

Browse files
committed
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>
1 parent 84b36ce commit 0464415

3 files changed

Lines changed: 5 additions & 0 deletions

File tree

‎drivers/iio/inkern.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ struct iio_channel *iio_channel_get_all(const char *name)
203203
if (name && strcmp(name, c->map->consumer_dev_name) != 0)
204204
continue;
205205
chans[mapind].indio_dev = c->indio_dev;
206+
chans[mapind].data = c->map->consumer_data;
206207
chans[mapind].channel =
207208
iio_chan_spec_from_name(chans[mapind].indio_dev,
208209
c->map->adc_channel_label);

‎include/linux/iio/consumer.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,12 @@ struct iio_chan_spec;
1818
* struct iio_channel - everything needed for a consumer to use a channel
1919
* @indio_dev: Device on which the channel exists.
2020
* @channel: Full description of the channel.
21+
* @data: Data about the channel used by consumer.
2122
*/
2223
struct iio_channel {
2324
struct iio_dev *indio_dev;
2425
const struct iio_chan_spec *channel;
26+
void *data;
2527
};
2628

2729
/**

‎include/linux/iio/machine.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,13 @@
1919
* @consumer_dev_name: Name to uniquely identify the consumer device.
2020
* @consumer_channel: Unique name used to identify the channel on the
2121
* consumer side.
22+
* @consumer_data: Data about the channel for use by the consumer driver.
2223
*/
2324
struct iio_map {
2425
const char *adc_channel_label;
2526
const char *consumer_dev_name;
2627
const char *consumer_channel;
28+
void *consumer_data;
2729
};
2830

2931
#endif

0 commit comments

Comments
 (0)