From: Jonathan Cameron <jic23@cam.ac.uk>
To: michael.hennerich@analog.com
Cc: linux-iio@vger.kernel.org,
device-drivers-devel@blackfin.uclinux.org, drivers@analog.com
Subject: Re: [PATCH 1/2] iio: industrialio-core: Add IIO_OUT type
Date: Fri, 10 Jun 2011 14:00:18 +0100 [thread overview]
Message-ID: <4DF21562.8040008@cam.ac.uk> (raw)
In-Reply-To: <1307706541-4750-1-git-send-email-michael.hennerich@analog.com>
On 06/10/11 12:49, michael.hennerich@analog.com wrote:
> From: Michael Hennerich <michael.hennerich@analog.com>
>
> Add IIO_OUT type for DAC like devices
> In case of IIO_OUT make sure the channel device attribute is writable
>
> Ideally we add a flag to iio_chan_spec that tells the core that
> the channel device attribute is writable...
That probably makes sense if / when we redo the naming again.
>
> Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
> ---
> drivers/staging/iio/iio.h | 1 +
> drivers/staging/iio/industrialio-core.c | 4 +++-
> 2 files changed, 4 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/staging/iio/iio.h b/drivers/staging/iio/iio.h
> index 9ca89c7..7a6ce4d 100644
> --- a/drivers/staging/iio/iio.h
> +++ b/drivers/staging/iio/iio.h
> @@ -30,6 +30,7 @@
> enum iio_chan_type {
> /* real channel types */
> IIO_IN,
> + IIO_OUT,
> IIO_CURRENT,
> IIO_POWER,
> IIO_ACCEL,
> diff --git a/drivers/staging/iio/industrialio-core.c b/drivers/staging/iio/industrialio-core.c
> index 744153e..8fa2be6 100644
> --- a/drivers/staging/iio/industrialio-core.c
> +++ b/drivers/staging/iio/industrialio-core.c
> @@ -47,6 +47,7 @@ static const char * const iio_chan_type_name_spec_shared[] = {
> [IIO_TIMESTAMP] = "timestamp",
> [IIO_ACCEL] = "accel",
> [IIO_IN] = "in",
> + [IIO_OUT] = "out",
> [IIO_CURRENT] = "current",
> [IIO_POWER] = "power",
> [IIO_IN_DIFF] = "in-in",
> @@ -675,7 +676,8 @@ static int iio_device_add_channel_sysfs(struct iio_dev *dev_info,
> else
> ret = __iio_add_chan_devattr("raw", NULL, chan,
> &iio_read_channel_info,
> - NULL,
> + (chan->type == IIO_OUT ?
> + &iio_write_channel_info : NULL),
> 0,
> 0,
> &dev_info->dev,
next prev parent reply other threads:[~2011-06-10 12:52 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-10 11:49 [PATCH 1/2] iio: industrialio-core: Add IIO_OUT type michael.hennerich
2011-06-10 11:49 ` [PATCH 2/2] iio: dac: New driver for AD5686R, AD5685R, AD5684R Digital to analog converters michael.hennerich
2011-06-10 13:15 ` Jonathan Cameron
2011-06-10 13:33 ` Michael Hennerich
2011-06-10 13:56 ` Jonathan Cameron
2011-06-10 13:00 ` Jonathan Cameron [this message]
-- strict thread matches above, loose matches on Subject: below --
2011-06-10 13:40 [PATCH 1/2] iio: industrialio-core: Add IIO_OUT type michael.hennerich
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=4DF21562.8040008@cam.ac.uk \
--to=jic23@cam.ac.uk \
--cc=device-drivers-devel@blackfin.uclinux.org \
--cc=drivers@analog.com \
--cc=linux-iio@vger.kernel.org \
--cc=michael.hennerich@analog.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