Skip to contentSkip to conversation

Hardware monitoring support for SMSC

PATCH New Hartmut Rick 3 participants 5 messages Mar 19, 2006 – Mar 22, 2006

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Hardware monitoring support for SMSC

Hi Jean,

Thanks a lot for your comments, and sorry this takes so long.
Here's a new patch, now with individual alarm files only. I've also renamed the temp[23]_fault files to temp[23]_input_fault in order to match your sysfs interface proposal.

I have included all your comments except these:

Quoted 6 lines · Jean Delvare
Quoted 1 line

* add smsc47m192 driver documentation

Thanks for that, this is very welcome. A large part of the "/sys files" section (which would be better named "sysfs interface" IMHO) is redundant with Dcumentation/hwmon/sysfs-interface, so you may want to skip everything which isn't driver specific. But I don't care that much

Thanks for not caring too much, since I like it better to include a complete list of features that this driver offers, even though some of it is a repetition from sysfs-interface documentation. The latter contains more entries which don't apply to this driver, and the information of which parts do apply here cannot be there.

Quoted 8 lines

Review

Quoted 4 lines
(quoted diff) +4 -0
+			dev_info(&adapter->dev,
+					"found SMSC47M192 or SMSC47M997, "
+						"version 2, stepping A%d\n",
+						version&0x0f);

I'm sure you can get this to fit on 3 lines max ;) Also, how relevant is it to mention "version 2" given that all chips have this same version by definition (else they are not supported by the driver)?

Hm, it is true that only version 2 is supported here, but then again, only SMSC47M192 and compatibles are supported and we still mention that we found one. I don't know whether there is ever going to be any other version than version 2, but if there was, and if there was another driver that handled only version 3+, you would want to distinguish the two drivers. Somehow I think the version number belongs there if we mention the type and the stepping.
Having said that, I'm still happy to have it removed if you insist that it should not be there.

Best regards,
Hartmut

--------------------------------------------------------------------------

This patch adds a new driver (smsc47m192.o) which supports voltage and temperature measurement features of SMSC LPC47M192 and LPC47M997 chips.

Signed-off-by: Hartmut Rick <linux at rick.claranet.de> -------------- next part --------------

