summaryrefslogtreecommitdiff
path: root/drivers/hwmon/nct6775.c
AgeCommit message (Collapse)AuthorFilesLines
2013-10-18hwmon: (nct6775) fix coccinelle warningsFengguang Wu1-4/+1
drivers/hwmon/nct6775.c:3866:1-3: WARNING: PTR_RET can be used Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR Generated by: coccinelle/api/ptr_ret.cocci CC: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-10-14hwmon: (nct6775) Convert to use devm_hwmon_device_register_with_groupsGuenter Roeck1-16/+5
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-10-14hwmon: (nct6775) Convert to use hwmon_device_register_with_groupsGuenter Roeck1-86/+36
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-10-14hwmon: (nct6775) Check array index when accessing temp_offsetGuenter Roeck1-1/+2
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>
2013-10-14hwmon: (nct6775) Use return value from find_temp_sourceGuenter Roeck1-2/+2
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>
2013-08-12hwmon: (nct6775) Add support for hibernateHarald Judt1-0/+2
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 Han1-1/+1
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 Carpenter1-2/+2
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 Roeck1-26/+25
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 Bartley1-74/+207
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 Roeck1-21/+218
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-08-12hwmon: (nct6775) Add support for critical low/high temperature limits on NCT6106Guenter Roeck1-9/+34
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-08-12hwmon: (nct6775) Add support for NCT6102D/6106DGuenter Roeck1-25/+225
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-08-12hwmon: (nct6775) Support two SuperIO chips in the same systemGuenter Roeck1-50/+63
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-08-12hwmon: (nct6775) Allocate attributes dynamically from templatesGuenter Roeck1-1103/+507
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-06-27hwmon: (nct6775) Drop unsupported fan alarm attributes for NCT6775Guenter Roeck1-5/+7
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 Roeck1-23/+57
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-05-12hwmon: (nct6775) Do not create non-existing attributesGuenter Roeck1-2/+4
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-04-21hwmon: (nct6775) Fix coding style problemsGuenter Roeck1-3/+3
Add space around binary operators (CodingStyle, chapter 3.1). Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-04-21hwmon: (nct6775) Constify stringsGuenter Roeck1-1/+1
nct6775_sio_names should be a constant pointer to an array of constant strings. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-04-13hwmon: (nct6775) Use ARRAY_SIZE for loops where possibleGuenter Roeck1-8/+8
This ensures that the loop iterations are correct even if/when the number of elements in an array changes. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-04-08hwmon: (nct6775) Enable both AUXTIN and VIN3 on NCT6776Guenter Roeck1-37/+0
Per datasheet, VIN3 and AUXTIN share the same external pin. However, there is no clean way to detect this condition. Furthermore, both are reported by the BIOS on Supermicro C7H61. It may thus be possible that chip revisions exist where both attributes are supported at the same time. Better play safe and report both. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-04-08hwmon: (nct6775) Expand scope of supported chipsGuenter Roeck1-9/+8
NCT6775, NCT6776, and NCT6779 have a number of variants with the same chip ID but different chip labels. Add text "or compatible" to the message displayed when the driver is loaded and rephrase the Kconfig entry to reflect that it also supports compatible chips. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-04-08hwmon: (nct6775) Drop read/write lockGuenter Roeck1-10/+0
The read/write lock is acquired for each read/write operation from/to the chip. This occurs either during initialization, when it is not needed, or during updates, when the update_lock is held as well, and it is not needed either. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-04-08hwmon: (nct6775) Only report VID if supported and enabledGuenter Roeck1-6/+24
VID is not always enabled (NCT6775, NCT6776) or supported (NCT6779). Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-04-08hwmon: (nct6775) Detect and report additional temperature sourcesGuenter Roeck1-0/+33
Scan all temperature sources used for fan control and report if additional monitoring registers are available. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-04-08hwmon: (nct6775) Add support for weighted fan controlGuenter Roeck1-14/+266
The NCT677X series support weighted fan control. In this mode, a secondary temperature source is used in addition to the primary temperature source to control fan speed. Add support for this feature. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-04-08hwmon: (nct6775) Add support for automatic fan controlGuenter Roeck1-7/+1092
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-04-08hwmon: (nct6775) Add support for pwm, pwm_mode, and pwm_enableGuenter Roeck1-0/+329
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-04-08hwmon: (nct6775) Add power management supportGuenter Roeck1-0/+86
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-04-08hwmon: (nct6775) Add support for fan debounce module parameterGuenter Roeck1-0/+28
If set, fan debounce is enabled when loading the driver. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-04-08hwmon: (nct6775) Add support for fanX_pulses sysfs attributeGuenter Roeck1-0/+64
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-04-08hwmon: (nct6775) Add support for fan speed attributesGuenter Roeck1-1/+515
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-04-08hwmon: (nct6775) Add support for temperature sensorsGuenter Roeck1-3/+745
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-04-08hwmon: (nct6775) Add case open detectionGuenter Roeck1-0/+67
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-04-08hwmon: Driver for Nuvoton NCT6775F, NCT6776F, and NCT6779DGuenter Roeck1-0/+1021
This driver will replace the w83627ehf driver for NCT6775F and NCT6776F, and provides support for NCT6779D. This patch provides support for voltage monitor attributes. Signed-off-by: Guenter Roeck <linux@roeck-us.net>