Skip to contentSkip to conversation

Enable lm90 in Tegra30 and Tegra114.

PATCH Superseded Wei Ni 5 participants 13 messages Jul 4, 2013 – Jul 9, 2013

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Wei Ni

author
#0 lore raw

cover Enable lm90 in Tegra30 and Tegra114.

Enable thermal sensor lm90 for Tegra30 Cardhu and Tegra114 Dalmore.

This series is v1, based on [RFC 1/9] submitted here:
http://thread.gmane.org/gmane.linux.power-management.general/31056

Changes from RFC:
1. Enable it for Tegra114 Dalmore.

Wei Ni (2):
ARM: dt: t30 cardhu: add dt entry for lm90
ARM: dt: t114 dalmore: add dt entry for lm90

 arch/arm/boot/dts/tegra114-dalmore.dts |    7 +++++++
 arch/arm/boot/dts/tegra30-cardhu.dtsi  |    7 +++++++
 2 files changed, 14 insertions(+)
Signature · 1 line
1.7.9.5
author
#1 lore raw

PATCH 1/2 ARM: dt: t30 cardhu: add dt entry for lm90

Enable thermal sensor lm90 for t30 cardhu.

---
 arch/arm/boot/dts/tegra30-cardhu.dtsi |    7 +++++++
 1 file changed, 7 insertions(+)
arch/arm/boot/dts/tegra30-cardhu.dtsi +7 -0
index f65b53d..8778c94 100644
@@ -286,6 +286,13 @@
 				};
 			};
 		};
+
+		nct1008: nct1008 {
+			compatible = "lm90,nct1008";
+			reg = <0x4c>;
+			interrupt-parent = <&gpio>;
+			interrupts = <TEGRA_GPIO(CC, 2) IRQ_TYPE_LEVEL_LOW>;
+		};
 	};
 
 	spi at 7000da00 {
Signature · 1 line
1.7.9.5
author
#12 lore raw

PATCH 2/2 ARM: dt: t114 dalmore: add dt entry for lm90

In reply to Wei Ni

Enable thermal sensor lm90 for t114 dalmore.

---
 arch/arm/boot/dts/tegra114-dalmore.dts |    7 +++++++
 1 file changed, 7 insertions(+)
arch/arm/boot/dts/tegra114-dalmore.dts +7 -0
index cb640eb..8325797 100644
@@ -738,6 +738,13 @@
 			realtek,ldo1-en-gpios =
 				<&gpio TEGRA_GPIO(V, 3) GPIO_ACTIVE_HIGH>;
 		};
