Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752369AbdDLDBy (ORCPT ); Tue, 11 Apr 2017 23:01:54 -0400 Received: from mx-out-2.rwth-aachen.de ([134.130.5.187]:49260 "EHLO mx-out-2.rwth-aachen.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751686AbdDLDBw (ORCPT ); Tue, 11 Apr 2017 23:01:52 -0400 X-IronPort-AV: E=Sophos;i="5.37,188,1488841200"; d="scan'208";a="496118010" From: =?UTF-8?q?Stefan=20Br=C3=BCns?= To: CC: , Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , =?UTF-8?q?Stefan=20Br=C3=BCns?= Subject: [PATCH 0/2] Enhancements for TI INA219/220 current/voltage monitors Date: Wed, 12 Apr 2017 05:01:38 +0200 X-Mailer: git-send-email 2.12.0 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [78.48.237.175] X-ClientProxiedBy: rwthex-s1-b.rwth-ad.de (2002:8682:1a99::8682:1a99) To rwthex-w2-b.rwth-ad.de (2002:8682:1a9f::8682:1a9f) Message-ID: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 931 Lines: 24 The ina2xx adc driver does not handle differences between INA219/220 and INA226/230/231 completely: - The 219 uses a 4 bit register field for for the bus/shunt voltage adc integration times each, whereas the 226 uses two 3 bit fields for the integration times and an additional 3 bit averaging field. The first patch correct setting integration times in the config register. - The 219 also has an adjustable PGA. The default setting allows the maximum range, but also reduces accuracy. The second patch adds attributes for shunt PGA gain and bus voltage range (bus voltage PGA), and sets the config register accordingly. Stefan BrĂ¼ns (2): iio: adc: Fix integration time/averaging for INA219/220 iio: adc: Allow setting Shunt Voltage PGA gain and Bus Voltage range drivers/iio/adc/ina2xx-adc.c | 344 ++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 322 insertions(+), 22 deletions(-) -- 2.12.0