summaryrefslogtreecommitdiff
path: root/drivers/hwmon
AgeCommit message (Collapse)Author
2013-08-12hwmon: (w83627ehf) Add support for hibernateHarald Judt
Hibernation uses its own set of callback functions, even if the code is the same as the code used for suspend/restore. Signed-off-by: Harald Judt <h.judt@gmx.at> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-08-12hwmon: (nct6775) Add support for hibernateHarald Judt
Hibernation uses its own set of callback functions, even if the code is the same as the code used for suspend/restore. Signed-off-by: Harald Judt <h.judt@gmx.at> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-08-12hwmon: use dev_get_platdata()Jingoo Han
Use the wrapper function for retrieving the platform data instead of accessing dev->platform_data directly. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-08-12hwmon: (nct6775) Fix size of data->temp arrayDan Carpenter
Smatch complains that we have a array overflow: drivers/hwmon/nct6775.c:1456 nct6775_update_device() error: buffer overflow 'data->temp' 4 <= 4 Guenter Roeck says that the array should have been made larger in 7cbbd6aee6 (Add support for critical low/high temperature limits on NCT6106). This patch does that. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-08-12hwmon: (nct6775) Avoid using device platform data outside probe functionGuenter Roeck
Plan going forward is to attach all device attributes to the hwmon device and no longer to the platform device. With that change, accessing platform data outside the probe function will be more difficult. To avoid the problem, change code to no longer rely on it. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-08-12hwmon: (nct6775) Add support for NCT6791DDavid Bartley
Signed-off-by: David Bartley <andareed@gmail.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-08-12hwmon: (nct6775) Add support for beep attributesGuenter Roeck
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-08-12hwmon: (nct6775) Add support for critical low/high temperature limits on NCT6106Guenter Roeck
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-08-12hwmon: (nct6775) Add support for NCT6102D/6106DGuenter Roeck
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-08-12hwmon: (nct6775) Support two SuperIO chips in the same systemGuenter Roeck
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-08-12hwmon: (nct6775) Allocate attributes dynamically from templatesGuenter Roeck
Static attribute allocation is large and very repetitive. Allocate attributes and attribute groups dynamically instead. This reduces the size of the driver source by more than 600 lines, and object size by more than 20k (more than 30%). Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-08-12hwmon: (coretemp) Atom CPUs don't support TjMax; no warning neededGuenter Roeck
Display warning "Unable to read TjMax from CPU x" only if the CPU is supposed to support it. This is not the case for the various Atom CPUs. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-08-08hwmon: (adt7470) Fix incorrect return code checkCurt Brune
In adt7470_write_word_data(), which writes two bytes using i2c_smbus_write_byte_data(), the return codes are incorrectly AND-ed together when they should be OR-ed together. The return code of i2c_smbus_write_byte_data() is zero for success. The upshot is only the first byte was ever written to the hardware. The 2nd byte was never written out. I noticed that trying to set the fan speed limits was not working correctly on my system. Setting the fan speed limits is the only code that uses adt7470_write_word_data(). After making the change the limit settings work and the alarms work also. Signed-off-by: Curt Brune <curt@cumulusnetworks.com> Cc: stable@vger.kernel.org Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-08-03hwmon: (max6697) fix MAX6581 idealityVivien Didelot
Without this patch, the values for ideality (register 0x4b) and ideality selection mask (register 0x4c) are inverted. Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Cc: stable@vger.kernel.org # 3.9+ Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-07-18Merge tag 'hwmon-for-linus' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging Pull hwmon fix from Guenter Roeck: "Single patch to staticize a local variable" * tag 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: hwmon: (abx500) Staticize abx500_temp_attributes
2013-07-14hwmon: delete __cpuinit usage from all hwmon filesPaul Gortmaker
The __cpuinit type of throwaway sections might have made sense some time ago when RAM was more constrained, but now the savings do not offset the cost and complications. For example, the fix in commit 5e427ec2d0 ("x86: Fix bit corruption at CPU resume time") is a good example of the nasty type of bugs that can be created with improper use of the various __init prefixes. After a discussion on LKML[1] it was decided that cpuinit should go the way of devinit and be phased out. Once all the users are gone, we can then finally remove the macros themselves from linux/init.h. This removes all the drivers/hwmon uses of the __cpuinit macros from all C files. [1] https://lkml.org/lkml/2013/5/20/589 Cc: Fenghua Yu <fenghua.yu@intel.com> Cc: lm-sensors@lm-sensors.org Acked-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2013-07-14hwmon: (abx500) Staticize abx500_temp_attributesSachin Kamat
abx500_temp_attributes is used only in this file. Make it static. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-07-08hwmon: (lm63) Drop redundant safety on cache lifetimeJean Delvare
time_after (as opposed to time_after_equal) already ensures that the cache lifetime is at least as much as requested. There is no point in manually adding another jiffy to that value, and this can confuse the reader into wrong interpretation. Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Imre Deak <imre.deak@intel.com>
2013-07-08hwmon: (lm90) Drop redundant safety on cache lifetimeJean Delvare
time_after (as opposed to time_after_equal) already ensures that the cache lifetime is at least as much as requested. There is no point in manually adding another jiffy to that value, and this can confuse the reader into wrong interpretation. Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Imre Deak <imre.deak@intel.com>
2013-07-04Merge tag 'hwmon-for-linus' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging Pull hwmon updates from Guenter Roeck: - new driver to support GMT G762/G763 pwm fan controllers - add support for DS1631, DS1721, and DS1731 to ds1621 driver - remove detect function from ds1621 driver as unreliable - bug fixes in nct6775, iio_hwmon, and adm1021 drivers - remove redundant platform_set_drvdata in various drivers - add device tree support to ina2xx driver * tag 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: hwmon: (ds1621) Fix temperature rounding operations hwmon: (nct6775) Drop unsupported fan alarm attributes for NCT6775 hwmon: (nct6775) Fix temperature alarm attributes Add support for GMT G762/G763 PWM fan controllers hwmon: (ina2xx) Add device tree support to pass the shunt resistor hwmon: (ds1621) Update documentation hwmon: (ds1621) Add DS1731 chip support to ds1621 driver hwmon: (iio_hwmon) add alias table hwmon: (adm1021) Do not create min sysfs attributes for LM84 hwmon: (ds1621) Remove detect function hwmon: (ds1621) Add ds1631 chip support to ds1621 driver and documentation hwmon: (ds1621) Add ds1721 update interval sysfs attribute hwmon: (ds1621) Add ds1721 chip support hwmon: (w83627ehf) Remove redundant platform_set_drvdata() hwmon: (ntc_thermistor) Remove redundant platform_set_drvdata() hwmon: (i5k_amb) Remove redundant platform_set_drvdata() hwmon: (coretemp) Remove redundant platform_set_drvdata() hwmon: (abituguru3) Remove redundant platform_set_drvdata()
2013-07-03drivers: avoid parsing names as kthread_run() format stringsKees Cook
Calling kthread_run with a single name parameter causes it to be handled as a format string. Many callers are passing potentially dynamic string content, so use "%s" in those cases to avoid any potential accidents. Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-06-28hwmon: (ds1621) Fix temperature rounding operationsGuenter Roeck
Commit "hwmon: (ds1621) Add ds1721 chip support" broke rounding for chips or configurations with less than 12 bit resolution. Tested-by: Jean Delvare <khali@linux-fr.org> Acked-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-06-27hwmon: (nct6775) Drop unsupported fan alarm attributes for NCT6775Guenter Roeck
NCT6775 does not support alarms for fans 4 and 5. Drop the attributes. cc: stable@vger.kernel.org # 3.10+ Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-06-27hwmon: (nct6775) Fix temperature alarm attributesGuenter Roeck
Driver displays wrong alarms for temperature attributes. Turns out that temperature alarm bits are not fixed, but determined by temperature source mapping. To fix the problem, walk through the temperature sources to determine the correct alarm bit associated with a given attribute. Cc: stable@vger.kernel.org # 3.10+ Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-06-27Add support for GMT G762/G763 PWM fan controllersArnaud Ebalard
GMT G762/763 fan speed PWM controller is connected directly to a fan and performs closed-loop or open-loop control of the fan speed. Two modes - PWM or DC - are supported by the chip. Introduced driver provides various knobs to control the operations of the chip (via sysfs interface). Specific characteristics of the system can be passed either using board init code or via DT. Documentation for both the driver and DT bindings are also provided. Signed-off-by: Arnaud Ebalard <arno@natisbad.org> Tested-by: Simon Guinot <simon.guinot@sequanux.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-06-27hwmon: (ina2xx) Add device tree support to pass the shunt resistorTang Yuantian
Adding another way that is device tree to pass the shunt resistor value to driver except for platform data. Signed-off-by: Tang Yuantian <Yuantian.Tang@freescale.com> [Guenter Roeck: Added missing of.h include] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-06-27hwmon: (ds1621) Add DS1731 chip support to ds1621 driverRobert Coulson
These changes add DS1731 chip support to the ds1621 driver, Kconfig, and documentation. Signed-off-by: Robert Coulson <rob.coulson@gmail.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-06-27hwmon: (iio_hwmon) add alias tableSebastian Andrzej Siewior
This helps the kernel to find the right module once the device is created. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-06-27hwmon: (adm1021) Do not create min sysfs attributes for LM84Guenter Roeck
LM84 does not support minimum temperature registers. Only create the respective sysfs attributes for other chips. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Acked-by: Jean Delvare <khali@linux-fr.org>
2013-06-27hwmon: (ds1621) Remove detect functionRobert Coulson
Due to a lack of device and vendor identification registers, the Dallas/Maxim DS16xx devices cannot be uniquely detected, sometimes resulting in false positives. Therefore, the detect function is being removed in favor of explicit device instantiation. Signed-off-by: Robert Coulson <rob.coulson@gmail.com> Acked-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-06-27hwmon: (ds1621) Add ds1631 chip support to ds1621 driver and documentationRobert Coulson
Add definitions, information, and code for ds1631 chip support to the ds1621 driver. Signed-off-by: Robert Coulson <rob.coulson@gmail.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-06-27hwmon: (ds1621) Add ds1721 update interval sysfs attributeRobert Coulson
The ds1721 device can be configured for 9..12 bit resolutions; add a sysfs attribute for userspace to configure this attribute. The definition, description, details, and usage are shown in the documentation and were crafted from an LM73 driver patch done by Chris Verges & Guenter Roeck). Signed-off-by: Robert Coulson <rob.coulson@gmail.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-06-27hwmon: (ds1621) Add ds1721 chip supportRobert Coulson
Update the ds1621 documentation, driver, and Kconfig with ds1721 chip support. Signed-off-by: Robert Coulson <rob.coulson@gmail.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-06-21hwmon: (w83627ehf) Remove redundant platform_set_drvdata()Sachin Kamat
Commit 0998d06310 (device-core: Ensure drvdata = NULL when no driver is bound) removes the need to set driver data field to NULL. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Cc: Jean Delvare <khali@linux-fr.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-06-21hwmon: (ntc_thermistor) Remove redundant platform_set_drvdata()Sachin Kamat
Commit 0998d06310 (device-core: Ensure drvdata = NULL when no driver is bound) removes the need to set driver data field to NULL. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Cc: MyungJoo Ham <myungjoo.ham@samsung.com> Acked-by: MyungJoo Ham <myungjoo.ham@samsung.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-06-21hwmon: (i5k_amb) Remove redundant platform_set_drvdata()Sachin Kamat
Commit 0998d06310 (device-core: Ensure drvdata = NULL when no driver is bound) removes the need to set driver data field to NULL. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Cc: Darrick J. Wong <djwong@us.ibm.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-06-21hwmon: (coretemp) Remove redundant platform_set_drvdata()Sachin Kamat
Commit 0998d06310 (device-core: Ensure drvdata = NULL when no driver is bound) removes the need to set driver data field to NULL. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Cc: Rudolf Marek <r.marek@assembler.cz> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-06-21hwmon: (abituguru3) Remove redundant platform_set_drvdata()Sachin Kamat
Commit 0998d06310 (device-core: Ensure drvdata = NULL when no driver is bound) removes the need to set driver data field to NULL. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Cc: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-06-07hwmon: (adm1021) Strengthen chip detection for ADM1021, LM84 and MAX1617Guenter Roeck
On a system with both MAX1617 and JC42 sensors, JC42 sensors can be misdetected as LM84. Strengthen detection sufficiently enough to avoid this misdetection. Also improve detection for ADM1021. Modeled after chip detection code in sensors-detect command. Cc: stable@vger.kernel.org Signed-off-by: Guenter Roeck <linux@roeck-us.net> Tested-by: Jean Delvare <khali@linux-fr.org> Acked-by: Jean Delvare <khali@linux-fr.org>
2013-05-19hwmon: (tmp401) Drop redundant safety on cache lifetimeJean Delvare
time_after (as opposed to time_after_equal) already ensures that the cache lifetime is at least as much as requested. There is no point in manually adding another jiffy to that value, and this can confuse the reader into wrong interpretation. Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Imre Deak <imre.deak@intel.com> Cc: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-05-13hwmon: fix error return code in abituguru_probe()Wei Yongjun
Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Cc: stable@vger.kernel.org Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-05-13hwmon: (iio_hwmon) Fix null pointer dereferenceAxel Lin
This patch fixes the null pointer dereference in goto error_release_channels path when allocate memory for st fails. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-05-12hwmon: (nct6775) Do not create non-existing attributesGuenter Roeck
Overtemperature and hysteresis registers only exist for primary temperature registers, not for alternates, so do not assign those registers when initializing alternates. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-05-12hwmon: (iio_hwmon) Fix missing iio_channel_release_all call if devm_kzalloc failAxel Lin
Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-05-04Merge branch 'hwmon-for-linus' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging Pull hwmon update from Jean Delvare: "Only lm75 driver updates this time" * 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging: hwmon: (lm75) Add support for the Dallas/Maxim DS7505 hwmon: (lm75) Tune resolution and sample time per chip hwmon: (lm75) Prepare to support per-chip resolution and sample time hwmon: (lm75) Per-chip configuration register initialization
2013-05-04more mode_t whack-a-mole...Al Viro
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-05-04hwmon: (lm75) Add support for the Dallas/Maxim DS7505Jean Delvare
Basically it's the same as the original DS75 but much faster. Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Guenter Roeck <linux@roeck-us.net>
2013-05-04hwmon: (lm75) Tune resolution and sample time per chipJean Delvare
Most LM75-compatible chips can either sample much faster or with a much better resolution than the original LM75 chip. So far the lm75 driver did not let the user take benefit of these improvements. Do it now. I decided to almost always configure the chip to use the best resolution possible, which also means the longest sample time. The only chips for which I didn't are the DS75, DS1775 and STDS75, because they are really too slow in 12-bit mode (1.2 to 1.5 second worst case) so I went for 11-bit mode as a more reasonable tradeoff. This choice is dictated by the fact that the hwmon subsystem is meant for system monitoring, it has never been supposed to be ultra-fast, and as a matter of fact we do cache the sampled values in almost all drivers. If anyone isn't pleased with these default settings, they can always introduce a platform data structure or DT support for the lm75. That being said, it seems nobody ever complained that the driver wouldn't refresh the value faster than every 1.5 second, and the change made it faster for all chips even in 12-bit mode, so I don't expect any complaint. Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Guenter Roeck <linux@roeck-us.net>
2013-05-04hwmon: (lm75) Prepare to support per-chip resolution and sample timeJean Delvare
Prepare the lm75 driver to support per-chip resolution and sample time. For now we only make the code generic enough to support it, but we still use the same, unchanged resolution (9-bit) and sample time (1.5 s) for all chips. Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Guenter Roeck <linux@roeck-us.net>
2013-05-04hwmon: (lm75) Per-chip configuration register initializationJean Delvare
There is no standard for the configuration register bits of LM75-like chips. We shouldn't blindly clear bits setting the resolution as they are either unused or used for something else on some of the supported chips. So, switch to per-chip configuration initialization. This will allow for better tuning later, for example using more resolution bits when available. Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Guenter Roeck <linux@roeck-us.net>