aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon
Commit message (Collapse)AuthorAge
...
* | | | hwmon: (max16065) Convert to use devm_hwmon_device_register_with_groupsGuenter Roeck2013-10-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Modify code to use is_visible to determine if an attribute should be created or not, then use devm_hwmon_device_register_with_groups to create the hwmon device and all attributes in one operation. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | | hwmon: (max6697) Convert to use devm_hwmon_device_register_with_groupsGuenter Roeck2013-10-13
| | | | | | | | | | | | | | | | Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | | hwmon: (lm73) Convert to use devm_hwmon_device_register_with_groupsGuenter Roeck2013-10-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Also introduce new variable dev pointing to client->dev in the probe function, and use new macro ATTRIBUTE_GROUPS to declare attribute groups. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | | hwmon: (max6642) Convert to use devm_hwmon_device_register_with_groupsGuenter Roeck2013-10-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also rename new_client variable to client and introduce new variable dev pointing to client->dev in the probe function, and use new macro ATTRIBUTE_GROUPS to declare attribute groups. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | | hwmon: (ds1621) Convert to use devm_hwmon_device_register_with_groupsGuenter Roeck2013-10-13
| | | | | | | | | | | | | | | | | | | | | | | | Also use new macro __ATTRIBUTE_GROUPS to declare attribute groups. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | | hwmon: (nct6775) Convert to use devm_hwmon_device_register_with_groupsGuenter Roeck2013-10-13
| | | | | | | | | | | | | | | | Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | | hwmon: Provide managed hwmon registrationGuenter Roeck2013-10-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Drivers using the new hwmon_device_register_with_groups API often have a remove function which consists solely of a call hwmon_device_unregister(). Provide support for devm_hwmon_device_register_with_groups and devm_hwmon_device_unregister to allow this repeated code to be removed and help eliminate error handling code. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | | hwmon: (nct6775) Convert to use hwmon_device_register_with_groupsGuenter Roeck2013-10-13
| | | | | | | | | | | | | | | | Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | | hwmon: (pmbus) Convert to use hwmon_device_register_with_groupsGuenter Roeck2013-10-13
| | | | | | | | | | | | | | | | Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | | hwmon: (ltc4245) Convert to use hwmon_device_register_with_groupsGuenter Roeck2013-10-13
| | | | | | | | | | | | | | | | Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | | hwmon: (gpio-fan) Convert to use hwmon_device_register_with_groupsGuenter Roeck2013-10-13
| | | | | | | | | | | | | | | | Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | | hwmon: (ds1621) Convert to use hwmon_device_register_with_groupsGuenter Roeck2013-10-13
| | | | | | | | | | | | | | | | Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | | hwmon: Introduce hwmon_device_register_with_groupsGuenter Roeck2013-10-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | hwmon_device_register_with_groups() lets callers register a hwmon device together with all sysfs attributes in a single call. When using hwmon_device_register_with_groups(), hwmon attributes are attached to the hwmon device directly and no longer with its parent device. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | | hwmon: (f71882fg) Remove extra return statementGuenter Roeck2013-10-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Leftover from commit 33cd66e3 (hwmon: (f71882fg) Convert to use devm_ functions). Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | | hwmon: (f75375s) Don't crash the kernel unnecessarilyGuenter Roeck2013-10-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The f75375s driver crashes the kernel if it detects an an internal implementation error. While the detected conditions suggest that there is a bug in the code, the condition is not fatal. Replace BUG() with WARN(). Cc: Riku Voipio <riku.voipio@iki.fi> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | | hwmon: (atxp1) Set and use error code from vid_to_reg()Guenter Roeck2013-10-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | vid_to_reg() returns -1 if it encounters an error. Return -EINVAL instead. Its only caller, atxp1_storevcore(), doesn't use the return code but returns -1 instead, which is wrong anyway as it means -EPERM. Use the return value from vid_to_reg() instead to report the error. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Reviewed-by: Jean Delvare <khali@linux-fr.org>
* | | | hwmon: (acpi_power_meter) Use return value from acpi_bus_register_driverGuenter Roeck2013-10-13
| | | | | | | | | | | | | | | | | | | | | | | | acpi_bus_register_driver() returns a valid error code. Use it. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | | hwmon: (acpi_power_meter) Don't crash the kernel unnecessarilyGuenter Roeck2013-10-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | acpi_power_meter crashes the kernel if it detects an unexpected event or an internal implementation error. While the detected conditions suggest that there is a bug in the code, the condition is not fatal. Replace BUG() with WARN(). Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | | hwmon: (gpio_fan) Use error value returned from get_fan_speed_index()Guenter Roeck2013-10-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | get_fan_speed_index() returns -EINVAL in case of errors, only to have it ignored and replaced with -ENODEV. Make it return -ENODEV and use it. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | | hwmon: (adt7462) Use error value returned from find_trange_value()Guenter Roeck2013-10-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | find_trange_value() returns -ENODEV in case of errors, only to have it ignored and replaced with -EINVAL. Make it return -EINVAL and use it. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Reviewed-by: Jean Delvare <khali@linux-fr.org>
* | | | hwmon: (pmbus) Don't unnecessarily crash the kernelGuenter Roeck2013-10-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | pmbus code currently crashes the kernel if it detects an internal implementation error. While the detected condition suggests that there is a bug in the code, it is hardly fatal. Therefore, it should not trigger a crash. Replace BUG() with WARN(). Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | | hwmon: (mc13783-adc) Increase size of name stringGuenter Roeck2013-10-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | smatch complains about mc13783_adc_probe() error: snprintf() chops off the last chars of 'id->name': 20 +vs 10 Use PLATFORM_NAME_SIZE instead of '10' as size when declaring the name variable. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | | hwmon: (nct6775) Check array index when accessing temp_offsetGuenter Roeck2013-10-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | smatch complains about a potential out-of-bounds access to the temp_offset array. That doesn't happen in practice, but it doesn't hurt to add an explicit check either. This prevents potential problems in the future (for example if the number of 'fixed' temperature sensors is increased to add support for another chip). Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | | hwmon: (nct6775) Use return value from find_temp_sourceGuenter Roeck2013-10-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | smatch complains that we don't use the return value from find_temp_source(). Valid point, only find_temp_source() doesn't return a valid error code. Have it return a valid error code and use it. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | | hwmon: Remove unnecessary semicolonsGuenter Roeck2013-10-13
|/ / / | | | | | | | | | | | | | | | | | | | | | Semicolons after closing } of conditional blocks are not needed and can be removed. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Reviewed-by: Jean Delvare <khali@linux-fr.org>
* / / hwmon: (applesmc) Always read until end of dataHenrik Rydberg2013-10-09
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The crash reported and investigated in commit 5f4513 turned out to be caused by a change to the read interface on newer (2012) SMCs. Tests by Chris show that simply reading the data valid line is enough for the problem to go away. Additional tests show that the newer SMCs no longer wait for the number of requested bytes, but start sending data right away. Apparently the number of bytes to read is no longer specified as before, but instead found out by reading until end of data. Failure to read until end of data confuses the state machine, which eventually causes the crash. As a remedy, assuming bit0 is the read valid line, make sure there is nothing more to read before leaving the read function. Tested to resolve the original problem, and runtested on MBA3,1, MBP4,1, MBP8,2, MBP10,1, MBP10,2. The patch seems to have no effect on machines before 2012. Tested-by: Chris Murphy <chris@cmurf.com> Cc: stable@vger.kernel.org Signed-off-by: Henrik Rydberg <rydberg@euromail.se> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* / hwmon: (applesmc) Check key count before proceedingHenrik Rydberg2013-09-26
|/ | | | | | | | | | | | | After reports from Chris and Josh Boyer of a rare crash in applesmc, Guenter pointed at the initialization problem fixed below. The patch has not been verified to fix the crash, but should be applied regardless. Reported-by: <jwboyer@fedoraproject.org> Suggested-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Henrik Rydberg <rydberg@euromail.se> Cc: stable@vger.kernel.org Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (k10temp) remove unnecessary pci_set_drvdata()Jingoo Han2013-09-12
| | | | | | | | | | The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Acked-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (tmp421) Fix return valueSachin Kamat2013-09-11
| | | | | | | | | Propagate return value obtained from i2c_smbus_read_byte_data() instead of hardcoding. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Cc: Andre Prendel <andre.prendel@gmx.de> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (amc6821) Remove redundant breakSachin Kamat2013-09-11
| | | | | | | | 'break' after return or goto has no effect. Remove it. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Cc: T. Mertelj <tomaz.mertelj@guest.arnes.si> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (amc6821) Fix return valueSachin Kamat2013-09-11
| | | | | | | | | Propagate return value obtained from i2c_smbus_read_byte_data() instead of hardcoding. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Cc: T. Mertelj <tomaz.mertelj@guest.arnes.si> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (ibmaem) Fix return valueSachin Kamat2013-09-11
| | | | | | | | | | Propagate appropriate error code obtained from ipmi_create_user() instead of hardcoding. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Cc: Darrick J. Wong <darrick.wong@oracle.com> Acked-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (emc2103) Fix return valueSachin Kamat2013-09-11
| | | | | | | | | | kstrtol() returns appropriate error values. Use those instead of hardcoding. Silences several sparse messages of following type: "why not propagate 'result' from kstrtol() instead of (-22)?" Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Cc: Steve Glendinning <steve.glendinning@shawell.net> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (ina2xx) Remove casting the return value which is a void pointerJingoo Han2013-09-10
| | | | | | | | | | Casting the return value which is a void pointer is redundant. The conversion from void pointer to any other pointer type is guaranteed by the C programming language. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Acked-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (hwmon-vid) Add __maybe_unused attribute to dummy variableGuenter Roeck2013-09-10
| | | | | | | | | | | This gets rid of this warning: drivers/hwmon/hwmon-vid.c: In function 'get_via_model_d_vrm': drivers/hwmon/hwmon-vid.c:249:27: warning: variable 'dummy' set but not used [-Wunused-but-set-variable] Signed-off-by: Guenter Roeck <linux@roeck-us.net> Reviewed-by: Jean Delvare <khali@linux-fr.org>
* Merge branch 'hwmon-for-linus' of ↵Linus Torvalds2013-09-07
|\ | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging Pull hwmon fixes from Jean Delvare. * 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging: hwmon: (emc6w201) Do not declare enum variable hwmon: (w83792d) Update module author
| * hwmon: (emc6w201) Do not declare enum variableGuenter Roeck2013-09-06
| | | | | | | | | | | | | | | | | | | | | | | | Fix the following smatch warning: emc6w201.c:52:26: warning: symbol 'subfeature' was not declared. Should it be static? 'enum { } subtype' declares an enum as (global) variable which we don't want. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Jean Delvare <khali@linux-fr.org>
| * hwmon: (w83792d) Update module authorShane Huang2013-09-06
| | | | | | | | | | | | | | | | w83792d was written by me in 2004, I'd like to update my first name into my current one to keep consistent, and delete invalid address. Signed-off-by: Shane Huang <shane.huang@amd.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
* | Merge tag 'hwmon-for-linus' of ↵Linus Torvalds2013-09-03
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging Pull hwmon updates from Guenter Roeck: - new driver for HTU21D (humidity sensor) - add support for Fam16h (Kabini) to k10temp - add support for NCT6102D/6106D and NCT6791D to nct6775 driver - add support for ADS1115 to ads1015 driver - add support for hibernate to w83627ehf and nct6775 drivers - some minor cleanups * tag 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: hwmon: (htu21) Add Measurement Specialties HTU21D support hwmon: Change my email address. hwmon: (k10temp) Add support for Fam16h (Kabini) hwmon: (adt7462) ADT7462_REG_VOLT_MAX() should return 0 hwmon: (ads1015) Add support for ADS1115 hwmon: (w83627ehf) Add support for hibernate hwmon: (nct6775) Add support for hibernate hwmon: use dev_get_platdata() hwmon: (nct6775) Fix size of data->temp array hwmon: (nct6775) Avoid using device platform data outside probe function hwmon: (nct6775) Add support for NCT6791D hwmon: (nct6775) Add support for beep attributes hwmon: (nct6775) Add support for critical low/high temperature limits on NCT6106 hwmon: (nct6775) Add support for NCT6102D/6106D hwmon: (nct6775) Support two SuperIO chips in the same system hwmon: (nct6775) Allocate attributes dynamically from templates hwmon: (coretemp) Atom CPUs don't support TjMax; no warning needed
| * | hwmon: (htu21) Add Measurement Specialties HTU21D supportWilliam Markezana2013-08-29
| | | | | | | | | | | | | | | | | | Signed-off-by: William Markezana <william.markezana@meas-spec.com> [Guenter Roeck - minor formatting changes] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
| * | hwmon: Change my email address.Darrick J. Wong2013-08-27
| | | | | | | | | | | | | | | | | | | | | I've changed employers, so change the email addresses to match. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
| * | hwmon: (k10temp) Add support for Fam16h (Kabini)Wei Hu2013-08-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The temperature reporting interface stays the same, so we just add the PCI-ID to the list. Verified on AMD Olive Hill. Signed-off-by: Wei Hu <wei@aristanetworks.com> Acked-by: Clemens Ladisch <clemens@ladisch.de> Cc: stable@vger.kernel.org # 3.10+ Signed-off-by: Guenter Roeck <linux@roeck-us.net>
| * | hwmon: (adt7462) ADT7462_REG_VOLT_MAX() should return 0Dan Carpenter2013-08-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The callers never check for negative but they sometimes check for zero returns: int reg = ADT7462_REG_VOLT_MAX(data, i); data->volt_max[i] = (reg ? i2c_smbus_read_byte_data(client, reg) : 0); Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
| * | hwmon: (ads1015) Add support for ADS1115Evgeniy Dushistov2013-08-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for ads1115 device to ads1015 driver. Based on work of Emiliano Carnati <carnatiatebneuro.com>. Tested on ARM CPU based board. Signed-off-by: Evgeniy A. Dushistov <dushistov@mail.ru> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
| * | hwmon: (w83627ehf) Add support for hibernateHarald Judt2013-08-12
| | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | hwmon: (nct6775) Add support for hibernateHarald Judt2013-08-12
| | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | hwmon: use dev_get_platdata()Jingoo Han2013-08-12
| | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | hwmon: (nct6775) Fix size of data->temp arrayDan Carpenter2013-08-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | hwmon: (nct6775) Avoid using device platform data outside probe functionGuenter Roeck2013-08-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | hwmon: (nct6775) Add support for NCT6791DDavid Bartley2013-08-12
| | | | | | | | | | | | | | | Signed-off-by: David Bartley <andareed@gmail.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>