Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752881AbdLLXsw (ORCPT ); Tue, 12 Dec 2017 18:48:52 -0500 Received: from mail-out-1.itc.rwth-aachen.de ([134.130.5.46]:11247 "EHLO mail-out-1.itc.rwth-aachen.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752723AbdLLXsu (ORCPT ); Tue, 12 Dec 2017 18:48:50 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2AIAwCHajBa/54agoZdGgEBAQEBAgEBA?= =?us-ascii?q?QEIAQEBAYM+ZoEbB50hgX2NaYs9BwMjhElPAoUIQxQBAQEBAQEBAQFrKIUjAQE?= =?us-ascii?q?BAQIBeRALDgoJJQ8BRwYOBYogCAQMqmeKYAEBAQEGAQEBAQEUDwkBg1mCC4M/g?= =?us-ascii?q?yuDL4FSEYJjgyAFkl6QOYEQhmuPQYYSg2UphzGNDokpAgICAgkCGoE7NiKBTnC?= =?us-ascii?q?CdwmCfoFPd4k6AYEUAQEB?= X-IPAS-Result: =?us-ascii?q?A2AIAwCHajBa/54agoZdGgEBAQEBAgEBAQEIAQEBAYM+ZoE?= =?us-ascii?q?bB50hgX2NaYs9BwMjhElPAoUIQxQBAQEBAQEBAQFrKIUjAQEBAQIBeRALDgoJJ?= =?us-ascii?q?Q8BRwYOBYogCAQMqmeKYAEBAQEGAQEBAQEUDwkBg1mCC4M/gyuDL4FSEYJjgyA?= =?us-ascii?q?Fkl6QOYEQhmuPQYYSg2UphzGNDokpAgICAgkCGoE7NiKBTnCCdwmCfoFPd4k6A?= =?us-ascii?q?YEUAQEB?= X-IronPort-AV: E=Sophos;i="5.45,395,1508796000"; d="asc'?scan'208";a="28851852" From: Stefan =?ISO-8859-1?Q?Br=FCns?= To: Jonathan Cameron CC: , Peter Meerwald-Stadler , Maciej Purski , , "Andrew F . Davis" , Lars-Peter Clausen , Hartmut Knaack 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 Message-ID: <2569854.02uJhrbl9B@pebbles> In-Reply-To: <20171212201530.3c64d47e@archlinux> References: <20171208174152.30341-1-stefan.bruens@rwth-aachen.de> <1575331.Q2WhDFQurN@pebbles> <20171212201530.3c64d47e@archlinux> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart3923781.Ejxvntlrnk"; micalg=pgp-sha1; protocol="application/pgp-signature" X-Originating-IP: [92.228.35.179] X-ClientProxiedBy: rwthex-s1-b.rwth-ad.de (2002:8682:1a99::8682:1a99) To rwthex-w2-a.rwth-ad.de (2002:8682:1a9e::8682:1a9e) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2853 Lines: 83 --nextPart3923781.Ejxvntlrnk Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="iso-8859-1" On Tuesday, December 12, 2017 9:15:30 PM CET Jonathan Cameron wrote: > On Sun, 10 Dec 2017 21:53:42 +0100 >=20 > Stefan Br=FCns wrote: > > On Sunday, December 10, 2017 6:27:33 PM CET Jonathan Cameron wrote: > > > On Fri, 8 Dec 2017 18:41:48 +0100 > > >=20 > > > Stefan Br=FCns wrote: > > > > Although the datasheet states the CNVR flag is cleared by reading t= he > > > > BUS_VOLTAGE register, it is actually cleared by reading any of the > > > > voltage/current/power registers. > > > >=20 > > > > The behaviour has been confirmed by TI support: > > > > http://e2e.ti.com/support/amplifiers/current-shunt-monitors/f/931/p= /64 > > > > 7053 > > > > /2378282 > > > >=20 > > > > Signed-off-by: Stefan Br=FCns > > >=20 > > > 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 enab= led > > > is > > > the timestamp? > > >=20 > > > Obviously it makes little sense, but IIRC there is nothing in the core > > > preventing that happening. > >=20 > > The timestamp is completely unrelated to the status register, so I fail= to > > understand your question. Can you please clarify? >=20 > 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= =20 just stream out 64 bits of timestamp each interval. In synchronous mode, th= e=20 driver will read the status register (low bits of bus voltage register for= =20 INA219, msk register for INA226), which implicitly clears the CNVR flag. =20 > > This only removes a redundant read. >=20 > 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 differentl= y.=20 As it turned out, both actually behave the same way regarding the CNVR flag= ,=20 so we just poll the status register, which for both devices clears the flag. Regards, Stefan =2D-=20 Stefan Br=FCns / Bergstra=DFe 21 / 52062 Aachen home: +49 241 53809034 mobile: +49 151 50412019 --nextPart3923781.Ejxvntlrnk Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQSwWRWIpJbl0W4DemNvf0o9jP6qUwUCWjBq2AAKCRBvf0o9jP6q U7+JAJ0fm0sEFiSPeoMF6xtS4jc9dqjZpwCeKUPrqr/bi8KHv5Y6m7tqHxGQXP4= =B+35 -----END PGP SIGNATURE----- --nextPart3923781.Ejxvntlrnk--