public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Stefan Brüns" <stefan.bruens@rwth-aachen.de>
To: Jonathan Cameron <jic23@kernel.org>
Cc: <linux-iio@vger.kernel.org>,
	Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
	Maciej Purski <m.purski@samsung.com>,
	<linux-kernel@vger.kernel.org>, "Andrew F . Davis" <afd@ti.com>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Hartmut Knaack <knaack.h@gmx.de>
Subject: Re: [PATCH v1 3/7] iio: adc: ina2xx: Remove unneeded dummy read to clear CNVR flag
Date: Wed, 13 Dec 2017 00:48:40 +0100	[thread overview]
Message-ID: <2569854.02uJhrbl9B@pebbles> (raw)
In-Reply-To: <20171212201530.3c64d47e@archlinux>

[-- Attachment #1: Type: text/plain, Size: 2312 bytes --]

On Tuesday, December 12, 2017 9:15:30 PM CET Jonathan Cameron wrote:
> On Sun, 10 Dec 2017 21:53:42 +0100
> 
> Stefan Brüns <stefan.bruens@rwth-aachen.de> wrote:
> > On Sunday, December 10, 2017 6:27:33 PM CET Jonathan Cameron wrote:
> > > On Fri, 8 Dec 2017 18:41:48 +0100
> > > 
> > > Stefan Brüns <stefan.bruens@rwth-aachen.de> wrote:
> > > > Although the datasheet states the CNVR flag is cleared by reading the
> > > > BUS_VOLTAGE register, it is actually cleared by reading any of the
> > > > voltage/current/power registers.
> > > > 
> > > > The behaviour has been confirmed by TI support:
> > > > http://e2e.ti.com/support/amplifiers/current-shunt-monitors/f/931/p/64
> > > > 7053
> > > > /2378282
> > > > 
> > > > Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
> > > 
> > > I haven't checked the code thoroughly so there may well be something
> > > stopping it but have you checked the case where the only channel enabled
> > > is
> > > the timestamp?
> > > 
> > > Obviously it makes little sense, but IIRC there is nothing in the core
> > > preventing that happening.
> > 
> > The timestamp is completely unrelated to the status register, so I fail to
> > understand your question. Can you please clarify?
> 
> If you only have a timestamp, the trigger will still fire (I think)
> but you'll do no reading at all from the device.  If configured in this,
> admittedly odd, way you should just get a stream of timestamps with no
> data.

If there are reads depends on the mode - if running asynchronously, it will 
just stream out 64 bits of timestamp each interval. In synchronous mode, the 
driver will read the status register (low bits of bus voltage register for 
INA219, msk register for INA226), which implicitly clears the CNVR flag.
 
> > This only removes a redundant read.
> 
> The question is whether it is redundant if we have no non timestamp
> registers enabled.

According to the documentation, INA219 and 226 had to be treated differently. 
As it turned out, both actually behave the same way regarding the CNVR flag, 
so we just poll the status register, which for both devices clears the flag.

Regards,

Stefan


-- 
Stefan Brüns  /  Bergstraße 21  /  52062 Aachen
home: +49 241 53809034     mobile: +49 151 50412019

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

  reply	other threads:[~2017-12-12 23:48 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20171208174152.30341-1-stefan.bruens@rwth-aachen.de>
2017-12-08 17:41 ` [PATCH v1 1/7] iio: adc: ina2xx: Remove bogus cast for data argument Stefan Brüns
2017-12-17  9:43   ` Jonathan Cameron
2017-12-08 17:41 ` [PATCH v1 2/7] iio: adc: ina2xx: Clarify size requirement for data buffer Stefan Brüns
2017-12-17  9:44   ` Jonathan Cameron
2017-12-08 17:41 ` [PATCH v1 3/7] iio: adc: ina2xx: Remove unneeded dummy read to clear CNVR flag Stefan Brüns
2017-12-10 17:27   ` Jonathan Cameron
2017-12-10 20:53     ` Stefan Brüns
2017-12-12 20:15       ` Jonathan Cameron
2017-12-12 23:48         ` Stefan Brüns [this message]
2017-12-17 10:09           ` Jonathan Cameron
2017-12-08 17:41 ` [PATCH v1 4/7] iio: adc: ina2xx: Do not udelay for several seconds Stefan Brüns
2017-12-17 11:53   ` Jonathan Cameron
2017-12-08 17:41 ` [PATCH v1 5/7] iio: adc: ina2xx: Use a monotonic clock for delay calculation Stefan Brüns
2017-12-10 17:31   ` Jonathan Cameron
2017-12-10 20:47     ` Stefan Brüns
2017-12-12 20:21       ` Jonathan Cameron
2017-12-17 11:56         ` Jonathan Cameron
2017-12-08 17:41 ` [PATCH v1 6/7] iio: adc: ina2xx: Align timestamp with conversion ready flag Stefan Brüns
2017-12-08 17:41 ` [PATCH v1 7/7] iio: adc: ina2xx: Actually align the loop with the " Stefan Brüns

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=2569854.02uJhrbl9B@pebbles \
    --to=stefan.bruens@rwth-aachen.de \
    --cc=afd@ti.com \
    --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=m.purski@samsung.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