summaryrefslogtreecommitdiff
path: root/drivers/hwmon
AgeCommit message (Collapse)Author
2017-02-27scripts/spelling.txt: add "followings" pattern and fix typo instancesMasahiro Yamada
Fix typos and add the following to the scripts/spelling.txt: followings||following While we are here, add a missing colon in the boilerplate in DT binding documents. The "you SoC" in allwinner,sunxi-pinctrl.txt was fixed as well. I reworded "as the followings:" to "as follows:" for drivers/usb/gadget/udc/renesas_usb3.c. Link: http://lkml.kernel.org/r/1481573103-11329-32-git-send-email-yamada.masahiro@socionext.com Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2017-02-16hwmon: (sht15) Add device tree supportMarco Franchi
Allow the driver to work with device tree support. Based on initial patch submission from Peter Fox. Tested on a imx7d-sdb board connected to a SHT15 board via Mikro Bus. Signed-off-by: Marco Franchi <marco.franchi@nxp.com> Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-02-10hwmon: (it87) Add support for IT8792EGuenter Roeck
The chip is similar to IT8732E, but supports only three fans and pwm outputs instead of four (the driver currently does not support the 4th fan and pwm output of IT8732E). Note that the chip ID is 0x8733, not 0x8792 as one would expect. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-02-10hwmon: (it87) Do not overwrite bit 2..6 of pwm control registersGuenter Roeck
In IT8620E, after setting pwm control to manual, it was observed that pwm values for fan 4..6 have reversed results (writing 0 results in fans running at full speed, writing 255 results in fans turned off). With the new PWM control, pwm polarity for pwm control 4..6 is specified in its pwm control registers. Those registers are overwritten when setting the pwm mode or the temperature mapping. Do not touch bit 2..6 of pwm control registers on register writes to fix the problem. Cc: stable@vger.kernel.org # 4.9+ Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-02-10hwmon: (it87) Fix pwm4 detection for IT8620 and IT8628Guenter Roeck
pwm4 is enabled if bit 2 of GPIO control register 4 is disabled, not when it is enabled. Since the check is for the skip condition, it is reversed. This applies to both IT8620 and IT8628. Fixes: 36c4d98a7883d ("hwmon: (it87) Add support for all pwm channels ...") Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-02-10hwmon: (it87) Ensure that pwm control cache is current before updating valuesGuenter Roeck
If sensor attributes were never read, the pwm control data has not been initiialized, which can cause wrong driver behavior. Ensure that cached data is current before acting on it. Cc: stable@vger.kernel.org # 4.4+ Reported-by: Kevin Folz <kfolz@evertz.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-02-10hwmon: (it87) Improve IT8622 supportGuenter Roeck
Configuration registers on ITE8622 are different to 8620 and 8628 and require special handling. Also, the chip supports up to 5 pwm controls. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-02-10hwmon: (it87) Add support for IT8622EGuenter Roeck
IT8622E is similar to IT8620E, but only supports five pwm controls and five fan tachometers. Originally-from: Kevin Folz <kfolz@evertz.com>. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-02-10hwmon: (it87) Add feature flag indicating that VIN3 is connected to 5VGuenter Roeck
On IT8622E and IT8628E, VIN3 is expected to be connected to +5V. Add feature flag and reflect in input label. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-02-03hwmon: new driver for ST stts751 thermal sensorandrea.merello
This patch adds a HWMON driver for ST Microelectronics STTS751 temperature sensors. Thanks-to: LABBE Corentin [for suggestions] Thanks-to: Guenter Roeck [for suggestion and discussions] Signed-off-by: Andrea Merello <andrea.merello@gmail.com> Cc: LABBE Corentin <clabbe.montjoie@gmail.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-01-31hwmon: Register thermal zone only if 'dev' parameter was providedGuenter Roeck
Rgistering a thermal zone uses devm_kzalloc(), which requires a pointer to the parent device. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-01-31hwmon: Relax name attribute validation for new APIsGuenter Roeck
While invalid name attributes are really not desirable and do mess up libsensors, enforcing valid names has the detrimental effect of driving users away from using the new hardware monitoring API, especially those registering name attributes violating the ABI restrictions. Another undesirable side effect is that this violation and the resulting error may only be discovered some time after a conversion to the new API, which in turn may trigger a revert of that conversion. To solve the problem, relax validation and only issue a warning instead of returning an error if a name attribute violating the ABI is provided. This lets callers continue to provide invalid name attributes while notifying them about it. Many thanks are due to Dmitry Torokhov for the idea. Reviewed-by: Jean Delvare <jdelvare@suse.de> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-01-25hwmon: Make name attribute mandatory for new APIsGuenter Roeck
It does not make sense to use one of the the new APIs when not even providing a name attribute. Make it mandatory. Reviewed-by: Jean Delvare <jdelvare@suse.de> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-01-21hwmon: (lm70) Add support for TI TMP122/124Florian Fainelli
Add support for Texas Instruments TMP122/124 which are nearly identical to their TMP121/123 except that they also support programmable temperature thresholds. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-01-21hwmon: (lm70) Utilize dev_warn instead of pr_warnFlorian Fainelli
We have a device reference, utilize it instead of pr_warn(). Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-01-21hwmon: (ltc4151) Export OF device ID table as module aliasesJavier Martinez Canillas
The I2C core always reports a MODALIAS of the form i2c:<foo> even if the device was registered via OF, this means that exporting the OF device ID table device aliases in the module is not needed. But in order to change how the core reports modaliases to user-space, it's better to export it. Before this patch: $ modinfo drivers/hwmon/ltc4151.ko | grep alias alias: i2c:ltc4151 After this patch: $ modinfo drivers/hwmon/ltc4151.ko | grep alias alias: i2c:ltc4151 alias: of:N*T*Clltc,ltc4151C* alias: of:N*T*Clltc,ltc4151 Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-01-10hwmon: (adc128d818) Preserve operation modeAlexander Koch
Preserve chip operation mode if no mode is specified via devicetree. This enables operation when chip configuration is done by BIOS/ROMMON. Signed-off-by: Alexander Koch <mail@alexanderkoch.net> Acked-by: Michael Hornung <mhornung.linux@gmail.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-01-10hwmon: (adc128d818) Support operation modes 1-3Alexander Koch
Add support for operation modes 1-3 of the ADC128D818 (see datasheet sec. 8.4.1). These differ in the number and type of the available input signals, requiring the driver to selectively hide sysfs nodes according to the operation mode configured via devicetree. Signed-off-by: Alexander Koch <mail@alexanderkoch.net> Acked-by: Michael Hornung <mhornung.linux@gmail.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-01-10hwmon: (adc128d818) Implement mode selection via dtAlexander Koch
Implement operation mode selection using the optional 'ti,mode' devicetree property (see [1]). The ADC128D818 supports four operation modes differing in the number and type of input readings (see datasheet, sec. 8.4.1), of which mode 0 is the default. We only add handling of the 'ti,mode' property here, the driver still supports nothing else than the default mode 0. [1] Documentation/devicetree/bindings/hwmon/adc128d818.txt Signed-off-by: Alexander Koch <mail@alexanderkoch.net> Acked-by: Michael Hornung <mhornung.linux@gmail.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-01-10hwmon: (tmp401) use smb word operations instead of 2 smb byte operationsJeroen De Wachter
tmp401 separately read/wrote high and low bytes of temperature values while the hardware supports reading/writing those values in one operation. Driver has been modified to use word operations where possible. Tested with a tmp432 sensor on a mips64 platform. Signed-off-by: Jeroen De Wachter <jeroen.de_wachter.ext@nokia.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-01-10hwmon: (gl520sm) Fix overflows and crash seen when writing into limit attributesGuenter Roeck
Writes into limit attributes can overflow due to multplications and additions with unbound input values. Writing into fan limit attributes can result in a crash with a division by zero if very large values are written and the fan divider is larger than 1. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-01-10hwmon: (gl518sm) Fix overflows seen when writing into limit attributesGuenter Roeck
Writes into limit attributes can overflow due to additions and multiplications with unchecked parameters. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-01-10hwmon: (dme1737) Fix overflows seen when writing into limit attributesGuenter Roeck
Writes into voltage limit, temperature limit, temperature hysteresis, and temperature zone attributes can overflow due to unclamped parameters to multiplications, additions, and subtractions. Cc: Juerg Haefliger <juergh@gmail.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-01-02hwmon: (sht21) Add Electronic Identification Code retrievalPeter A. Bigot
Expose the per-chip unique identifier so it can be used to identify the sensor producing the measurements. Signed-off-by: Peter A. Bigot <pab@pabigot.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-01-02hwmon: (tmp401) use permission-specific DEVICE_ATTR variantsJulia Lawall
Use DEVICE_ATTR_RW for read/write attributes. This simplifies the source code, improves readbility, and reduces the chance of inconsistencies. The conversion was done automatically using coccinelle. It was validated by compiling both the old and the new source code and comparing its text, data, and bss size. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> [groeck: Updated description] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-01-02hwmon: (fam15h_power) use permission-specific DEVICE_ATTR variantsJulia Lawall
Use DEVICE_ATTR_RO for read only attributes and DEVICE_ATTR_RW for read/write attributes. This simplifies the source code, improves readbility, and reduces the chance of inconsistencies. The conversion was done automatically using coccinelle. It was validated by compiling both the old and the new source code and comparing its text, data, and bss size. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> [groeck: Updated description] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-01-02hwmon: (adt7475) use permission-specific DEVICE_ATTR variantsJulia Lawall
Use DEVICE_ATTR_RO for read only attributes and DEVICE_ATTR_RW for read/write attributes. This simplifies the source code, improves readbility, and reduces the chance of inconsistencies. The conversion was done automatically using coccinelle. It was validated by compiling both the old and the new source code and comparing its text, data, and bss size. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> [groeck: Updated description] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-01-02hwmon: (lm95234) use permission-specific DEVICE_ATTR variantsJulia Lawall
Use DEVICE_ATTR_RW for read/write attributes. This simplifies the source code, improves readbility, and reduces the chance of inconsistencies. The conversion was done automatically using coccinelle. It was validated by compiling both the old and the new source code and comparing its text, data, and bss size. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> [groeck: Updated description] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-01-02hwmon: (max6650) use permission-specific DEVICE_ATTR variantsJulia Lawall
Use DEVICE_ATTR_RW for read/write attributes. This simplifies the source code, improves readbility, and reduces the chance of inconsistencies. The conversion was done automatically using coccinelle. It was validated by compiling both the old and the new source code and comparing its text, data, and bss size. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> [groeck: Updated description] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-01-02hwmon: (emc2103) use permission-specific DEVICE_ATTR variantsJulia Lawall
Use DEVICE_ATTR_RO for read only attributes and DEVICE_ATTR_RW for read/write attributes. This simplifies the source code, improves readbility, and reduces the chance of inconsistencies. The conversion was done automatically using coccinelle. It was validated by compiling both the old and the new source code and comparing its text, data, and bss size. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> [groeck: Updated description] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-01-02hwmon: (lm83) use permission-specific DEVICE_ATTR variantsJulia Lawall
Use DEVICE_ATTR_RO for read-only attributes. This simplifies the source code, improves readbility, and reduces the chance of inconsistencies. The conversion was done automatically using coccinelle. It was validated by compiling both the old and the new source code and comparing its text, data, and bss size. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> [groeck: Updated description] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-01-02hwmon: (adm1025) use permission-specific DEVICE_ATTR variantsJulia Lawall
Use DEVICE_ATTR_RO for read only attributes and DEVICE_ATTR_RW for read/write attributes. This simplifies the source code, improves readbility, and reduces the chance of inconsistencies. The conversion was done automatically using coccinelle. It was validated by compiling both the old and the new source code and comparing its text, data, and bss size. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> [groeck: Updated description] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-01-02hwmon: (k8temp) use permission-specific DEVICE_ATTR variantsJulia Lawall
Use DEVICE_ATTR_RO for read-only attributes. This simplifies the source code, improves readbility, and reduces the chance of inconsistencies. The conversion was done automatically using coccinelle. It was validated by compiling both the old and the new source code and comparing its text, data, and bss size. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> [groeck: Updated description] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-01-02hwmon: (sch5627) use permission-specific DEVICE_ATTR variantsJulia Lawall
Use DEVICE_ATTR_RO for read-only attributes. This simplifies the source code, improves readbility, and reduces the chance of inconsistencies. The conversion was done automatically using coccinelle. It was validated by compiling both the old and the new source code and comparing its text, data, and bss size. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> [groeck: Updated description] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-01-02hwmon: (lm78) use permission-specific DEVICE_ATTR variantsJulia Lawall
Use DEVICE_ATTR_RO for read only attributes and DEVICE_ATTR_RW for read/write attributes. This simplifies the source code, improves readbility, and reduces the chance of inconsistencies. The conversion was done automatically using coccinelle. It was validated by compiling both the old and the new source code and comparing its text, data, and bss size. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> [groeck: Updated description] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-01-02hwmon: (pc87360) use permission-specific DEVICE_ATTR variantsJulia Lawall
Use DEVICE_ATTR_RO for read only attributes and DEVICE_ATTR_RW for read/write attributes. This simplifies the source code, improves readbility, and reduces the chance of inconsistencies. The conversion was done automatically using coccinelle. It was validated by compiling both the old and the new source code and comparing its text, data, and bss size. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> [groeck: Updated description] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-01-02hwmon: (nct6775) use permission-specific DEVICE_ATTR variantsJulia Lawall
Use DEVICE_ATTR_RW for read/write attributes. This simplifies the source code, improves readbility, and reduces the chance of inconsistencies. The conversion was done automatically using coccinelle. It was validated by compiling both the old and the new source code and comparing its text, data, and bss size. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> [groeck: Updated description] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-01-02hwmon: (lm90) use permission-specific DEVICE_ATTR variantsJulia Lawall
Use DEVICE_ATTR_RW for read/write attributes. This simplifies the source code, improves readbility, and reduces the chance of inconsistencies. The conversion was done automatically using coccinelle. It was validated by compiling both the old and the new source code and comparing its text, data, and bss size. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> [groeck: Updated description] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-01-02hwmon: (it87) use permission-specific DEVICE_ATTR variantsJulia Lawall
Use DEVICE_ATTR_RO for read only attributes and DEVICE_ATTR_RW for read/write attributes. This simplifies the source code, improves readbility, and reduces the chance of inconsistencies. The conversion was done automatically using coccinelle. It was validated by compiling both the old and the new source code and comparing its text, data, and bss size. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> [groeck: Updated description] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-01-02hwmon: (dme1737) use permission-specific DEVICE_ATTR variantsJulia Lawall
Use DEVICE_ATTR_RO for read only attributes and DEVICE_ATTR_RW for read/write attributes. This simplifies the source code, improves readbility, and reduces the chance of inconsistencies. The conversion was done automatically using coccinelle. It was validated by compiling both the old and the new source code and comparing its text, data, and bss size. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> [groeck: Updated description] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-01-02hwmon: (k10temp) use permission-specific DEVICE_ATTR variantsJulia Lawall
Use DEVICE_ATTR_RO for read-only attributes. This simplifies the source code, improves readbility, and reduces the chance of inconsistencies. The conversion was done automatically using coccinelle. It was validated by compiling both the old and the new source code and comparing its text, data, and bss size. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> [groeck: Updated description] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-01-02hwmon: (vt8231) use permission-specific DEVICE_ATTR variantsJulia Lawall
Use DEVICE_ATTR_RO for read only attributes and DEVICE_ATTR_RW for read/write attributes. This simplifies the source code, improves readbility, and reduces the chance of inconsistencies. The conversion was done automatically using coccinelle. It was validated by compiling both the old and the new source code and comparing its text, data, and bss size. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> [groeck: Updated description] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-01-02hwmon: (w83793) use permission-specific DEVICE_ATTR variantsJulia Lawall
Use DEVICE_ATTR_RW for read/write attributes. This simplifies the source code, improves readbility, and reduces the chance of inconsistencies. The conversion was done automatically using coccinelle. It was validated by compiling both the old and the new source code and comparing its text, data, and bss size. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> [groeck: Updated description] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-01-02hwmon: (f71805f) use permission-specific DEVICE_ATTR variantsJulia Lawall
Use DEVICE_ATTR_RO for read-only attributes. This simplifies the source code, improves readbility, and reduces the chance of inconsistencies. The conversion was done automatically using coccinelle. It was validated by compiling both the old and the new source code and comparing its text, data, and bss size. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> [groeck: Updated description] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-01-02hwmon: (pc87427) use permission-specific DEVICE_ATTR variantsJulia Lawall
Use DEVICE_ATTR_RO for read-only attributes. This simplifies the source code, improves readbility, and reduces the chance of inconsistencies. The conversion was done automatically using coccinelle. It was validated by compiling both the old and the new source code and comparing its text, data, and bss size. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> [groeck: Updated description] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-01-02hwmon: (w83791d) use permission-specific DEVICE_ATTR variantsJulia Lawall
Use DEVICE_ATTR_RO for read only attributes and DEVICE_ATTR_RW for read/write attributes. This simplifies the source code, improves readbility, and reduces the chance of inconsistencies. The conversion was done automatically using coccinelle. It was validated by compiling both the old and the new source code and comparing its text, data, and bss size. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> [groeck: Updated description] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-01-02hwmon: (w83792d) use permission-specific DEVICE_ATTR variantsJulia Lawall
Use DEVICE_ATTR_RO for read only attributes and DEVICE_ATTR_RW for read/write attributes. This simplifies the source code, improves readbility, and reduces the chance of inconsistencies. The conversion was done automatically using coccinelle. It was validated by compiling both the old and the new source code and comparing its text, data, and bss size. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> [groeck: Updated description] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-01-02hwmon: (w83781d) use permission-specific DEVICE_ATTR variantsJulia Lawall
Use DEVICE_ATTR_RO for read only attributes and DEVICE_ATTR_RW for read/write attributes. This simplifies the source code, improves readbility, and reduces the chance of inconsistencies. The conversion was done automatically using coccinelle. It was validated by compiling both the old and the new source code and comparing its text, data, and bss size. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> [groeck: Updated description] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-01-02hwmon: (w83627hf) use permission-specific DEVICE_ATTR variantsJulia Lawall
Use DEVICE_ATTR_RO for read-only attributes. This simplifies the source code, improves readbility, and reduces the chance of inconsistencies. The conversion was done automatically using coccinelle. It was validated by compiling both the old and the new source code and comparing its text, data, and bss size. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> [groeck: Updated description] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-01-02hwmon: (w83627ehf) use permission-specific DEVICE_ATTR variantsJulia Lawall
Use DEVICE_ATTR_RO for read-only attributes. This simplifies the source code, improves readbility, and reduces the chance of inconsistencies. The conversion was done automatically using coccinelle. It was validated by compiling both the old and the new source code and comparing its text, data, and bss size. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> [groeck: Updated description] Signed-off-by: Guenter Roeck <linux@roeck-us.net>