Documentation/hwmon/smsc47m192 +102 -0
diff -uprN linux-2.6.16-rc5/Documentation/hwmon/smsc47m192 linux-2.6.16-new/Documentation/hwmon/smsc47m192
@@ -0,0 +1,102 @@
+Kernel driver smsc47m192
+============
+
+Supported chips:
+  * SMSC LPC47M192 and LPC47M997
+    Prefix: 'smsc47m192'
+    Addresses scanned: I2C 0x2c - 0x2d
+    Datasheet:	The datasheet for LPC47M192 is publicly available from
+		http://www.smsc.com
+		The LPC47M997 is compatible for hardware monitoring
+
+Author: Hartmut Rick <linux at rick.claranet.de>
+	Special thanks to Jean Delvare for careful checking
+	of the code and many helpful comments and suggestions.
+
+
+Description
+-----------
+
+This driver implements support for the hardware sensor capabilities
+of the SMSC LPC47M192 and LPC47M997 Super-I/O chips.
+
+These chips support 3 temperature channels and 8 voltage inputs
+as well as CPU voltage VID input.
+
+They do also have fan monitoring and control capabilities, but the
+latter are accessed via ISA bus and are not supported by this driver.
+Use the 'smsc47m1' driver for fan monitoring.
+
+Voltages and temperatures are measured by an 8-bit ADC, the resolution
+of the temperatures is 1 bit per degree C.
+Voltages are scaled such that the nominal voltage corresponds to
+192 counts, i.e. 3/4 of the full range. Thus the available range for
+each voltage channel is 0V ... 255/192*(nominal voltage), the resolution
+is 1 bit per (nominal voltage)/192.
+Both voltage and temperature values are scaled by 1000, the sys files
+show voltages in mV and temperatures in units of 0.001 degC.
+
+The +12V analog voltage input channel (in4_input) is multiplexed with
+bit 4 of the encoded CPU voltage. This means that you either get
+a +12V voltage measurement or a 5 bit CPU VID, but not both.
+The default setting is to use the pin as 12V input, and use only 4 bit VID.
+This driver assumes that the information in the configuration register
+is correct, i.e. that the BIOS has updated the configuration if
+the motherboard has this input wired to VID4.
+
+The temperature and voltage readings are updated once every 1.5 seconds.
+Reading them more often repeats the same values.
+
+
+sysfs interface
+---------------
+
+in0_input	- +2.5V voltage input
+in1_input	- CPU voltage input (nominal 2.25V)
+in2_input	- +3.3V voltage input
+in3_input	- +5V voltage input
+in4_input	- +12V voltage input (may be missing if used as VID4)
+in5_input	- Vcc voltage input (nominal 3.3V)
+		  This is the supply voltage of the sensor chip itself.
+in6_input	- +1.5V voltage input
+in7_input	- +1.8V voltage input
+
+in[0-7]_min,	
+in[0-7]_max	- lower and upper alarm thresholds for in[0-7]_input reading
+
+		  All voltages are read and written in mV.
+
+in[0-7]_alarm	- alarm flags for voltage inputs
+		  These files read '1' in case of alarm, '0' otherwise.
+
+temp1_input	- chip temperature measured by on-chip diode
+temp[2-3]_input	- temperature measured by external diodes (one of these would
+		  typically be wired to the diode inside the CPU)
+
+temp[1-3]_min,
+temp[1-3]_max	- lower and upper alarm thresholds for temperatures
+
+temp[1-3]_offset - temperature offset registers
+		  The chip adds the offsets stored in these registers to
+		  the corresponding temperature readings.
+		  Note that temp1 and temp2 offsets share the same register,
+		  they cannot both be different from zero at the same time.
+		  Writing a non-zero number to one of them will reset the other
+		  offset to zero.
+
+		  All temperatures and offsets are read and written in
+		  units of 0.001 degC.
+
+temp[1-3]_alarm - alarm flags for temperature inputs, '1' in case of alarm,
+		  '0' otherwise.
+temp[2-3]_input_fault - diode fault flags for temperature inputs 2 and 3.
+		  A fault is detected if the two pins for the corresponding
+		  sensor are open or shorted, or any of the two is shorted
+		  to ground or Vcc. '1' indicates a diode fault.
+
+cpu0_vid	- CPU voltage as received from the CPU
+
+vrm		- CPU VID standard used for decoding CPU voltage
+
+The *_min, *_max, *_offset and vrm files can be read and written, all others
+		  are read-only
Documentation/hwmon/sysfs-interface +6 -0
diff -uprN linux-2.6.16-rc5/Documentation/hwmon/sysfs-interface linux-2.6.16-new/Documentation/hwmon/sysfs-interface
@@ -218,6 +218,12 @@ temp[1-2]_crit_hyst
 		from the critical value.
 		Read/Write value.
 
+temp[1-4]_offset
+		Temperature offset which is added to the temperature reading
+		by the chip.
+		Unit: millidegree Celsius
+		Read/Write value.
+
 		If there are multiple temperature sensors, temp1_* is
 		generally the sensor inside the chip itself,
 		reported as "motherboard temperature".  temp2_* to
drivers/hwmon/Kconfig +22 -1
diff -uprN linux-2.6.16-rc5/drivers/hwmon/Kconfig linux-2.6.16-new/drivers/hwmon/Kconfig
@@ -333,11 +333,32 @@ config SENSORS_SMSC47M1
 	help
 	  If you say yes here you get support for the integrated fan
 	  monitoring and control capabilities of the SMSC LPC47B27x,
-	  LPC47M10x, LPC47M13x, LPC47M14x, LPC47M15x and LPC47M192 chips.
+	  LPC47M10x, LPC47M13x, LPC47M14x, LPC47M15x, LPC47M192 and
+	  LPC47M997 chips.
+
+	  The temperature and voltage sensor features of the LPC47M192
+	  and LPC47M997 are supported by another driver, select also
+	  "SMSC LPC47M192 and compatibles" below for those.
 
 	  This driver can also be built as a module.  If so, the module
 	  will be called smsc47m1.
 
+config SENSORS_SMSC47M192
+	tristate "SMSC LPC47M192 and compatibles"
+	depends on HWMON && I2C && EXPERIMENTAL
+	select HWMON_VID
+	help
+	  If you say yes here you get support for the temperature and
+	  voltage sensors of the SMSC LPC47M192 and LPC47M997 chips.
+
+	  The fan monitoring and control capabilities of these chips
+	  are supported by another driver, select 
+	  "SMSC LPC47M10x and compatibles" above. You need both drivers
+	  if you want fan control and voltage/temperature sensor support.
+
+	  This driver can also be built as a module.  If so, the module
+	  will be called smsc47m192.
+
 config SENSORS_SMSC47B397
 	tristate "SMSC LPC47B397-NC"
 	depends on HWMON && I2C && EXPERIMENTAL
drivers/hwmon/Makefile +1 -0
diff -uprN linux-2.6.16-rc5/drivers/hwmon/Makefile linux-2.6.16-new/drivers/hwmon/Makefile
@@ -40,6 +40,7 @@ obj-$(CONFIG_SENSORS_PC87360)	+= pc87360
 obj-$(CONFIG_SENSORS_SIS5595)	+= sis5595.o
 obj-$(CONFIG_SENSORS_SMSC47B397)+= smsc47b397.o
 obj-$(CONFIG_SENSORS_SMSC47M1)	+= smsc47m1.o
+obj-$(CONFIG_SENSORS_SMSC47M192)+= smsc47m192.o
 obj-$(CONFIG_SENSORS_VIA686A)	+= via686a.o
 obj-$(CONFIG_SENSORS_VT8231)	+= vt8231.o
 obj-$(CONFIG_SENSORS_W83627EHF)	+= w83627ehf.o
drivers/hwmon/smsc47m192.c +652 -0

652 lines not on this page · raw message

#1 lore raw

PATCH 1/1 Hardware monitoring support for SMSC

Hi,

Quoted 2 lines

This patch adds a new driver (smsc47m192.o) which supports voltage and temperature measurement features of SMSC LPC47M192 and LPC47M997 chips.

This version doesn't load module on my system MSI RS480M2-IL with patch applied on vanilla kernel 2.6.15.6.
Older version from smsc47m192_patch_2615.txt file works great. There are errors from modprobe and dmesg:
---------------------------------
linux# modprobe smsc47m192

FATAL: Error inserting smsc47m192 (/lib/modules/2.6.15.6/kernel/drivers/hwmon/smsc47m192.ko): Permission denied
---------------------------------
linux# dmesg
kobject_register failed for (-13)

Call Trace:<ffffffff80200226>{kobject_register+70} 
<ffffffff80269e15>{bus_add_driver+101}
       <ffffffff8818855b>{:i2c_core:i2c_add_driver+107} 
<ffffffff80150e54>{sys_init_module+244}
       <ffffffff8010eb9a>{system_call+126}

---------------------------------

Best regards,

Pavel Ruzicka

#2 lore raw

PATCH 1/1 Hardware monitoring support for SMSC

In reply to Hartmut Rick

Hi Pavel,

Quoted 2 lines · Pavel Ruzicka

This version doesn't load module on my system MSI RS480M2-IL with patch applied on vanilla kernel 2.6.15.6.

I guess I forgot to mention that the patch was for kernel version 2.6.16-rc5 - sorry for that.

For convenience, I attach the corresponding patch for 2.6.15 to this email.

Best wishes,
Hartmut
-------------- next part --------------

