Skip to contentSkip to conversation

adding hwmon support to sequoia device tree

RFC In review Matthias Fuchs 7 participants 18 messages Sep 4, 2008 – Sep 9, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

RFC 1/1 adding hwmon support to sequoia device tree

Hi,

I added support for the Sequoia on-board I2C temperature sensor to the device. I am not sure if there is any node naming convention for such devices. The needed I2C driver can be found under drivers/hwmon in the kernel sources, so I found "hwmon" suitable for the node.

Do we want to add this to the sequoia dts file? If this is how it should be done, I will commit a proper patch.

arch/powerpc/boot/dts/sequoia.dts +10 -0
index 72d15f0..82fdfdf 100644
@@ -246,13 +246,23 @@
                        };
 
                        IIC0: i2c@ef600700 {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
                                compatible = "ibm,iic-440epx", "ibm,iic";
                                reg = <0xef600700 0x00000014>;
                                interrupt-parent = <&UIC0>;
                                interrupts = <0x2 0x4>;
+
+                               hwmon@48 {
+                                       device_type = "hwmon";
+                                       compatible = "analog,ad7414";
+                                       reg = <0x48>;
+                               };
                        };
 
                        IIC1: i2c@ef600800 {
+                               #address-cells = <1>;
+                               #size-cells = <0>;

(prepare for adding devices on the 2nd I2C also)

                                compatible = "ibm,iic-440epx", "ibm,iic";
                                reg = <0xef600800 0x00000014>;
                                interrupt-parent = <&UIC0>;

Matthias

#1 lore raw
Quoted 9 lines · Matthias Fuchs

Hi,

I added support for the Sequoia on-board I2C temperature sensor to the device. I am not sure if there is any node naming convention for such devices. The needed I2C driver can be found under drivers/hwmon in the kernel sources, so I found "hwmon" suitable for the node.

Do we want to add this to the sequoia dts file? If this is how it should be done, I will commit a proper patch.

See comments below. Out of curiosity, do you have a working driver and setup with this?

Quoted 7 lines
arch/powerpc/boot/dts/sequoia.dts +0 -0
index 72d15f0..82fdfdf 100644
@@ -246,13 +246,23 @@
                       };
 

arch/powerpc/boot/dts/sequoia.dts line 257

