linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: linux-iio@vger.kernel.org
Cc: Michael.Hennerich@analog.com, lars@metafoo.de,
	srinivas.pandruvada@intel.com,
	Jonathan Cameron <jic23@kernel.org>
Subject: [PATCH 2/4] staging:iio:in kernel users: Add a data field for channel specific info.
Date: Sat, 13 Oct 2012 10:24:36 +0100	[thread overview]
Message-ID: <1350120278-26929-3-git-send-email-jic23@kernel.org> (raw)
In-Reply-To: <1350120278-26929-1-git-send-email-jic23@kernel.org>

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         | 1 +
 include/linux/iio/consumer.h | 2 ++
 include/linux/iio/machine.h  | 2 ++
 3 files changed, 5 insertions(+)

diff --git a/drivers/iio/inkern.c b/drivers/iio/inkern.c
index f2b78d4..4113105 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)
 		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/include/linux/iio/consumer.h b/include/linux/iio/consumer.h
index e875bcf..57efee6 100644
--- a/include/linux/iio/consumer.h
+++ b/include/linux/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/include/linux/iio/machine.h b/include/linux/iio/machine.h
index 809a3f0..1601a2a 100644
--- a/include/linux/iio/machine.h
+++ b/include/linux/iio/machine.h
@@ -19,11 +19,13 @@
  * @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
-- 
1.7.12.2


  parent reply	other threads:[~2012-10-13  9:24 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-13  9:24 [PATCH 0/4 V5] staging:iio: Add support for multiple buffers (testing required!) Jonathan Cameron
2012-10-13  9:24 ` [PATCH 1/4] staging:iio: Add support for multiple buffers Jonathan Cameron
2012-10-17  8:37   ` Lars-Peter Clausen
2012-10-19 15:03     ` Jonathan Cameron
2012-10-13  9:24 ` Jonathan Cameron [this message]
2012-10-13  9:24 ` [PATCH 3/4] staging:iio: add a callback buffer for in kernel push interface Jonathan Cameron
2012-10-17  8:50   ` Lars-Peter Clausen
2012-10-17  8:52     ` Jonathan Cameron
2012-10-13  9:24 ` [PATCH 4/4] staging:iio: Proof of concept input driver Jonathan Cameron
2012-10-13  9:57   ` Jonathan Cameron
2012-10-18 18:28 ` [PATCH 0/4 V5] staging:iio: Add support for multiple buffers (testing required!) Pandruvada, Srinivas
2012-10-19 15:00   ` Jonathan Cameron
  -- strict thread matches above, loose matches on Subject: below --
2012-10-31 10:30 [PATCH 0/4 V6] " Jonathan Cameron
2012-10-31 10:30 ` [PATCH 2/4] staging:iio:in kernel users: Add a data field for channel specific info Jonathan Cameron
2012-06-30 19:06 [PATCH 0/4 V3] staging:iio: Add support for multiple buffers Jonathan Cameron
2012-06-30 19:06 ` [PATCH 2/4] staging:iio:in kernel users: Add a data field for channel specific info Jonathan Cameron
2012-05-30 19:36 [PATCH 0/4 V2] staging:iio: Add support for multiple buffers Jonathan Cameron
2012-05-30 19:36 ` [PATCH 2/4] staging:iio:in kernel users: Add a data field for channel specific info Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1350120278-26929-3-git-send-email-jic23@kernel.org \
    --to=jic23@kernel.org \
    --cc=Michael.Hennerich@analog.com \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=srinivas.pandruvada@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).