Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932463AbcCKP1C (ORCPT ); Fri, 11 Mar 2016 10:27:02 -0500 Received: from mail-wm0-f51.google.com ([74.125.82.51]:35199 "EHLO mail-wm0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932328AbcCKP0z (ORCPT ); Fri, 11 Mar 2016 10:26:55 -0500 Subject: Re: [PATCH-vs-togreg 1/2] iio: ina2xx-adc: update the CALIB. register when RShunt changes To: "Andrew F. Davis" , jic23@kernel.org, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net References: <1457707950-17593-1-git-send-email-marc.titinger@baylibre.com> <56E2DE7E.5090905@ti.com> Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org From: Marc Titinger Message-ID: <56E2E3BC.6090405@baylibre.com> Date: Fri, 11 Mar 2016 16:26:52 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <56E2DE7E.5090905@ti.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1086 Lines: 43 On 11/03/2016 16:04, Andrew F. Davis wrote: ... >> >> @@ -599,6 +621,8 @@ static const struct iio_info ina2xx_info = { >> .debugfs_reg_access = ina2xx_debug_reg, >> }; >> >> + >> + > > ? > Ok, will fix in v2, thanks ! M. >> /* Initialize the configuration and calibration registers. */ >> static int ina2xx_init(struct ina2xx_chip_info *chip, unsigned int config) >> { >> @@ -609,17 +633,7 @@ static int ina2xx_init(struct ina2xx_chip_info *chip, unsigned int config) >> if (ret) >> return ret; >> >> - /* >> - * Set current LSB to 1mA, shunt is in uOhms >> - * (equation 13 in datasheet). We hardcode a Current_LSB >> - * of 1.0 x10-6. The only remaining parameter is RShunt. >> - * There is no need to expose the CALIBRATION register >> - * to the user for now. >> - */ >> - regval = DIV_ROUND_CLOSEST(chip->config->calibration_factor, >> - chip->shunt_resistor); >> - >> - return regmap_write(chip->regmap, INA2XX_CALIBRATION, regval); >> + return ina2xx_set_calibration(chip); >> } >> >> static int ina2xx_probe(struct i2c_client *client, >>