Documentation/hwmon/smsc47m192 +102 -0
diff -uprN linux-2.6.15/Documentation/hwmon/smsc47m192 linux-2.6.15-new/Documentation/hwmon/smsc47m192
@@ -0,0 +1,102 @@
+Kernel driver smsc47m192
+============
+
+Supported chips:
+  * SMSC LPC47M192 and LPC47M997
+    Prefix: 'smsc47m192'
+    Addresses scanned: I2C 0x2c - 0x2d
+    Datasheet:	The datasheet for LPC47M192 is publicly available from
+		http://www.smsc.com
+		The LPC47M997 is compatible for hardware monitoring
+
+Author: Hartmut Rick <linux at rick.claranet.de>
+	Special thanks to Jean Delvare for careful checking
+	of the code and many helpful comments and suggestions.
+
+
+Description
+-----------
+
+This driver implements support for the hardware sensor capabilities
+of the SMSC LPC47M192 and LPC47M997 Super-I/O chips.
+
+These chips support 3 temperature channels and 8 voltage inputs
+as well as CPU voltage VID input.
+
+They do also have fan monitoring and control capabilities, but the
+latter are accessed via ISA bus and are not supported by this driver.
+Use the 'smsc47m1' driver for fan monitoring.
+
+Voltages and temperatures are measured by an 8-bit ADC, the resolution
+of the temperatures is 1 bit per degree C.
+Voltages are scaled such that the nominal voltage corresponds to
+192 counts, i.e. 3/4 of the full range. Thus the available range for
+each voltage channel is 0V ... 255/192*(nominal voltage), the resolution
+is 1 bit per (nominal voltage)/192.
+Both voltage and temperature values are scaled by 1000, the sys files
+show voltages in mV and temperatures in units of 0.001 degC.
+
+The +12V analog voltage input channel (in4_input) is multiplexed with
+bit 4 of the encoded CPU voltage. This means that you either get
+a +12V voltage measurement or a 5 bit CPU VID, but not both.
+The default setting is to use the pin as 12V input, and use only 4 bit VID.
+This driver assumes that the information in the configuration register
+is correct, i.e. that the BIOS has updated the configuration if
+the motherboard has this input wired to VID4.
+
+The temperature and voltage readings are updated once every 1.5 seconds.
+Reading them more often repeats the same values.
+
+
+sysfs interface
+---------------
+
+in0_input	- +2.5V voltage input
+in1_input	- CPU voltage input (nominal 2.25V)
+in2_input	- +3.3V voltage input
+in3_input	- +5V voltage input
+in4_input	- +12V voltage input (may be missing if used as VID4)
+in5_input	- Vcc voltage input (nominal 3.3V)
+		  This is the supply voltage of the sensor chip itself.
+in6_input	- +1.5V voltage input
+in7_input	- +1.8V voltage input
+
+in[0-7]_min,	
+in[0-7]_max	- lower and upper alarm thresholds for in[0-7]_input reading
+
+		  All voltages are read and written in mV.
+
+in[0-7]_alarm	- alarm flags for voltage inputs
+		  These files read '1' in case of alarm, '0' otherwise.
+
+temp1_input	- chip temperature measured by on-chip diode
+temp[2-3]_input	- temperature measured by external diodes (one of these would
+		  typically be wired to the diode inside the CPU)
+
+temp[1-3]_min,
+temp[1-3]_max	- lower and upper alarm thresholds for temperatures
+
+temp[1-3]_offset - temperature offset registers
+		  The chip adds the offsets stored in these registers to
+		  the corresponding temperature readings.
+		  Note that temp1 and temp2 offsets share the same register,
+		  they cannot both be different from zero at the same time.
+		  Writing a non-zero number to one of them will reset the other
+		  offset to zero.
+
+		  All temperatures and offsets are read and written in
+		  units of 0.001 degC.
+
+temp[1-3]_alarm - alarm flags for temperature inputs, '1' in case of alarm,
+		  '0' otherwise.
+temp[2-3]_input_fault - diode fault flags for temperature inputs 2 and 3.
+		  A fault is detected if the two pins for the corresponding
+		  sensor are open or shorted, or any of the two is shorted
+		  to ground or Vcc. '1' indicates a diode fault.
+
+cpu0_vid	- CPU voltage as received from the CPU
+
+vrm		- CPU VID standard used for decoding CPU voltage
+
+The *_min, *_max, *_offset and vrm files can be read and written, all others
+		  are read-only
Documentation/hwmon/sysfs-interface +6 -0
diff -uprN linux-2.6.15/Documentation/hwmon/sysfs-interface linux-2.6.15-new/Documentation/hwmon/sysfs-interface
@@ -217,6 +217,12 @@ temp[1-2]_crit_hyst
 		from the critical value.
 		Read/Write value.
 
+temp[1-4]_offset
+		Temperature offset which is added to the temperature reading
+		by the chip.
+		Unit: millidegree Celsius
+		Read/Write value.
+
 		If there are multiple temperature sensors, temp1_* is
 		generally the sensor inside the chip itself,
 		reported as "motherboard temperature".  temp2_* to
drivers/hwmon/Kconfig +22 -1
diff -uprN linux-2.6.15/drivers/hwmon/Kconfig linux-2.6.15-new/drivers/hwmon/Kconfig
@@ -323,11 +323,32 @@ config SENSORS_SMSC47M1
 	help
 	  If you say yes here you get support for the integrated fan
 	  monitoring and control capabilities of the SMSC LPC47B27x,
-	  LPC47M10x, LPC47M13x, LPC47M14x, LPC47M15x and LPC47M192 chips.
+	  LPC47M10x, LPC47M13x, LPC47M14x, LPC47M15x, LPC47M192 and
+	  LPC47M997 chips.
+
+	  The temperature and voltage sensor features of the LPC47M192
+	  and LPC47M997 are supported by another driver, select also
+	  "SMSC LPC47M192 and compatibles" below for those.
 
 	  This driver can also be built as a module.  If so, the module
 	  will be called smsc47m1.
 
+config SENSORS_SMSC47M192
+	tristate "SMSC LPC47M192 and compatibles"
+	depends on HWMON && I2C && EXPERIMENTAL
+	select HWMON_VID
+	help
+	  If you say yes here you get support for the temperature and
+	  voltage sensors of the SMSC LPC47M192 and LPC47M997 chips.
+
+	  The fan monitoring and control capabilities of these chips
+	  are supported by another driver, select 
+	  "SMSC LPC47M10x and compatibles" above. You need both drivers
+	  if you want fan control and voltage/temperature sensor support.
+
+	  This driver can also be built as a module.  If so, the module
+	  will be called smsc47m192.
+
 config SENSORS_SMSC47B397
 	tristate "SMSC LPC47B397-NC"
 	depends on HWMON && I2C && EXPERIMENTAL
