Skip to contentSkip to conversation

ADT7475 (resend) (WAS: First shot at Asus M2N-SLI

lm-sensors Jordan Crouse 3 participants 3 messages Feb 26, 2008 – Feb 27, 2008

Subsystems (3)
lore
Share & tools
lore
#0 lore raw
Quoted 7 lines
Quoted 2 lines

Okay - I understand. So I should just get rid of all of the labels in
the whole driver?

Yes, the foo#_label attributes are only there for the rare exception when the driver has knowledge about the pcb layouts used / about which motherboard it is operating on and which input is measuring what on that motherboard.

Okay, done, and updated the documentation too. It also occurred to me that I should probably send it through checkpatch.pl, and it was a good thing that I did, because there were style issues. The result is attached.

Thanks for the comments,
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
new file mode 100644
index 0000000..64eb78c
@@ -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
index 368879f..131b812 100644
@@ -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
index 3bdb05a..41567be 100644
@@ -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

#1 lore raw
Quoted 1 line · Jordan Crouse

Okay, done, and updated the documentation too.

I tried this latest version and can confirm that it works, both with a null sensors.conf and with my proposed Asus M2N-SLI Deluxe sensors.conf .

Quoted 3 lines

It also occurred to me that I should probably send it through checkpatch.pl, and it was a good thing that I did, because there were style issues.

This seems to have caused the following compiler warnings, which weren't there before:

drivers/hwmon/adt7475.c: In function 'adt7475_detect':
drivers/hwmon/adt7475.c:803: warning: assignment from incompatible pointer type drivers/hwmon/adt7475.c: In function 'adt7475_detach_client':
drivers/hwmon/adt7475.c:831: warning: passing argument 1 of 'hwmon_device_unregister' from incompatible pointer type

This is with gcc 4.1.2 on Debian "Etch" AMD64; gcc --version says
gcc (GCC) 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)
and uname -a says
Linux birdbird 2.6.18 #3 SMP PREEMPT Sun Jan 20 20:51:02 CST 2008 x86_64 GNU/Linux

Matt Roberds

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

#2 lore raw
In reply to Jordan Crouse
Quoted 10 lines · Matt Roberds
Quoted 1 line · Jordan Crouse

Okay, done, and updated the documentation too.

I tried this latest version and can confirm that it works, both with a null sensors.conf and with my proposed Asus M2N-SLI Deluxe sensors.conf .

Quoted 3 lines

It also occurred to me that I should probably send it through checkpatch.pl, and it was a good thing that I did, because there were style issues.

Quoted 8 lines

This seems to have caused the following compiler warnings, which weren't there before:

drivers/hwmon/adt7475.c: In function 'adt7475_detect':
drivers/hwmon/adt7475.c:803: warning: assignment from incompatible pointer type drivers/hwmon/adt7475.c: In function 'adt7475_detach_client':
drivers/hwmon/adt7475.c:831: warning: passing argument 1 of 'hwmon_device_unregister' from incompatible pointer type

Those warnings are because you are using an older kernel, with a new kernel these shouldn't happen.

Regards,

Hans

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