aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/hwmon
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-06-03 14:09:43 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-06-03 14:09:43 -0400
commitf456205265a61f1d649f8378eceaa163850cba4e (patch)
treec974aafac8fad9bf1322f2ec66aaf01d01adfaf8 /Documentation/hwmon
parent8f5759aeb88a47448cd92ab55a016d013b154a98 (diff)
parent9d311eddf3565ed0e05b3cb5a22db41fa74d9d86 (diff)
Merge tag 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging into next
Pull hwmon updates from Guenter Roeck: "New driver for NCT6683D New chip support to existing drivers: - add support for STTS2004 and AT30TSE004 to jc42 driver - add support for EMC1402/EMC1412/EMC1422 to emc1403 driver Other notable changes: - document hwmon kernel API - convert jc42, lm70, lm75, lm77, lm83, lm92, max1619, tmp421, and tmp102 drivers to use new hwmon API functions - replace function macros in lm80, lm92, and jc42 drivers with real code - convert emc1403 driver to use regmap, add support for additional attributes, and add device IDs for EMC1412, EMC1413, and EMC1414 - various additional cleanup and minor bug fixes in several drivers" * tag 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: (60 commits) hwmon: (nct6775) Fix probe unwind paths to properly unregister platform devices hwmon: (nct6683) Fix probe unwind paths to properly unregister platform devices hwmon: (ultra45_env) Introduce managed version of kzalloc hwmon: Driver for NCT6683D hwmon: (lm80) Rearrange code to avoid forward declarations hwmon: (lm80) Convert fan display function macros into functions hwmon: (lm80) Convert voltage display function macros into functions hwmon: (lm80) Convert temperature display function macros into functions hwmon: (lm80) Normalize all temperature values to 16 bit hwmon: (lm80) Simplify TEMP_FROM_REG hwmon: (lm83) Convert to use devm_hwmon_device_register_with_groups hwmon: (lm83) Rearange code to avoid forward declarations hwmon: (lm83) Drop FSF address hwmon: (max1619) Convert to use devm_hwmon_device_register_with_groups hwmon: (max1619) Drop function macros hwmon: (max1619) Rearrange code to avoid forward declarations hwmon: (max1619) Drop FSF address hwmon: (max1619) Fix critical alarm display hwmon: (jc42) Add support for STTS2004 and AT30TSE004 hwmon: (jc42) Convert function macros into functions ...
Diffstat (limited to 'Documentation/hwmon')
-rw-r--r--Documentation/hwmon/emc140359
-rw-r--r--Documentation/hwmon/hwmon-kernel-api.txt107
-rw-r--r--Documentation/hwmon/jc4216
-rw-r--r--Documentation/hwmon/lm7720
-rw-r--r--Documentation/hwmon/nct668357
5 files changed, 251 insertions, 8 deletions
diff --git a/Documentation/hwmon/emc1403 b/Documentation/hwmon/emc1403
new file mode 100644
index 000000000000..a869b0ef6a9d
--- /dev/null
+++ b/Documentation/hwmon/emc1403
@@ -0,0 +1,59 @@
1Kernel driver emc1403
2=====================
3
4Supported chips:
5 * SMSC / Microchip EMC1402, EMC1412
6 Addresses scanned: I2C 0x18, 0x1c, 0x29, 0x4c, 0x4d, 0x5c
7 Prefix: 'emc1402'
8 Datasheets:
9 http://ww1.microchip.com/downloads/en/DeviceDoc/1412.pdf
10 http://ww1.microchip.com/downloads/en/DeviceDoc/1402.pdf
11 * SMSC / Microchip EMC1403, EMC1404, EMC1413, EMC1414
12 Addresses scanned: I2C 0x18, 0x29, 0x4c, 0x4d
13 Prefix: 'emc1403', 'emc1404'
14 Datasheets:
15 http://ww1.microchip.com/downloads/en/DeviceDoc/1403_1404.pdf
16 http://ww1.microchip.com/downloads/en/DeviceDoc/1413_1414.pdf
17 * SMSC / Microchip EMC1422
18 Addresses scanned: I2C 0x4c
19 Prefix: 'emc1422'
20 Datasheet:
21 http://ww1.microchip.com/downloads/en/DeviceDoc/1422.pdf
22 * SMSC / Microchip EMC1423, EMC1424
23 Addresses scanned: I2C 0x4c
24 Prefix: 'emc1423', 'emc1424'
25 Datasheet:
26 http://ww1.microchip.com/downloads/en/DeviceDoc/1423_1424.pdf
27
28Author:
29 Kalhan Trisal <kalhan.trisal@intel.com
30
31
32Description
33-----------
34
35The Standard Microsystems Corporation (SMSC) / Microchip EMC14xx chips
36contain up to four temperature sensors. EMC14x2 support two sensors
37(one internal, one external). EMC14x3 support three sensors (one internal,
38two external), and EMC14x4 support four sensors (one internal, three
39external).
40
41The chips implement three limits for each sensor: low (tempX_min), high
42(tempX_max) and critical (tempX_crit.) The chips also implement an
43hysteresis mechanism which applies to all limits. The relative difference
44is stored in a single register on the chip, which means that the relative
45difference between the limit and its hysteresis is always the same for
46all three limits.
47
48This implementation detail implies the following:
49* When setting a limit, its hysteresis will automatically follow, the
50 difference staying unchanged. For example, if the old critical limit
51 was 80 degrees C, and the hysteresis was 75 degrees C, and you change
52 the critical limit to 90 degrees C, then the hysteresis will
53 automatically change to 85 degrees C.
54* The hysteresis values can't be set independently. We decided to make
55 only temp1_crit_hyst writable, while all other hysteresis attributes
56 are read-only. Setting temp1_crit_hyst writes the difference between
57 temp1_crit_hyst and temp1_crit into the chip, and the same relative
58 hysteresis applies automatically to all other limits.
59* The limits should be set before the hysteresis.
diff --git a/Documentation/hwmon/hwmon-kernel-api.txt b/Documentation/hwmon/hwmon-kernel-api.txt
new file mode 100644
index 000000000000..2ecdbfc85ecf
--- /dev/null
+++ b/Documentation/hwmon/hwmon-kernel-api.txt
@@ -0,0 +1,107 @@
1The Linux Hardware Monitoring kernel API.
2=========================================
3
4Guenter Roeck
5
6Introduction
7------------
8
9This document describes the API that can be used by hardware monitoring
10drivers that want to use the hardware monitoring framework.
11
12This document does not describe what a hardware monitoring (hwmon) Driver or
13Device is. It also does not describe the API which can be used by user space
14to communicate with a hardware monitoring device. If you want to know this
15then please read the following file: Documentation/hwmon/sysfs-interface.
16
17For additional guidelines on how to write and improve hwmon drivers, please
18also read Documentation/hwmon/submitting-patches.
19
20The API
21-------
22Each hardware monitoring driver must #include <linux/hwmon.h> and, in most
23cases, <linux/hwmon-sysfs.h>. linux/hwmon.h declares the following
24register/unregister functions:
25
26struct device *hwmon_device_register(struct device *dev);
27struct device *
28hwmon_device_register_with_groups(struct device *dev, const char *name,
29 void *drvdata,
30 const struct attribute_group **groups);
31
32struct device *
33devm_hwmon_device_register_with_groups(struct device *dev,
34 const char *name, void *drvdata,
35 const struct attribute_group **groups);
36
37void hwmon_device_unregister(struct device *dev);
38void devm_hwmon_device_unregister(struct device *dev);
39
40hwmon_device_register registers a hardware monitoring device. The parameter
41of this function is a pointer to the parent device.
42This function returns a pointer to the newly created hardware monitoring device
43or PTR_ERR for failure. If this registration function is used, hardware
44monitoring sysfs attributes are expected to have been created and attached to
45the parent device prior to calling hwmon_device_register. A name attribute must
46have been created by the caller.
47
48hwmon_device_register_with_groups is similar to hwmon_device_register. However,
49it has additional parameters. The name parameter is a pointer to the hwmon
50device name. The registration function wil create a name sysfs attribute
51pointing to this name. The drvdata parameter is the pointer to the local
52driver data. hwmon_device_register_with_groups will attach this pointer
53to the newly allocated hwmon device. The pointer can be retrieved by the driver
54using dev_get_drvdata() on the hwmon device pointer. The groups parameter is
55a pointer to a list of sysfs attribute groups. The list must be NULL terminated.
56hwmon_device_register_with_groups creates the hwmon device with name attribute
57as well as all sysfs attributes attached to the hwmon device.
58
59devm_hwmon_device_register_with_groups is similar to
60hwmon_device_register_with_groups. However, it is device managed, meaning the
61hwmon device does not have to be removed explicitly by the removal function.
62
63hwmon_device_unregister deregisters a registered hardware monitoring device.
64The parameter of this function is the pointer to the registered hardware
65monitoring device structure. This function must be called from the driver
66remove function if the hardware monitoring device was registered with
67hwmon_device_register or with hwmon_device_register_with_groups.
68
69devm_hwmon_device_unregister does not normally have to be called. It is only
70needed for error handling, and only needed if the driver probe fails after
71the call to devm_hwmon_device_register_with_groups.
72
73The header file linux/hwmon-sysfs.h provides a number of useful macros to
74declare and use hardware monitoring sysfs attributes.
75
76In many cases, you can use the exsting define DEVICE_ATTR to declare such
77attributes. This is feasible if an attribute has no additional context. However,
78in many cases there will be additional information such as a sensor index which
79will need to be passed to the sysfs attribute handling function.
80
81SENSOR_DEVICE_ATTR and SENSOR_DEVICE_ATTR_2 can be used to define attributes
82which need such additional context information. SENSOR_DEVICE_ATTR requires
83one additional argument, SENSOR_DEVICE_ATTR_2 requires two.
84
85SENSOR_DEVICE_ATTR defines a struct sensor_device_attribute variable.
86This structure has the following fields.
87
88struct sensor_device_attribute {
89 struct device_attribute dev_attr;
90 int index;
91};
92
93You can use to_sensor_dev_attr to get the pointer to this structure from the
94attribute read or write function. Its parameter is the device to which the
95attribute is attached.
96
97SENSOR_DEVICE_ATTR_2 defines a struct sensor_device_attribute_2 variable,
98which is defined as follows.
99
100struct sensor_device_attribute_2 {
101 struct device_attribute dev_attr;
102 u8 index;
103 u8 nr;
104};
105
106Use to_sensor_dev_attr_2 to get the pointer to this structure. Its parameter
107is the device to which the attribute is attached.
diff --git a/Documentation/hwmon/jc42 b/Documentation/hwmon/jc42
index 868d74d6b773..f3893f7440de 100644
--- a/Documentation/hwmon/jc42
+++ b/Documentation/hwmon/jc42
@@ -5,9 +5,12 @@ Supported chips:
5 * Analog Devices ADT7408 5 * Analog Devices ADT7408
6 Datasheets: 6 Datasheets:
7 http://www.analog.com/static/imported-files/data_sheets/ADT7408.pdf 7 http://www.analog.com/static/imported-files/data_sheets/ADT7408.pdf
8 * Atmel AT30TS00 8 * Atmel AT30TS00, AT30TS002A/B, AT30TSE004A
9 Datasheets: 9 Datasheets:
10 http://www.atmel.com/Images/doc8585.pdf 10 http://www.atmel.com/Images/doc8585.pdf
11 http://www.atmel.com/Images/doc8711.pdf
12 http://www.atmel.com/Images/Atmel-8852-SEEPROM-AT30TSE002A-Datasheet.pdf
13 http://www.atmel.com/Images/Atmel-8868-DTS-AT30TSE004A-Datasheet.pdf
11 * IDT TSE2002B3, TSE2002GB2, TS3000B3, TS3000GB2 14 * IDT TSE2002B3, TSE2002GB2, TS3000B3, TS3000GB2
12 Datasheets: 15 Datasheets:
13 http://www.idt.com/sites/default/files/documents/IDT_TSE2002B3C_DST_20100512_120303152056.pdf 16 http://www.idt.com/sites/default/files/documents/IDT_TSE2002B3C_DST_20100512_120303152056.pdf
@@ -34,12 +37,13 @@ Supported chips:
34 Datasheet: 37 Datasheet:
35 http://www.onsemi.com/pub_link/Collateral/CAT34TS02-D.PDF 38 http://www.onsemi.com/pub_link/Collateral/CAT34TS02-D.PDF
36 http://www.onsemi.com/pub/Collateral/CAT6095-D.PDF 39 http://www.onsemi.com/pub/Collateral/CAT6095-D.PDF
37 * ST Microelectronics STTS424, STTS424E02, STTS2002, STTS3000 40 * ST Microelectronics STTS424, STTS424E02, STTS2002, STTS2004, STTS3000
38 Datasheets: 41 Datasheets:
39 http://www.st.com/internet/com/TECHNICAL_RESOURCES/TECHNICAL_LITERATURE/DATASHEET/CD00157556.pdf 42 http://www.st.com/web/en/resource/technical/document/datasheet/CD00157556.pdf
40 http://www.st.com/internet/com/TECHNICAL_RESOURCES/TECHNICAL_LITERATURE/DATASHEET/CD00157558.pdf 43 http://www.st.com/web/en/resource/technical/document/datasheet/CD00157558.pdf
41 http://www.st.com/internet/com/TECHNICAL_RESOURCES/TECHNICAL_LITERATURE/DATASHEET/CD00225278.pdf 44 http://www.st.com/web/en/resource/technical/document/datasheet/CD00266638.pdf
42 http://www.st.com/internet/com/TECHNICAL_RESOURCES/TECHNICAL_LITERATURE/DATA_BRIEF/CD00270920.pdf 45 http://www.st.com/web/en/resource/technical/document/datasheet/CD00225278.pdf
46 http://www.st.com/web/en/resource/technical/document/datasheet/DM00076709.pdf
43 * JEDEC JC 42.4 compliant temperature sensor chips 47 * JEDEC JC 42.4 compliant temperature sensor chips
44 Datasheet: 48 Datasheet:
45 http://www.jedec.org/sites/default/files/docs/4_01_04R19.pdf 49 http://www.jedec.org/sites/default/files/docs/4_01_04R19.pdf
diff --git a/Documentation/hwmon/lm77 b/Documentation/hwmon/lm77
index 57c3a46d6370..bfc915fe3639 100644
--- a/Documentation/hwmon/lm77
+++ b/Documentation/hwmon/lm77
@@ -18,5 +18,21 @@ sensor incorporates a band-gap type temperature sensor,
1810-bit ADC, and a digital comparator with user-programmable upper 1810-bit ADC, and a digital comparator with user-programmable upper
19and lower limit values. 19and lower limit values.
20 20
21Limits can be set through the Overtemperature Shutdown register and 21The LM77 implements 3 limits: low (temp1_min), high (temp1_max) and
22Hysteresis register. 22critical (temp1_crit.) It also implements an hysteresis mechanism which
23applies to all 3 limits. The relative difference is stored in a single
24register on the chip, which means that the relative difference between
25the limit and its hysteresis is always the same for all 3 limits.
26
27This implementation detail implies the following:
28* When setting a limit, its hysteresis will automatically follow, the
29 difference staying unchanged. For example, if the old critical limit
30 was 80 degrees C, and the hysteresis was 75 degrees C, and you change
31 the critical limit to 90 degrees C, then the hysteresis will
32 automatically change to 85 degrees C.
33* All 3 hysteresis can't be set independently. We decided to make
34 temp1_crit_hyst writable, while temp1_min_hyst and temp1_max_hyst are
35 read-only. Setting temp1_crit_hyst writes the difference between
36 temp1_crit_hyst and temp1_crit into the chip, and the same relative
37 hysteresis applies automatically to the low and high limits.
38* The limits should be set before the hysteresis.
diff --git a/Documentation/hwmon/nct6683 b/Documentation/hwmon/nct6683
new file mode 100644
index 000000000000..c1301d4300cd
--- /dev/null
+++ b/Documentation/hwmon/nct6683
@@ -0,0 +1,57 @@
1Kernel driver nct6683
2=====================
3
4Supported chips:
5 * Nuvoton NCT6683D
6 Prefix: 'nct6683'
7 Addresses scanned: ISA address retrieved from Super I/O registers
8 Datasheet: Available from Nuvoton upon request
9
10Authors:
11 Guenter Roeck <linux@roeck-us.net>
12
13Description
14-----------
15
16This driver implements support for the Nuvoton NCT6683D eSIO chip.
17
18The chips implement up to shared 32 temperature and voltage sensors.
19It supports up to 16 fan rotation sensors and up to 8 fan control engines.
20
21Temperatures are measured in degrees Celsius. Measurement resolution is
220.5 degrees C.
23
24Voltage sensors (also known as IN sensors) report their values in millivolts.
25
26Fan rotation speeds are reported in RPM (rotations per minute).
27
28Usage Note
29----------
30
31Limit register locations on Intel boards with EC firmware version 1.0
32build date 04/03/13 do not match the register locations in the Nuvoton
33datasheet. Nuvoton confirms that Intel uses a special firmware version
34with different register addresses. The specification describing the Intel
35firmware is held under NDA by Nuvoton and Intel and not available
36to the public.
37
38Some of the register locations can be reverse engineered; others are too
39well hidden. Given this, writing any values from the operating system is
40considered too risky with this firmware and has been disabled. All limits
41must all be written from the BIOS.
42
43The driver has only been tested with the Intel firmware, and by default
44only instantiates on Intel boards. To enable it on non-Intel boards,
45set the 'force' module parameter to 1.
46
47Tested Boards and Firmware Versions
48-----------------------------------
49
50The driver has been reported to work with the following boards and
51firmware versions.
52
53Board Firmware version
54---------------------------------------------------------------
55Intel DH87RL NCT6683D EC firmware version 1.0 build 04/03/13
56Intel DH87MC NCT6683D EC firmware version 1.0 build 04/03/13
57Intel DB85FL NCT6683D EC firmware version 1.0 build 04/03/13