2014-06-26 12:22:34

by Naveen Krishna Chatradhi

[permalink] [raw]
Subject: [PATCH 0/3] ARM: DTS: create common dtsi for Peach pit and pi boards

This patchset does the following
1. Create a common dtsi file cros-exynos-peach.dtsi for
exynos5420-peach-pit.dts and exynos5800-peach-pi.dts
2. Adds the ADC based Thermistor nodes and enables them in peach_pit.dts
and peach_pi.dts
3. Adds the ADC based Thermistor nodes for Exynos5250 based Snow
4. Corrects the vendor prefix for thermistors in exynos4412-trats2.dts

Naveen Krishna Chatradhi (3):
ARM: DTS: use new compatible string for thermistors in trats2
ARM: DTS: Add NTC thermistor nodes to Exynos5250 based Snow
ARM: DTS: Add common dts file for Peach PIT and PI along with ADC
nodes

arch/arm/boot/dts/cros-exynos-peach.dtsi | 41 ++++++++++++++++++++++++++++
arch/arm/boot/dts/exynos4412-trats2.dts | 4 +--
arch/arm/boot/dts/exynos5250-snow.dts | 34 +++++++++++++++++++++++
arch/arm/boot/dts/exynos5420-peach-pit.dts | 6 ++++
arch/arm/boot/dts/exynos5800-peach-pi.dts | 6 ++++
5 files changed, 89 insertions(+), 2 deletions(-)
create mode 100644 arch/arm/boot/dts/cros-exynos-peach.dtsi

--
1.7.9.5


2014-06-26 12:22:49

by Naveen Krishna Chatradhi

[permalink] [raw]
Subject: [PATCH 1/3] ARM: DTS: use new compatible string for thermistors in trats2

As Murata Manufactures the NTC based thermistors. The vendor
name in the compatibility is preposed to change to "murata"

This patch uses the new compatibility string in exynos4412 based
Trats2 board.

Signed-off-by: Naveen Krishna Chatradhi <[email protected]>
Cc: Chanwoo Choi <[email protected]>
Reviewed-by: Chanwoo Choi <[email protected]>
---
This patch is carried forward (tracking purpose) along with the other
dts changes in the patch set discussed
http://www.spinics.net/lists/linux-iio/msg13486.html

This patch was posted
http://www.spinics.net/lists/linux-samsung-soc/msg33037.html


arch/arm/boot/dts/exynos4412-trats2.dts | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/exynos4412-trats2.dts b/arch/arm/boot/dts/exynos4412-trats2.dts
index 11967f4..d35755a 100644
--- a/arch/arm/boot/dts/exynos4412-trats2.dts
+++ b/arch/arm/boot/dts/exynos4412-trats2.dts
@@ -771,7 +771,7 @@
};

thermistor-ap@0 {
- compatible = "ntc,ncp15wb473";
+ compatible = "murata,ncp15wb473";
pullup-uv = <1800000>; /* VCC_1.8V_AP */
pullup-ohm = <100000>; /* 100K */
pulldown-ohm = <100000>; /* 100K */
@@ -779,7 +779,7 @@
};

