diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-06-03 14:09:43 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-06-03 14:09:43 -0400 |
| commit | f456205265a61f1d649f8378eceaa163850cba4e (patch) | |
| tree | c974aafac8fad9bf1322f2ec66aaf01d01adfaf8 /Documentation/hwmon | |
| parent | 8f5759aeb88a47448cd92ab55a016d013b154a98 (diff) | |
| parent | 9d311eddf3565ed0e05b3cb5a22db41fa74d9d86 (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/emc1403 | 59 | ||||
| -rw-r--r-- | Documentation/hwmon/hwmon-kernel-api.txt | 107 | ||||
| -rw-r--r-- | Documentation/hwmon/jc42 | 16 | ||||
| -rw-r--r-- | Documentation/hwmon/lm77 | 20 | ||||
| -rw-r--r-- | Documentation/hwmon/nct6683 | 57 |
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 @@ | |||
| 1 | Kernel driver emc1403 | ||
| 2 | ===================== | ||
| 3 | |||
| 4 | Supported 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 | |||
| 28 | Author: | ||
| 29 | Kalhan Trisal <kalhan.trisal@intel.com | ||
| 30 | |||
| 31 | |||
| 32 | Description | ||
| 33 | ----------- | ||
| 34 | |||
| 35 | The Standard Microsystems Corporation (SMSC) / Microchip EMC14xx chips | ||
| 36 | contain up to four temperature sensors. EMC14x2 support two sensors | ||
| 37 | (one internal, one external). EMC14x3 support three sensors (one internal, | ||
| 38 | two external), and EMC14x4 support four sensors (one internal, three | ||
| 39 | external). | ||
| 40 | |||
| 41 | The chips implement three limits for each sensor: low (tempX_min), high | ||
| 42 | (tempX_max) and critical (tempX_crit.) The chips also implement an | ||
| 43 | hysteresis mechanism which applies to all limits. The relative difference | ||
| 44 | is stored in a single register on the chip, which means that the relative | ||
| 45 | difference between the limit and its hysteresis is always the same for | ||
| 46 | all three limits. | ||
| 47 | |||
| 48 | This 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 @@ | |||
| 1 | The Linux Hardware Monitoring kernel API. | ||
| 2 | ========================================= | ||
| 3 | |||
| 4 | Guenter Roeck | ||
| 5 | |||
| 6 | Introduction | ||
| 7 | ------------ | ||
| 8 | |||
| 9 | This document describes the API that can be used by hardware monitoring | ||
| 10 | drivers that want to use the hardware monitoring framework. | ||
| 11 | |||
| 12 | This document does not describe what a hardware monitoring (hwmon) Driver or | ||
| 13 | Device is. It also does not describe the API which can be used by user space | ||
| 14 | to communicate with a hardware monitoring device. If you want to know this | ||
| 15 | then please read the following file: Documentation/hwmon/sysfs-interface. | ||
| 16 | |||
| 17 | For additional guidelines on how to write and improve hwmon drivers, please | ||
| 18 | also read Documentation/hwmon/submitting-patches. | ||
| 19 | |||
| 20 | The API | ||
| 21 | ------- | ||
| 22 | Each hardware monitoring driver must #include <linux/hwmon.h> and, in most | ||
| 23 | cases, <linux/hwmon-sysfs.h>. linux/hwmon.h declares the following | ||
| 24 | register/unregister functions: | ||
| 25 | |||
| 26 | struct device *hwmon_device_register(struct device *dev); | ||
| 27 | struct device * | ||
| 28 | hwmon_device_register_with_groups(struct device *dev, const char *name, | ||
| 29 | void *drvdata, | ||
| 30 | const struct attribute_group **groups); | ||
| 31 | |||
| 32 | struct device * | ||
| 33 | devm_hwmon_device_register_with_groups(struct device *dev, | ||
| 34 | const char *name, void *drvdata, | ||
| 35 | const struct attribute_group **groups); | ||
| 36 | |||
| 37 | void hwmon_device_unregister(struct device *dev); | ||
| 38 | void devm_hwmon_device_unregister(struct device *dev); | ||
| 39 | |||
| 40 | hwmon_device_register registers a hardware monitoring device. The parameter | ||
| 41 | of this function is a pointer to the parent device. | ||
| 42 | This function returns a pointer to the newly created hardware monitoring device | ||
| 43 | or PTR_ERR for failure. If this registration function is used, hardware | ||
| 44 | monitoring sysfs attributes are expected to have been created and attached to | ||
| 45 | the parent device prior to calling hwmon_device_register. A name attribute must | ||
| 46 | have been created by the caller. | ||
| 47 | |||
| 48 | hwmon_device_register_with_groups is similar to hwmon_device_register. However, | ||
| 49 | it has additional parameters. The name parameter is a pointer to the hwmon | ||
| 50 | device name. The registration function wil create a name sysfs attribute | ||
| 51 | pointing to this name. The drvdata parameter is the pointer to the local | ||
| 52 | driver data. hwmon_device_register_with_groups will attach this pointer | ||
| 53 | to the newly allocated hwmon device. The pointer can be retrieved by the driver | ||
| 54 | using dev_get_drvdata() on the hwmon device pointer. The groups parameter is | ||
| 55 | a pointer to a list of sysfs attribute groups. The list must be NULL terminated. | ||
| 56 | hwmon_device_register_with_groups creates the hwmon device with name attribute | ||
| 57 | as well as all sysfs attributes attached to the hwmon device. | ||
| 58 | |||
| 59 | devm_hwmon_device_register_with_groups is similar to | ||
| 60 | hwmon_device_register_with_groups. However, it is device managed, meaning the | ||
| 61 | hwmon device does not have to be removed explicitly by the removal function. | ||
| 62 | |||
| 63 | hwmon_device_unregister deregisters a registered hardware monitoring device. | ||
| 64 | The parameter of this function is the pointer to the registered hardware | ||
| 65 | monitoring device structure. This function must be called from the driver | ||
| 66 | remove function if the hardware monitoring device was registered with | ||
| 67 | hwmon_device_register or with hwmon_device_register_with_groups. | ||
| 68 | |||
| 69 | devm_hwmon_device_unregister does not normally have to be called. It is only | ||
| 70 | needed for error handling, and only needed if the driver probe fails after | ||
| 71 | the call to devm_hwmon_device_register_with_groups. | ||
| 72 | |||
| 73 | The header file linux/hwmon-sysfs.h provides a number of useful macros to | ||
| 74 | declare and use hardware monitoring sysfs attributes. | ||
| 75 | |||
| 76 | In many cases, you can use the exsting define DEVICE_ATTR to declare such | ||
| 77 | attributes. This is feasible if an attribute has no additional context. However, | ||
| 78 | in many cases there will be additional information such as a sensor index which | ||
| 79 | will need to be passed to the sysfs attribute handling function. | ||
| 80 | |||
| 81 | SENSOR_DEVICE_ATTR and SENSOR_DEVICE_ATTR_2 can be used to define attributes | ||
| 82 | which need such additional context information. SENSOR_DEVICE_ATTR requires | ||
| 83 | one additional argument, SENSOR_DEVICE_ATTR_2 requires two. | ||
| 84 | |||
| 85 | SENSOR_DEVICE_ATTR defines a struct sensor_device_attribute variable. | ||
| 86 | This structure has the following fields. | ||
| 87 | |||
| 88 | struct sensor_device_attribute { | ||
| 89 | struct device_attribute dev_attr; | ||
| 90 | int index; | ||
| 91 | }; | ||
| 92 | |||
| 93 | You can use to_sensor_dev_attr to get the pointer to this structure from the | ||
| 94 | attribute read or write function. Its parameter is the device to which the | ||
| 95 | attribute is attached. | ||
| 96 | |||
| 97 | SENSOR_DEVICE_ATTR_2 defines a struct sensor_device_attribute_2 variable, | ||
| 98 | which is defined as follows. | ||
| 99 | |||
| 100 | struct sensor_device_attribute_2 { | ||
| 101 | struct device_attribute dev_attr; | ||
| 102 | u8 index; | ||
| 103 | u8 nr; | ||
| 104 | }; | ||
| 105 | |||
| 106 | Use to_sensor_dev_attr_2 to get the pointer to this structure. Its parameter | ||
| 107 | is 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, | |||
| 18 | 10-bit ADC, and a digital comparator with user-programmable upper | 18 | 10-bit ADC, and a digital comparator with user-programmable upper |
| 19 | and lower limit values. | 19 | and lower limit values. |
| 20 | 20 | ||
| 21 | Limits can be set through the Overtemperature Shutdown register and | 21 | The LM77 implements 3 limits: low (temp1_min), high (temp1_max) and |
| 22 | Hysteresis register. | 22 | critical (temp1_crit.) It also implements an hysteresis mechanism which |
| 23 | applies to all 3 limits. The relative difference is stored in a single | ||
| 24 | register on the chip, which means that the relative difference between | ||
| 25 | the limit and its hysteresis is always the same for all 3 limits. | ||
| 26 | |||
| 27 | This 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 @@ | |||
| 1 | Kernel driver nct6683 | ||
| 2 | ===================== | ||
| 3 | |||
| 4 | Supported 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 | |||
| 10 | Authors: | ||
| 11 | Guenter Roeck <linux@roeck-us.net> | ||
| 12 | |||
| 13 | Description | ||
| 14 | ----------- | ||
| 15 | |||
| 16 | This driver implements support for the Nuvoton NCT6683D eSIO chip. | ||
| 17 | |||
| 18 | The chips implement up to shared 32 temperature and voltage sensors. | ||
| 19 | It supports up to 16 fan rotation sensors and up to 8 fan control engines. | ||
| 20 | |||
| 21 | Temperatures are measured in degrees Celsius. Measurement resolution is | ||
| 22 | 0.5 degrees C. | ||
| 23 | |||
| 24 | Voltage sensors (also known as IN sensors) report their values in millivolts. | ||
| 25 | |||
| 26 | Fan rotation speeds are reported in RPM (rotations per minute). | ||
| 27 | |||
| 28 | Usage Note | ||
| 29 | ---------- | ||
| 30 | |||
| 31 | Limit register locations on Intel boards with EC firmware version 1.0 | ||
| 32 | build date 04/03/13 do not match the register locations in the Nuvoton | ||
| 33 | datasheet. Nuvoton confirms that Intel uses a special firmware version | ||
| 34 | with different register addresses. The specification describing the Intel | ||
| 35 | firmware is held under NDA by Nuvoton and Intel and not available | ||
| 36 | to the public. | ||
| 37 | |||
| 38 | Some of the register locations can be reverse engineered; others are too | ||
| 39 | well hidden. Given this, writing any values from the operating system is | ||
| 40 | considered too risky with this firmware and has been disabled. All limits | ||
| 41 | must all be written from the BIOS. | ||
| 42 | |||
| 43 | The driver has only been tested with the Intel firmware, and by default | ||
| 44 | only instantiates on Intel boards. To enable it on non-Intel boards, | ||
| 45 | set the 'force' module parameter to 1. | ||
| 46 | |||
| 47 | Tested Boards and Firmware Versions | ||
| 48 | ----------------------------------- | ||
| 49 | |||
| 50 | The driver has been reported to work with the following boards and | ||
| 51 | firmware versions. | ||
| 52 | |||
| 53 | Board Firmware version | ||
| 54 | --------------------------------------------------------------- | ||
| 55 | Intel DH87RL NCT6683D EC firmware version 1.0 build 04/03/13 | ||
| 56 | Intel DH87MC NCT6683D EC firmware version 1.0 build 04/03/13 | ||
| 57 | Intel DB85FL NCT6683D EC firmware version 1.0 build 04/03/13 | ||
