diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-12-13 15:43:56 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-12-13 15:43:56 -0800 |
commit | 1c59e1edb13d60b97b7b03b332ceed5d967d4227 (patch) | |
tree | d5340c2e7b3682adc190b939aec8666bc3659a56 /Documentation/hwmon | |
parent | bb3dd056ed1af9b186f0d9fe849eab78c51d14ce (diff) | |
parent | 4fccd4a1e8944033bcd7693ea4e8fb478cd2059a (diff) | |
download | linux-1c59e1edb13d60b97b7b03b332ceed5d967d4227.tar.bz2 |
Merge tag 'hwmon-for-linus-v4.10' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging
Pull hwmon updates from Guenter Roeck:
- new drivers for TMP108 and TC654
- hwmon core code cleanup
- coretemp driver cleanup
- fix overflow issues in several drivers
- minor fixes, cleanups and enhancements in various drivers
* tag 'hwmon-for-linus-v4.10' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: (41 commits)
hwmon: (g762) Fix overflows and crash seen when writing limit attributes
hwmon: (emcw201) Fix overflows seen when writing into limit attributes
hwmon: (emc2103) Fix overflows seen when temperature limit attributes
hwmon: (lm85) Fix overflows seen when writing voltage limit attributes
hwmon: (lm87) Fix overflow seen when writing voltage limit attributes
hwmon: (nct7802) Fix overflows seen when writing into limit attributes
hwmon: (adt7470) Fix overflows seen when writing into limit attributes
hwmon: (adt7462) Fix overflows seen when writing into limit attributes
hwmon: (adm1026) Fix overflows seen when writing into limit attributes
hwmon: (adm1025) Fix overflows seen when writing voltage limits
hwmon: (via-cputemp) Convert to hotplug state machine
devicetree: hwmon: Add documentation for TMP108 driver.
hwmon: Add Texas Instruments TMP108 temperature sensor driver.
hwmon: (core) Simplify sysfs attribute name allocation
hwmon: (core) Rename groups parameter in API to extra_groups
hwmon: (core) Explain why at least two attribute groups are allocated
hwmon: (core) Make is_visible callback truly mandatory
hwmon: (core) Deprecate hwmon_device_register()
hwmon: (core) Clarify use of chip attributes
hwmon: (core) Add support for string attributes to new API
...
Diffstat (limited to 'Documentation/hwmon')
-rw-r--r-- | Documentation/hwmon/hwmon-kernel-api.txt | 58 | ||||
-rw-r--r-- | Documentation/hwmon/tc654 | 31 | ||||
-rw-r--r-- | Documentation/hwmon/tmp108 | 36 |
3 files changed, 93 insertions, 32 deletions
diff --git a/Documentation/hwmon/hwmon-kernel-api.txt b/Documentation/hwmon/hwmon-kernel-api.txt index ef9d74947f5c..2505ae67e2b6 100644 --- a/Documentation/hwmon/hwmon-kernel-api.txt +++ b/Documentation/hwmon/hwmon-kernel-api.txt @@ -23,7 +23,6 @@ Each hardware monitoring driver must #include <linux/hwmon.h> and, in most cases, <linux/hwmon-sysfs.h>. linux/hwmon.h declares the following register/unregister functions: -struct device *hwmon_device_register(struct device *dev); struct device * hwmon_device_register_with_groups(struct device *dev, const char *name, void *drvdata, @@ -38,36 +37,31 @@ struct device * hwmon_device_register_with_info(struct device *dev, const char *name, void *drvdata, const struct hwmon_chip_info *info, - const struct attribute_group **groups); + const struct attribute_group **extra_groups); struct device * devm_hwmon_device_register_with_info(struct device *dev, - const char *name, - void *drvdata, - const struct hwmon_chip_info *info, - const struct attribute_group **groups); + const char *name, + void *drvdata, + const struct hwmon_chip_info *info, + const struct attribute_group **extra_groups); void hwmon_device_unregister(struct device *dev); void devm_hwmon_device_unregister(struct device *dev); -hwmon_device_register registers a hardware monitoring device. The parameter -of this function is a pointer to the parent device. -This function returns a pointer to the newly created hardware monitoring device -or PTR_ERR for failure. If this registration function is used, hardware -monitoring sysfs attributes are expected to have been created and attached to -the parent device prior to calling hwmon_device_register. A name attribute must -have been created by the caller. - -hwmon_device_register_with_groups is similar to hwmon_device_register. However, -it has additional parameters. The name parameter is a pointer to the hwmon -device name. The registration function wil create a name sysfs attribute -pointing to this name. The drvdata parameter is the pointer to the local -driver data. hwmon_device_register_with_groups will attach this pointer -to the newly allocated hwmon device. The pointer can be retrieved by the driver -using dev_get_drvdata() on the hwmon device pointer. The groups parameter is +hwmon_device_register_with_groups registers a hardware monitoring device. +The first parameter of this function is a pointer to the parent device. +The name parameter is a pointer to the hwmon device name. The registration +function wil create a name sysfs attribute pointing to this name. +The drvdata parameter is the pointer to the local driver data. +hwmon_device_register_with_groups will attach this pointer to the newly +allocated hwmon device. The pointer can be retrieved by the driver using +dev_get_drvdata() on the hwmon device pointer. The groups parameter is a pointer to a list of sysfs attribute groups. The list must be NULL terminated. hwmon_device_register_with_groups creates the hwmon device with name attribute as well as all sysfs attributes attached to the hwmon device. +This function returns a pointer to the newly created hardware monitoring device +or PTR_ERR for failure. devm_hwmon_device_register_with_groups is similar to hwmon_device_register_with_groups. However, it is device managed, meaning the @@ -87,13 +81,13 @@ hwmon_device_unregister deregisters a registered hardware monitoring device. The parameter of this function is the pointer to the registered hardware monitoring device structure. This function must be called from the driver remove function if the hardware monitoring device was registered with -hwmon_device_register, hwmon_device_register_with_groups, or -hwmon_device_register_with_info. +hwmon_device_register_with_groups or hwmon_device_register_with_info. devm_hwmon_device_unregister does not normally have to be called. It is only needed for error handling, and only needed if the driver probe fails after -the call to devm_hwmon_device_register_with_groups and if the automatic -(device managed) removal would be too late. +the call to devm_hwmon_device_register_with_groups or +hwmon_device_register_with_info and if the automatic (device managed) +removal would be too late. Using devm_hwmon_device_register_with_info() -------------------------------------------- @@ -106,9 +100,9 @@ const char *name Device name void *drvdata Driver private data const struct hwmon_chip_info *info Pointer to chip description. -const struct attribute_group **groups - Null-terminated list of additional sysfs attribute - groups. +const struct attribute_group **extra_groups + Null-terminated list of additional non-standard + sysfs attribute groups. This function returns a pointer to the created hardware monitoring device on success and a negative error code for failure. @@ -160,7 +154,7 @@ It contains following fields: * type: The hardware monitoring sensor type. Supported sensor types are * hwmon_chip A virtual sensor type, used to describe attributes - which apply to the entire chip. + * which are not bound to a specific input or output * hwmon_temp Temperature sensor * hwmon_in Voltage sensor * hwmon_curr Current sensor @@ -293,9 +287,9 @@ Driver-provided sysfs attributes If the hardware monitoring device is registered with hwmon_device_register_with_info or devm_hwmon_device_register_with_info, -it is most likely not necessary to provide sysfs attributes. Only non-standard -sysfs attributes need to be provided when one of those registration functions -is used. +it is most likely not necessary to provide sysfs attributes. Only additional +non-standard sysfs attributes need to be provided when one of those registration +functions is used. The header file linux/hwmon-sysfs.h provides a number of useful macros to declare and use hardware monitoring sysfs attributes. diff --git a/Documentation/hwmon/tc654 b/Documentation/hwmon/tc654 new file mode 100644 index 000000000000..91a2843f5f98 --- /dev/null +++ b/Documentation/hwmon/tc654 @@ -0,0 +1,31 @@ +Kernel driver tc654 +=================== + +Supported chips: + * Microship TC654 and TC655 + Prefix: 'tc654' + Datasheet: http://ww1.microchip.com/downloads/en/DeviceDoc/20001734C.pdf + +Authors: + Chris Packham <chris.packham@alliedtelesis.co.nz> + Masahiko Iwamoto <iwamoto@allied-telesis.co.jp> + +Description +----------- +This driver implements support for the Microchip TC654 and TC655. + +The TC654 uses the 2-wire interface compatible with the SMBUS 2.0 +specification. The TC654 has two (2) inputs for measuring fan RPM and +one (1) PWM output which can be used for fan control. + +Configuration Notes +------------------- +Ordinarily the pwm1_mode ABI is used for controlling the pwm output +mode. However, for this chip the output is always pwm, and the +pwm1_mode determines if the pwm output is controlled via the pwm1 value +or via the Vin analog input. + + +Setting pwm1_mode to 1 will cause the pwm output to be driven based on +the pwm1 value. Setting pwm1_mode to 0 will cause the pwm output to be +driven based on the Vin input. diff --git a/Documentation/hwmon/tmp108 b/Documentation/hwmon/tmp108 new file mode 100644 index 000000000000..25802df23010 --- /dev/null +++ b/Documentation/hwmon/tmp108 @@ -0,0 +1,36 @@ +Kernel driver tmp108 +==================== + +Supported chips: + * Texas Instruments TMP108 + Prefix: 'tmp108' + Addresses scanned: none + Datasheet: http://www.ti.com/product/tmp108 + +Author: + John Muir <john@jmuir.com> + +Description +----------- + +The Texas Instruments TMP108 implements one temperature sensor. An alert pin +can be set when temperatures exceed minimum or maximum values plus or minus a +hysteresis value. (This driver does not support interrupts for the alert pin, +and the device runs in comparator mode.) + +The sensor is accurate to 0.75C over the range of -25 to +85 C, and to 1.0 +degree from -40 to +125 C. Resolution of the sensor is 0.0625 degree. The +operating temperature has a minimum of -55 C and a maximum of +150 C. +Hysteresis values can be set to 0, 1, 2, or 4C. + +The TMP108 has a programmable update rate that can select between 8, 4, 1, and +0.5 Hz. + +By default the TMP108 reads the temperature continuously. To conserve power, +the TMP108 has a one-shot mode where the device is normally shut-down. When a +one shot is requested the temperature is read, the result can be retrieved, +and then the device is shut down automatically. (This driver only supports +continuous mode.) + +The driver provides the common sysfs-interface for temperatures (see +Documentation/hwmon/sysfs-interface under Temperatures). |