thermistor-battery@1 {
- compatible = "ntc,ncp15wb473";
+ compatible = "murata,ncp15wb473";
pullup-uv = <1800000>; /* VCC_1.8V_AP */
pullup-ohm = <100000>; /* 100K */
pulldown-ohm = <100000>; /* 100K */
--
1.7.9.5

2014-06-26 12:23:08

by Naveen Krishna Chatradhi

[permalink] [raw]
Subject: [PATCH 2/3] ARM: DTS: Add NTC thermistor nodes to Exynos5250 based Snow

Exynos5250 based Snow board has 4 NTC thermistors to measure
temperatures at various points on the board.

IIO based ADC becomes the parent and NTC thermistors are the childs,
via the HWMON interface.

Signed-off-by: Naveen Krishna Chatradhi <[email protected]>
---
Posted earlier by Doug Anderson @ https://lkml.org/lkml/2013/3/27/453

This patch depends on (1/4 and 2/4 patches of) patchset posted
http://www.spinics.net/lists/linux-iio/msg13486.html
Which were applied on to Guenter Roeck's tree.

cat sysfs entries exported by hwmon for 4 thermistors
and verified the values on Snow.

arch/arm/boot/dts/exynos5250-snow.dts | 34 +++++++++++++++++++++++++++++++++
1 file changed, 34 insertions(+)

diff --git a/arch/arm/boot/dts/exynos5250-snow.dts b/arch/arm/boot/dts/exynos5250-snow.dts
index 7bd2df1..0fa7067 100644
--- a/arch/arm/boot/dts/exynos5250-snow.dts
+++ b/arch/arm/boot/dts/exynos5250-snow.dts
@@ -20,6 +20,40 @@
i2c104 = &i2c_104;
};

+ adc@12D10000 {
+ status = "okay";
+ vdd-supply = <&buck5_reg>;
+
+ ncp15wb473@3 {
+ compatible = "murata,ncp15wb473";
+ pullup-uv = <1800000>;
+ pullup-ohm = <47000>;
+ pulldown-ohm = <0>;
+ io-channels = <&adc 3>;
+ };
+ ncp15wb473@4 {
+ compatible = "murata,ncp15wb473";
+ pullup-uv = <1800000>;
+ pullup-ohm = <47000>;
+ pulldown-ohm = <0>;
+ io-channels = <&adc 4>;
+ };
+ ncp15wb473@5 {
+ compatible = "murata,ncp15wb473";
+ pullup-uv = <1800000>;
+ pullup-ohm = <47000>;
+ pulldown-ohm = <0>;
+ io-channels = <&adc 5>;
+ };
+ ncp15wb473@6 {
+ compatible = "murata,ncp15wb473";
+ pullup-uv = <1800000>;
+ pullup-ohm = <47000>;
+ pulldown-ohm = <0>;
+ io-channels = <&adc 6>;
+ };
+ };
+
rtc@101E0000 {
status = "okay";
};
--
1.7.9.5

2014-06-26 12:23:27

by Naveen Krishna Chatradhi

[permalink] [raw]
Subject: [PATCH 3/3] ARM: DTS: Add common dts file for Peach PIT and PI along with ADC nodes

DTS files exynos5420-peach-pit.dts and exynos5800-peach-pi.dts
have lots of device tree nodes in common.

This patch creates a cros-exynos-peach.dts file, which can carry the
device tree nodes common across exynos5420-peach-pit.dts and
exynos5800-peach-pi.dts. Starting with ADC based Thermistor nodes.

Also, enables ADC based thermistors for peach_pi and peach_pit.

Signed-off-by: Naveen Krishna Chatradhi <[email protected]>
---
This patchset needs
"[PATCH v4 00/14] Add Maxim 77802 PMIC support" by "Javier Martinez Canillas"
Posted https://lkml.org/lkml/2014/6/25/668

Intention is to slowly move the common DT nodes across exynos5420-peach-pit.dts
and exynos5800-peach-pi.dts into cros-exynos-peach.dts

I'm unsure of the naming conventions for dts files
Named it "cros-exynos-peach.dts" as below.
used for "cros" + based on "exynos" + boards named "peach" in common.

cat sysfs entries exported by hwmon for 4 thermistors
and verified the values on peach pit.

arch/arm/boot/dts/cros-exynos-peach.dtsi | 41 ++++++++++++++++++++++++++++
arch/arm/boot/dts/exynos5420-peach-pit.dts | 6 ++++
arch/arm/boot/dts/exynos5800-peach-pi.dts | 6 ++++
3 files changed, 53 insertions(+)
create mode 100644 arch/arm/boot/dts/cros-exynos-peach.dtsi

