summaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/nct6775.c
Commit message (Collapse)AuthorAgeFilesLines
* hwmon: (nct6683,nct6775) constify sensor_template_group structuresJulia Lawall2015-12-181-5/+6
| | | | | | | | | | The sensor_template_group structures are never modified, so declare them as const. Done with the help of Coccinelle. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (nct6775) Introduce separate temperature labels for NCT6792 and NCT6793Guenter Roeck2015-10-301-1/+82
| | | | | | | | | NCT6792 and NCT6793 are mostly register compatible to NCT6791, but temperature sources are different and difficult to manage with a single temperature label array. Introduce separate temperature label arrays for those chips to reflect the differences. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (nct6775) NCT6791D and NCT6792D have an additional temperature sourceGuenter Roeck2015-10-301-5/+13
| | | | | | | | Both NCT6791D and NCT6792D permit selection of a 'virtual' temperature register as temperature source. The virtual temperature registers are registers 0xea to 0xef in bank 0 and can be written by software. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (nct6775) Add support for NCT6793DGuenter Roeck2015-09-121-16/+32
| | | | | | | | | | | NCT6793D is register compatible with NCT6792D. Also move nct6775_sio_names[] closer to enum kinds to simplify adding new chips. Tested-by: Grazvydas Ignotas <notasas@gmail.com> Reviewed-by: Jean Delvare <jdelvare@suse.de> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (nct6775) Swap STEP_UP_TIME and STEP_DOWN_TIME registers for most chipsGuenter Roeck2015-09-121-6/+10
| | | | | | | | | | The STEP_UP_TIME and STEP_DOWN_TIME registers are swapped for all chips but NCT6775. Reported-by: Grazvydas Ignotas <notasas@gmail.com> Reviewed-by: Jean Delvare <jdelvare@suse.de> Cc: stable@vger.kernel.org # v3.10+ Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (nct6775) Add missing sysfs attribute initializationGuenter Roeck2015-05-291-0/+2
| | | | | | | | | | | | | | | | | | | The following error message is seen when loading the nct6775 driver with DEBUG_LOCK_ALLOC enabled. BUG: key ffff88040b2f0030 not in .data! ------------[ cut here ]------------ WARNING: CPU: 0 PID: 186 at kernel/locking/lockdep.c:2988 lockdep_init_map+0x469/0x630() DEBUG_LOCKS_WARN_ON(1) Caused by a missing call to sysfs_attr_init() when initializing sysfs attributes. Reported-by: Alexey Orishko <alexey.orishko@gmail.com> Reviewed-by: Jean Delvare <jdelvare@suse.de> Cc: stable@vger.kernel.org # v3.12+ Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (nct6775) Enable auxiliary fan monitoring on ASRock Z77 Pro4-MGuenter Roeck2015-03-151-0/+21
| | | | | | | Auxiliary fan monitoring is not enabled on ASRock Z77 Pro4-M with BIOS version 2.00 if booted in UEFI Ultra-FastBoot mode. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (nct6775) Restore hardware monitoring logical device status on resumeGuenter Roeck2015-03-151-13/+22
| | | | | | | After a suspend/resume cycle it is not guaranteed that the hardware monitoring device is still enabled. Ensure that this is the case after resume. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (nct6775) Convert to use SIMPLE_DEV_PM_OPSGuenter Roeck2015-03-151-17/+5
| | | | | | | Get rid of #ifdef CONFIG_PM by using SIMPLE_DEV_PM_OPS and declaring suspend and resume functions with __maybe_unused. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* Merge tag 'driver-core-3.19-rc1' of ↵Linus Torvalds2014-12-141-1/+0
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core Pull driver core update from Greg KH: "Here's the set of driver core patches for 3.19-rc1. They are dominated by the removal of the .owner field in platform drivers. They touch a lot of files, but they are "simple" changes, just removing a line in a structure. Other than that, a few minor driver core and debugfs changes. There are some ath9k patches coming in through this tree that have been acked by the wireless maintainers as they relied on the debugfs changes. Everything has been in linux-next for a while" * tag 'driver-core-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (324 commits) Revert "ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries" fs: debugfs: add forward declaration for struct device type firmware class: Deletion of an unnecessary check before the function call "vunmap" firmware loader: fix hung task warning dump devcoredump: provide a one-way disable function device: Add dev_<level>_once variants ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries ath: use seq_file api for ath9k debugfs files debugfs: add helper function to create device related seq_file drivers/base: cacheinfo: remove noisy error boot message Revert "core: platform: add warning if driver has no owner" drivers: base: support cpu cache information interface to userspace via sysfs drivers: base: add cpu_device_create to support per-cpu devices topology: replace custom attribute macros with standard DEVICE_ATTR* cpumask: factor out show_cpumap into separate helper function driver core: Fix unbalanced device reference in drivers_probe driver core: fix race with userland in device_add() sysfs/kernfs: make read requests on pre-alloc files use the buffer. sysfs/kernfs: allow attributes to request write buffer be pre-allocated. fs: sysfs: return EGBIG on write if offset is larger than file size ...
| * hwmon: drop owner assignment from platform_driversWolfram Sang2014-10-201-1/+0
| | | | | | | | | | | | | | A platform_driver does not need to set an owner, it will be populated by the driver core. Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
* | hwmon: (nct6775) Add blank lines after declarationsGuenter Roeck2014-11-301-6/+24
| | | | | | | | | | | | | | | | | | | | | | checkpatch complains about WARNING: Missing a blank line after declarations Add missing blank lines. Also reorder variables length-wise where appropriate if a function header is touched anyway. Reviewed-by: Jean Delvare <jdelvare@suse.de> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | hwmon: (nct6775) Add support for NCT6792DGuenter Roeck2014-11-301-10/+37
|/ | | | | | | | NCT6792D is similar to NCT6791D. Only beep control and temperature monitoring registers are different. Reviewed-by: Jean Delvare <jdelvare@suse.de> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (nct6775) Remove num_attr_groups from struct nct6775_dataAxel Lin2014-08-041-6/+6
| | | | | | | num_attr_groups is only used in nct6775_probe(), make it to be local variable. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (nct6775) Update module description and Kconfig for NCT6106D and NCT6791DAxel Lin2014-08-041-1/+1
| | | | | | | | This driver also supports NCT6106D and NCT6791D, thus update module description and Kconfig accordingly. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (nct6775) Fix probe unwind paths to properly unregister platform devicesAxel Lin2014-05-241-3/+5
| | | | | | | | Call platform_device_unregister() rather than platform_device_put() to unregister successfully registered platform devices. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* Merge branch 'hwmon-for-linus' of ↵Linus Torvalds2014-01-291-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging Pull hwmon updates from Jean Delvare: "This include it87 driver improvements, and a tree-wide change of my e-mail address" * 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging: Update Jean Delvare's e-mail address hwmon: (it87) Print proper names for the IT8771E and IT8772E hwmon: (it87) Add support for the ITE IT8603E
| * Update Jean Delvare's e-mail addressJean Delvare2014-01-291-1/+1
| | | | | | | | Signed-off-by: Jean Delvare <khali@linux-fr.org>
* | hwmon: (nct6775) Re-enable logical device mapping for NCT6791 during resumeGuenter Roeck2014-01-141-11/+27
|/ | | | | | | | After a suspend/resume cycle, the NCT6791 is back to its original BIOS programming. In this state, HWMON IO access may be locked. Re-enable it during resume. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (nct6775) NCT6791 supports weight control only for CPUFANGuenter Roeck2013-11-181-8/+21
| | | | | | | | Unlike other chips supported by this driver, the NCT6791 only has a single set of registers to configure weighted fan control. Enable it only for the single channel supporting it. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (nct6775) Monitor additional temperature registersGuenter Roeck2013-11-181-2/+60
| | | | | | | | | | | The number of SMIOVT registers on NCT6779 and NCT6791 is limited to 2. As result, the driver may not report some of the temperatures used for fan control. This can result in some of the pwmX_temp_sel or pwm2_weight_temp_sel attributes to wrongly return 0. Fortunately, the chip has registers to monitor those temperatures. Add them to the list of temperatures to report. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (nct6775) Remove an unused variableDan Carpenter2013-10-191-2/+2
| | | | | | | We don't actually use "j" for anything. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (nct6775) fix coccinelle warningsFengguang Wu2013-10-181-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>
* hwmon: (nct6775) Convert to use devm_hwmon_device_register_with_groupsGuenter Roeck2013-10-131-16/+5
| | | | Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (nct6775) Convert to use hwmon_device_register_with_groupsGuenter Roeck2013-10-131-86/+36
| | | | Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (nct6775) Check array index when accessing temp_offsetGuenter Roeck2013-10-131-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>
* hwmon: (nct6775) Use return value from find_temp_sourceGuenter Roeck2013-10-131-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>
* hwmon: (nct6775) Add support for hibernateHarald Judt2013-08-111-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>
* hwmon: use dev_get_platdata()Jingoo Han2013-08-111-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>
* hwmon: (nct6775) Fix size of data->temp arrayDan Carpenter2013-08-111-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>
* hwmon: (nct6775) Avoid using device platform data outside probe functionGuenter Roeck2013-08-111-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>
* hwmon: (nct6775) Add support for NCT6791DDavid Bartley2013-08-111-74/+207
| | | | | Signed-off-by: David Bartley <andareed@gmail.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (nct6775) Add support for beep attributesGuenter Roeck2013-08-111-21/+218
| | | | Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (nct6775) Add support for critical low/high temperature limits on NCT6106Guenter Roeck2013-08-111-9/+34
| | | | Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (nct6775) Add support for NCT6102D/6106DGuenter Roeck2013-08-111-25/+225
| | | | Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (nct6775) Support two SuperIO chips in the same systemGuenter Roeck2013-08-111-50/+63
| | | | Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (nct6775) Allocate attributes dynamically from templatesGuenter Roeck2013-08-111-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>
* hwmon: (nct6775) Drop unsupported fan alarm attributes for NCT6775Guenter Roeck2013-06-271-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>
* hwmon: (nct6775) Fix temperature alarm attributesGuenter Roeck2013-06-271-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>
* hwmon: (nct6775) Do not create non-existing attributesGuenter Roeck2013-05-111-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>
* hwmon: (nct6775) Fix coding style problemsGuenter Roeck2013-04-211-3/+3
| | | | | | Add space around binary operators (CodingStyle, chapter 3.1). Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (nct6775) Constify stringsGuenter Roeck2013-04-211-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>
* hwmon: (nct6775) Use ARRAY_SIZE for loops where possibleGuenter Roeck2013-04-131-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>
* hwmon: (nct6775) Enable both AUXTIN and VIN3 on NCT6776Guenter Roeck2013-04-071-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>
* hwmon: (nct6775) Expand scope of supported chipsGuenter Roeck2013-04-071-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>
* hwmon: (nct6775) Drop read/write lockGuenter Roeck2013-04-071-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>
* hwmon: (nct6775) Only report VID if supported and enabledGuenter Roeck2013-04-071-6/+24
| | | | | | VID is not always enabled (NCT6775, NCT6776) or supported (NCT6779). Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (nct6775) Detect and report additional temperature sourcesGuenter Roeck2013-04-071-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>
* hwmon: (nct6775) Add support for weighted fan controlGuenter Roeck2013-04-071-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>
* hwmon: (nct6775) Add support for automatic fan controlGuenter Roeck2013-04-071-7/+1092
| | | | Signed-off-by: Guenter Roeck <linux@roeck-us.net>
OpenPOWER on IntegriCloud