From: Silvan Murer <silvan.murer@gmail.com>
To: Lars-Peter Clausen <lars@metafoo.de>, jic23@kernel.org
Cc: linux-iio@vger.kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v2] Add support for external reference voltage through the regulator framework
Date: Fri, 18 May 2018 11:13:36 +0200 [thread overview]
Message-ID: <1526634816.32235.24.camel@gmail.com> (raw)
In-Reply-To: <37a86fef-2097-cc02-56e4-9c3ffbe393e3@metafoo.de>
Hi Lars,
Thanks for your review.
Should I create a new version of this patch whithout the whitespace
issues?
Generally question: What is the next step? Do you include the reviewed
patch into the iio.git repository? And do you submit the patches to the
mainline repository?
Sorry for the basic questions, currently I try to understand the whole
flow of the patch flow :)
On Don, 2018-05-17 at 13:01 +0200, Lars-Peter Clausen wrote:
> On 05/15/2018 10:14 PM, Silvan Murer wrote:
> >
> > Add support for external reference voltage through the regulator
> > framework.
> >
> > Signed-off-by: Silvan Murer <silvan.murer@gmail.com>
> Looks good, thanks.
>
> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
>
> Just two tiny whitespace issues.
>
> [...]
> >
> > enum ltc2632_supported_device_ids {
> > @@ -90,7 +96,7 @@ static int ltc2632_read_raw(struct iio_dev
> > *indio_dev,
> >
> > switch (m) {
> > case IIO_CHAN_INFO_SCALE:
> > - *val = chip_info->vref_mv;
> > + *val = st->vref_mv;
> Extra space after the '='.
>
> >
> > *val2 = chan->scan_type.realbits;
> > return IIO_VAL_FRACTIONAL_LOG2;
> > }
> > @@ -247,6 +253,45 @@ static int ltc2632_probe(struct spi_device
> > *spi)
> > chip_info = (struct ltc2632_chip_info *)
> > spi_get_device_id(spi)->driver_data;
> >
> > + st->vref_reg = devm_regulator_get_optional(&spi->dev,
> > "vref");
> > + if (PTR_ERR(st->vref_reg) == -ENODEV) {
> > + /* use internal reference voltage */
> > + st->vref_reg = NULL;
> > + st->vref_mv = chip_info->vref_mv;
> > +
> > + ret = ltc2632_spi_write(spi,
> > LTC2632_CMD_INTERNAL_REFER,
> > + 0, 0, 0);
> > + if (ret) {
> > + dev_err(&spi->dev,
> > + "Set internal reference command
> > failed, %d\n",
> > + ret);
> > + return ret;
> > + }
> > + } else if (IS_ERR(st->vref_reg)) {
> > + dev_err(&spi->dev,
> > + "Error getting voltage reference
> > regulator\n");
> > + return PTR_ERR(st->vref_reg);
> Extra tab before the 'return'.
>
> >
> > + } else {
> > + /* use external reference voltage */
> > + ret = regulator_enable(st->vref_reg);
> > + if (ret) {
> > + dev_err(&spi->dev,
> > + "enable reference regulator
> > failed, %d\n",
> > + ret);
> > + return ret;
> > + }
> > + st->vref_mv = regulator_get_voltage(st->vref_reg)
> > / 1000;
> > +
> > + ret = ltc2632_spi_write(spi,
> > LTC2632_CMD_EXTERNAL_REFER,
> > + 0, 0, 0);
> > + if (ret) {
> > + dev_err(&spi->dev,
> > + "Set external reference command
> > failed, %d\n",
> > + ret);
> > + return ret;
> > + }
> > + }
> > +
> [...]
next prev parent reply other threads:[~2018-05-18 9:13 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-15 20:14 [PATCH v2] Add support for external reference voltage through the regulator framework Silvan Murer
2018-05-17 11:01 ` Lars-Peter Clausen
2018-05-18 9:13 ` Silvan Murer [this message]
2018-05-18 9:59 ` Lars-Peter Clausen
2018-05-20 0:26 ` Silvan Murer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1526634816.32235.24.camel@gmail.com \
--to=silvan.murer@gmail.com \
--cc=devicetree@vger.kernel.org \
--cc=jic23@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).