+
+		nct1008: nct1008 {
+			compatible = "lm90,nct1008";
+			reg = <0x4c>;
+			interrupt-parent = <&gpio>;
+			interrupts = <TEGRA_GPIO(O, 4) IRQ_TYPE_LEVEL_LOW>;
+		};
 	};
 
 	i2c at 7000d000 {
Signature · 1 line
1.7.9.5
#2 lore raw

Re: [PATCH 1/2] ARM: dt: t30 cardhu: add dt entry for lm90

In reply to Wei Ni

arch/arm/boot/dts/tegra30-cardhu.dtsi line 291

Quoted 6 lines · Wei Ni

Enable thermal sensor lm90 for t30 cardhu.

arch/arm/boot/dts/tegra30-cardhu.dtsi +2 -0
 
+		nct1008: nct1008 {
+			compatible = "lm90,nct1008";

"lm90" isn't a valid vendor prefix. I believe the value you want is "onnn,nct1008". Same comment for patch 2/2.

author
#3 lore raw

Re: [PATCH 1/2] ARM: dt: t30 cardhu: add dt entry for lm90

Quoted 11 lines · Stephen Warren

arch/arm/boot/dts/tegra30-cardhu.dtsi line 291

Quoted 6 lines · Wei Ni

Enable thermal sensor lm90 for t30 cardhu.

arch/arm/boot/dts/tegra30-cardhu.dtsi +2 -0
 
+		nct1008: nct1008 {
+			compatible = "lm90,nct1008";

"lm90" isn't a valid vendor prefix. I believe the value you want is "onnn,nct1008". Same comment for patch 2/2.

The lm90 doesn't support device tree very well. In the DT, we need to named as "lm90" so that the lm90 driver can be loaded, and we also need to add "nct1008" to indicate this is the nct1008 device, so that the lm90 driver can be loaded with the right i2c_device_id->driver_data.

I set the " compatible = "lm90,nct1008" ", this is the simplest way, and we doesn't need to change the lm90.c.

Thanks.
Wei.

#4 lore raw

Re: [lm-sensors] [PATCH 1/2] ARM: dt: t30 cardhu: add dt entry for lm90

Quoted 6 lines · Wei Ni
Quoted 5 lines · Stephen Warren
Quoted 3 lines · Wei Ni

Enable thermal sensor lm90 for t30 cardhu.

arch/arm/boot/dts/tegra30-cardhu.dtsi +0 -0
Quoted 7 lines
Quoted 5 lines

arch/arm/boot/dts/tegra30-cardhu.dtsi line 291

Quoted 2 lines
arch/arm/boot/dts/tegra30-cardhu.dtsi +2 -0
+		nct1008: nct1008 {
+			compatible = "lm90,nct1008";

"lm90" isn't a valid vendor prefix. I believe the value you want is "onnn,nct1008". Same comment for patch 2/2.

The lm90 doesn't support device tree very well.

I doubt it, but if this is the case, then please fix it, instead of working the problem around in a different place.

Quoted 2 lines

In the DT, we need to
named as "lm90" so that the lm90 driver can be loaded,

Not that I am an expert with regards to DT, but this doesn't make any sense to me. AFAIK DT is about devices, not which drivers handle them.

Quoted 6 lines

and we also need
to add "nct1008" to indicate this is the nct1008 device, so that the lm90 driver can be loaded with the right i2c_device_id->driver_data.

I set the " compatible = "lm90,nct1008" ", this is the simplest way, and we doesn't need to change the lm90.c.

There's no problem with changing the lm90 driver, if this is the right thing to do.

Signature · 1 line
Jean Delvare
author
#5 lore raw

Re: [lm-sensors] [PATCH 1/2] ARM: dt: t30 cardhu: add dt entry for lm90

Quoted 28 lines · Jean Delvare
Quoted 6 lines · Wei Ni
Quoted 5 lines · Stephen Warren
Quoted 3 lines · Wei Ni

Enable thermal sensor lm90 for t30 cardhu.

arch/arm/boot/dts/tegra30-cardhu.dtsi +0 -0
Quoted 7 lines
Quoted 5 lines

arch/arm/boot/dts/tegra30-cardhu.dtsi line 291

Quoted 2 lines
arch/arm/boot/dts/tegra30-cardhu.dtsi +2 -0
+		nct1008: nct1008 {
+			compatible = "lm90,nct1008";

"lm90" isn't a valid vendor prefix. I believe the value you want is "onnn,nct1008". Same comment for patch 2/2.

The lm90 doesn't support device tree very well.

I doubt it, but if this is the case, then please fix it, instead of working the problem around in a different place.

Quoted 2 lines

In the DT, we need to
named as "lm90" so that the lm90 driver can be loaded,

Not that I am an expert with regards to DT, but this doesn't make any sense to me. AFAIK DT is about devices, not which drivers handle them.

Quoted 4 lines

and we also need
to add "nct1008" to indicate this is the nct1008 device, so that the lm90 driver can be loaded with the right i2c_device_id->driver_data.

Quoted 5 lines
Quoted 2 lines

I set the " compatible = "lm90,nct1008" ", this is the simplest way, and we doesn't need to change the lm90.c.

There's no problem with changing the lm90 driver, if this is the right thing to do.

Ok, I will add DT support in the lm90.c in my next version patch.

Thanks.
Wei.

Quoted 1 line
#11 lore raw

Re: [lm-sensors] [PATCH 1/2] ARM: dt: t30 cardhu: add dt entry for lm90

In reply to Wei Ni
Quoted 12 lines · Wei Ni
Quoted 11 lines · Stephen Warren

arch/arm/boot/dts/tegra30-cardhu.dtsi line 291

Quoted 6 lines · Wei Ni

Enable thermal sensor lm90 for t30 cardhu.

arch/arm/boot/dts/tegra30-cardhu.dtsi +2 -0
 
+		nct1008: nct1008 {
+			compatible = "lm90,nct1008";

"lm90" isn't a valid vendor prefix. I believe the value you want is "onnn,nct1008". Same comment for patch 2/2.

Quoted 8 lines

The lm90 doesn't support device tree very well. In the DT, we need to named as "lm90" so that the lm90 driver can be loaded, and we also need to add "nct1008" to indicate this is the nct1008 device, so that the lm90 driver can be loaded with the right i2c_device_id->driver_data.

I set the " compatible = "lm90,nct1008" ", this is the simplest way, and we doesn't need to change the lm90.c.

Did you really test "onn,nct1008" or, for that matter, "anything,nct1008" ?

I have been using

	maxim,max1137
	maxim,max1139
	maxim,max6697
	dallas,ds1621
	linear,ltc3880
	linear,ltc2978
	intersil,zl2006
	ti,tmp421
	ti,tmp431

without problems, and without having to add code to the respective drivers. I would be quite surprised if "onn,nct1008" would not work.

Guenter

#6 lore raw

Re: [lm-sensors] [PATCH 1/2] ARM: dt: t30 cardhu: add dt entry for lm90

In reply to Wei Ni
Quoted 29 lines · Wei Ni
Quoted 28 lines · Jean Delvare
Quoted 6 lines · Wei Ni
Quoted 5 lines · Stephen Warren
Quoted 3 lines · Wei Ni

Enable thermal sensor lm90 for t30 cardhu.

arch/arm/boot/dts/tegra30-cardhu.dtsi +0 -0
Quoted 7 lines
Quoted 5 lines

arch/arm/boot/dts/tegra30-cardhu.dtsi line 291

Quoted 2 lines
arch/arm/boot/dts/tegra30-cardhu.dtsi +2 -0
+		nct1008: nct1008 {
+			compatible = "lm90,nct1008";

"lm90" isn't a valid vendor prefix. I believe the value you want is "onnn,nct1008". Same comment for patch 2/2.

The lm90 doesn't support device tree very well.

I doubt it, but if this is the case, then please fix it, instead of working the problem around in a different place.

Quoted 2 lines

In the DT, we need to
named as "lm90" so that the lm90 driver can be loaded,

Not that I am an expert with regards to DT, but this doesn't make any sense to me. AFAIK DT is about devices, not which drivers handle them.

Quoted 4 lines

and we also need
to add "nct1008" to indicate this is the nct1008 device, so that the lm90 driver can be loaded with the right i2c_device_id->driver_data.

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

I set the " compatible = "lm90,nct1008" ", this is the simplest way, and we doesn't need to change the lm90.c.

There's no problem with changing the lm90 driver, if this is the right thing to do.

Ok, I will add DT support in the lm90.c in my next version patch.

Only if you can show that it is necessary.

Guenter

#7 lore raw

Re: [lm-sensors] [PATCH 1/2] ARM: dt: t30 cardhu: add dt entry for lm90

Quoted 33 lines · Guenter Roeck
Quoted 32 lines · Wei Ni
Quoted 31 lines · Jean Delvare
Quoted 6 lines · Wei Ni
Quoted 5 lines · Stephen Warren
Quoted 3 lines · Wei Ni

Enable thermal sensor lm90 for t30 cardhu.

arch/arm/boot/dts/tegra30-cardhu.dtsi +0 -0
Quoted 7 lines
Quoted 5 lines

arch/arm/boot/dts/tegra30-cardhu.dtsi line 291

Quoted 2 lines
arch/arm/boot/dts/tegra30-cardhu.dtsi +2 -0
+		nct1008: nct1008 {
+			compatible = "lm90,nct1008";

"lm90" isn't a valid vendor prefix. I believe the value you want is "onnn,nct1008". Same comment for patch 2/2.

The lm90 doesn't support device tree very well.

I doubt it, but if this is the case, then please fix it, instead of working the problem around in a different place.

Quoted 2 lines

In the DT, we need to
named as "lm90" so that the lm90 driver can be loaded,

Not that I am an expert with regards to DT, but this doesn't make any sense to me. AFAIK DT is about devices, not which drivers handle them.

Quoted 6 lines

and we also need
to add "nct1008" to indicate this is the nct1008 device, so that the lm90 driver can be loaded with the right i2c_device_id->driver_data.

I set the " compatible = "lm90,nct1008" ", this is the simplest way, and we doesn't need to change the lm90.c.

Quoted 6 lines
Quoted 5 lines
Quoted 2 lines

There's no problem with changing the lm90 driver, if this is the right thing to do.

Ok, I will add DT support in the lm90.c in my next version patch.

Only if you can show that it is necessary.

It should work out of the box. As a matter of fact the same chip is used on Tamonten and the DTS files use "onnn,nct1008". That used to work. If it no longer does then that's a regression.

Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130709/e5ffac6e/attachment.sig>

author
#8 lore raw

Re: [lm-sensors] [PATCH 1/2] ARM: dt: t30 cardhu: add dt entry for lm90

Quoted 39 lines · Thierry Reding

* PGP Signed by an unknown key

Quoted 36 lines · Guenter Roeck
Quoted 35 lines · Wei Ni
Quoted 33 lines · Jean Delvare
Quoted 6 lines · Wei Ni
Quoted 5 lines · Stephen Warren
Quoted 3 lines · Wei Ni

Enable thermal sensor lm90 for t30 cardhu.

arch/arm/boot/dts/tegra30-cardhu.dtsi +0 -0
Quoted 7 lines
Quoted 5 lines

arch/arm/boot/dts/tegra30-cardhu.dtsi

Quoted 2 lines
arch/arm/boot/dts/tegra30-cardhu.dtsi +2 -0
+		nct1008: nct1008 {
+			compatible = "lm90,nct1008";

"lm90" isn't a valid vendor prefix. I believe the value you want is "onnn,nct1008". Same comment for patch 2/2.

The lm90 doesn't support device tree very well.

I doubt it, but if this is the case, then please fix it, instead of working the problem around in a different place.

Quoted 2 lines

In the DT, we need to
named as "lm90" so that the lm90 driver can be loaded,

Not that I am an expert with regards to DT, but this doesn't make any sense to me. AFAIK DT is about devices, not which drivers handle them.

Quoted 6 lines

and we also need
to add "nct1008" to indicate this is the nct1008 device, so that the lm90 driver can be loaded with the right i2c_device_id->driver_data.

I set the " compatible = "lm90,nct1008" ", this is the simplest way, and we doesn't need to change the lm90.c.

There's no problem with changing the lm90 driver, if this is the right thing to do.

Quoted 7 lines
Quoted 3 lines
Quoted 2 lines

Ok, I will add DT support in the lm90.c in my next version patch.

Only if you can show that it is necessary.

It should work out of the box. As a matter of fact the same chip is used on Tamonten and the DTS files use "onnn,nct1008". That used to work. If it no longer does then that's a regression.

I synced the linux-next from:
git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
and use the tag v3.10-rc7, but in the lm90.c it doesn't have DT support, such as "onnn,nct1008".
I googled it and found there has patch:
[PATCH] hwmon: (lm90) Add device tree support , which is in:
http://lists.lm-sensors.org/pipermail/lm-sensors/2013-February/038099.html
, but it didn't be merged into the linux-next.

which git repository and branch should I use ?

Thanks.
Wei.

Quoted 6 lines

Thierry

* Unknown Key
* 0x7F3EB3A1

#9 lore raw

Re: [lm-sensors] [PATCH 1/2] ARM: dt: t30 cardhu: add dt entry for lm90

Quoted 5 lines · Wei Ni
Quoted 3 lines · Thierry Reding

It should work out of the box. As a matter of fact the same chip is used on Tamonten and the DTS files use "onnn,nct1008". That used to work. If it no longer does then that's a regression.

Quoted 8 lines

I synced the linux-next from:
git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
and use the tag v3.10-rc7, but in the lm90.c it doesn't have DT support, such as "onnn,nct1008".
I googled it and found there has patch:
[PATCH] hwmon: (lm90) Add device tree support , which is in:
http://lists.lm-sensors.org/pipermail/lm-sensors/2013-February/038099.html
, but it didn't be merged into the linux-next.

It was not, because of the next reply in the same thread:
http://lists.lm-sensors.org/pipermail/lm-sensors/2013-February/038100.html

Quoted 1 line

which git repository and branch should I use ?

It is supposed to just work. What doesn't work for you exactly?

Signature · 1 line
Jean Delvare
author
#10 lore raw

Re: [lm-sensors] [PATCH 1/2] ARM: dt: t30 cardhu: add dt entry for lm90

Quoted 15 lines · Jean Delvare
Quoted 5 lines · Wei Ni
Quoted 3 lines · Thierry Reding

It should work out of the box. As a matter of fact the same chip is used on Tamonten and the DTS files use "onnn,nct1008". That used to work. If it no longer does then that's a regression.

Quoted 8 lines

I synced the linux-next from:
git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
and use the tag v3.10-rc7, but in the lm90.c it doesn't have DT support, such as "onnn,nct1008".
I googled it and found there has patch:
[PATCH] hwmon: (lm90) Add device tree support , which is in:
http://lists.lm-sensors.org/pipermail/lm-sensors/2013-February/038099.html
, but it didn't be merged into the linux-next.

Quoted 7 lines

It was not, because of the next reply in the same thread:
http://lists.lm-sensors.org/pipermail/lm-sensors/2013-February/038100.html

Quoted 1 line

which git repository and branch should I use ?

It is supposed to just work. What doesn't work for you exactly?

Oh, yes, the "onnn,nct1008" can work. I read the i2c driver and the of_i2c.c carefully, I understand why the lm90 can be loaded by setting "onnn,nct1008". Indeed, we can set the vendor string to anything, even "xxx,nct1008", the lm90 also can be loaded correctly.

Anyway, I will use the "onnn,nct1008" in my next version.

Thanks for your comments.
Wei.