From: Jonathan Cameron <jic23@kernel.org>
To: linux-iio@vger.kernel.org
Cc: device-drivers-devel@blackfin.uclinux.org, greg@kroah.com,
dmitry.torokhov@gmail.com, broonie@opensource.wolfsonmicro.com,
alan@lxorguk.ukuu.org.uk, arnd@arndb.de,
linus.walleij@linaro.org, maxime.ripard@free-electrons.com,
thomas.petazzoni@free-electrons.com, zdevai@gmail.com,
w.sang@pengutronix.de, marek.vasut@gmail.com,
Jonathan Cameron <jic23@kernel.org>
Subject: [PATCH 3/4] staging:iio:in kernel users: Add a data field for channel specific info.
Date: Tue, 10 Apr 2012 21:38:13 +0100 [thread overview]
Message-ID: <1334090294-23407-4-git-send-email-jic23@kernel.org> (raw)
In-Reply-To: <1334090294-23407-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/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
next prev parent reply other threads:[~2012-04-10 20:38 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-10 20:38 [RFC PATCH 0/4 V2] Add push based interface for non userspace iio users Jonathan Cameron
2012-04-10 20:38 ` [PATCH 1/4] staging:iio: make all buffer access pass through the buffer_list Jonathan Cameron
2012-04-16 15:59 ` Lars-Peter Clausen
2012-04-16 20:40 ` Jonathan Cameron
2012-04-10 20:38 ` Jonathan Cameron [this message]
2012-04-10 20:38 ` [PATCH 4/4] staging:iio: Proof of concept input driver 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=1334090294-23407-4-git-send-email-jic23@kernel.org \
--to=jic23@kernel.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=arnd@arndb.de \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=device-drivers-devel@blackfin.uclinux.org \
--cc=dmitry.torokhov@gmail.com \
--cc=greg@kroah.com \
--cc=linus.walleij@linaro.org \
--cc=linux-iio@vger.kernel.org \
--cc=marek.vasut@gmail.com \
--cc=maxime.ripard@free-electrons.com \
--cc=thomas.petazzoni@free-electrons.com \
--cc=w.sang@pengutronix.de \
--cc=zdevai@gmail.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).