Skip to contentSkip to conversation

Documentation: add Device tree bindings for hwmon/nct7802

PATCH Superseded Constantine Shulyupin 2 participants 3 messages Oct 26, 2015 – Nov 14, 2015

Subsystems (2)

v8 of 9 Superseded Latest is v9 →

lore
Share & tools
lore
#0 lore raw

PATCH v8 1/1 Documentation: add Device tree bindings for hwmon/nct7802

From: Constantine Shulyupin <[email protected]>

Introduced subnodes sensor, fan and peci with properties.

---
Changed in v8:
- added senor type "local"
- Compatible nodes converted to senor types "vcore", "vcc"

Changed in v7:
- sensors type (thermistor, thermistor, voltage) and pwm type selected with type property instead of compatible property.

Changed in v6:
- Removed previous definition.
- Introduced subnodes sensor, fan and peci with properties.

Changed in v5:
- Fixed typos

Changed in v4:
- Removed registers initialization by names
- Added properties nuvoton,sensor*-type

Changed in v3:
- Fixed vendor prefix
- Added short registers description,
full registers description is available at
https://www.nuvoton.com/hq/products/cloud-computing/hardware-monitors/desktop-server-series/nct7802y/

Changed in v2:
- Removed nct7802,reg-init
- Added registers initialization by names

Introduced in v1:
- nct7802,reg-init

---
 .../devicetree/bindings/hwmon/nct7802.txt          | 102 +++++++++++++++++++++
 1 file changed, 102 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/hwmon/nct7802.txt
Documentation/devicetree/bindings/hwmon/nct7802.txt new file +102 -0
new file mode 100644
index 0000000..8647783
@@ -0,0 +1,102 @@
+Nuvoton NCT7802Y Hardware Monitoring IC
+
+Required node properties:
+
+ - "compatible": must be "nuvoton,nct7802"
+ - "reg": I2C bus address of the device
+ - #address-cells=<1>;
+ - #size-cells=<0>;
+
+Optional subnodes:
+
+Sensor subnodes properties:
+ - "compatible", allowed values:
+	 - "nuvoton,nct7802"
+ - "sensor-type", allowed values:
+	"thermal-diode"
+	"thermistor"
+	"voltage"
+	"local"
+	"vcore"
+	"vcc"
+For sensors of types "thermal-diode", "thermistor" and "voltage" required
+ - "reg": index in range 0 .. 2
+
+Except sensor at address 2 can't be "thermal-diode".
+
+Fan subnode:
+
+Required properties:
+ - "reg" :index of in range 0 .. 2.
+ - "compatible", should be "nuvoton,nct7802-fan"
+Optional boolean properties:
+ - "direct-current" :direct current powered fan instead default PWM
+ - "invert" :inverted polarity
+ - "open-drain" :open-drain output instead push pull
+
+Subnode "peci" properties:
+ - "reg" :index in range 0 .. 1
+ - "compatible", should be "nuvoton,nct7802-peci"
+
+Not defined sensors, fans and PECI modules will be disabled.
+
+Example nct7802 node:
+
+nct7802-example@28 {
+	compatible = "nuvoton,nct7802";
+	reg = <0x28>;
+	#address-cells=<1>;
+	#size-cells=<0>;
+	local-sensor {
+		compatible = "nuvoton,nct7802-sensor";
+		sensor-type = "local";
+	};
+	sensor@0 {
+		compatible = "nuvoton,nct7802-sensor";
+		reg = <0>;
+		sensor-type = "thermal-diode";
+	};
+	sensor@1 {
+		compatible = "nuvoton,nct7802-sensor";
+		reg = <1>;
+		sensor-type = "thermistor";
+	};
+	sensor@2 {
+		compatible = "nuvoton,nct7802-sensor";
+		reg = <2>;
+		sensor-type = "voltage";
+	};
+	vcc {
+		compatible = "nuvoton,nct7802-sensor";
+		sensor-type = "vcc";
+	};
+	vcore {
+		compatible = "nuvoton,nct7802-sensor";
+		sensor-type = "vcore";
+	};
+	pwm-fan@0 {
+		compatible = "nuvoton,nct7802-fan";
+		reg = <0>;
+	};
+	dc-fan@1 {
+		compatible = "nuvoton,nct7802-fan";
+		reg = <1>;
+		direct-current;
+		open-drain;
+		invert;
+	};
+	fan@2 {
+		compatible = "nuvoton,nct7802-fan";
+		reg = <2>;
+		open-drain;
+		invert;
+	};
+	peci@0 {
+		compatible = "nuvoton,nct7802-peci";
+		reg = <0>;
+	};
+	peci@1 {
+		compatible = "nuvoton,nct7802-peci";
+		reg = <1>;
+	};
+};
Signature · 1 line
1.9.1
maintainer
#1 lore raw
Quoted 52 lines · Constantine Shulyupin

