Skip to contentSkip to conversation

hwmon: Add tachometer pulses per fan

PATCH Superseded Guenter Roeck 2 participants 4 messages Mar 2, 2011 – Mar 4, 2011

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hwmon: Add tachometer pulses per fan

Some fan control chips support a configuration register to set the number of tachometer pulses per fan revolution. Add an ABI attribute to support this configuration register.

---
 Documentation/hwmon/sysfs-interface |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
Documentation/hwmon/sysfs-interface +6 -0
index c6559f1..134c6a4 100644
@@ -187,6 +187,12 @@ fan[1-*]_div	Fan divisor.
 		Note that this is actually an internal clock divisor, which
 		affects the measurable speed range, not the read value.
 
+fan[1-*]_pulses	Number of tachometer pulses per fan revolution.
+		Integer value, typically between 1 and 4.
+		RW
+		Should only be created if the chip has a register to configure
+		the value.
+
 fan[1-*]_target
 		Desired fan speed
 		Unit: revolution/min (RPM)
Signature · 7 lines
1.7.3.1


_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
#1 lore raw
Quoted 14 lines · Guenter Roeck

Some fan control chips support a configuration register to set the number of tachometer pulses per fan revolution. Add an ABI attribute to support this configuration register.

---
 Documentation/hwmon/sysfs-interface |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
Documentation/hwmon/sysfs-interface +0 -0
index c6559f1..134c6a4 100644

Documentation/hwmon/sysfs-interface fan[1-*]_div Fan divisor. · line 190

Quoted 4 lines
Documentation/hwmon/sysfs-interface +1 -0
@@ -187,6 +187,12 @@ fan[1-*]_div	Fan divisor.
 		Note that this is actually an internal clock divisor, which
 		affects the measurable speed range, not the read value.
 
+fan[1-*]_pulses	Number of tachometer pulses per fan revolution.

It might be good to specify that this is a characteristic of the fan connected to the device's input, so you have to set the value in accordance with the fan model.

Documentation/hwmon/sysfs-interface fan[1-*]_div Fan divisor. · line 194

Quoted 4 lines
Documentation/hwmon/sysfs-interface +4 -0
+		Integer value, typically between 1 and 4.
+		RW
+		Should only be created if the chip has a register to configure
+		the value.

You could mention that, in the absence of register (and thus attribute) the value assumed by all devices is 2 pulses per fan revolution because almost all fans do this.

Documentation/hwmon/sysfs-interface fan[1-*]_div Fan divisor. · line 198

Quoted 4 lines
Documentation/hwmon/sysfs-interface +1 -0
+
 fan[1-*]_target
 		Desired fan speed
 		Unit: revolution/min (RPM)

I'm fine with this new attribute. We'll need support in libsensors too, so that users can change the settings through configuration file + "sensors -s".

Signature · 6 lines
Jean Delvare

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
#2 lore raw
In reply to Guenter Roeck
Quoted 24 lines · Jean Delvare
Quoted 14 lines · Guenter Roeck

Some fan control chips support a configuration register to set the number of tachometer pulses per fan revolution. Add an ABI attribute to support this configuration register.

---
 Documentation/hwmon/sysfs-interface |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
Documentation/hwmon/sysfs-interface +0 -0
index c6559f1..134c6a4 100644

Documentation/hwmon/sysfs-interface fan[1-*]_div Fan divisor. · line 190

Quoted 4 lines
Documentation/hwmon/sysfs-interface +1 -0
@@ -187,6 +187,12 @@ fan[1-*]_div	Fan divisor.
 		Note that this is actually an internal clock divisor, which
 		affects the measurable speed range, not the read value.
 
+fan[1-*]_pulses	Number of tachometer pulses per fan revolution.

It might be good to specify that this is a characteristic of the fan connected to the device's input, so you have to set the value in accordance with the fan model.

Quoted 9 lines

Documentation/hwmon/sysfs-interface fan[1-*]_div Fan divisor. · line 194

Quoted 4 lines
Documentation/hwmon/sysfs-interface +4 -0
+		Integer value, typically between 1 and 4.
+		RW
+		Should only be created if the chip has a register to configure
+		the value.

You could mention that, in the absence of register (and thus attribute) the value assumed by all devices is 2 pulses per fan revolution because almost all fans do this.

Both make sense. I'll make those changes.

Quoted 5 lines

I'm fine with this new attribute. We'll need support in libsensors too, so that users can change the settings through configuration file + "sensors -s".

Ok. Note though that I still have the other changes (support for new attributes) pending against the sensors command.

Thanks,
Guenter

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

#3 lore raw
In reply to Guenter Roeck
Quoted 7 lines · Guenter Roeck
Quoted 3 lines · Jean Delvare

I'm fine with this new attribute. We'll need support in libsensors too, so that users can change the settings through configuration file + "sensors -s".

Ok. Note though that I still have the other changes (support for new attributes) pending against the sensors command.

Should be independent. For fan[1-*]_pulses you only need to touch libsensors, not sensors, as the value doesn't have to be displayed (well at least that's my opinion.)

Nevertheless, I'll try to review your sensors patch during the week-end. And I'd like to release a new version of lm-sensors too...

Signature · 6 lines
Jean Delvare

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors