[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230617193715.20d0c048@jic23-huawei>
Date: Sat, 17 Jun 2023 19:37:15 +0100
From: Jonathan Cameron <jic23@...nel.org>
To: Andy Shevchenko <andy.shevchenko@...il.com>
Cc: "Paller, Kim Seer" <KimSeer.Paller@...log.com>,
"lars@...afoo.de" <lars@...afoo.de>,
"lgirdwood@...il.com" <lgirdwood@...il.com>,
"broonie@...nel.org" <broonie@...nel.org>,
"Hennerich, Michael" <Michael.Hennerich@...log.com>,
"robh@...nel.org" <robh@...nel.org>,
"krzysztof.kozlowski@...aro.org" <krzysztof.kozlowski@...aro.org>,
"conor+dt@...nel.org" <conor+dt@...nel.org>,
"linux-iio@...r.kernel.org" <linux-iio@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>
Subject: Re: [PATCH v6 2/2] iio: adc: max14001: New driver
On Sat, 17 Jun 2023 19:34:23 +0100
Jonathan Cameron <jic23@...nel.org> wrote:
> On Wed, 14 Jun 2023 14:53:12 +0300
> Andy Shevchenko <andy.shevchenko@...il.com> wrote:
>
> > On Wed, Jun 14, 2023 at 1:43 PM Paller, Kim Seer
> > <KimSeer.Paller@...log.com> wrote:
> > > > From: Andy Shevchenko <andy.shevchenko@...il.com>
> > > > Sent: Wednesday, June 14, 2023 5:12 PM
> >
> > ...
> >
> > > > > + /* select external voltage reference source for the ADC */
> > > > > + ret = max14001_reg_update(st, MAX14001_CFG,
> > > > > + MAX14001_CFG_EXRF, 1);
> > > > > +
> > > > > + ret = regulator_get_voltage(vref);
> > > > > + if (ret < 0)
> > > > > + return dev_err_probe(dev, ret,
> > > > > + "Failed to get vref\n");
> > > >
> > > > Is it important to choose the external reference source _before_ getting the
> > > > voltage of the regulator? If not, I would swap these calls, otherwise the
> > > > comment is needed to explain why the sequence is important in the way it's
> > > > written.
> > >
> > > It is not important. These calls can be swap without any issues.
> >
> > If you send a new version, please swap, otherwise I hope Jonathan can
> > do it when applying.
> >
>
> I made these changes whilst applying...
>
> --- 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;
>
> - /* select external voltage reference source for the ADC */
> - ret = max14001_reg_update(st, MAX14001_CFG,
> - MAX14001_CFG_EXRF, 1);
> -
> ret = regulator_get_voltage(vref);
> if (ret < 0)
> return dev_err_probe(dev, ret,
> "Failed to get vref\n");
>
> st->vref_mv = ret / 1000;
> +
> + /* select external voltage reference source for the ADC */
> + ret = max14001_reg_update(st, MAX14001_CFG,
> + MAX14001_CFG_EXRF, 1);
> +
> + if (ret < 0)
> + return ret;
> }
>
> mutex_init(&st->lock);
>
>
> Note that whilst I've applied this to the togreg branch of iio.git - it is 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 tests.
I'll address that in a separate reply.
Jonathan
>
> Thanks,
>
> Jonathan
Powered by blists - more mailing lists