From: Daniel Baluta <daniel.baluta@gmail.com>
To: Ladislav Michl <ladis@linux-mips.org>
Cc: "linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
Jonathan Cameron <jic23@kernel.org>
Subject: Re: [PATCH 1/2] iio: adc: ti-ads1015: fix conversion time
Date: Tue, 1 Aug 2017 19:25:14 +0300 [thread overview]
Message-ID: <CAEnQRZDz5hYXpLRH2gXrxAcLLd0FCXSec8oe855vr_ApdujszA@mail.gmail.com> (raw)
In-Reply-To: <20170801095929.avlqhcqv6eq2zll6@lenoch>
On Tue, Aug 1, 2017 at 12:59 PM, Ladislav Michl <ladis@linux-mips.org> wrote:
> On Tue, Aug 01, 2017 at 12:09:34PM +0300, Daniel Baluta wrote:
>> On Tue, Aug 1, 2017 at 11:26 AM, Ladislav Michl <ladis@linux-mips.org> wrote:
>> > When reading diffrent channel value than device is currently processing
>> > wait time of conversion period is applied, which is not enough as device
>> > might be already in the middle of conversion and therefore previously
>> > converted value is returned - the one belonging to another channel.
>> > Fix it by waiting for two sampling periods.
>> >
>> > Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
>>
>> Did you actually experienced this in practice? I guess you are right,
>> if you change the channel during a conversion, this change will be applied
>> to the next conversion *but* reading will still return old value because the
>> current conversion hasn't finished yet.
>
> Yes, that's what actually happens without patch and could be easily
> demonstrated from command line:
>
> $ cat in_voltage0_raw
> 847
> $ cat in_voltage1_raw
> 846
> $ cat in_voltage1_raw
> 195
> $ cat in_voltage0_raw
> 196
> $ cat in_voltage0_raw
> 846
>
> Btw, driver is using continuous conversion mode, but I was unable to
> make iio_generic_buffer work with it. And for reading values one by
> one single shot mode is enough. Any hints?
Haven't looked at this sensor for long time. Can you tell us what have you
tried and what doesn't work?
Daniel.
next prev parent reply other threads:[~2017-08-01 16:25 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-01 8:25 [PATCH 0/2] iio: adc: ti-ads1015: fix channel crosstalk Ladislav Michl
2017-08-01 8:26 ` [PATCH 1/2] iio: adc: ti-ads1015: fix conversion time Ladislav Michl
2017-08-01 9:09 ` Daniel Baluta
2017-08-01 9:59 ` Ladislav Michl
2017-08-01 16:25 ` Daniel Baluta [this message]
2017-08-09 14:15 ` Jonathan Cameron
2017-08-09 16:27 ` Ladislav Michl
2017-08-01 8:26 ` [PATCH 2/2] iio: adc: ti-ads1015: use dynamically generated attributes Ladislav Michl
2017-08-09 14:11 ` Jonathan Cameron
2017-08-09 16:44 ` Ladislav Michl
2017-08-12 11:10 ` 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=CAEnQRZDz5hYXpLRH2gXrxAcLLd0FCXSec8oe855vr_ApdujszA@mail.gmail.com \
--to=daniel.baluta@gmail.com \
--cc=jic23@kernel.org \
--cc=ladis@linux-mips.org \
--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).