diff --git a/arch/arm/boot/dts/cros-exynos-peach.dtsi b/arch/arm/boot/dts/cros-exynos-peach.dtsi
new file mode 100644
index 0000000..86135bd
--- /dev/null
+++ b/arch/arm/boot/dts/cros-exynos-peach.dtsi
@@ -0,0 +1,41 @@
+/*
+ * Common device tree include for Exynos5420 based Peach PIT and
+ * Exynos5800 based Peach PI.
+ *
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+*/
+
+&adc {
+ ncp15wb473@3 {
+ compatible = "murata,ncp15wb473";
+ pullup-uv = <1800000>;
+ pullup-ohm = <47000>;
+ pulldown-ohm = <0>;
+ io-channels = <&adc 3>;
+ };
+ ncp15wb473@4 {
+ compatible = "murata,ncp15wb473";
+ pullup-uv = <1800000>;
+ pullup-ohm = <47000>;
+ pulldown-ohm = <0>;
+ io-channels = <&adc 4>;
+ };
+ ncp15wb473@5 {
+ compatible = "murata,ncp15wb473";
+ pullup-uv = <1800000>;
+ pullup-ohm = <47000>;
+ pulldown-ohm = <0>;
+ io-channels = <&adc 5>;
+ };
+ ncp15wb473@6 {
+ compatible = "murata,ncp15wb473";
+ pullup-uv = <1800000>;
+ pullup-ohm = <47000>;
+ pulldown-ohm = <0>;
+ io-channels = <&adc 6>;
+ };
+};
diff --git a/arch/arm/boot/dts/exynos5420-peach-pit.dts b/arch/arm/boot/dts/exynos5420-peach-pit.dts
index d124394..682b9c2 100644
--- a/arch/arm/boot/dts/exynos5420-peach-pit.dts
+++ b/arch/arm/boot/dts/exynos5420-peach-pit.dts
@@ -12,6 +12,7 @@
#include <dt-bindings/input/input.h>
#include <dt-bindings/gpio/gpio.h>
#include "exynos5420.dtsi"
+#include "cros-exynos-peach.dtsi"

/ {
model = "Google Peach Pit Rev 6+";
@@ -101,6 +102,11 @@
};
};

+&adc {
+ status = "okay";
+ vdd-supply = <&ldo9_reg>;
+};
+
&dp {
status = "okay";
pinctrl-names = "default";
diff --git a/arch/arm/boot/dts/exynos5800-peach-pi.dts b/arch/arm/boot/dts/exynos5800-peach-pi.dts
index c36c9ce..7552173 100644
--- a/arch/arm/boot/dts/exynos5800-peach-pi.dts
+++ b/arch/arm/boot/dts/exynos5800-peach-pi.dts
@@ -12,6 +12,7 @@
#include <dt-bindings/input/input.h>
#include <dt-bindings/gpio/gpio.h>
#include "exynos5800.dtsi"
+#include "cros-exynos-peach.dtsi"

/ {
model = "Google Peach Pi Rev 10+";
@@ -99,6 +100,11 @@
};
};

+&adc {
+ status = "okay";
+ vdd-supply = <&ldo9_reg>;
+};
+
&dp {
status = "okay";
pinctrl-names = "default";
--
1.7.9.5

2014-06-26 15:21:24

by Javier Martinez Canillas

[permalink] [raw]
Subject: Re: [PATCH 0/3] ARM: DTS: create common dtsi for Peach pit and pi boards

Hello Naveen,

On Thu, Jun 26, 2014 at 2:19 PM, Naveen Krishna Chatradhi
<[email protected]> wrote:
> This patchset does the following
> 1. Create a common dtsi file cros-exynos-peach.dtsi for
> exynos5420-peach-pit.dts and exynos5800-peach-pi.dts

There was some previous discussion in this list about what's the best
approach to handle common DTS chunks, please take a look to
http://patchwork.ozlabs.org/patch/362633/.

In summary, there is a common .dtsi file for Daisy based boards
(arch/arm/boot/dts/exynos5250-cros-common.dtsi) but it seems it turned
out to do more harm than good since having a single .dtsi for all the
common DTS chunks is not quite flexible. As more boards gets
introduced you have to start moving stuff from the common .dtsi file
to the board .dts.

The same was tried to do for OMAP2+ boards and it turned out that you
need to either a) create a hierarchy of .dtsi files to model all the
different board combinations that have similar fragments or b) split
out isolated DTS fragments on an .dtsi and include a set of this
fragments.

