hwmon: Add a driver for the ADT7475 thermal
Subsystems (3)
PATCH 1/1 hwmon: Add a driver for the ADT7475 thermal
Hi Mark -
Attached is a patch for the ADT7475 that has been bouncing around on the list for some time now. It is suitable for the testing GIT tree, and I think it is a good candidate for the 2.6.26 push.
Jordan
Signature · 3 lines
Jordan Crouse Systems Software Development Engineer Advanced Micro Devices, Inc.
[PATCH] hwmon: Add a driver for the ADT7475 thermal sensor
From: Jordan Crouse <[email protected]>
HWMON driver for the ADT7475 thermal sensor.
---
Documentation/hwmon/adt7475 | 104 +++++ drivers/hwmon/Kconfig | 10 drivers/hwmon/Makefile | 2 drivers/hwmon/adt7475.c | 938 +++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 1054 insertions(+), 0 deletions(-)
Documentation/hwmon/adt7475 new file +104 -0
@@ -0,0 +1,104 @@ +This describes the interface for the ADT7475 driver: + +(there are 4 fans, numbered fan1 to fan4): + +fanX_input Read the current speed of the fan (in RPMs) +fanX_min Read/write the minimum speed of the fan. Dropping + below this sets an alarm. + +(there are three PWMs, numbered pwm1 to pwm3): + +pwmX Read/write the current duty cycle of the PWM. Writes + only have effect when auto mode is turned off (see + below). + +pwmX_enable Read/write the PWM configuration based on the following + table: + + 0 - Remote1 temp controls PWMx (auto mode) + 1 - local temp controls PWMx (auto mode) + 2 - remote2 temp controls PWMx (auto mode) + 3 - PWMx runs at full speed + 4 - PWMx is disabled + 5 - Use fastest speed calculated by local and remote2 + 6 - Use fastest speed calculated by all three channels + 7 - Manual mode + +pwmX_freq Read/write the PWM frequency. The value returned is + an index into the following table: + + 0x0 - 11.0 Hz + 0x1 - 14.7 Hz + 0x2 - 22.1 Hz + 0x3 - 29.4 Hz + 0x4 - 35.3 Hz + 0x5 - 44.1 Hz + 0x6 - 58.8 Hz + 0x7 - 88.2 Hz + +pwmX_max Read/write the maximum PWM duty cycle. The PWM + duty cycle will never exceed this. + +pwmX_min Read/write the minimum PWM duty cycle in automatic mode + +(there are three temperature settings numbered temp1 to temp3): + +tempX_input Read the current temperature. The value is in milli + degrees of Celsius. + +tempX_max Read/write the upper temperature limit - exceeding this + will cause an alarm. + +tempX_min Read/write the lower temperature limit - exceeding this + will cause an alarm. + +tempX_offset Read/write the temperature adjustment offset + +tempX_crit_max Read/write the THERM limit for remote1. Exceeding this + causes the chip to force the processor off. + +tempX_auto_min Read/write the minimum temperature where the fans will + turn on in automatic mode. + +tempX_auto_range Read/write the range over which the automatic fan + control will be executed. The value returned is a + index into the following table: + + 0x0 - 2 C + 0x1 - 2.5 C + 0x2 - 3.33 C + 0x3 - 4 C + 0x4 - 5 C + 0x5 - 6.67 C + 0x6 - 8 C + 0x7 - 10 C + 0x8 - 13.33 C + 0x9 - 16 C + 0xA - 20 C + 0xB - 26.67 C + 0xC - 32 C + 0xD - 40 C + 0xE - 53.33 C + 0xF - 80 C + +tempX_crit_hyst set the temperature range below crit_max where the + fans will stay on - this helps drive the temperature + low enough so it doesn't stay near the edge and + cause THERM to keep tripping. + +tempX_alarm Read a 1 if the max/min alarm is set +tempX_crit_alarm Read a 1 if the critical limit is exceeded +tempX_fault Read a 1 if either temp1 or temp3 diode has a fault + +(There are two voltage settings, in1 and in2): + +inX_input Read the current voltage on VCC. Value is in + millivolts. + +inX_min read/write the minimum voltage limit. + Dropping below this causes an alarm. + +inX_max read/write the maximum voltage limit. + Exceeding this causes an alarm. + +inX_alarm Read a 1 if the max/min alarm is set.
drivers/hwmon/Kconfig +10 -0
@@ -153,6 +153,16 @@ config SENSORS_ADT7473 This driver can also be built as a module. If so, the module will be called adt7473. +config SENSORS_ADT7475 + tristate "Analog Devices ADT7475" + depends on I2C && EXPERIMENTAL + help + If you say yes here you get support for the Analog Devices + ADT7475 temperature monitoring chips. + + This driver can also be build as a module. If so, the module + will be called adt7475. + config SENSORS_K8TEMP tristate "AMD Athlon64/FX or Opteron temperature sensor" depends on X86 && PCI && EXPERIMENTAL
drivers/hwmon/Makefile +2 -0
@@ -25,6 +25,8 @@ obj-$(CONFIG_SENSORS_ADM9240) += adm9240.o obj-$(CONFIG_SENSORS_ADS7828) += ads7828.o obj-$(CONFIG_SENSORS_ADT7470) += adt7470.o obj-$(CONFIG_SENSORS_ADT7473) += adt7473.o +obj-$(CONFIG_SENSORS_ADT7475) += adt7475.o + obj-$(CONFIG_SENSORS_APPLESMC) += applesmc.o obj-$(CONFIG_SENSORS_AMS) += ams/ obj-$(CONFIG_SENSORS_ATXP1) += atxp1.o
drivers/hwmon/adt7475.c new file +938 -0
938 lines not on this page · raw message
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Re: [lm-sensors] [PATCH] hwmon: Add a driver for the ADT7475
Quoted 3 lines · Jordan Crouse
Attached is a patch for the ADT7475 that has been bouncing around on the list for some time now. It is suitable for the testing GIT tree, and I think it is a good candidate for the 2.6.26 push.
FWIW, I've been running this patch on my desktop for a few months (Asus M2N-SLI Deluxe motherboard) and it seems to work fine. Thanks!
Matt Roberds
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Re: [lm-sensors] [PATCH] hwmon: Add a driver for the ADT7475
In reply to Jordan CrouseQuoted 6 lines · Jordan Crouse
Hi Mark -
Attached is a patch for the ADT7475 that has been bouncing around on the list for some time now. It is suitable for the testing GIT tree, and I think it is a good candidate for the 2.6.26 push.
Hi,
Very sorry for the long silence, it seems all of us involved in the hwmon tree have a bit too much on our plate. As can be witnessed from Mark Hoffman stepping down as hwmon subsys maintainer.
Anyways I've started reviewing your driver, but I haven't come around to reviewing the actual code. Thanks for writting good documentation :) As I now already have found quite a few cases where your driver deviates from the standard sysfs interface as documented in:Documentation/hwmon/sysfs-interface
So in this initial review I'll only comment on your:Documentation/hwmon/adt7475
And I kindly ask you todo a revised version of your driver fixing the interface deviations I believe to be present. When thats done I'll do a full review and I promise I'll be a lot quicker this time around (and when I promise something, you can expect it to happen!).
+This describes the interface for the ADT7475 driver:
+
+(there are 4 fans, numbered fan1 to fan4):
+
+fanX_input Read the current speed of the fan (in RPMs)
+fanX_min Read/write the minimum speed of the fan. Dropping
+ below this sets an alarm.
+
+(there are three PWMs, numbered pwm1 to pwm3):
+
+pwmX Read/write the current duty cycle of the PWM. Writes
+ only have effect when auto mode is turned off (see
+ below).
+
Good, I assume (not looked at the code yet) this goes from 0 - 255 ? If not it should and that should be scaled to whatever the IC wants.
+pwmX_enable Read/write the PWM configuration based on the following
+ table:
+
+ 0 - Remote1 temp controls PWMx (auto mode)
+ 1 - local temp controls PWMx (auto mode)
+ 2 - remote2 temp controls PWMx (auto mode)
+ 3 - PWMx runs at full speed + 4 - PWMx is disabled + 5 - Use fastest speed calculated by local and remote2 + 6 - Use fastest speed calculated by all three channels + 7 - Manual mode
+
Erm, this is somewhat non standard, atleast 0 and 1 have a well defined meaning in the sysfs-interface standard:
"pwm[1-*]_enable
Fan speed control method:
0: no fan speed control (i.e. fan at full speed) 1: manual fan speed control enabled (using pwm[1-*]) 2+: automatic fan speed control enabled
Check individual chip documentation files for automatic mode details."
Actually reading the datasheet, I think this is not what we want, what we want pwmX_enable to be for the adt7475 is:
0: No fan speed control (fan at full speed, iow 3 in your old table) 1: Manual fan speed control (7 in your old table)
2: Automatic fan speed control (0-2, 5-6 in your old table, see below for
which one should be used when).
And then add a pwmX_auto_channels_temp atrribute to control which temp sensor(s) influence the pwm, quoting our sysfs standard doc again:
"pwm[1-*]_auto_channels_temp
Select which temperature channels affect this PWM output in auto mode. Bitfield, 1 is temp1, 2 is temp2, 4 is temp3 etc... Which values are possible depend on the chip used. RW"
So that would mean that valid values for the adt7475 are, with corresponding number in your old table:
1 -> 0 (I assume remote1 is temp1, local temp2 and remote2 temp3) 2 -> 1
4 -> 2
6 -> 5
7 -> 6
Note that 4 from your old table is not used, we don't want people to be able to
turn of the pwm (and thus the fan) through pwm_enable _ever_. If they really
want todo something that stupid they should configure manual mode and write a duty cycle of 0 %.
+pwmX_freq Read/write the PWM frequency. The value returned is
+ an index into the following table:
+
+ 0x0 - 11.0 Hz + 0x1 - 14.7 Hz + 0x2 - 22.1 Hz + 0x3 - 29.4 Hz + 0x4 - 35.3 Hz + 0x5 - 44.1 Hz + 0x6 - 58.8 Hz + 0x7 - 88.2 Hz
+
That table should be in the driver and userspace should read/write a value in Hz, to quote the docs:
"pwm[1-*]_freq Base PWM frequency in Hz.
Only possibly available when pwmN_mode is PWM, but not always present even then.
RW"
+pwmX_max Read/write the maximum PWM duty cycle. The PWM
+ duty cycle will never exceed this.
+
+pwmX_min Read/write the minimum PWM duty cycle in automatic mode
+
Good (but again 0 - 255 scale please).
+(there are three temperature settings numbered temp1 to temp3):
+
+tempX_input Read the current temperature. The value is in milli
+ degrees of Celsius.
+
+tempX_max Read/write the upper temperature limit - exceeding this
+ will cause an alarm.
+
+tempX_min Read/write the lower temperature limit - exceeding this
+ will cause an alarm.
+
+tempX_offset Read/write the temperature adjustment offset
+
I assume this are all milli degrees too? If not they should be.
+tempX_crit_max Read/write the THERM limit for remote1. Exceeding this
+ causes the chip to force the processor off.
+
The standardized name for this is tempX_crit, and drop the force the processor off language, that really depends on how the IC is hooked up on the motherboard and thus isn't always true.
+tempX_auto_min Read/write the minimum temperature where the fans will
+ turn on in automatic mode.
+
+tempX_auto_range Read/write the range over which the automatic fan
+ control will be executed. The value returned is a
+ index into the following table:
+
+ 0x0 - 2 C
+ 0x1 - 2.5 C
+ 0x2 - 3.33 C
+ 0x3 - 4 C
+ 0x4 - 5 C
+ 0x5 - 6.67 C
+ 0x6 - 8 C
+ 0x7 - 10 C
+ 0x8 - 13.33 C
+ 0x9 - 16 C
+ 0xA - 20 C
+ 0xB - 26.67 C
+ 0xC - 32 C
+ 0xD - 40 C
+ 0xE - 53.33 C
+ 0xF - 80 C
+
Please rename tempX_auto_min to
tempX_auto_point1_temp
And rename tempX_auto_range to tempX_auto_point2_temp and when tempX_auto_point2_temp gets read show tempX_auto_point1_temp + the range value looked up in the above table (in milli degrees please) and vica versa when tempX_auto_point2_temp gets written.
+tempX_crit_hyst set the temperature range below crit_max where the
+ fans will stay on - this helps drive the temperature + low enough so it doesn't stay near the edge and + cause THERM to keep tripping.
+
Good, but note that this should not be an offset, but an absolute value so when temp1_crit is for example 100000 and the temp must drop more then 10 degrees before the crit alarm gets cleared, then reading temp1_crit_hyst should return 90000.
+tempX_alarm Read a 1 if the max/min alarm is set
+tempX_crit_alarm Read a 1 if the critical limit is exceeded
+tempX_fault Read a 1 if either temp1 or temp3 diode has a fault
+
All good.
+(There are two voltage settings, in1 and in2):
+
+inX_input Read the current voltage on VCC. Value is in
+ millivolts.
+
+inX_min read/write the minimum voltage limit.
+ Dropping below this causes an alarm.
+
+inX_max read/write the maximum voltage limit.
+ Exceeding this causes an alarm.
+
+inX_alarm Read a 1 if the max/min alarm is set.
Also all good.
Again, apologies for being so slow, esp since all I've done now is take a look at the API and not even at the code :(
I'll be leaving tomorrow morning for a week vacation. I hope you will have been able todo a new revision fixing all the API remarks I've made and then I'll do a full review real soon!
Regards,
Hans
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
PATCH 1/1 hwmon: Add a driver for the ADT7475 thermal
In reply to Jordan CrouseResend of the ADT7475 driver. Jean said he would like to see a review on this version, even though it had been discussed before. Therefore I'm CCing Hans for his opinion.. :) I would really like to see this go into 2.6.28 and get out of my patch stack.
Jordan
Signature · 3 lines
Jordan Crouse Systems Software Development Engineer Advanced Micro Devices, Inc.
[PATCH] hwmon: Add a driver for the ADT7475 thermal sensor
From: Jordan Crouse <[email protected]>
HWMON driver for the ADT7475 thermal sensor.
---
Documentation/hwmon/adt7475 | 104 +++++ drivers/hwmon/Kconfig | 10 drivers/hwmon/Makefile | 2 drivers/hwmon/adt7475.c | 938 +++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 1054 insertions(+), 0 deletions(-)
Documentation/hwmon/adt7475 new file +104 -0
@@ -0,0 +1,104 @@ +This describes the interface for the ADT7475 driver: + +(there are 4 fans, numbered fan1 to fan4): + +fanX_input Read the current speed of the fan (in RPMs) +fanX_min Read/write the minimum speed of the fan. Dropping + below this sets an alarm. + +(there are three PWMs, numbered pwm1 to pwm3): + +pwmX Read/write the current duty cycle of the PWM. Writes + only have effect when auto mode is turned off (see + below). + +pwmX_enable Read/write the PWM configuration based on the following + table: + + 0 - Remote1 temp controls PWMx (auto mode) + 1 - local temp controls PWMx (auto mode) + 2 - remote2 temp controls PWMx (auto mode) + 3 - PWMx runs at full speed + 4 - PWMx is disabled + 5 - Use fastest speed calculated by local and remote2 + 6 - Use fastest speed calculated by all three channels + 7 - Manual mode + +pwmX_freq Read/write the PWM frequency. The value returned is + an index into the following table: + + 0x0 - 11.0 Hz + 0x1 - 14.7 Hz + 0x2 - 22.1 Hz + 0x3 - 29.4 Hz + 0x4 - 35.3 Hz + 0x5 - 44.1 Hz + 0x6 - 58.8 Hz + 0x7 - 88.2 Hz + +pwmX_max Read/write the maximum PWM duty cycle. The PWM + duty cycle will never exceed this. + +pwmX_min Read/write the minimum PWM duty cycle in automatic mode + +(there are three temperature settings numbered temp1 to temp3): + +tempX_input Read the current temperature. The value is in milli + degrees of Celsius. + +tempX_max Read/write the upper temperature limit - exceeding this + will cause an alarm. + +tempX_min Read/write the lower temperature limit - exceeding this + will cause an alarm. + +tempX_offset Read/write the temperature adjustment offset + +tempX_crit_max Read/write the THERM limit for remote1. Exceeding this + causes the chip to force the processor off. + +tempX_auto_min Read/write the minimum temperature where the fans will + turn on in automatic mode. + +tempX_auto_range Read/write the range over which the automatic fan + control will be executed. The value returned is a + index into the following table: + + 0x0 - 2 C + 0x1 - 2.5 C + 0x2 - 3.33 C + 0x3 - 4 C + 0x4 - 5 C + 0x5 - 6.67 C + 0x6 - 8 C + 0x7 - 10 C + 0x8 - 13.33 C + 0x9 - 16 C + 0xA - 20 C + 0xB - 26.67 C + 0xC - 32 C + 0xD - 40 C + 0xE - 53.33 C + 0xF - 80 C + +tempX_crit_hyst set the temperature range below crit_max where the + fans will stay on - this helps drive the temperature + low enough so it doesn't stay near the edge and + cause THERM to keep tripping. + +tempX_alarm Read a 1 if the max/min alarm is set +tempX_crit_alarm Read a 1 if the critical limit is exceeded +tempX_fault Read a 1 if either temp1 or temp3 diode has a fault + +(There are two voltage settings, in1 and in2): + +inX_input Read the current voltage on VCC. Value is in + millivolts. + +inX_min read/write the minimum voltage limit. + Dropping below this causes an alarm. + +inX_max read/write the maximum voltage limit. + Exceeding this causes an alarm. + +inX_alarm Read a 1 if the max/min alarm is set.
drivers/hwmon/Kconfig +10 -0
@@ -179,6 +179,16 @@ config SENSORS_ADT7473 This driver can also be built as a module. If so, the module will be called adt7473. +config SENSORS_ADT7475 + tristate "Analog Devices ADT7475" + depends on I2C && EXPERIMENTAL + help + If you say yes here you get support for the Analog Devices + ADT7475 temperature monitoring chips. + + This driver can also be build as a module. If so, the module + will be called adt7475. + config SENSORS_K8TEMP tristate "AMD Athlon64/FX or Opteron temperature sensor" depends on X86 && PCI && EXPERIMENTAL
drivers/hwmon/Makefile +2 -0
@@ -27,6 +27,8 @@ obj-$(CONFIG_SENSORS_ADM9240) += adm9240.o obj-$(CONFIG_SENSORS_ADS7828) += ads7828.o obj-$(CONFIG_SENSORS_ADT7470) += adt7470.o obj-$(CONFIG_SENSORS_ADT7473) += adt7473.o +obj-$(CONFIG_SENSORS_ADT7475) += adt7475.o + obj-$(CONFIG_SENSORS_APPLESMC) += applesmc.o obj-$(CONFIG_SENSORS_AMS) += ams/ obj-$(CONFIG_SENSORS_ATXP1) += atxp1.o
drivers/hwmon/adt7475.c new file +938 -0
938 lines not on this page · raw message
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Re: [lm-sensors] [PATCH] hwmon: Add a driver for the ADT7475
In reply to Jordan CrouseQuoted 5 lines · Jordan Crouse
Resend of the ADT7475 driver. Jean said he would like to see a review on this version, even though it had been discussed before. Therefore I'm CCing Hans for his opinion.. :) I would really like to see this go into 2.6.28 and get out of my patch stack.
Jordan,
I did do a review although very late (but didn't get very far, as there are some sysfs API issues that need addressing first).
See:
http://lists.lm-sensors.org/pipermail/lm-sensors/2008-August/023948.html
Regards,
Hans
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
PATCH 1/1 hwmon: Add a driver for the ADT7475 thermal
In reply to Jordan CrouseHi Jean,
As Jordan did not get around to doing this and the 2.6.29 merge window is near I've fixed the last few outstanding issues from my review(s) of his adt7475 I've done myself. Attached is a new version of the adt7475 with:
* all issues review found fixed
* converted to the new i2c driver style
* a few more registers needed reading in store methods
* corrected register to voltage conversion (more accurate)
* some style fixes
* locking around show functions where the value shown depends on more then
1 reg.
* read limit registers only once every 60 seconds
* rename pwm_min and pwm_max to pwm_auto_pointX_pwm, as the
control the scope between which the pwm gets changed in auto mode
* remove tempX_crit_alarm (only one crit alarm flag for all 3 channels)
I hope this is ok now to be queued for 2.6.29
Thanks & Regards,
Hans
[PATCH] hwmon: Add a driver for the ADT7475 thermal sensor
From: Jordan Crouse <[email protected]>
HWMON driver for the ADT7475 thermal sensor.
Documentation/hwmon/adt7475 new file +87 -0
@@ -0,0 +1,87 @@ +This describes the interface for the ADT7475 driver: + +(there are 4 fans, numbered fan1 to fan4): + +fanX_input Read the current speed of the fan (in RPMs) +fanX_min Read/write the minimum speed of the fan. Dropping + below this sets an alarm. + +(there are three PWMs, numbered pwm1 to pwm3): + +pwmX Read/write the current duty cycle of the PWM. Writes + only have effect when auto mode is turned off (see + below). Range is 0 - 255. + +pwmX_enable Fan speed control method: + + 0 - No control (fan at full speed) + 1 - Manual fan speed control (using pwm[1-*]) + 2 - Automatic fan speed control + +pwmX_auto_channels_temp Select which channels affect this PWM + + 1 - TEMP1 controls PWM + 2 - TEMP2 controls PWM + 4 - TEMP3 controls PWM + 6 - TEMP2 and TEMP3 control PWM + 7 - All three inputs control PWM + +pwmX_freq Read/write the PWM frequency in Hz. The number + should be one of the following: + + 11 Hz + 14 Hz + 22 Hz + 29 Hz + 35 Hz + 44 Hz + 58 Hz + 88 Hz + +pwmX_auto_point1_pwm Read/write the minimum PWM duty cycle in automatic mode + +pwmX_auto_point2_pwm Read/write the maximum PWM duty cycle in automatic mode + +(there are three temperature settings numbered temp1 to temp3): + +tempX_input Read the current temperature. The value is in milli + degrees of Celsius. + +tempX_max Read/write the upper temperature limit - exceeding this + will cause an alarm. + +tempX_min Read/write the lower temperature limit - exceeding this + will cause an alarm. + +tempX_offset Read/write the temperature adjustment offset + +tempX_crit Read/write the THERM limit for remote1. + +tempX_crit_hyst Set the temperature value below crit where the + fans will stay on - this helps drive the temperature + low enough so it doesn't stay near the edge and + cause THERM to keep tripping. + +tempX_auto_point1_temp Read/write the minimum temperature where the fans will + turn on in automatic mode. + +tempX_auto_point2_temp Read/write the maximum temperature over which the fans + will run in automatic mode. tempX_auto_point1_temp + and tempX_auto_point2_temp together define the + range of automatic control. + +tempX_alarm Read a 1 if the max/min alarm is set +tempX_fault Read a 1 if either temp1 or temp3 diode has a fault + +(There are two voltage settings, in1 and in2): + +inX_input Read the current voltage on VCC. Value is in + millivolts. + +inX_min read/write the minimum voltage limit. + Dropping below this causes an alarm. + +inX_max read/write the maximum voltage limit. + Exceeding this causes an alarm. + +inX_alarm Read a 1 if the max/min alarm is set.
drivers/hwmon/Kconfig renamed from drivers/hwmon/Kconfig.adt7475 +10 -0
@@ -189,6 +189,16 @@ config SENSORS_ADT7473 This driver can also be built as a module. If so, the module will be called adt7473. +config SENSORS_ADT7475 + tristate "Analog Devices ADT7475" + depends on I2C && EXPERIMENTAL + help + If you say yes here you get support for the Analog Devices + ADT7475 temperature monitoring chips. + + This driver can also be build as a module. If so, the module + will be called adt7475. + config SENSORS_K8TEMP tristate "AMD Athlon64/FX or Opteron temperature sensor" depends on X86 && PCI && EXPERIMENTAL
drivers/hwmon/Makefile renamed from drivers/hwmon/Makefile.adt7475 +2 -0
@@ -28,6 +28,8 @@ obj-$(CONFIG_SENSORS_ADS7828) += ads7828 obj-$(CONFIG_SENSORS_ADT7462) += adt7462.o obj-$(CONFIG_SENSORS_ADT7470) += adt7470.o obj-$(CONFIG_SENSORS_ADT7473) += adt7473.o +obj-$(CONFIG_SENSORS_ADT7475) += adt7475.o + obj-$(CONFIG_SENSORS_APPLESMC) += applesmc.o obj-$(CONFIG_SENSORS_AMS) += ams/ obj-$(CONFIG_SENSORS_ATXP1) += atxp1.o
drivers/hwmon/adt7475.c new file +1221 -0
1,221 lines not on this page · raw message
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
PATCH 1/1 hwmon: Add a driver for the ADT7475 thermal
In reply to Jordan Crousep.s.
This has been tested on my Asus M2N SLI deluxe motherboard
Hi Jean,
As Jordan did not get around to doing this and the 2.6.29 merge window is near I've fixed the last few outstanding issues from my review(s) of his adt7475 I've done myself. Attached is a new version of the adt7475 with:
* all issues review found fixed
* converted to the new i2c driver style
* a few more registers needed reading in store methods
* corrected register to voltage conversion (more accurate)
* some style fixes
* locking around show functions where the value shown depends on more then
1 reg.
* read limit registers only once every 60 seconds
* rename pwm_min and pwm_max to pwm_auto_pointX_pwm, as the control the scope between which the pwm gets changed in auto mode
* remove tempX_crit_alarm (only one crit alarm flag for all 3 channels)
I hope this is ok now to be queued for 2.6.29
Thanks & Regards,
Hans
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Re: [lm-sensors] [PATCH] hwmon: Add a driver for the ADT7475
In reply to Jordan CrouseQuoted 1 line · Hans de Goede
* converted to the new i2c driver style
I suspect this is what is causing the failure to compile on my old kernel (2.6.18), and right now I don't have time to try it against a newer kernel.
I did take a quick look through the patch and I do have a question about find_nearest(). Sometimes it returns an array index (if the query is less than the lowest data value in the array, or if the query is in the middle of the data values in the array), and sometimes it returns a data value (if the query is higher than the highest data value in the array). Looking at what happens next after find_nearest() is called, I think it should always return an array index.
In other words, in find_nearest(), this:
if (val > array[size - 1])
return array[size - 1];
should be this:
if (val > array[size - 1])
return size - 1;
Also, when find_nearest() is used against autorange_table, the low 4 bits of the return value are used. Since autorange_table has 16 entries, this is probably OK. But when find_nearest is used against pwmfreq_table, only the low 2 bits of the return value are used. pwmfreq_table has 8 entries; should the low 3 bits of the return value be used instead?
In other words, in set_pwmfreq(), should this:
data->range[sattr->index] &= ~3;
data->range[sattr->index] |= out & 0x03;
be something like this:
data->range[sattr->index] &= ~0x07;
data->range[sattr->index] |= out & 0x07;
Maybe this is just how the hardware works, but I figured I would mention it.
Matt Roberds
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Re: [lm-sensors] [PATCH] hwmon: Add a driver for the ADT7475
In reply to Jordan CrouseQuoted 7 lines · Matt Roberds
Quoted 1 line · Hans de Goede
* converted to the new i2c driver style
I suspect this is what is causing the failure to compile on my old kernel (2.6.18), and right now I don't have time to try it against a newer kernel.
Yes, you need atleast a 2.6.27 kernel for the new style.
Quoted 10 lines
I did take a quick look through the patch and I do have a question about
find_nearest(). Sometimes it returns an array index (if the query is less than the lowest data value in the array, or if the query is in the middle of the data values in the array), and sometimes it returns a data value (if the query is higher than the highest data value in the array). Looking at what happens next afterfind_nearest()is called, I think it should always return an array index.In other words, in
find_nearest(), this:
Quoted 8 lines
if (val > array[size - 1])
return array[size - 1];should be this:
if (val > array[size - 1])
return size - 1;
Correct, good catch!
Quoted 12 lines
Also, when
find_nearest()is used againstautorange_table, the low 4 bits of the return value are used. Sinceautorange_tablehas 16 entries, this is probably OK. But whenfind_nearestis used againstpwmfreq_table, only the low 2 bits of the return value are used.pwmfreq_tablehas 8 entries; should the low 3 bits of the return value be used instead?In other words, in
set_pwmfreq(), should this:data->range[sattr->index] &= ~3;
data->range[sattr->index] |= out &0x03;
Quoted 7 lines
be something like this:
data->range[sattr->index] &= ~0x07;
data->range[sattr->index] |= out &0x07;Maybe this is just how the hardware works, but I figured I would mention it.
Hmm, another good catch, lemme check the datasheet ... You are right there are 3 frequency bits (the 3 least significant bits) in the range register so the mask should be 7 not 3. New version coming up!
Regards,
Hans
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
PATCH 1/1 hwmon: Add a driver for the ADT7475 thermal
In reply to Jordan CrouseHi Jean,
Here is a new version with the comments / review from Matt Roberds taken in to account.
Thanks & Regards,
Hans
[PATCH] hwmon: Add a driver for the ADT7475 thermal sensor
From: Jordan Crouse <[email protected]>
HWMON driver for the ADT7475 thermal sensor.
Documentation/hwmon/adt7475 new file +87 -0
@@ -0,0 +1,87 @@ +This describes the interface for the ADT7475 driver: + +(there are 4 fans, numbered fan1 to fan4): + +fanX_input Read the current speed of the fan (in RPMs) +fanX_min Read/write the minimum speed of the fan. Dropping + below this sets an alarm. + +(there are three PWMs, numbered pwm1 to pwm3): + +pwmX Read/write the current duty cycle of the PWM. Writes + only have effect when auto mode is turned off (see + below). Range is 0 - 255. + +pwmX_enable Fan speed control method: + + 0 - No control (fan at full speed) + 1 - Manual fan speed control (using pwm[1-*]) + 2 - Automatic fan speed control + +pwmX_auto_channels_temp Select which channels affect this PWM + + 1 - TEMP1 controls PWM + 2 - TEMP2 controls PWM + 4 - TEMP3 controls PWM + 6 - TEMP2 and TEMP3 control PWM + 7 - All three inputs control PWM + +pwmX_freq Read/write the PWM frequency in Hz. The number + should be one of the following: + + 11 Hz + 14 Hz + 22 Hz + 29 Hz + 35 Hz + 44 Hz + 58 Hz + 88 Hz + +pwmX_auto_point1_pwm Read/write the minimum PWM duty cycle in automatic mode + +pwmX_auto_point2_pwm Read/write the maximum PWM duty cycle in automatic mode + +(there are three temperature settings numbered temp1 to temp3): + +tempX_input Read the current temperature. The value is in milli + degrees of Celsius. + +tempX_max Read/write the upper temperature limit - exceeding this + will cause an alarm. + +tempX_min Read/write the lower temperature limit - exceeding this + will cause an alarm. + +tempX_offset Read/write the temperature adjustment offset + +tempX_crit Read/write the THERM limit for remote1. + +tempX_crit_hyst Set the temperature value below crit where the + fans will stay on - this helps drive the temperature + low enough so it doesn't stay near the edge and + cause THERM to keep tripping. + +tempX_auto_point1_temp Read/write the minimum temperature where the fans will + turn on in automatic mode. + +tempX_auto_point2_temp Read/write the maximum temperature over which the fans + will run in automatic mode. tempX_auto_point1_temp + and tempX_auto_point2_temp together define the + range of automatic control. + +tempX_alarm Read a 1 if the max/min alarm is set +tempX_fault Read a 1 if either temp1 or temp3 diode has a fault + +(There are two voltage settings, in1 and in2): + +inX_input Read the current voltage on VCC. Value is in + millivolts. + +inX_min read/write the minimum voltage limit. + Dropping below this causes an alarm. + +inX_max read/write the maximum voltage limit. + Exceeding this causes an alarm. + +inX_alarm Read a 1 if the max/min alarm is set.
drivers/hwmon/Kconfig renamed from drivers/hwmon/Kconfig.adt7475 +10 -0
@@ -189,6 +189,16 @@ config SENSORS_ADT7473 This driver can also be built as a module. If so, the module will be called adt7473. +config SENSORS_ADT7475 + tristate "Analog Devices ADT7475" + depends on I2C && EXPERIMENTAL + help + If you say yes here you get support for the Analog Devices + ADT7475 temperature monitoring chips. + + This driver can also be build as a module. If so, the module + will be called adt7475. + config SENSORS_K8TEMP tristate "AMD Athlon64/FX or Opteron temperature sensor" depends on X86 && PCI && EXPERIMENTAL
drivers/hwmon/Makefile renamed from drivers/hwmon/Makefile.adt7475 +2 -0
@@ -28,6 +28,8 @@ obj-$(CONFIG_SENSORS_ADS7828) += ads7828 obj-$(CONFIG_SENSORS_ADT7462) += adt7462.o obj-$(CONFIG_SENSORS_ADT7470) += adt7470.o obj-$(CONFIG_SENSORS_ADT7473) += adt7473.o +obj-$(CONFIG_SENSORS_ADT7475) += adt7475.o + obj-$(CONFIG_SENSORS_APPLESMC) += applesmc.o obj-$(CONFIG_SENSORS_AMS) += ams/ obj-$(CONFIG_SENSORS_ATXP1) += atxp1.o
drivers/hwmon/adt7475.c new file +1221 -0
1,221 lines not on this page · raw message
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Re: [lm-sensors] [PATCH] hwmon: Add a driver for the ADT7475
In reply to Jordan CrouseQuoted 5 lines · Hans de Goede
Hi Jean,
As Jordan did not get around to doing this and the 2.6.29 merge window is near I've fixed the last few outstanding issues from my review(s) of his adt7475 I've done myself. Attached is a new version of the adt7475
Thanks - I let this slide due to other issues, and I was feeling bad about letting this drop through another kernel cycle - I appreciate your help.
Jordan
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Re: [lm-sensors] [PATCH] hwmon: Add a driver for the ADT7475
In reply to Jordan CrouseQuoted 2 lines · Daimonos Tereutes
I'm using the patch for ADT7475 since the begining on an ASUS M2N32 WS Professional without problem.
It looks like you might be using a modified version of this sensors3.conf :
http://www.lm-sensors.org/wiki/Configurations/Asus/M2N-SLI%20Deluxe
On your board, it seems like it8716 in2 (+3.3 V) works, and it8716 temp3 is chassis temp. Also, the assignment of fans (CPU/chassis/power supply) to chip inputs is a little different. If you have verified that the labels are correct, can you post your sensors3.conf here on the list? This will help it get to the wiki as a reference for others.
Thanks!
Matt Roberds
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Re: [lm-sensors] [PATCH] hwmon: Add a driver for the ADT7475
In reply to Jordan CrouseQuoted 14 lines · Matt Roberds
Quoted 2 lines · Daimonos Tereutes
I'm using the patch for ADT7475 since the begining on an ASUS M2N32 WS Professional without problem.
It looks like you might be using a modified version of this sensors3.conf :
http://www.lm-sensors.org/wiki/Configurations/Asus/M2N-SLI%20DeluxeOn your board, it seems like it8716 in2 (+3.3 V) works, and it8716 temp3 is chassis temp. Also, the assignment of fans (CPU/chassis/power supply) to chip inputs is a little different. If you have verified that the labels are correct, can you post your sensors3.conf here on the list? This will help it get to the wiki as a reference for others.
Quoted 4 lines
Thanks!
Matt Roberds
Hello,
Sorry for late reply, I was away from computer.
My starting point was indeed
http://www.lm-sensors.org/wiki/Configurations/Asus/M2N-SLI%20Deluxe
I added some names based on dissasembly of ACPI following instructions on this page : http://www.lm-sensors.org/wiki/AsusFormulaHacking
And some other based on different messages on the lm_sensors list.
Hopes it will help someone.
François
chip "it8716-*"
# Voltages
label in0 "VCore"
ignore in1 #"VDDR" # Allways 0V
label in2 "+3.3V" # 3.3 V is monitored by adt7475 too
label in3 "+5V" # VCC
label in4 "+12V"
label in5 "VDDR" # VDDR? (~1.83V)
ignore in6 # Allways 0V
label in7 "5VSB" # Not in BIOS
label in8 "VBat" # Not in BIOS # Vcore, VDDR, and Vbat are connected directly, so no compute
# line is needed for these. For +5V, +12V and 5VSB, the default
# resistors seem to have been used.
# Those formulae are from http://www.lm-sensors.org/wiki/Configurations/Asus/M2N-SLI%20Deluxe
# compute in3 ((6.8/10)+1)*@ , @/((6.8/10)+1)
# compute in4 ((30/10)+1)*@ , @/((30/10)+1)
# compute in5 (84*@)/50, (@/84)*50
# Those formulae are from ACPI disassembly. The results are similare
compute in3 (84*@)/50, (@/84)*50
compute in4 (40*@)/10, (@/40)*10
compute in5 @/2, @*2
compute in7 ((6.8/10)+1)*@, @/((6.8/10)+1)# The BIOS won't set any limit for voltages.
# CPU is an Athlon X2 BE-2350, with Cool'n'Quiet activated so the rather wide range of Voltage set in0_min 1.05 * 0.95
set in0_max 1.25 * 1.05
set in2_min 3.3 * 0.95
set in2_max 3.3 * 1.05
set in3_min 5 * 0.95
set in3_max 5 * 1.05
set in4_min 12 * 0.95
set in4_max 12 * 1.05
set in7_min 5 * 0.95
set in7_max 5 * 1.05
# Temperatures
# Not sure. temp1 always reads close to what k8temp reports for Core0,
# and to what the BIOS reports as the CPU temperature. temp2 is between # temp1 and temp3; it is close to what the BIOS reports as the motherboard # temperature. temp3 always reads approximate ambient temperature.
label temp1 "CPU Temp"
label temp2 "MB Temp"
label temp3 "Chassis Temp"
# Fans
label fan1 "CPU Fan"
label fan2 "Chassis Fan 1"
label fan3 "Chassis Fan 2"# QFAN is on in BIOS, fan1 is a 4 pin fan, but fan2 and fan3 are 3 pin fans
# and only show when RPM is above 1000.
set fan1_min 1200
set fan2_min 300
set fan3_min 300chip "adt7475-*"
# Note: this section depends on some further hacks I have made to # Jordan Crouse's driver
# Voltages
ignore in1
label in2 "+3.3V"# Temperatures
# temp1 and temp3 don't appear to be hooked up; temp2 is on board the # adt7475 chip itself.
ignore temp1
label temp2 "ADT7475 Temp"
ignore temp3
# Fans
label fan1 "Chassis Fan 3"
label fan2 "Chassis Fan 4"
label fan3 "Power Supply Fan" # Only one in BIOS
label fan4 "Chassis Fan 5"# fan3 is take from ACPI dissasembly
# other fan are simply numbered in order, I never saw anything but 0 RPM
# for these. According to MB manual there aren't even connected
# Ignore fans you don't have
set fan3_min 600chip "k8temp-*"
label temp1 "core0 temp0"
label temp2 "core0 temp1"
label temp3 "core1 temp0"
label temp4 "core1 temp1"
# 21°C offset taken from message on lm_sensors list
# not sure if it is correct or if CPU is boggus, but # temps are similar to others probes temp. compute temp1 (@+21), (@-21) compute temp2 (@+21), (@-21) compute temp3 (@+21), (@-21) compute temp4 (@+21), (@-21)
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Re: [lm-sensors] [PATCH] hwmon: Add a driver for the ADT7475
In reply to Jordan CrouseHi Hans,
Quoted 2 lines · Hans de Goede
Here is a new version with the comments / review from Matt Roberds taken in to account.
Thank you (and to Jordan and Matt as well) for finishing the driver. I've just added it to my hwmon tree, so that it goes into linux-next. I'll push it to Linus as part of my next round of hwmon patches (which should basically be the adt7475 driver + the k8temp fixes which I still need to review and test.)
Signature · 6 lines
Jean Delvare _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Re: [lm-sensors] [PATCH] hwmon: Add a driver for the ADT7475
In reply to Jordan CrouseQuoted 9 lines · Jean Delvare
Hi Hans,
Quoted 2 lines · Hans de Goede
Here is a new version with the comments / review from Matt Roberds taken in to account.
Thank you (and to Jordan and Matt as well) for finishing the driver. I've just added it to my hwmon tree, so that it goes into linux-next. I'll push it to Linus as part of my next round of hwmon patches
Great, thanks!
(which
Quoted 3 lines
should basically be the adt7475 driver + the k8temp fixes which I still need to review and test.)
I can test the k8temp driver too if you want. I actually have access to 3 different k8 models. But testing on some of them is easier for me then testing on others. I can test without much work from my side on atleast 1.
Regards,
Hans
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors