Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp4353760rwd; Sat, 17 Jun 2023 11:54:02 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4CCqryUzN3nHY4dw8Mhj4HBFZGb+ij4Voe8E2DI8WYsgXCcmblOLqVmfK1Oc38fIRls+yc X-Received: by 2002:a17:902:f68a:b0:1b4:5699:aac8 with SMTP id l10-20020a170902f68a00b001b45699aac8mr14695058plg.21.1687028042346; Sat, 17 Jun 2023 11:54:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687028042; cv=none; d=google.com; s=arc-20160816; b=dDhoi0ohfN7mUtg5m9UBnd7XuShWg1I0tzRlcWh6HDhvg6FFLLY4/Nm12ovPggE9Qw Ul9fFyVIhbIbv6yRZesaW/7AvFMOhQyqJdCfgFcCOstTSV6nUdBodG9cT2vfx3IxYnKm AxlZiAk5EAyUfS39f0DnwfMsNjUHdWVBqMqjh4lxPmXsx6n6Z7QOrPgYyc7JEDTPGaLJ AD0wyZeS/r/sDxn+uygj5r++BQMW2riZkmOf8TRjjtx0n3PruVHgEvPzoShCu25PT1N6 hIk/zAQ93G95a5qMEm05yON/u2B/hjtvOML425dfhFVyqWYQoFLIhXugfMQv0dQK2ibo OUQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=BE1ldc+Q0o7l0qQGYAqTUzP7dtjwlFlMxKm9iixre5o=; b=oA4ChhixnqnudHR6kfM20ZRMl8gK4l3s1frgI8Lv+lhsP55VfD8qbKUeF5vTyEe9Tm pfKZ6eGjBGwskCxdnGBN59fxNEiRdhdi4hH+OLH1aJvoH51FNFaAS+Z/VdeZT9VBjkl0 dK/WKKnSBZuT6Ep0xZiQft2ohQtghlzOgPsllmnxhe5ng55uG7/GSTtVafYKqjyc5gk1 Baa3FDTOJi50HR78o2yoZEcsz3ABHowrAbOeE3FlUuQYXIMyPy/vbaNO1XFDKQwODQQC LTusKHNRWg3DXdms74imlIrIofZHGVPe4RsKi5w/GvH2NW7KWLdtQb4qwZsgFv2jq+R1 QQbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QHsuxD7r; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r7-20020a63e507000000b00524ecfa05d8si3516256pgh.15.2023.06.17.11.53.49; Sat, 17 Jun 2023 11:54:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QHsuxD7r; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346445AbjFQSh1 (ORCPT + 99 others); Sat, 17 Jun 2023 14:37:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49342 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229515AbjFQShZ (ORCPT ); Sat, 17 Jun 2023 14:37:25 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A856C19A3; Sat, 17 Jun 2023 11:37:24 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 3BEF660B5A; Sat, 17 Jun 2023 18:37:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C3ACFC433C8; Sat, 17 Jun 2023 18:37:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687027043; bh=0gXitJCRhwNZ9Hvgsis90nxHbGGP+Fap5swbmod0VXI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=QHsuxD7r4OSzwnmlVvStlH4wUNHu11qxRTL4ZHrU3yjWlrTqkKVHpgwu15D642Uym 7LcSVxOiQtr3SqEEkAixLNTXURcqF+gwQAnMcmVJeyHS/nQ/DSbzaKcd/j3qsO+Kys W6axLT+rbFAulYWP4fm582NZ4yd3JSmKI/GnRIj47B73ZhgDY4e4f6sfao9/MliHE0 iOR76vV5tzXIHgv7PzIFk1gVxecoQdYaAo6tyY2+mbt5dPQqpDdTD7qw8BTGkauOu+ ulfUe8Qd3qShNmAvOzVsH+vQ5qsHkQ+LVzs1qx+M85HPIhH38dC72OsrmWEjU6GHtj pTsvgu31hd3pg== Date: Sat, 17 Jun 2023 19:37:15 +0100 From: Jonathan Cameron To: Andy Shevchenko Cc: "Paller, Kim Seer" , "lars@metafoo.de" , "lgirdwood@gmail.com" , "broonie@kernel.org" , "Hennerich, Michael" , "robh@kernel.org" , "krzysztof.kozlowski@linaro.org" , "conor+dt@kernel.org" , "linux-iio@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "devicetree@vger.kernel.org" Subject: Re: [PATCH v6 2/2] iio: adc: max14001: New driver Message-ID: <20230617193715.20d0c048@jic23-huawei> In-Reply-To: <20230617193423.42a4d66c@jic23-huawei> References: <20230614004857.134980-1-kimseer.paller@analog.com> <20230614004857.134980-2-kimseer.paller@analog.com> <20230617193423.42a4d66c@jic23-huawei> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 17 Jun 2023 19:34:23 +0100 Jonathan Cameron wrote: > On Wed, 14 Jun 2023 14:53:12 +0300 > Andy Shevchenko wrote: >=20 > > On Wed, Jun 14, 2023 at 1:43=E2=80=AFPM Paller, Kim Seer > > wrote: =20 > > > > From: Andy Shevchenko > > > > Sent: Wednesday, June 14, 2023 5:12 PM =20 > >=20 > > ... > > =20 > > > > > + /* select external voltage reference source for t= he ADC */ > > > > > + ret =3D max14001_reg_update(st, MAX14001_CFG, > > > > > + MAX14001_CFG_EXRF, 1); > > > > > + > > > > > + ret =3D regulator_get_voltage(vref); > > > > > + if (ret < 0) > > > > > + return dev_err_probe(dev, ret, > > > > > + "Failed to get vref\= n"); =20 > > > > > > > > Is it important to choose the external reference source _before_ ge= tting the > > > > voltage of the regulator? If not, I would swap these calls, otherwi= se the > > > > comment is needed to explain why the sequence is important in the w= ay it's > > > > written. =20 > > > > > > It is not important. These calls can be swap without any issues. =20 > >=20 > > If you send a new version, please swap, otherwise I hope Jonathan can > > do it when applying. > > =20 >=20 > I made these changes whilst applying... >=20 > --- a/drivers/iio/adc/max14001.c > +++ b/drivers/iio/adc/max14001.c > @@ -290,16 +290,19 @@ static int max14001_probe(struct spi_device *spi) > if (ret) > return ret; > =20 > - /* select external voltage reference source for the ADC */ > - ret =3D max14001_reg_update(st, MAX14001_CFG, > - MAX14001_CFG_EXRF, 1); > - > ret =3D regulator_get_voltage(vref); > if (ret < 0) > return dev_err_probe(dev, ret, > "Failed to get vref\n"); > =20 > st->vref_mv =3D ret / 1000; > + > + /* select external voltage reference source for the ADC */ > + ret =3D max14001_reg_update(st, MAX14001_CFG, > + MAX14001_CFG_EXRF, 1); > + > + if (ret < 0) > + return ret; > } > =20 > mutex_init(&st->lock); >=20 >=20 > Note that whilst I've applied this to the togreg branch of iio.git - it i= s just > a tiny bit too late to make the merge window that starts in about a week. > As such I'll only push this out as testing until I can rebase the tree > on rc1 once available. Actually nope. Dropped it again because a question came up in my build test= s. I'll address that in a separate reply. Jonathan >=20 > Thanks, >=20 > Jonathan