For an example of a) you can take a look to
arch/arm/boot/dts/omap3-overo* and for b) to
arch/arm/boot/dts/omap-gpmc-smsc9*.dtsi.

For a Peach Pit/Pi specific example of b) you can look at the recent
arch/arm/boot/dts/cros-ec-keyboard.dtsi file that Doug added for Peach
Pit/Pi keyboard.

Personally I think that b) is a more flexible and reusable approach.
So, maybe instead of creating a cros-exynos-peach.dts to contain all
the common DT nodes you can add a cros-ec-thermistor.dsti file that
only includes the ADC based Thermistor nodes?

Thanks a lot and best regards,
Javier

> 2. Adds the ADC based Thermistor nodes and enables them in peach_pit.dts
> and peach_pi.dts
> 3. Adds the ADC based Thermistor nodes for Exynos5250 based Snow
> 4. Corrects the vendor prefix for thermistors in exynos4412-trats2.dts
>
> Naveen Krishna Chatradhi (3):
> ARM: DTS: use new compatible string for thermistors in trats2
> ARM: DTS: Add NTC thermistor nodes to Exynos5250 based Snow
> ARM: DTS: Add common dts file for Peach PIT and PI along with ADC
> nodes
>
> arch/arm/boot/dts/cros-exynos-peach.dtsi | 41 ++++++++++++++++++++++++++++
> arch/arm/boot/dts/exynos4412-trats2.dts | 4 +--
> arch/arm/boot/dts/exynos5250-snow.dts | 34 +++++++++++++++++++++++
> arch/arm/boot/dts/exynos5420-peach-pit.dts | 6 ++++
> arch/arm/boot/dts/exynos5800-peach-pi.dts | 6 ++++
> 5 files changed, 89 insertions(+), 2 deletions(-)
> create mode 100644 arch/arm/boot/dts/cros-exynos-peach.dtsi
>
> --
> 1.7.9.5
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html

2014-06-26 15:46:18

by Doug Anderson

[permalink] [raw]
Subject: Re: [PATCH 2/3] ARM: DTS: Add NTC thermistor nodes to Exynos5250 based Snow

Naveen,

On Thu, Jun 26, 2014 at 5:19 AM, Naveen Krishna Chatradhi
<[email protected]> wrote:
> Exynos5250 based Snow board has 4 NTC thermistors to measure
> temperatures at various points on the board.
>
> IIO based ADC becomes the parent and NTC thermistors are the childs,
> via the HWMON interface.
>
> Signed-off-by: Naveen Krishna Chatradhi <[email protected]>
> ---
> Posted earlier by Doug Anderson @ https://lkml.org/lkml/2013/3/27/453
>
> This patch depends on (1/4 and 2/4 patches of) patchset posted
> http://www.spinics.net/lists/linux-iio/msg13486.html
> Which were applied on to Guenter Roeck's tree.
>
> cat sysfs entries exported by hwmon for 4 thermistors
> and verified the values on Snow.
>
> arch/arm/boot/dts/exynos5250-snow.dts | 34 +++++++++++++++++++++++++++++++++
> 1 file changed, 34 insertions(+)

NAK.

The first chunk of exynos5250-snow devices have the thermistors
populated, but a huge chunk of devices also _don't_ have them
populated.

If I remember my history properly, rev3 and earlier all had
thermistors. Some of rev4 might have thermistors (I never got a clear
answer). ...and rev5 definitely doesn't have resistors. Aside from
thermistors there's no good reason to differentiate rev3 and rev4
(they just have different memory). The upstream kernel may eventually
need to differentiate rev4 and rev5 since they have a different audio
codec.