drivers/hwmon/Makefile +1 -0
diff -uprN linux-2.6.15/drivers/hwmon/Makefile linux-2.6.15-new/drivers/hwmon/Makefile
@@ -39,6 +39,7 @@ obj-$(CONFIG_SENSORS_PC87360)	+= pc87360
 obj-$(CONFIG_SENSORS_SIS5595)	+= sis5595.o
 obj-$(CONFIG_SENSORS_SMSC47B397)+= smsc47b397.o
 obj-$(CONFIG_SENSORS_SMSC47M1)	+= smsc47m1.o
+obj-$(CONFIG_SENSORS_SMSC47M192)+= smsc47m192.o
 obj-$(CONFIG_SENSORS_VIA686A)	+= via686a.o
 obj-$(CONFIG_SENSORS_W83627EHF)	+= w83627ehf.o
 obj-$(CONFIG_SENSORS_W83L785TS)	+= w83l785ts.o
drivers/hwmon/smsc47m192.c +652 -0

652 lines not on this page · raw message

#3 lore raw

PATCH 1/1 Hardware monitoring support for SMSC

In reply to Hartmut Rick

Hi Hartmut,

in-between is out final 2.6.16 and I tried it before few minutes. I applied patch for ATI chipset from Rudolf too.
It works for me, but my board MSI RS480M2-IL probably doesn't have connected voltage inputs and TEMP3 input.
It corresponds to latest BIOS, where only fans and two temperatures are visible.

Here is output from sensors program:
--------------------------------------
[root at home lm_sensors-2.10.0]# sensors
smsc47m1-isa-0800

Adapter: ISA adapter
fan1:        0 RPM  (min =  640 RPM, div = 8)          ALARM
fan2:     1059 RPM  (min =  640 RPM, div = 8)

smsc47m192-i2c-0-2d
Adapter: SMBus PIIX4 adapter at 0b00

+2.5V:     +0.00 V  (min =  +0.00 V, max =  +3.32 V)   ALARM
VCore:     +0.00 V  (min =  +0.00 V, max =  +2.99 V)   ALARM
+3.3V:     +0.00 V  (min =  +0.00 V, max =  +4.38 V)   ALARM
+5V:       +0.00 V  (min =  +0.00 V, max =  +6.64 V)   ALARM
VCC:       +3.37 V  (min =  +0.00 V, max =  +4.38 V)
+1.5V:     +0.00 V  (min =  +0.00 V, max =  +1.99 V)   ALARM
+1.8V:     +0.00 V  (min =  +0.00 V, max =  +2.39 V)   ALARM
Chip Temp: +37.0?C  (low  =  -128?C, high =  +127?C)
CPU Temp:  +26.0?C  (low  =  -128?C, high =   +60?C)
Sys Temp: +117.0?C  (low  =  -128?C, high =  +127?C)
vid:      +1.550 V  (VRM Version 2.4)

--------------------------------------
-------------
dmesg output:
smsc47m1: Found SMSC LPC47M15x/LPC47M192/LPC47M997 i2c_adapter i2c-0: found SMSC47M192 or SMSC47M997, version 2, stepping A0
-------------

I must add line "MODULE_4=smsc47m192" for automatic loading of module.

Best regards,

Pavel Ruzicka

Quoted 8 lines

I guess I forgot to mention that the patch was for kernel version 2.6.16-rc5 - sorry for that.

For convenience, I attach the corresponding patch for 2.6.15 to this email.

Best wishes,
Hartmut

#4 lore raw

PATCH 1/1 Hardware monitoring support for SMSC

In reply to Hartmut Rick

Hi Hartmut,

Quoted 4 lines

Thanks a lot for your comments, and sorry this takes so long.
Here's a new patch, now with individual alarm files only. I've also renamed the temp[23]_fault files to temp[23]_input_fault in order to match your sysfs interface proposal.

Great! I've queued this version of the patch, and will send it to Greg KH shortly. I made some whitespace cleanups, but the code is otherwise very good now.

Quoted 2 lines

Having said that, I'm still happy to have it removed if you insist that it should not be there.

Naah, I'm not insisting at all, I'm fine with it.

Thanks,

Signature · 1 line
Jean Delvare