From: Constantine Shulyupin <[email protected]>

Introduced subnodes sensor, fan and peci with properties.

---
Changed in v8:
- added senor type "local"
- Compatible nodes converted to senor types "vcore", "vcc"

Changed in v7:
- sensors type (thermistor, thermistor, voltage) and pwm type selected with type property instead of compatible property.

Changed in v6:
- Removed previous definition.
- Introduced subnodes sensor, fan and peci with properties.

Changed in v5:
- Fixed typos

Changed in v4:
- Removed registers initialization by names
- Added properties nuvoton,sensor*-type

Changed in v3:
- Fixed vendor prefix
- Added short registers description,
full registers description is available at
https://www.nuvoton.com/hq/products/cloud-computing/hardware-monitors/desktop-server-series/nct7802y/

Changed in v2:
- Removed nct7802,reg-init
- Added registers initialization by names

Introduced in v1:
- nct7802,reg-init

---
 .../devicetree/bindings/hwmon/nct7802.txt          | 102 +++++++++++++++++++++
 1 file changed, 102 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/hwmon/nct7802.txt
Documentation/devicetree/bindings/hwmon/nct7802.txt new file +4 -0
new file mode 100644
index 0000000..8647783
@@ -0,0 +1,102 @@
+Nuvoton NCT7802Y Hardware Monitoring IC
+
+Required node properties:
+

Documentation/devicetree/bindings/hwmon/nct7802.txt line 14

Quoted 10 lines
Documentation/devicetree/bindings/hwmon/nct7802.txt new file +10 -0
+ - "compatible": must be "nuvoton,nct7802"
+ - "reg": I2C bus address of the device
+ - #address-cells=<1>;
+ - #size-cells=<0>;
+
+Optional subnodes:
+
+Sensor subnodes properties:
+ - "compatible", allowed values:
+	 - "nuvoton,nct7802"

This should have -sensor appended?

Documentation/devicetree/bindings/hwmon/nct7802.txt line 21

Quoted 7 lines
Documentation/devicetree/bindings/hwmon/nct7802.txt new file +7 -0
+ - "sensor-type", allowed values:
+	"thermal-diode"
+	"thermistor"
+	"voltage"
+	"local"
+	"vcore"
+	"vcc"

These are different connections to the same h/w block in the chip? If so, then this is fine. If the h/w blocks are different, then it would be better to go back to different compatible strings.

Documentation/devicetree/bindings/hwmon/nct7802.txt line 30

Quoted 9 lines
Documentation/devicetree/bindings/hwmon/nct7802.txt new file +9 -0
+For sensors of types "thermal-diode", "thermistor" and "voltage" required
+ - "reg": index in range 0 .. 2
+
+Except sensor at address 2 can't be "thermal-diode".
+
+Fan subnode:
+
+Required properties:
+ - "reg" :index of in range 0 .. 2.

What does the numbering correspond to in the h/w?

