linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael Welling <mwelling@ieee.org>
To: Lucas De Marchi <lucas.de.marchi@gmail.com>
Cc: Daniel Baluta <daniel.baluta@intel.com>,
	Jonathan Cameron <jic23@kernel.org>,
	Hartmut Knaack <knaack.h@gmx.de>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
	lkml <linux-kernel@vger.kernel.org>,
	linux-iio@vger.kernel.org,
	Lucas De Marchi <lucas.demarchi@intel.com>,
	Guenter Roeck <linux@roeck-us.net>,
	eibach@gdsys.de
Subject: Re: [PATCH v4] iio: adc: Add TI ADS1015 ADC driver support
Date: Mon, 29 Feb 2016 20:42:17 -0600	[thread overview]
Message-ID: <20160301024217.GA12912@deathstar> (raw)
In-Reply-To: <CAKi4VAKBOge=-DcT9S7+uZWUte3EFNQ95u-fHCudRXZHqYuE1w@mail.gmail.com>

On Mon, Feb 29, 2016 at 10:09:10PM -0300, Lucas De Marchi wrote:
> On Mon, Feb 29, 2016 at 9:50 PM, Michael Welling <mwelling@ieee.org> wrote:
> > On Fri, Feb 05, 2016 at 03:17:18PM +0200, Daniel Baluta wrote:
> >> The driver has sysfs readings with runtime PM support for power saving.
> >> It also offers buffer support that can be used together with IIO software
> >> triggers.
> >>
> >
> > Daniel,
> >
> > So I noticed something yesterday while testing new boards.
> > The channels are occassionally swapping when accessing data from multiple channels.
> >
> > I wrote a simple bash script to demonstrate.
> 
> This happened to me in a previous version of the patch. I remember it
> being fixed in the last version (or at least I could not reproduce).
> I'll test again tomorrow with your script.
>

Here is what I believe is happening.

The request for a conversion on a new channel comes in while the conversion
for the previous channel is still converting. The driver waits approximately
one conversion cycle. The previous channel completes within this timeframe
and the MUX is changed and the new sample is started. The new sample is still
converting and the driver returns the value from the previous conversion.

For a test I multiplied the conv_time value by 2 in the ads1015_get_adc_result
function. This allows time for the current sample flush out and always returns
the appropriate channel's value.

Looking at the buffered mode it appears that only one channel is being accessed
at any time. This being the first one in the active_scan_mask found by
find_first_bit. So the MUX would never change is buffered mode as far I can
tell.

Don't we typically want to read all of enabled channels in buffered mode?
 
> Lucas De Marchi

  parent reply	other threads:[~2016-03-01  2:42 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-05 13:17 [PATCH v4] iio: adc: Add TI ADS1015 ADC driver support Daniel Baluta
2016-02-05 17:25 ` Michael Welling
2016-02-05 19:32   ` Daniel Baluta
2016-02-05 19:50     ` Michael Welling
2016-02-06  0:32     ` Michael Welling
2016-02-08 10:25       ` Wolfram Sang
2016-02-08 14:44         ` Daniel Baluta
2016-02-08 15:03           ` Daniel Baluta
2016-02-08 16:37           ` Michael Welling
2016-02-08 16:36         ` Michael Welling
2016-02-08 19:11           ` Sricharan
2016-02-08 19:16             ` Michael Welling
2016-02-08 20:00               ` Wolfram Sang
2016-02-08 20:06                 ` Michael Welling
2016-02-10 12:22               ` Sricharan
2016-02-10 12:56                 ` Daniel Baluta
2016-02-10 15:09                   ` Sricharan
2016-02-10 16:36                     ` Michael Welling
2016-02-17 23:53                       ` Michael Welling
2016-02-18  8:45                         ` Sricharan
2016-02-05 21:02 ` Lucas De Marchi
2016-02-05 21:44   ` Daniel Baluta
2016-02-06 10:52     ` Jonathan Cameron
2016-02-06 11:05 ` Jonathan Cameron
2016-02-06 11:07   ` Jonathan Cameron
2016-03-01  0:50 ` Michael Welling
2016-03-01  1:09   ` Lucas De Marchi
2016-03-01  1:16     ` Michael Welling
2016-03-01  1:33     ` Michael Welling
2016-03-01  2:42     ` Michael Welling [this message]
2016-03-01  8:35       ` jic23
2016-03-01 16:02         ` Michael Welling
2016-03-01 17:24           ` Jonathan Cameron
2016-03-01 11:28       ` Daniel Baluta
2016-03-01 15:57         ` Michael Welling

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=20160301024217.GA12912@deathstar \
    --to=mwelling@ieee.org \
    --cc=daniel.baluta@intel.com \
    --cc=eibach@gdsys.de \
    --cc=jic23@kernel.org \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=lucas.de.marchi@gmail.com \
    --cc=lucas.demarchi@intel.com \
    --cc=pmeerw@pmeerw.net \
    /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).