Quoted 10 lines
arch/powerpc/boot/dts/sequoia.dts +5 -0
                       IIC0: i2c@ef600700 {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
                               compatible = "ibm,iic-440epx", "ibm,iic";
                               reg = <0xef600700 0x00000014>;
                               interrupt-parent = <&UIC0>;
                               interrupts = <0x2 0x4>;
+
+                               hwmon@48 {
+                                       device_type = "hwmon";

We don't need device_type. Particularly not a new one like this.

arch/powerpc/boot/dts/sequoia.dts line 258

Quoted 1 line
arch/powerpc/boot/dts/sequoia.dts +1 -0
+                                       compatible = "analog,ad7414";

Perhaps 'compatible = "analog,ad7417", "amcc,hwmon-440epx";'

josh

#2 lore raw
Quoted 5 lines · Josh Boyer
Quoted 2 lines

Do we want to add this to the sequoia dts file? If this is how it should be done, I will commit a proper patch.

See comments below. Out of curiosity, do you have a working driver and setup with this?

Sure, it did hit mainline with 2.6.27:

drivers/hwmon/ad7414.c

Quoted 20 lines
Quoted 7 lines
(quoted diff) +0 -0

b/arch/powerpc/boot/dts/sequoia.dts index 72d15f0..82fdfdf 100644

arch/powerpc/boot/dts/sequoia.dts +0 -0
@@ -246,13 +246,23 @@
                       };
 

arch/powerpc/boot/dts/sequoia.dts line 257

Quoted 10 lines
arch/powerpc/boot/dts/sequoia.dts +5 -0
                       IIC0: i2c@ef600700 {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
                               compatible = "ibm,iic-440epx", "ibm,iic";
                               reg = <0xef600700 0x00000014>;
                               interrupt-parent = <&UIC0>;
                               interrupts = <0x2 0x4>;
+
+                               hwmon@48 {
+                                       device_type = "hwmon";

We don't need device_type. Particularly not a new one like this.

Quoted 3 lines

arch/powerpc/boot/dts/sequoia.dts line 258

Quoted 1 line
arch/powerpc/boot/dts/sequoia.dts +1 -0
+                                       compatible = "analog,ad7414";

Perhaps 'compatible = "analog,ad7417", "amcc,hwmon-440epx";'

I don't think we need any amcc and/or 440epx here. Its a common chip from Analog.

Best regards,
Stefan

#3 lore raw
In reply to Josh Boyer

Hi,=20

Quoted 4 lines · Josh Boyer
Quoted 3 lines · Matthias Fuchs

Hi,

I added support for the Sequoia on-board I2C temperature sensor to the d=

evice.

Quoted 2 lines
Quoted 2 lines

I am not sure if there is any node naming convention for such devices. The needed I2C driver can be found under drivers/hwmon in the kernel sou=

rces,

Quoted 3 lines
Quoted 3 lines

so I found "hwmon" suitable for the node.

Do we want to add this to the sequoia dts file? If this is how it should=

be done,

Quoted 4 lines
Quoted 1 line

I will commit a proper patch.

=20
See comments below. Out of curiosity, do you have a working driver and setup with this?

Of course.=20

You need

	CONFIG_HWMON=3Dy
	CONFIG_SENSORS_AD7414=3Dy

Via sysfs you get:

sequoia:~# cat /sys/bus/i2c/devices/0-0048/temp1_input
34750
sequoia:~# cat /sys/class/hwmon/hwmon0/device/temp1_input
34750
sequoia:~#=20

34750 =3D 34.75=B0C

Quoted 2 lines

=20

arch/powerpc/boot/dts/s=

Quoted 1 line
arch/powerpc/boot/dts/s= renamed from arch/powerpc/boot/dts/sequoia.dts +0 -0

equoia.dts

Quoted 10 lines

arch/powerpc/boot/dts/sequoia.dts line 251

Quoted 10 lines

index 72d15f0..82fdfdf 100644

arch/powerpc/boot/dts/sequoia.dts +2 -0
@@ -246,13 +246,23 @@
                       };
 
                       IIC0: i2c@ef600700 {
+                               #address-cells =3D <1>;
+                               #size-cells =3D <0>;
                               compatible =3D "ibm,iic-440epx", "ibm,ii=

c";

Quoted 8 lines

arch/powerpc/boot/dts/sequoia.dts line 257

Quoted 6 lines
arch/powerpc/boot/dts/sequoia.dts +3 -0
                               reg =3D <0xef600700 0x00000014>;
                               interrupt-parent =3D <&UIC0>;
                               interrupts =3D <0x2 0x4>;
+
+                               hwmon@48 {
+                                       device_type =3D "hwmon";

=20
We don't need device_type. Particularly not a new one like this.

I will remove that.

Quoted 4 lines

=20

arch/powerpc/boot/dts/sequoia.dts line 258

Quoted 1 line
arch/powerpc/boot/dts/sequoia.dts +1 -0
+                                       compatible =3D "analog,ad7414";

=20
Perhaps 'compatible =3D "analog,ad7417", "amcc,hwmon-440epx";'

It has nothing to do with either AMCC or 440EPx.

Patch is on the way.

Matthias

#4 lore raw

PATCH 1/1 powerpc/44x: Add hwmon support to Sequoia device tree

This patch adds support for the AD7414 temperature sensor on Sequoia PPC440EPx board.

---
 arch/powerpc/boot/dts/sequoia.dts |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
arch/powerpc/boot/dts/sequoia.dts +9 -0
index 72d15f0..9ba5def 100644
@@ -246,13 +246,22 @@
 	   		};
 
 			IIC0: i2c@ef600700 {
+				#address-cells = <1>;
+				#size-cells = <0>;
 				compatible = "ibm,iic-440epx", "ibm,iic";
 				reg = <0xef600700 0x00000014>;
 				interrupt-parent = <&UIC0>;
 				interrupts = <0x2 0x4>;
+
+				hwmon@48 {
+					compatible = "analog,ad7414";
+					reg = <0x48>;
+				};
 			};
 
 			IIC1: i2c@ef600800 {
+				#address-cells = <1>;
+				#size-cells = <0>;
 				compatible = "ibm,iic-440epx", "ibm,iic";
 				reg = <0xef600800 0x00000014>;
 				interrupt-parent = <&UIC0>;
Signature · 1 line
1.5.3
Acked-by on v1 1/1
#5 lore raw

Re: [PATCH] powerpc/44x: Add hwmon support to Sequoia device tree

Quoted 14 lines · Matthias Fuchs

This patch adds support for the AD7414 temperature sensor on Sequoia PPC440EPx board.

---
 arch/powerpc/boot/dts/sequoia.dts |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
(quoted diff) +0 -0

b/arch/powerpc/boot/dts/sequoia.dts index 72d15f0..9ba5def 100644

arch/powerpc/boot/dts/sequoia.dts +0 -0
@@ -246,13 +246,22 @@
 	   		};

arch/powerpc/boot/dts/sequoia.dts line 256

Quoted 10 lines
arch/powerpc/boot/dts/sequoia.dts +4 -0
 
 			IIC0: i2c@ef600700 {
+				#address-cells = <1>;
+				#size-cells = <0>;
 				compatible = "ibm,iic-440epx", "ibm,iic";
 				reg = <0xef600700 0x00000014>;
 				interrupt-parent = <&UIC0>;
 				interrupts = <0x2 0x4>;
+
+				hwmon@48 {

Not sure if we shouldn't use

                                ad7414@48 {

here. This is the way it is already done in warp.dts.

Other than this:

Best regards,
Stefan

#6 lore raw

Re: [PATCH] powerpc/44x: Add hwmon support to Sequoia device tree

Hi,

I was inspired by some I2C RTC node (tqm5200.dts). Those nodes are named rtc@... But to be in common I can change it. Also
the vendor is differnet in warp's dts file. adi (analog device inc.) against "analog".

So I will update my patch to be compatible with warp.dts.

I keep your ack, Stefan.

Matthias

Quoted 22 lines · Stefan Roese
Quoted 6 lines
(quoted diff) +0 -0

b/arch/powerpc/boot/dts/sequoia.dts index 72d15f0..9ba5def 100644

arch/powerpc/boot/dts/sequoia.dts +0 -0
@@ -246,13 +246,22 @@
 	   		};

arch/powerpc/boot/dts/sequoia.dts line 256

Quoted 10 lines
arch/powerpc/boot/dts/sequoia.dts +4 -0
 
 			IIC0: i2c@ef600700 {
+				#address-cells = <1>;
+				#size-cells = <0>;
 				compatible = "ibm,iic-440epx", "ibm,iic";
 				reg = <0xef600700 0x00000014>;
 				interrupt-parent = <&UIC0>;
 				interrupts = <0x2 0x4>;
+
+				hwmon@48 {

Not sure if we shouldn't use

                                ad7414@48 {

here. This is the way it is already done in warp.dts.

#8 lore raw

Re: [PATCH] powerpc/44x: Add hwmon support to Sequoia device tree

Quoted 6 lines · On Fri, 5 Sep 2008 11:00:18 -0500 "Scott Wood" <[email protected]> wrote:
Quoted 5 lines · Stefan Roese

arch/powerpc/boot/dts/sequoia.dts line 256

Quoted 2 lines
arch/powerpc/boot/dts/sequoia.dts +2 -0
+
+				hwmon@48 {

Not sure if we shouldn't use

Quoted 6 lines
Quoted 3 lines
                                ad7414@48 {

here. This is the way it is already done in warp.dts.

We shouldn't. Node names are supposed to be generic:
http://playground.sun.com/1275/practice/gnames/gnamv14a.html

Damn. Where were you a year ago when I first introduced this? ;)

And if it is really supposed to be generic, would temp@48 be a better name since this is basically a generic temperature chip?

Now that the i2c driver is a full of platform driver, I think I can change the name with no repercussions. So I can live with whatever decision is made. Can't do anything about the systems that are out in the field though....

Cheers,
Sean

#9 lore raw

Re: [PATCH] powerpc/44x: Add hwmon support to Sequoia device tree

Quoted 18 lines · Sean MacLennan
Quoted 6 lines · On Fri, 5 Sep 2008 11:00:18 -0500 "Scott Wood" <[email protected]> wrote:
Quoted 5 lines · Stefan Roese

arch/powerpc/boot/dts/sequoia.dts line 256

Quoted 2 lines
arch/powerpc/boot/dts/sequoia.dts +2 -0
+
+				hwmon@48 {

Not sure if we shouldn't use

Quoted 6 lines
Quoted 3 lines
                                ad7414@48 {

here. This is the way it is already done in warp.dts.

We shouldn't. Node names are supposed to be generic:
http://playground.sun.com/1275/practice/gnames/gnamv14a.html

Damn. Where were you a year ago when I first introduced this? ;)

Quoted 7 lines

And if it is really supposed to be generic, would temp@48 be a better name since this is basically a generic temperature chip?

Now that the i2c driver is a full of platform driver, I think I can change the name with no repercussions. So I can live with whatever decision is made. Can't do anything about the systems that are out in the field though....

It's just the unit-name that should be generic, not the compatible. The only thing unit-name is used for is path lookup and distinguishing between similar hardware units. I don't think either is a problem in this case.

josh

#10 lore raw

PATCH v2 1/1 powerpc/44x: Add hwmon support to Sequoia device tree

This patch adds support for the AD7414 temperature sensor on Sequoia PPC440EPx board.

---
 arch/powerpc/boot/dts/sequoia.dts |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
arch/powerpc/boot/dts/sequoia.dts +9 -0
index 72d15f0..3b295e8 100644
@@ -246,13 +246,22 @@
 	   		};
 
 			IIC0: i2c@ef600700 {
+				#address-cells = <1>;
+				#size-cells = <0>;
 				compatible = "ibm,iic-440epx", "ibm,iic";
 				reg = <0xef600700 0x00000014>;
 				interrupt-parent = <&UIC0>;
 				interrupts = <0x2 0x4>;
+
+				hwmon@48 {
+					compatible = "adi,ad7414";
+					reg = <0x48>;
+				};
 			};
 
 			IIC1: i2c@ef600800 {
+				#address-cells = <1>;
+				#size-cells = <0>;
 				compatible = "ibm,iic-440epx", "ibm,iic";
 				reg = <0xef600800 0x00000014>;
 				interrupt-parent = <&UIC0>;
Signature · 1 line
1.5.3
#11 lore raw

Re: [PATCH] powerpc/44x: Add hwmon support to Sequoia device tree

In reply to Sean MacLennan

Hi,

I have chosen "hwmon" because those drivers are placed in the kernel's drivers/hwmon subdirectory. "temp" sounds to much like "temporary" for me :-)

We can name it "sensor" - inspired by the lm-sensors projects that takes care of such sensors. Because these type of devices are not always used to monitor the whatever hardware ... sensor could even be better.

So my favorites are sensor@ or hwmon@.

Sean, I can take your "adi" instead of "analog" for this special sensor.

Matthias

Quoted 32 lines · On Saturday 06 September 2008 02:17:03 Sean MacLennan wrote:

On Fri, 5 Sep 2008 11:00:18 -0500

Quoted 6 lines · Scott Wood
Quoted 5 lines · Stefan Roese

arch/powerpc/boot/dts/sequoia.dts line 256

Quoted 2 lines
arch/powerpc/boot/dts/sequoia.dts +2 -0
+
+				hwmon@48 {

Not sure if we shouldn't use

Quoted 6 lines
Quoted 3 lines
                                ad7414@48 {

here. This is the way it is already done in warp.dts.

We shouldn't. Node names are supposed to be generic:
http://playground.sun.com/1275/practice/gnames/gnamv14a.html

Damn. Where were you a year ago when I first introduced this? ;)

And if it is really supposed to be generic, would temp@48 be a better name since this is basically a generic temperature chip?

Now that the i2c driver is a full of platform driver, I think I can change the name with no repercussions. So I can live with whatever decision is made. Can't do anything about the systems that are out in the field though....

Cheers,
Sean
_______________________________________________
Linuxppc-dev mailing list
[email protected]
https://ozlabs.org/mailman/listinfo/linuxppc-dev

#12 lore raw

Re: [PATCH] powerpc/44x: Add hwmon support to Sequoia device tree

Quoted 2 lines · On Sat, 6 Sep 2008 14:40:41 +0200 "Matthias Fuchs"…

Sean, I can take your "adi" instead of "analog" for this special sensor.

I think I was told to use adi because it is the stock market symbol for analog devices.

Cheers,
Sean

#13 lore raw

Re: [PATCH] powerpc/44x: Add hwmon support to Sequoia device tree

In reply to Matthias Fuchs
Quoted 5 lines · Matthias Fuchs

Hi,

I have chosen "hwmon" because those drivers are placed in the kernel's drivers/hwmon subdirectory. "temp" sounds to much like "temporary" for me :-)

How about "dtt"? That's what we use in U-Boot for digital temperature sensors as well.

Quoted 7 lines

We can name it "sensor" - inspired by the lm-sensors projects that takes care of such sensors. Because these type of devices are not always used to monitor the whatever hardware ... sensor could even be better.

So my favorites are sensor@ or hwmon@.

Sean, I can take your "adi" instead of "analog" for this special sensor.

"adi" sounds more reasonable, indeed and as the OF software ignores the vendor field, changing the name should not harm.

Wolfgang.

#14 lore raw

Re: [PATCH] powerpc/44x: Add hwmon support to Sequoia device tree

Quoted 2 lines · Wolfgang Grandegger

How about "dtt"? That's what we use in U-Boot for digital temperature sensors as well.

I vote against any acronyms that are not very well known. Even knowing that it's supposed to be "digital temperature <something>", I can't figure out what the <something> is. Not having the context that it relates to temperature, I wouldn't have a clue what "dtt" is.

hwmon is concise and fairly obvious, and unlike "temp" could be meaningfully used with chips that also monitor voltages, fan speeds, etc.

-Scott

#15 lore raw

Re: [PATCH] powerpc/44x: Add hwmon support to Sequoia device tree

Quoted 9 lines · Scott Wood
Quoted 2 lines · Wolfgang Grandegger

How about "dtt"? That's what we use in U-Boot for digital temperature sensors as well.

I vote against any acronyms that are not very well known. Even knowing that it's supposed to be "digital temperature <something>", I can't figure out what the <something> is. Not having the context that it relates to temperature, I wouldn't have a clue what "dtt" is.

Quoted 4 lines

hwmon is concise and fairly obvious, and unlike "temp" could be meaningfully used with chips that also monitor voltages, fan speeds, etc.

-Scott

Uh, thanks Scott. Now we got it. I am fully with you and my "V2" patch should make everybody happy.

So, let's apply this patch.

Matthias

#16 lore raw

Re: [PATCH] powerpc/44x: Add hwmon support to Sequoia device tree

Quoted 13 lines · Matthias Fuchs
Quoted 12 lines · Scott Wood
Quoted 2 lines · Wolfgang Grandegger

How about "dtt"? That's what we use in U-Boot for digital temperature sensors as well.

I vote against any acronyms that are not very well known. Even knowing that it's supposed to be "digital temperature <something>", I can't figure out what the <something> is. Not having the context that it relates to temperature, I wouldn't have a clue what "dtt" is.

hwmon is concise and fairly obvious, and unlike "temp" could be meaningfully used with chips that also monitor voltages, fan speeds, etc.

Quoted 6 lines
Quoted 1 line

-Scott

Uh, thanks Scott. Now we got it. I am fully with you and my "V2" patch should make everybody happy.

So, let's apply this patch.

I already have it queued up.

josh

#17 lore raw
In reply to Matthias Fuchs

Yes, the ad7414 driver was finally accepted into the kernel. The ad7414 = is a generic temperature chip.

FWIW, the warp.dts uses ad7414@4c, not hwmon.

Cheers,
Sean

-----Original Message-----
From: [email protected] on =
behalf of Matthias Fuchs
Sent: Thu 9/4/2008 10:28 AM
To: Josh Boyer
Cc: [email protected]
Subject: Re: [RFC] adding hwmon support to sequoia device tree

Hi,=20

Quoted 4 lines · Josh Boyer
Quoted 3 lines · Matthias Fuchs

Hi,

I added support for the Sequoia on-board I2C temperature sensor to =

the device.

Quoted 1 line
Quoted 1 line

I am not sure if there is any node naming convention for such =

devices.

Quoted 1 line
Quoted 1 line

The needed I2C driver can be found under drivers/hwmon in the kernel =

sources,

Quoted 3 lines
Quoted 3 lines

so I found "hwmon" suitable for the node.

Do we want to add this to the sequoia dts file? If this is how it =

should be done,

Quoted 3 lines
Quoted 1 line

I will commit a proper patch.

=20
See comments below. Out of curiosity, do you have a working driver =

and

Quoted 1 line

setup with this?

Of course.=20

You need

	CONFIG_HWMON=3Dy
	CONFIG_SENSORS_AD7414=3Dy

Via sysfs you get:

sequoia:~# cat /sys/bus/i2c/devices/0-0048/temp1_input
34750
sequoia:~# cat /sys/class/hwmon/hwmon0/device/temp1_input
34750
sequoia:~#=20

34750 =3D 34.75=B0C

Quoted 2 lines

=20

=

Quoted 1 line
= renamed from arch/powerpc/boot/dts/sequoia.dts +0 -0

b/arch/powerpc/boot/dts/sequoia.dts

Quoted 10 lines

arch/powerpc/boot/dts/sequoia.dts line 251

Quoted 10 lines

index 72d15f0..82fdfdf 100644

arch/powerpc/boot/dts/sequoia.dts +2 -0
@@ -246,13 +246,23 @@
                       };
 
                       IIC0: i2c@ef600700 {
+                               #address-cells =3D <1>;
+                               #size-cells =3D <0>;
                               compatible =3D "ibm,iic-440epx", =

"ibm,iic";

Quoted 8 lines

arch/powerpc/boot/dts/sequoia.dts line 257

Quoted 6 lines
arch/powerpc/boot/dts/sequoia.dts +3 -0
                               reg =3D <0xef600700 0x00000014>;
                               interrupt-parent =3D <&UIC0>;
                               interrupts =3D <0x2 0x4>;
+
+                               hwmon@48 {
+                                       device_type =3D "hwmon";

=20
We don't need device_type. Particularly not a new one like this.

I will remove that.

Quoted 2 lines

=20

Quoted 1 line
arch/powerpc/boot/dts/sequoia.dts +1 -0
+                                       compatible =3D =

"analog,ad7414";

Quoted 2 lines

=20
Perhaps 'compatible =3D "analog,ad7417", "amcc,hwmon-440epx";'

It has nothing to do with either AMCC or 440EPx.

Patch is on the way.

Matthias
_______________________________________________
Linuxppc-dev mailing list
[email protected]
https://ozlabs.org/mailman/listinfo/linuxppc-dev