summaryrefslogtreecommitdiffstats
path: root/drivers/hwmon (follow)
Commit message (Collapse)AuthorAgeFilesLines
* hwmon: (fam15h_power) Add ratio of Tsample to the PTSC periodHuang Rui2015-08-271-1/+15
| | | | | | | | | | | | | This patch adds a member (cpu_pwr_sample_ratio) of fam15h_power_data, that represents the ratio of compute unit power accumulator sample period to the PTSC counter period. Tsample: compute unit power accumulator sample period Tref: the performance timestamp counter period PTSC: performance timestamp counter Signed-off-by: Huang Rui <ray.huang@amd.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (fam15h_power) Update running_avg_capture bit field to 28Huang Rui2015-08-271-2/+13
| | | | | | | | On Carrizo and later platforms, running_avg_capture bit field is extended to 4:31 (28 bits) from 4:25. Signed-off-by: Huang Rui <ray.huang@amd.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (fam15h_power) Rename fam15h_power_is_internal_node0 functionHuang Rui2015-08-271-2/+2
| | | | | | | | | We rename fam15h_power_is_internal_node0() function to should_load_on_this_node(), because it may not be node0 from KV and on, and they are single-node processors. Signed-off-by: Huang Rui <ray.huang@amd.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (fam15h_power) Add support for AMD CarrizoHuang Rui2015-08-271-0/+1
| | | | | | | | | AMD Carrizo(Fam15h, M60h) processors can report power1_crit (ProcessorPwrWatts) and power1_input (CurrPwrWatts) values. And this patch adds support for CZ. Signed-off-by: Huang Rui <ray.huang@amd.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (ltc2978) Add support for LTM4675Guenter Roeck2015-08-192-3/+9
| | | | | | | LTM2975 is a dual 9A or single 18A μModule regulator. It is register compatible with LTM4676. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (ltc2978) Add polling for chips requiring itMichael Jones2015-08-191-10/+101
| | | | | | | | | Some of the LTC chips supported by this driver have to be polled to ensure that they are ready to accept commands. Signed-off-by: Michael Jones <mike@proclivis.com> [Guenter Roeck: simplifications and formatting changes] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (pmbus) Enable PEC if the controller supports itGuenter Roeck2015-08-191-0/+5
| | | | | | | | PMBus controllers optionally support PEC. Configure the driver to use it if available to improve operational security. Suggested-by: Michael Jones <mike@proclivis.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (pmbus) Use BIT macroGuenter Roeck2015-08-195-102/+107
| | | | | | Using the BIT macro makes the code a little easier to read. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (ltc2978) Add support for LTC3886Guenter Roeck2015-08-182-3/+23
| | | | | | | | | | LTC3886 is a is a dual PolyPhase DC/DC synchronous step-down switching regulator controller. It is mostly command compatible to LTC3883, but supports two phases instead of one. Suggested-by: Michael Jones <mike@proclivis.com> Tested-by: Michael Jones <mike@proclivis.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (ltc2978) Add support for LTC2980 and LTM2987Guenter Roeck2015-08-182-5/+19
| | | | | | | | | | LTC2980 and LTM2987 are command compatible to LTC2977. They consist of two LTC2977 on a single die, and are instantiated as two separate chips, each supporting eight channels. Suggested-by: Michael Jones <mike@proclivis.com> Tested-by: Michael Jones <mike@proclivis.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (ltc2978) Add missing chip IDs for LTC2978 and LTC3882Guenter Roeck2015-08-181-3/+8
| | | | | | | | | | | Add additional chip ID for an older revision of LTC2978, as well as two chip IDs for LTC3882. Turns out the LTC3882 does support the LTC2978_MFR_SPECIAL_ID register, and reading it returns its chip ID, but the register is undocumented. Suggested-by: Michael Jones <mike@proclivis.com> Tested-by: Michael Jones <mike@proclivis.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (ltc2978) Use correct ID mask to detect all chipsGuenter Roeck2015-08-181-22/+17
| | | | | | | | | | Per information from Linear Technologies, the ID mask is 12 bit for all chips of this series. Use this mask to detect chips to ensure that all chip revisions are detected. Suggested-by: Michael Jones <mike@proclivis.com> Tested-by: Michael Jones <mike@proclivis.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (ltc2978) Introduce helper functions for min and max valuesGuenter Roeck2015-08-171-91/+57
| | | | | | | | The code used to determine historic low and high peaks is repeated several times. Introduce helper functions to simplify it. Tested-by: Michael Jones <mike@proclivis.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (ltc2978) Introduce feature flagsGuenter Roeck2015-08-171-12/+18
| | | | | | | | It is becoming cumbersom to track per-chip feature support. Introduce feature flag to simplify the code. Tested-by: Michael Jones <mike@proclivis.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (pmbus) Convert command register definitions to enumGuenter Roeck2015-08-171-140/+142
| | | | | | | This will simplify adding new virtual commands. Tested-by: Michael Jones <mike@proclivis.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (ltc2978) Add support for LTC2975Guenter Roeck2015-08-172-12/+96
| | | | | | | | LTC2975 is mostly compatible to LTC2974, but supports input current and power measurement. Tested-by: Michael Jones <mike@proclivis.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (ltc2978) Add support for LTC3887Guenter Roeck2015-08-122-6/+16
| | | | | | LTC3887 is an enhanced version of LTC3880 and supports the same commands. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (ltc2978) Add additional chip IDs for LTM4676 and LTM4676AGuenter Roeck2015-08-121-2/+6
| | | | | | | | | | | | | | | Per datasheet, the chip ID for LTM4676 is 0x448x. This was observed in real systems. In addition to that, chip ID 0x4401 was observed as well. Research shows that the chip ID has been changed from 0x440x to 0x448x in datasheet revision C. Add support for the additional chip ID. Also add the chip ID for LTM4676A, which is functionally identical to LTM4676. Reported-by: Ananda Babu Nettam <anandab@juniper.net> Cc: Ananda Babu Nettam <anandab@juniper.net> Cc: Amit U Jain <amjain@juniper.net> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (ltc2978) Add support for LTC3882Guenter Roeck2015-08-121-6/+44
| | | | | | | | LTC3882 is mostly compatible with LTC3880. Major differences are that it does not measure the input current, and it no longer supports LTC's legacy mechanism to identify the chip. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (ltc2978) Move code to read chip ID into separate functionGuenter Roeck2015-08-121-19/+29
| | | | | | | | | Verifying the chip type is getting more complicated with new chips, since not all chips support the same mechanism to read the chip type. Move the code into a separate function to simplify adding support for those chips. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon:change sht15_reverse()yalin wang2015-08-111-16/+4
| | | | | | | This change sht15_reverse() to be generic bitrev8(). Signed-off-by: yalin wang <yalin.wang2010@gmail.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (pmbus) Add device IDs for TPS544{B,C}2{0,5}Guenter Roeck2015-08-112-1/+6
| | | | | | | | Add device IDs and references for Texas Instruments TPS544B20, TPS544B25, TPS544C20, and TPS544C25 to the generic PMBus driver. Reviewed-by: Jean Delvare <jdelvare@suse.de> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (pmbus) Add support for MAX20751Guenter Roeck2015-08-093-0/+75
| | | | | | | | | | | MAX20751 is a multiphase power controller with internal buck converter. It uses VR12.0 to report the output voltage. This requires an explicit driver, since the VR version can not be auto-detected. The chip supports a manufacturer specific command to fine-tune the output voltage. This command is not currently supported. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (pmbus) Add support for VR12Guenter Roeck2015-08-093-4/+15
| | | | | | Newer chips such as MAX20751 support VR12. Add support for it. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (it87) Add support for IT8732FJustin Maggard2015-08-092-9/+38
| | | | | | | | | Add support for the IT8732F. This chip is pretty similar to IT8721F, with the main difference being that the ADC LSB is 10.9 mV instead of 12 mV. Signed-off-by: Justin Maggard <jmaggard@netgear.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (nct7802) Add auto_point attributesConstantine Shulyupin2015-08-091-4/+126
| | | | | | | | | Introduced REG_PWM, pwm[1..3]_auto_point[1..5]_temp, pwm[1..3]_auto_point[1..5]_pwm, nct7802_auto_point_attrs, nct7802_auto_point_group, updated nct7802_regmap_is_volatile Signed-off-by: Constantine Shulyupin <const@MakeLinux.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (lm70) add device tree supportRabin Vincent2015-08-091-1/+33
| | | | | | | Allow the lm70 to be probed from a device tree. Signed-off-by: Rabin Vincent <rabin@rab.in> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (ltc2978) LTM4676 supports CLEAR_PEAKSGuenter Roeck2015-08-091-1/+1
| | | | | | | Use the CLEAR_PEAKS command on LTM4676. Reviewed-by: Jean Delvare <jdelvare@suse.de> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (adm1275) Add support for ADM1293 and ADM1294Guenter Roeck2015-08-092-10/+135
| | | | | | | | ADM1293 and ADM1294 are mostly compatible with other chips of the same series, but have more configuration options. There are also some differences in register details. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (pmbus) Add support for lowest power value attributesGuenter Roeck2015-08-092-24/+34
| | | | | | Add support for powerX_input_lowest for both input and output power. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (adm1275) Introduce new feature flagsGuenter Roeck2015-08-091-43/+54
| | | | | | | | | | Introduce have_vout, have_vaux_status, have_pin_max, and have_uc_fault to simplify adding support for new chips. Also simplify error returns where appropriate to return immediately on error. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (adm1275) Introduce configuration data structure for coeffcientsGuenter Roeck2015-08-091-45/+68
| | | | | | | | Each new chip supported by the driver has a new set of coefficients, making hard-coding coefficients more and more cumbersome. Introduce a datastructure and table to simplify configuration. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (adm1275) Use BIT macroGuenter Roeck2015-08-091-9/+10
| | | | | | Use BIT macro to simplify adding new bit masks. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (pmbus_core) Constify pmbus_regulator_opsAxel Lin2015-08-092-2/+2
| | | | | | | pmbus_regulator_ops is not modified after initialized, so make it const. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (pmbus) Explicitly set regulator type for pmbus_regulator_opsAxel Lin2015-08-091-0/+1
| | | | | | | | The pmbus_regulator_ops is for voltage regulators, so explicitly set regulator type for better readability. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (g762) Drop owner assignment from struct i2c_driverKrzysztof Kozlowski2015-08-091-1/+0
| | | | | | | | i2c_driver does not need to set an owner because i2c_register_driver() will set it. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (f71882fg) Add support for f81768dGeorge Joseph2015-08-091-16/+29
| | | | | | | | | Add f81768d (id 0x1210) currently found on Jetway motherboards. It has 11 voltages but otherwise needed no special handling in this driver. Signed-off-by: George Joseph <george.joseph@fairview5.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (nct7802) Add pwmX_enable attributeConstantine Shulyupin2015-08-091-0/+48
| | | | | | | | Introduced REG_SMARTFAN_EN, SMARTFAN_EN_SHIFT, pwmX_enable, show_pwm_enable, store_pwm_enable. Signed-off-by: Constantine Shulyupin <const@MakeLinux.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon:(f71882fg) Fix f81866a voltage protectionPeter Hung2015-08-091-9/+41
| | | | | | | | | | | The f81866a voltage-1 protector(VIN1) address is differ from f71882. f71882 status:12H, beep:13H, v-high:32H f81866a status:16H, beep:17H, v-high:3aH Signed-off-by: Peter Hung <hpeter+linux_kernel@gmail.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (f71882fg) Fix f81866a temp/beep settingPeter Hung2015-08-091-8/+52
| | | | | | | | | | | | | | | | | The temperature value of Fintek F81866 is the same with f71882fg. It located with 0x6c + 2*(nr), others located with 0x6c + 2*(nr+1). We change the rule in f71882fg_probe(), If type = f71858fg/f8000/f81866a. the temp_start will set to 0, others are 1. The F81866 over-temperature beep setting is not the same with f71882fg too. They are using the same address 63H, but F81866 is using bit 0/1/2 & 4/5/6, others are using bit 1/2/3 & 5/6/7, So we copy from fxxxx_temp_beep_attr[] to f81866_temp_beep_attr and change bit setting. Signed-off-by: Peter Hung <hpeter+linux_kernel@gmail.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (f71882fg) Add support for F81866 and F71868Peter Hung2015-08-091-15/+38
| | | | | | | | | | | Add New Fintek SuperIO F81866(0x1010) & F71868(0x1106) with H/W Monitor functions. We increased F71882FG_MAX_INS from 9 to 10 to read F71868 10 voltage sets. Signed-off-by: Peter Hung <hpeter+linux_kernel@gmail.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (nct7802) Add pwm mode attributesConstantine Shulyupin2015-08-091-0/+26
| | | | | | Introduced: show_pwm_mode, pwm1_mode, pwm2_mode, pwm2_mode Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (nct7802) Add pwm controlConstantine Shulyupin2015-08-091-0/+47
| | | | | | | | | Added fan output control registers. Modes of operation are PWM (default) and DC. Introduced show_pwm, store_pwm, nct7802_pwm_attrs, nct7802_pwm_group. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (nct7802) add temperature sensor type attributeConstantine Shulyupin2015-08-091-12/+60
| | | | | | | | | | | | | | Sensor type: 3 diode (current mode), MD=1 4 thermistor, MD=2 Reference: Nuvoton Hardware Monitoring IC NCT7802Y 7.2.32 Mode Selection Register Location : Index 22h Signed-off-by: Constantine Shulyupin <const@MakeLinux.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (g762) Export OF module alias informationJavier Martinez Canillas2015-08-051-0/+1
| | | | | | | | | | | | | | | | | | | | | | | The I2C core always reports the MODALIAS uevent as "i2c:<client name" regardless if the driver was matched using the I2C id_table or the of_match_table. So technically there's no need for a driver to export the OF table since currently it's not used. In fact, the I2C device ID table is mandatory for I2C drivers since a i2c_device_id is passed to the driver's probe function even if the I2C core used the OF table to match the driver. And since the I2C core uses different tables, OF-only drivers needs to have duplicated data that has to be kept in sync and also the dev node compatible manufacturer prefix is stripped when reporting the MODALIAS. To avoid the above, the I2C core behavior may be changed in the future to not require an I2C device table for OF-only drivers and report the OF module alias. So, it's better to also export the OF table to prevent breaking module autoloading if that happens. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (nct7904) Export I2C module alias informationJavier Martinez Canillas2015-08-051-0/+1
| | | | | | | | | | | | The I2C core always reports the MODALIAS uevent as "i2c:<client name" regardless if the driver was matched using the I2C id_table or the of_match_table. So the driver needs to export the I2C table and this be built into the module or udev won't have the necessary information to auto load the correct module when the device is added. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Cc: stable@vger.kernel.org # v4.1+ Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (dell-smm) Blacklist Dell Studio XPS 8100Pali Rohár2015-08-051-1/+17
| | | | | | | | | | | | | CPU fan speed going up and down on Dell Studio XPS 8100 for unknown reasons. Without further debugging on the affected machine, it is not possible to find the problem. Link: https://bugzilla.kernel.org/show_bug.cgi?id=100121 Signed-off-by: Pali Rohár <pali.rohar@gmail.com> Tested-by: Jan C Peters <jcpeters89@gmail.com> Cc: stable@vger.kernel.org # v4.0+, will need backport [groeck: cleaned up description, comments] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (nct7802) Fix integer overflow seen when writing voltage limitsGuenter Roeck2015-07-301-1/+1
| | | | | | | | | | | Writing a large value into a voltage limit attribute can result in an overflow due to an auto-conversion from unsigned long to unsigned int. Cc: Constantine Shulyupin <const@MakeLinux.com> Reviewed-by: Jean Delvare <jdelvare@suse.de> Cc: stable@vger.kernel.org # v4.1+ Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (nct7904) Rename pwm attributes to match hwmon ABIGuenter Roeck2015-07-301-28/+29
| | | | | | | | pwm attributes have well defined names, which should be used. Cc: Vadim V. Vlasov <vvlasov@dev.rtsoft.ru> Cc: stable@vger.kernel.org #v4.1+ Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (w83627ehf) Use swap() in w82627ehf_swap_tempreg()Fabian Frederick2015-07-031-21/+5
| | | | | | | | | Use kernel.h macro definition. Thanks to Julia Lawall for Coccinelle scripting support. Signed-off-by: Fabian Frederick <fabf@skynet.be> Signed-off-by: Jean Delvare <jdelvare@suse.de>