Quoted 31 lines
Documentation/devicetree/bindings/hwmon/nct7802.txt new file +31 -0
+ - "compatible", should be "nuvoton,nct7802-fan"
+Optional boolean properties:
+ - "direct-current" :direct current powered fan instead default PWM
+ - "invert" :inverted polarity
+ - "open-drain" :open-drain output instead push pull
+
+Subnode "peci" properties:
+ - "reg" :index in range 0 .. 1
+ - "compatible", should be "nuvoton,nct7802-peci"
+
+Not defined sensors, fans and PECI modules will be disabled.
+
+Example nct7802 node:
+
+nct7802-example@28 {
+	compatible = "nuvoton,nct7802";
+	reg = <0x28>;
+	#address-cells=<1>;
+	#size-cells=<0>;
+	local-sensor {
+		compatible = "nuvoton,nct7802-sensor";
+		sensor-type = "local";
+	};
+	sensor@0 {
+		compatible = "nuvoton,nct7802-sensor";
+		reg = <0>;
+		sensor-type = "thermal-diode";
+	};
+	sensor@1 {
+		compatible = "nuvoton,nct7802-sensor";
+		reg = <1>;

Documentation/devicetree/bindings/hwmon/nct7802.txt line 71

Quoted 10 lines
Documentation/devicetree/bindings/hwmon/nct7802.txt new file +10 -0
+		sensor-type = "thermistor";
+	};
+	sensor@2 {
+		compatible = "nuvoton,nct7802-sensor";
+		reg = <2>;
+		sensor-type = "voltage";
+	};
+	vcc {
+		compatible = "nuvoton,nct7802-sensor";
+		sensor-type = "vcc";

No unit address?

Quoted 34 lines
Documentation/devicetree/bindings/hwmon/nct7802.txt new file +31 -0
+	};
+	vcore {
+		compatible = "nuvoton,nct7802-sensor";
+		sensor-type = "vcore";
+	};
+	pwm-fan@0 {
+		compatible = "nuvoton,nct7802-fan";
+		reg = <0>;
+	};
+	dc-fan@1 {
+		compatible = "nuvoton,nct7802-fan";
+		reg = <1>;
+		direct-current;
+		open-drain;
+		invert;
+	};
+	fan@2 {
+		compatible = "nuvoton,nct7802-fan";
+		reg = <2>;
+		open-drain;
+		invert;
+	};
+	peci@0 {
+		compatible = "nuvoton,nct7802-peci";
+		reg = <0>;
+	};
+	peci@1 {
+		compatible = "nuvoton,nct7802-peci";
+		reg = <1>;
+	};
+};
Signature · 1 line
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw
Quoted 9 lines · Rob Herring

Documentation/devicetree/bindings/hwmon/nct7802.txt line 14

Quoted 6 lines · Constantine Shulyupin

From: Constantine Shulyupin <[email protected]>

Documentation/devicetree/bindings/hwmon/nct7802.txt new file +5 -0
+Optional subnodes:
+
+Sensor subnodes properties:
+ - "compatible", allowed values:
+      - "nuvoton,nct7802"

This should have -sensor appended?

Right.

Quoted 11 lines

Documentation/devicetree/bindings/hwmon/nct7802.txt line 21

Quoted 7 lines

+ - "sensor-type", allowed values:

Documentation/devicetree/bindings/hwmon/nct7802.txt new file +6 -0
+     "thermal-diode"
+     "thermistor"
+     "voltage"
+     "local"
+     "vcore"
+     "vcc"

These are different connections to the same h/w block in the chip? If so, then this is fine. If the h/w blocks are different, then it would be better to go back to different compatible strings.

"thermal-diode", "thermistor", "voltage", "local" - is one H/W block (7.2.32 Mode Selection Register, 22h)
One of above "local" - is single input, enables by one bit EnLTD

"vcore", "vcc" - another H/W block (7.2.35 Voltage Monitor Enable
Register, 25h), each of them is different input.

I'll divide them in the next patch.

Quoted 12 lines

Documentation/devicetree/bindings/hwmon/nct7802.txt line 30

Quoted 10 lines
Documentation/devicetree/bindings/hwmon/nct7802.txt new file +9 -0
+For sensors of types "thermal-diode", "thermistor" and "voltage" required
+ - "reg": index in range 0 .. 2
+
+Except sensor at address 2 can't be "thermal-diode".
+
+Fan subnode:
+
+Required properties:
+ - "reg" :index of in range 0 .. 2.

What does the numbering correspond to in the h/w?

The numberring corresponds to the three different temperature/voltage inputs (RTD1_MD, RTD2_MD, RTD3_MD) and three different fans (EnFan1, EnFan2, EnFan3, EnDCFAN*, etc)

Quoted 11 lines

Documentation/devicetree/bindings/hwmon/nct7802.txt line 71

Quoted 3 lines
Documentation/devicetree/bindings/hwmon/nct7802.txt new file +3 -0
+     vcc {
+             compatible = "nuvoton,nct7802-sensor";
+             sensor-type = "vcc";

No unit address?

Quoted 5 lines
Documentation/devicetree/bindings/hwmon/nct7802.txt new file +5 -0
+     };
+     vcore {
+             compatible = "nuvoton,nct7802-sensor";
+             sensor-type = "vcore";
+     };

There is only one vcc anv vcore input.

Signature · 2 lines
Thanks
Constantine