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@xxxxxxxxxx> --- drivers/staging/iio/consumer.h | 2 ++ drivers/staging/iio/inkern.c | 1 + drivers/staging/iio/machine.h | 2 ++ 3 files changed, 5 insertions(+) diff --git a/drivers/staging/iio/consumer.h b/drivers/staging/iio/consumer.h index ef3c10c..d4863da 100644 --- a/drivers/staging/iio/consumer.h +++ b/drivers/staging/iio/consumer.h @@ -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; }; /** diff --git a/drivers/staging/iio/inkern.c b/drivers/staging/iio/inkern.c index de2c8ea..b895e7e 100644 --- a/drivers/staging/iio/inkern.c +++ b/drivers/staging/iio/inkern.c @@ -189,6 +189,7 @@ struct iio_channel *iio_st_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); diff --git a/drivers/staging/iio/machine.h b/drivers/staging/iio/machine.h index 0b1f19b..7409100 100644 --- a/drivers/staging/iio/machine.h +++ b/drivers/staging/iio/machine.h @@ -16,9 +16,11 @@ * @consumer_dev_name: Name to uniquely identify the consumer device. * @consumer_channel: Unique name used to idenitify 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; }; -- 1.7.9.4 -- To unsubscribe from this list: send the line "unsubscribe linux-iio" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html