See <https://chromium-review.googlesource.com/#/c/170841/> for some
descriptions of the different revisions of snow and how they were
handled in the Chrome OS tree.

See <https://chromium-review.googlesource.com/#/c/186357/> for
thermistors talk. Patch set #1 actually split out rev3, but we then
decided that we really didn't need to use the thermistors on any of
the revisions so the later patchsets just totally take them out.

-Doug

2014-06-26 16:39:11

by Naveen Krishna Ch

[permalink] [raw]
Subject: Re: [PATCH 0/3] ARM: DTS: create common dtsi for Peach pit and pi boards

Hello Javier,

On 26 June 2014 20:51, Javier Martinez Canillas <[email protected]> wrote:
> Hello Naveen,
>
> On Thu, Jun 26, 2014 at 2:19 PM, Naveen Krishna Chatradhi
> <[email protected]> wrote:
>> This patchset does the following
>> 1. Create a common dtsi file cros-exynos-peach.dtsi for
>> exynos5420-peach-pit.dts and exynos5800-peach-pi.dts
>
> There was some previous discussion in this list about what's the best
> approach to handle common DTS chunks, please take a look to
> http://patchwork.ozlabs.org/patch/362633/.
>
> In summary, there is a common .dtsi file for Daisy based boards
> (arch/arm/boot/dts/exynos5250-cros-common.dtsi) but it seems it turned
> out to do more harm than good since having a single .dtsi for all the
> common DTS chunks is not quite flexible. As more boards gets
> introduced you have to start moving stuff from the common .dtsi file
> to the board .dts.
>
> The same was tried to do for OMAP2+ boards and it turned out that you
> need to either a) create a hierarchy of .dtsi files to model all the
> different board combinations that have similar fragments or b) split
> out isolated DTS fragments on an .dtsi and include a set of this
> fragments.
>
> For an example of a) you can take a look to
> arch/arm/boot/dts/omap3-overo* and for b) to
> arch/arm/boot/dts/omap-gpmc-smsc9*.dtsi.
>
> For a Peach Pit/Pi specific example of b) you can look at the recent
> arch/arm/boot/dts/cros-ec-keyboard.dtsi file that Doug added for Peach
> Pit/Pi keyboard.

Right. It makes sense to have multiple smaller chunks
that can be included in more boards than having one big chunk
which can only be used for 2 or 3 boards.
But, then i was unsure. If Device Tree communities likes having more
smaller fragment files under one "arch/arm/boot/dts/ directory".


>
> Personally I think that b) is a more flexible and reusable approach.
> So, maybe instead of creating a cros-exynos-peach.dts to contain all
> the common DT nodes you can add a cros-ec-thermistor.dsti file that
> only includes the ADC based Thermistor nodes?

I've started with making a fragment dts naming it "cros-exynos-adc.dts".
Then moved on with an implementation similar to
exynos5250-cros-common.dtsi

>
> Thanks a lot and best regards,
> Javier

Will wait for few more opinions and make a fragment instead of common dtsi.
Thank you a lot for the information and the references.

>
>> 2. Adds the ADC based Thermistor nodes and enables them in peach_pit.dts
>> and peach_pi.dts
>> 3. Adds the ADC based Thermistor nodes for Exynos5250 based Snow
>> 4. Corrects the vendor prefix for thermistors in exynos4412-trats2.dts
>>
>> Naveen Krishna Chatradhi (3):
>> ARM: DTS: use new compatible string for thermistors in trats2
>> ARM: DTS: Add NTC thermistor nodes to Exynos5250 based Snow
>> ARM: DTS: Add common dts file for Peach PIT and PI along with ADC
>> nodes
>>
>> arch/arm/boot/dts/cros-exynos-peach.dtsi | 41 ++++++++++++++++++++++++++++
>> arch/arm/boot/dts/exynos4412-trats2.dts | 4 +--
>> arch/arm/boot/dts/exynos5250-snow.dts | 34 +++++++++++++++++++++++
>> arch/arm/boot/dts/exynos5420-peach-pit.dts | 6 ++++
>> arch/arm/boot/dts/exynos5800-peach-pi.dts | 6 ++++
>> 5 files changed, 89 insertions(+), 2 deletions(-)
>> create mode 100644 arch/arm/boot/dts/cros-exynos-peach.dtsi
>>
>> --
>> 1.7.9.5
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
>> the body of a message to [email protected]
>> More majordomo info at http://vger.kernel.org/majordomo-info.html



