devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tomasz Figa <t.figa@samsung.com>
To: Chanwoo Choi <cw00.choi@samsung.com>, kgene.kim@samsung.com
Cc: linux-samsung-soc@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, kyungmin.park@samsung.com,
	rob.herring@calxeda.com, pawel.moll@arm.com,
	mark.rutland@arm.com, swarren@wwwdotorg.org,
	ijc+devicetree@hellion.org.uk, linux@arm.linux.org.uk
Subject: Re: [PATCH 5/5] ARM: dts: exynos4412-trats2: Add ADC's dt data to get temperature of SoC/battery
Date: Tue, 11 Mar 2014 14:09:00 +0100	[thread overview]
Message-ID: <531F0AEC.7010606@samsung.com> (raw)
In-Reply-To: <1394524494-30641-6-git-send-email-cw00.choi@samsung.com>

Hi Chanwoo,

On 11.03.2014 08:54, Chanwoo Choi wrote:
> This patch use ADC to get the temperature of SoC/battery by using NTC thermistor
> driver in hwmon. NTC thermistor driver covnvert ADC's raw data to temperature
> by using following variables:
>
> - pullup-uv    : Voltage
> - pullup-ohm   : Pull-up resistance
> - pulldown-ohm : Pull-down resistance
> - io-channels  : It means ADC channel.
>

Those properties are well-defined in "ntc,ncp15wb473" DT bindings 
documentation. There is no need to repeat them here.

> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
> ---
>   arch/arm/boot/dts/exynos4412-trats2.dts | 21 +++++++++++++++++++++
>   1 file changed, 21 insertions(+)
>
> diff --git a/arch/arm/boot/dts/exynos4412-trats2.dts b/arch/arm/boot/dts/exynos4412-trats2.dts
> index 4f851cc..fc517c3 100644
> --- a/arch/arm/boot/dts/exynos4412-trats2.dts
> +++ b/arch/arm/boot/dts/exynos4412-trats2.dts
> @@ -106,6 +106,27 @@
>   		};
>   	};
>
> +	adc: adc@126C0000 {
> +		vdd-supply = <&ldo3_reg>;
> +		status = "okay";
> +
> +		ncp15wb473@0 {

style: Nodes should have generic names, e.g. thermistor@0.

Also if node name is suffixed with @unit-address, then the node should 
have a reg property with its first entry corresponding to the 
unit-address. Now there is no physical unit-address definition for those 
thermistors, so they shouldn't use this naming pattern, but rather 
something like "thermistor-0" or "thermistor-ap".

> +			compatible = "ntc,ncp15wb473";
> +			pullup-uv = <1800000>;	 /* VCC_1.8V_AP */
> +			pullup-ohm = <100000>;	 /* 100K */
> +			pulldown-ohm = <100000>; /* 100K */
> +			io-channels = <&adc 1>;  /* AP temperature */
> +		};
> +
> +		ncp15wb473@1 {
> +			compatible = "ntc,ncp15wb473";
> +			pullup-uv = <1800000>;	 /* VCC_1.8V_AP */
> +			pullup-ohm = <100000>;	 /* 100K */
> +			pulldown-ohm = <100000>; /* 100K */
> +			io-channels = <&adc 2>;  /* Battery temperature */
> +		};

Anyway, I don't think it is correct to place IIO consumers under IIO 
provider node, because IIO is not a control bus, but rather a resource 
provider, like GPIO, clock, etc. So both thermistor nodes should be 
placed outside the adc node. (They might be grouped in a simple-bus 
subnode, though, to improve readability.)

Best regards,
Tomasz

  reply	other threads:[~2014-03-11 13:09 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-11  7:54 [PATCH 0/5] ARM: dts: exynos: Add missing dt data to bring kernel of Exynos4x12 Chanwoo Choi
2014-03-11  7:54 ` [PATCH 1/5] ARM: dts: exynos4x12: Add ADC's dt data to read raw data Chanwoo Choi
2014-03-11 12:20   ` Tomasz Figa
2014-03-12  3:31     ` Chanwoo Choi
2014-03-11  7:54 ` [PATCH 2/5] ARM: dts: exynos4x12: Add PMU dt data to support PMU(Perforamnce Monitoring Unit) Chanwoo Choi
2014-03-11 12:21   ` Tomasz Figa
     [not found] ` <1394524494-30641-1-git-send-email-cw00.choi-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2014-03-11  7:54   ` [PATCH 3/5] ARM: dts: exynos4x12: Add GPS_ALIVE power domain Chanwoo Choi
2014-03-11 12:28     ` Tomasz Figa
2014-03-12  3:27       ` Chanwoo Choi
2014-03-11  7:54   ` [PATCH 5/5] ARM: dts: exynos4412-trats2: Add ADC's dt data to get temperature of SoC/battery Chanwoo Choi
2014-03-11 13:09     ` Tomasz Figa [this message]
     [not found]       ` <531F0AEC.7010606-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2014-03-12  6:01         ` Chanwoo Choi
2014-03-11  7:54 ` [PATCH 4/5] ARM: dts: exynos: Move common dt data for interrupt combiner controller Chanwoo Choi
2014-03-11 12:33   ` Tomasz Figa

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=531F0AEC.7010606@samsung.com \
    --to=t.figa@samsung.com \
    --cc=cw00.choi@samsung.com \
    --cc=devicetree@vger.kernel.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=kgene.kim@samsung.com \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=mark.rutland@arm.com \
    --cc=pawel.moll@arm.com \
    --cc=rob.herring@calxeda.com \
    --cc=swarren@wwwdotorg.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).