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] iio: industrialio-core: introduce IIO_VAL_INT_PLUS_NANO
Date: Tue, 31 May 2011 17:12:49 +0100 [thread overview]
Message-ID: <4DE51381.80204@cam.ac.uk> (raw)
In-Reply-To: <1306504304-19379-1-git-send-email-michael.hennerich@analog.com>
On 05/27/11 14:51, michael.hennerich@analog.com wrote:
> From: Michael Hennerich <michael.hennerich@analog.com>
>
>
As discussed, handling the writing case is more tricky, but as our
only user is read only we can tackle that in the future.
> 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 | 5 +++++
> 2 files changed, 6 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/staging/iio/iio.h b/drivers/staging/iio/iio.h
> index 38f1425..78a0927 100644
> --- a/drivers/staging/iio/iio.h
> +++ b/drivers/staging/iio/iio.h
> @@ -202,6 +202,7 @@ static inline s64 iio_get_time_ns(void)
> * call to iio_device_register. */
> #define IIO_VAL_INT 1
> #define IIO_VAL_INT_PLUS_MICRO 2
> +#define IIO_VAL_INT_PLUS_NANO 3
>
> /**
> * struct iio_info - constant information about device
> diff --git a/drivers/staging/iio/industrialio-core.c b/drivers/staging/iio/industrialio-core.c
> index 94d3bfa..e5a7663 100644
> --- a/drivers/staging/iio/industrialio-core.c
> +++ b/drivers/staging/iio/industrialio-core.c
> @@ -396,6 +396,11 @@ static ssize_t iio_read_channel_info(struct device *dev,
> return sprintf(buf, "-%d.%06u\n", val, -val2);
> else
> return sprintf(buf, "%d.%06u\n", val, val2);
> + } else if (ret == IIO_VAL_INT_PLUS_NANO) {
> + if (val2 < 0)
> + return sprintf(buf, "-%d.%09u\n", val, -val2);
> + else
> + return sprintf(buf, "%d.%09u\n", val, val2);
> } else
> return 0;
> }
next prev parent reply other threads:[~2011-05-31 16:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-27 13:51 [PATCH] iio: industrialio-core: introduce IIO_VAL_INT_PLUS_NANO michael.hennerich
2011-05-31 16:12 ` Jonathan Cameron [this message]
-- strict thread matches above, loose matches on Subject: below --
2011-06-06 7:25 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=4DE51381.80204@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