From: Jonathan Cameron <jic23@cam.ac.uk>
To: Paul Thomas <pthomas8589@gmail.com>
Cc: linux-iio@vger.kernel.org
Subject: Re: [PATCH] iio: [v2] add support for Analog Devices ad7194 a/d converter
Date: Mon, 15 Aug 2011 17:19:58 +0100 [thread overview]
Message-ID: <4E49472E.90104@cam.ac.uk> (raw)
In-Reply-To: <CAD56B7dVPpUB4twdYOdNx-pNMFVuxRANfNOjvqJV0Z357e_qQQ@mail.gmail.com>
On 08/15/11 16:57, Paul Thomas wrote:
> On Mon, Aug 15, 2011 at 2:52 AM, Jonathan Cameron <jic23@cam.ac.uk> wrote:
>> On 08/14/11 21:18, Paul Thomas wrote:
>>> This uses the iio sysfs interface, and inculdes gain
>> includes
>>
>> Couple of left over bits from chan_spec conversion that need
>> cleaning up and a that gain attribute wants to be done via the
>> scale_shared chan_info element instead.
> OK, most of that makes sense. I might have more questions latter, but
> one question for now. You say to use the scale_shared for the gain
> (can you point do a good example of this?) I just want to make sure
> we're on the same page as to what the gain is doing. It's really just
> setting the range of the voltage input I scale the result back down to
> volts. So if the input voltage is 0.2V you get 0.2V Whether you set
> the gain to 1 or 8
Ah, I missed that. In that case, given it's internal only, it should
be IIO_CHAN_INFO_CALIBSCALE_SHARED and you should be setting processed_val
in iio_chan_spec structures and scaling to millivolts not volts
(we may change everything to volts but haven't done it yet).
For a device like this we tend to leave things raw and use the scale attribute
to tell userspace enough to know how to convert it to SI units. Doesn't
matter so much with devices only being accessed over sysfs (hence fine here)
but you don't want to waste time with conversions when pushing to a buffer.
Jonathan
next prev parent reply other threads:[~2011-08-15 16:11 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-14 20:18 [PATCH] iio: [v2] add support for Analog Devices ad7194 a/d converter Paul Thomas
2011-08-14 20:21 ` Paul Thomas
2011-08-15 9:52 ` Jonathan Cameron
2011-08-15 15:57 ` Paul Thomas
2011-08-15 16:19 ` Jonathan Cameron [this message]
2011-08-15 16:47 ` Paul Thomas
2011-08-17 15:05 ` 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=4E49472E.90104@cam.ac.uk \
--to=jic23@cam.ac.uk \
--cc=linux-iio@vger.kernel.org \
--cc=pthomas8589@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.