--
Shine bright,
(: Nav :)

2014-06-26 16:54:04

by Naveen Krishna Ch

[permalink] [raw]
Subject: Re: [PATCH 2/3] ARM: DTS: Add NTC thermistor nodes to Exynos5250 based Snow

Hello Doug and Kukjin,

On 26 June 2014 21:16, Doug Anderson <[email protected]> wrote:
> Naveen,
>
> On Thu, Jun 26, 2014 at 5:19 AM, Naveen Krishna Chatradhi
> <[email protected]> wrote:
>> Exynos5250 based Snow board has 4 NTC thermistors to measure
>> temperatures at various points on the board.
>>
>> IIO based ADC becomes the parent and NTC thermistors are the childs,
>> via the HWMON interface.
>>
>> Signed-off-by: Naveen Krishna Chatradhi <[email protected]>
>> ---
>> Posted earlier by Doug Anderson @ https://lkml.org/lkml/2013/3/27/453
>>
>> This patch depends on (1/4 and 2/4 patches of) patchset posted
>> http://www.spinics.net/lists/linux-iio/msg13486.html
>> Which were applied on to Guenter Roeck's tree.
>>
>> cat sysfs entries exported by hwmon for 4 thermistors
>> and verified the values on Snow.
>>
>> arch/arm/boot/dts/exynos5250-snow.dts | 34 +++++++++++++++++++++++++++++++++
>> 1 file changed, 34 insertions(+)
>
> NAK.
>
> The first chunk of exynos5250-snow devices have the thermistors
> populated, but a huge chunk of devices also _don't_ have them
> populated.

I've realized only the rev4 and before boards have thermistors
while going through the git logs of snow related dts files
in an older chrome kernel.


>
> If I remember my history properly, rev3 and earlier all had
> thermistors. Some of rev4 might have thermistors (I never got a clear
> answer). ...and rev5 definitely doesn't have resistors. Aside from
> thermistors there's no good reason to differentiate rev3 and rev4
> (they just have different memory). The upstream kernel may eventually
> need to differentiate rev4 and rev5 since they have a different audio
> codec.

I've found one patch which says, "No thermistors on Rev5 and above boards"
I still thought, we should support few boards out there.

But, i din't knew they were removed completely.

>
> See <https://chromium-review.googlesource.com/#/c/170841/> for some
> descriptions of the different revisions of snow and how they were
> handled in the Chrome OS tree.

Got it now, Thanks

>
> See <https://chromium-review.googlesource.com/#/c/186357/> for
> thermistors talk. Patch set #1 actually split out rev3, but we then
> decided that we really didn't need to use the thermistors on any of
> the revisions so the later patchsets just totally take them out.

So, no need of thermistor nodes on Snow.
I thought https://lkml.org/lkml/2013/3/27/453 patch is missed out.

>
> -Doug

Kukjin, Sorry for the confusion. Please drop this one.

--
Thanks,
(: Nav :)

2014-06-26 23:53:35

by Doug Anderson

[permalink] [raw]
Subject: Re: [PATCH 0/3] ARM: DTS: create common dtsi for Peach pit and pi boards

Naveen,

On Thu, Jun 26, 2014 at 9:38 AM, Naveen Krishna Ch
<[email protected]> wrote:
> Will wait for few more opinions and make a fragment instead of common dtsi.
> Thank you a lot for the information and the references.

Just in case you're waiting for my opinion, I'll say that I'm of the
opinion that fragments will work better.

-Doug