From: Lars-Peter Clausen <lars@metafoo.de>
To: Jonathan Cameron <jic23@jic23.retrosnub.co.uk>
Cc: Guillaume Ballet <gballetwork@gmail.com>, linux-iio@vger.kernel.org
Subject: Re: Why is only one int returned in iio_read_channel_processed?
Date: Wed, 22 May 2013 10:19:31 +0200 [thread overview]
Message-ID: <519C7F93.9010606@metafoo.de> (raw)
In-Reply-To: <519C7C29.9040707@jic23.retrosnub.co.uk>
On 05/22/2013 10:04 AM, Jonathan Cameron wrote:
> On 22/05/13 08:49, Guillaume Ballet wrote:
>> Hello,
>>
>> The read_raw operation in iio_info has a signature that takes two
>> integer as in/out parameters. This lets the driver return values with
>> micro- or nano-unit precision.
>>
>> However, the high-level iio_read_channel_raw and
>> iio_read_channel_processed
> Do we even have an iio_read_channel_processed? I think you are referring
> to the in kernel consumer interface. In iio/consumer.h we have an
> iio_read_channel_raw but unless I am going mad no iio_read_channel_processed
> (as of yet).
>
> https://git.kernel.org/cgit/linux/kernel/git/jic23/iio.git/tree/include/linux/iio/consumer.h?h=togreg
>
> (is the latest development tree).
>
> Which tree are you looking at?
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/include/linux/iio/consumer.h#n145
>
>> functions' signature only has one integer
>> in/out parameter. That makes sense in the context of _raw because the
>> value isn't yet processed.
>>
>> However, as the scale is a number encoded over two ints, the
>> _processed value should also span two ints. Is there a reason why it's
>> still only one int?
> No it certainly should not be one int for exactly the reasons you have stated.
>>
I'm not to sure about that. I'd rather add a scale parameter to the
iio_read_channel_processed, just in the same way the
convert_raw_to_processed function takes a scale parameter.
- Lars
next prev parent reply other threads:[~2013-05-22 8:19 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-22 7:49 Why is only one int returned in iio_read_channel_processed? Guillaume Ballet
2013-05-22 8:04 ` Jonathan Cameron
2013-05-22 8:19 ` Lars-Peter Clausen [this message]
2013-05-22 9:00 ` Jonathan Cameron
2013-05-22 9:37 ` Guillaume Ballet
2013-05-22 11:43 ` Lars-Peter Clausen
2013-05-22 13:29 ` Guillaume Ballet
2013-05-22 13:39 ` Lars-Peter Clausen
2013-05-22 14:00 ` Guillaume Ballet
2013-05-22 14:15 ` Lars-Peter Clausen
2013-05-22 15:24 ` Guillaume Ballet
2013-05-22 17:14 ` Lars-Peter Clausen
2013-05-23 9:52 ` Guillaume Ballet
2013-05-23 10:39 ` Lars-Peter Clausen
2013-05-23 13:18 ` Guillaume Ballet
2013-05-23 13:28 ` Lars-Peter Clausen
2013-06-02 16:00 ` 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=519C7F93.9010606@metafoo.de \
--to=lars@metafoo.de \
--cc=gballetwork@gmail.com \
--cc=jic23@jic23.retrosnub.co.uk \
--cc=linux-iio@vger.kernel.org \
/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).