public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Jan Kiszka <jan.kiszka@siemens.com>, Jonathan Cameron <jic23@kernel.org>
Cc: linux-iio@vger.kernel.org,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Sascha Weisenberger <sascha.weisenberger@siemens.com>,
	Mika Westerberg <mika.westerberg@linux.intel.com>,
	Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
	Rob Herring <robh@kernel.org>
Subject: Re: [PATCH v3] iio: adc: Add support for TI ADC108S102 and ADC128S102
Date: Fri, 05 May 2017 12:54:18 +0300	[thread overview]
Message-ID: <1493978058.30052.26.camel@linux.intel.com> (raw)
In-Reply-To: <6d6bf102-1bc9-7019-13fa-b8f86b002dc8@siemens.com>

On Fri, 2017-05-05 at 08:31 +0200, Jan Kiszka wrote:
> This is an upstream port of an IIO driver for the TI ADC108S102 and
> ADC128S102. The former can be found on the Intel Galileo Gen2 and the
> Siemens SIMATIC IOT2000. For those boards, ACPI-based enumeration is
> included.
> 
> Due to the lack of regulators under ACPI, we need a special device
> property to define the voltage provide to the VA pin of the ADC
> ("va-millivolt"). For DT usage, the regulator "vref-supply" is
> requested. Note that DT usage has not been tested.

+1 to what Mika commented on this and just some additional information.

Other than that looks pretty good.

> Changes in v3:
>  - Reworked reference voltage handling, splitting up the different
> ACPI
>    case from DT usage. This also means that the "va-millivolt"
>    (formerly and incorrectly called "ext-vin-microvolt") becomes
>    ACPI-only

Just to be clean, there is *no* such thing as *XYZ-only* device
properties. The idea behind them is to provide resource provider
agnostic API to read properties.

> +			if (st->reg)
> +				*val = regulator_get_voltage(st->reg) 
> / 1000;
> +			else
> +				*val = st->va_millivolt;
> +

Another way is to not just hard code the value, but create a fixed
voltage regulator out of it. In this case you will have one way to get
its value.

> +		st->reg = devm_regulator_get(&spi->dev, "vref");

It should be _optional like I mentioned in one of previous review.

> +	if (!IS_ERR(st->reg))

This is redundant

> +		regulator_disable(st->reg);

> +	if (!IS_ERR(st->reg))

Ditto.

> +		regulator_disable(st->reg);


-- 
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy

  parent reply	other threads:[~2017-05-05  9:56 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-05  6:31 [PATCH v3] iio: adc: Add support for TI ADC108S102 and ADC128S102 Jan Kiszka
2017-05-05  9:40 ` Mika Westerberg
2017-05-05 10:23   ` Jan Kiszka
2017-05-05 10:40     ` Mika Westerberg
2017-05-05 18:50       ` Jonathan Cameron
2017-05-05  9:54 ` Andy Shevchenko [this message]
2017-05-05 10:39   ` Jan Kiszka
2017-05-05 18:52     ` Jonathan Cameron
2017-05-05 20:09       ` Jan Kiszka
2017-05-05 20:32         ` Andy Shevchenko
2017-05-07 11:19           ` Jonathan Cameron
2017-05-05 18:55 ` Jonathan Cameron
2017-05-05 19:09   ` Andy Shevchenko
2017-05-07 11:17     ` Jonathan Cameron

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=1493978058.30052.26.camel@linux.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=jan.kiszka@siemens.com \
    --cc=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.com \
    --cc=pmeerw@pmeerw.net \
    --cc=robh@kernel.org \
    --cc=sascha.weisenberger@siemens.com \
    /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