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>
This commit is contained in:
parent
84b36ce5f7
commit
0464415dd2
|
@ -203,6 +203,7 @@ struct iio_channel *iio_channel_get_all(const char *name)
|
||||||
if (name && strcmp(name, c->map->consumer_dev_name) != 0)
|
if (name && strcmp(name, c->map->consumer_dev_name) != 0)
|
||||||
continue;
|
continue;
|
||||||
chans[mapind].indio_dev = c->indio_dev;
|
chans[mapind].indio_dev = c->indio_dev;
|
||||||
|
chans[mapind].data = c->map->consumer_data;
|
||||||
chans[mapind].channel =
|
chans[mapind].channel =
|
||||||
iio_chan_spec_from_name(chans[mapind].indio_dev,
|
iio_chan_spec_from_name(chans[mapind].indio_dev,
|
||||||
c->map->adc_channel_label);
|
c->map->adc_channel_label);
|
||||||
|
|
|
@ -18,10 +18,12 @@ struct iio_chan_spec;
|
||||||
* struct iio_channel - everything needed for a consumer to use a channel
|
* struct iio_channel - everything needed for a consumer to use a channel
|
||||||
* @indio_dev: Device on which the channel exists.
|
* @indio_dev: Device on which the channel exists.
|
||||||
* @channel: Full description of the channel.
|
* @channel: Full description of the channel.
|
||||||
|
* @data: Data about the channel used by consumer.
|
||||||
*/
|
*/
|
||||||
struct iio_channel {
|
struct iio_channel {
|
||||||
struct iio_dev *indio_dev;
|
struct iio_dev *indio_dev;
|
||||||
const struct iio_chan_spec *channel;
|
const struct iio_chan_spec *channel;
|
||||||
|
void *data;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -19,11 +19,13 @@
|
||||||
* @consumer_dev_name: Name to uniquely identify the consumer device.
|
* @consumer_dev_name: Name to uniquely identify the consumer device.
|
||||||
* @consumer_channel: Unique name used to identify the channel on the
|
* @consumer_channel: Unique name used to identify the channel on the
|
||||||
* consumer side.
|
* consumer side.
|
||||||
|
* @consumer_data: Data about the channel for use by the consumer driver.
|
||||||
*/
|
*/
|
||||||
struct iio_map {
|
struct iio_map {
|
||||||
const char *adc_channel_label;
|
const char *adc_channel_label;
|
||||||
const char *consumer_dev_name;
|
const char *consumer_dev_name;
|
||||||
const char *consumer_channel;
|
const char *consumer_channel;
|
||||||
|
void *consumer_data;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Reference in New Issue