summaryrefslogtreecommitdiff
path: root/drivers/hwmon/pmbus
AgeCommit message (Collapse)AuthorFilesLines
2022-05-12Merge commit '49caedb668e476c100d727f2174724e0610a2b92' of ↵Sujoy Ray3-5/+54
https://github.com/openbmc/linux into openbmc/dev-5.15-intel-bump_v5.15.36 Signed-off-by: Sujoy Ray <sujoy.ray@intel.com>
2022-04-18hwmon: (adm1275) Allow setting sample averagingPotin Lai1-1/+39
Current driver assume PWR_AVG and VI_AVG as 1 by default, and user needs to set sample averaging via sysfs manually. This patch parses the properties "adi,power-sample-average" and "adi,volt-curr-sample-average" from device tree, and setting sample averaging during probe. Input value must be one of value in the list [1, 2, 4, 8, 16, 32, 64, 128]. OpenBMC-Staging-Count: 1 Signed-off-by: Potin Lai <potin.lai@quantatw.com> Link: https://lore.kernel.org/r/20220302123817.27025-2-potin.lai@quantatw.com Signed-off-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20220418091728.23051-2-potin.lai@quantatw.com Signed-off-by: Joel Stanley <joel@jms.id.au>
2022-04-14Merge tag 'v5.15.34' into dev-5.15Joel Stanley1-4/+14
This is the 5.15.34 stable release Signed-off-by: Joel Stanley <joel@jms.id.au>
2022-04-08hwmon: (pmbus) Add Vin unit off handlingBrandon Wyman2-1/+2
[ Upstream commit a5436af598779219b375c1977555c82def1c35d0 ] If there is an input undervoltage fault, reported in STATUS_INPUT command response, there is quite likely a "Unit Off For Insufficient Input Voltage" condition as well. Add a constant for bit 3 of STATUS_INPUT. Update the Vin limit attributes to include both bits in the mask for clearing faults. If an input undervoltage fault occurs, causing a unit off for insufficient input voltage, but the unit is off bit is not cleared, the STATUS_WORD will not be updated to clear the input fault condition. Including the unit is off bit (bit 3) allows for the input fault condition to completely clear. Signed-off-by: Brandon Wyman <bjwyman@gmail.com> Link: https://lore.kernel.org/r/20220317232123.2103592-1-bjwyman@gmail.com Fixes: b4ce237b7f7d3 ("hwmon: (pmbus) Introduce infrastructure to detect sensors and limit registers") [groeck: Dropped unnecessary ()] Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-04-08hwmon: (pmbus) Add mutex to regulator opsPatrick Rudolph1-3/+13
[ Upstream commit 686d303ee6301261b422ea51e64833d7909a2c36 ] On PMBUS devices with multiple pages, the regulator ops need to be protected with the update mutex. This prevents accidentally changing the page in a separate thread while operating on the PMBUS_OPERATION register. Tested on Infineon xdpe11280 while a separate thread polls for sensor data. Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com> Signed-off-by: Marcello Sylvester Bauer <sylv@sylv.io> Link: https://lore.kernel.org/r/b991506bcbf665f7af185945f70bf9d5cf04637c.1645804976.git.sylv@sylv.io Fixes: ddbb4db4ced1b ("hwmon: (pmbus) Add regulator support") Cc: Alan Tull <atull@opensource.altera.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-03-21hwmon: (pmbus) Add Vin unit off handlingBrandon Wyman2-1/+2
If there is an input undervoltage fault, reported in STATUS_INPUT command response, there is quite likely a "Unit Off For Insufficient Input Voltage" condition as well. Add a constant for bit 3 of STATUS_INPUT. Update the Vin limit attributes to include both bits in the mask for clearing faults. If an input undervoltage fault occurs, causing a unit off for insufficient input voltage, but the unit is off bit is not cleared, the STATUS_WORD will not be updated to clear the input fault condition. Including the unit is off bit (bit 3) allows for the input fault condition to completely clear. OpenBMC-Staging-Count: 1 Signed-off-by: Brandon Wyman <bjwyman@gmail.com> Link: https://lore.kernel.org/r/20220317232123.2103592-1-bjwyman@gmail.com Signed-off-by: Joel Stanley <joel@jms.id.au>
2022-03-21hwmon: (pmbus) Clear pmbus fault/warning bits after readVikash Chandola1-0/+5
Almost all fault/warning bits in pmbus status registers remain set even after fault/warning condition are removed. As per pmbus specification these faults must be cleared by user. Modify hwmon behavior to clear fault/warning bit after fetching data if fault/warning bit was set. This allows to get fresh data in next read. OpenBMC-Staging-Count: 1 Signed-off-by: Vikash Chandola <vikash.chandola@linux.intel.com> Link: https://lore.kernel.org/r/20220222131253.2426834-1-vikash.chandola@linux.intel.com Signed-off-by: Guenter Roeck <linux@roeck-us.net> (cherry picked from commit 35f165f08950a876f1b95a61d79c93678fba2fd6) Signed-off-by: Joel Stanley <joel@jms.id.au>
2022-03-16hwmon: (pmbus) Add Renesas RAA229126 VR driverZhikui Ren3-0/+102
Added pmbus driver for the new device Renesas raa229126 voltage regulator. Signed-off-by: Zhikui Ren <zhikui.ren@intel.com>
2022-03-16hwmon: (pmbus) Clear pmbus fault/warning bits after readVikash Chandola1-0/+5
[ Upstream commit 35f165f08950a876f1b95a61d79c93678fba2fd6 ] Almost all fault/warning bits in pmbus status registers remain set even after fault/warning condition are removed. As per pmbus specification these faults must be cleared by user. Modify hwmon behavior to clear fault/warning bit after fetching data if fault/warning bit was set. This allows to get fresh data in next read. Signed-off-by: Vikash Chandola <vikash.chandola@linux.intel.com> Link: https://lore.kernel.org/r/20220222131253.2426834-1-vikash.chandola@linux.intel.com Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-03-11Merge commit '2befcc6bb0bb1e0a4a31391a359adcab3925b6e4' of ↵Sujoy Ray3-0/+76
https://github.com/openbmc/linux into openbmc/linux_5.15.24_bump Signed-off-by: Sujoy Ray <sujoy.ray@intel.com>
2022-03-10hwmon: (pmbus) auto detect pmbus fan pwm modeZhikui Ren2-2/+64
PMBus device with fan controls have two possible control modes RPM and PWM. RPM mode is assumed and FANx_TARGET sensor is always created to provide read and write access of fan speed control. PWM only devices have been able to use the FANx_TARGET sensor to read commanded fan speed correctly because the pmbus core driver caches the write value and return it when the TARGET sensor is read. Recent pmbus_core driver change clears the cached value once the write to FANx_TARGET completes. Read FANx_TARGET sensor now reads from actual PMBus register. As a result, RPM mode only device, FANx_TARGET sensor always read 0. Add detection of current fan control mode during pmbus_identify and set flag PMBUS_HAVE_PWM12 and/or PMBUS_HAVE_PWM34 if PWM mode is detected. PWMx and PWMx_ENABLE sensors will be created based on these flags. Fixes: 1ae5aaf5d1c5 ("hwmon: (pmbus) Clear sensor data after chip write" Signed-off-by: Zhikui Ren <zhikui.ren@intel.com>
2022-02-24hwmon: (pmbus) Clear pmbus fault/warning bits after readVikash Chandola1-0/+5
Almost all fault/warning bits in pmbus status registers remain set even after fault/warning condition are removed. As per pmbus specification these faults must be cleared by user. Modify hwmon behavior to clear fault/warning bit after fetching data if fault/warning bit was set. This allows to get fresh data in next read. Signed-off-by: Vikash Chandola <vikash.chandola@linux.intel.com> Link: https://lore.kernel.org/r/20220222131253.2426834-1-vikash.chandola@linux.intel.com Signed-off-by: Guenter Roeck <linux@roeck-us.net> (cherry picked from commit 35f165f08950a876f1b95a61d79c93678fba2fd6)
2022-02-24Revert "hwmon: (pmbus) Clear pmbus fault/warning bits before read"Vikash Chandola1-9/+0
This reverts commit 747840ee70ac06bd8e4ebad5d0c0d25009481644. Better solution was found after conversation at linux-hwmon. Hence reverting original downstream fix in favour of upstream fix. Signed-off-by: Vikash Chandola <vikash.chandola@intel.com>
2022-02-07hwmon: (pmbus) Clear pmbus fault/warning bits before readVikash Chandola1-0/+9
pmbus fault and warning bits are not cleared by itself once fault/warning condition is not valid anymore. As per pmbus datasheet faults must be cleared by user. Modify hwmon behavior to clear latched status bytes if any bit in status register is high prior to returning fresh data to userspace. If fault/warning conditions are still applicable fault/warning bits will be set and we will get updated data in second read. Hwmon behavior is changed here. Now sysfs reads will reflect latest values from pmbus slave, not latched values. In case a transient warning/fault has happened in the past, it will no longer be reported to userspace. Signed-off-by: Vikash Chandola <vikash.chandola@intel.com>
2022-01-13hwmon: (pmbus) Add support for MPS Multi-phase mp5023Howard Chiu (邱冠睿)3-0/+76
Add support for mp5023 device from Monolithic Power Systems, Inc. (MPS) vendor. This is a Hot-Swap Controller. OpenBMC-Staging-Count: 1 Signed-off-by: Howard Chiu <howard.chiu@quantatw.com> Link: https://lore.kernel.org/r/HKAPR04MB400349AA406694FB976D78D096709@HKAPR04MB4003.apcprd04.prod.outlook.com Signed-off-by: Joel Stanley <joel@jms.id.au>
2021-11-18hwmon: (pmbus/lm25066) Let compiler determine outer dimension of lm25066_coeffZev Weiss1-1/+1
[ Upstream commit b7931a7b0e0df4d2a25fedd895ad32c746b77bc1 ] Maintaining this manually is error prone (there are currently only five chips supported, not six); gcc can do it for us automatically. Signed-off-by: Zev Weiss <zev@bewilderbeest.net> Fixes: 666c14906b49 ("hwmon: (pmbus/lm25066) Drop support for LM25063") Link: https://lore.kernel.org/r/20210928092242.30036-5-zev@bewilderbeest.net Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-11-18hwmon: (pmbus/lm25066) Add offset coefficientsZev Weiss1-0/+23
commit ae59dc455a78fb73034dd1fbb337d7e59c27cbd8 upstream. With the exception of the lm5066i, all the devices handled by this driver had been missing their offset ('b') coefficients for direct format readings. Cc: stable@vger.kernel.org Fixes: 58615a94f6a1 ("hwmon: (pmbus/lm25066) Add support for LM25056") Fixes: e53e6497fc9f ("hwmon: (pmbus/lm25066) Refactor device specific coefficients") Signed-off-by: Zev Weiss <zev@bewilderbeest.net> Link: https://lore.kernel.org/r/20210928092242.30036-2-zev@bewilderbeest.net Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-11-05pmbus: add 'fault' and 'beep' attributesJae Hyun Yoo2-0/+31
This commit adds two more attirbutes to reflect MFR_SPECIFIC bit in the STATUS_WORD and 'Unit Off For Insufficient Input Voltage' bit in the STATUS_INPUT into 'fault' and 'beep' attributes respectively. The attributes will be enumerated as 'inX_fault' and 'inX_beep' in a 'vin' group. Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
2021-11-01pmbus (max31785): Wrap all I2C accessors in one-shot failure handlersAndrew Jeffery1-42/+165
The MAX31785(A) has shown erratic behaviour across multiple system designs, unexpectedly clock stretching and NAKing transactions. Perform a one-shot retry if necessary for all access attempts. OpenBMC-Staging-Count: 15 Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Tested-by: George Keishing <gkeishin@in.ibm.com> Signed-off-by: Joel Stanley <joel@jms.id.au>
2021-11-01pmbus (core): One-shot retries for failure to set pageAndrew Jeffery1-2/+12
Work around the shonky behaviour seen with the MAX31785 where we fail to set the page register in some circumstances. There's no real elegant way to do this. We can propagate the error up, but that forces us to retry the operation way up the call tree in any number of places. It also forces callers to split out pmbus_set_page() from the pmbus_{read,write}_{byte,word}_data() functions in order to differentiate between a failure to set the page and a failure to read a register (that might not exist, in which case an error is anticiptated). OpenBMC-Staging-Count: 15 Cc: Eddie James <eajames@linux.vnet.ibm.com> Cc: Matt Spinler <mspinler@linux.vnet.ibm.com> Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Reviewed-by: Eddie James <eajames@linux.vnet.ibm.com> Tested-by: George Keishing <gkeishin@in.ibm.com> Signed-off-by: Joel Stanley <joel@jms.id.au>
2021-11-01pmbus (core): Use driver callbacks in pmbus_get_fan_rate()Andrew Jeffery1-4/+4
The driver may have overridden the pmbus_read_byte_data() callback, so make sure we use that to achieve expected behaviour. This helps in the MAX31785 case where we may need to perform a one-shot retry of transfers in the face of a failure. OpenBMC-Staging-Count: 15 Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Reviewed-by: Eddie James <eajames@linux.vnet.ibm.com> Tested-by: George Keishing <gkeishin@in.ibm.com> Signed-off-by: Joel Stanley <joel@jms.id.au>
2021-11-01pmbus (max31785): Add support for devicetree configurationAndrew Jeffery1-0/+318
OpenBMC-Staging-Count: 15 Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Tested-by: George Keishing <gkeishin@in.ibm.com> Signed-off-by: Joel Stanley <joel@jms.id.au>
2021-11-01hwmon: (pmbus/lm25066) Support configurable sense resistor valuesZev Weiss1-0/+11
The appropriate mantissa values for the lm25066 family's direct-format current and power readings are a function of the sense resistor employed between the SENSE and VIN pins of the chip. Instead of assuming that resistance is always the same 1mOhm as used in the datasheet, allow it to be configured via a device-tree property ("shunt-resistor-micro-ohms"). Signed-off-by: Zev Weiss <zev@bewilderbeest.net> Link: https://lore.kernel.org/r/20210928092242.30036-8-zev@bewilderbeest.net [groeck: Fixed checkpatch warnings] Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Joel Stanley <joel@jms.id.au>
2021-11-01hwmon: (pmbus/lm25066) Add OF device ID tableZev Weiss1-2/+23
The driver doesn't have a struct of_device_id table but supported devices are registered via Device Trees. This is working on the assumption that a I2C device registered via OF will always match a legacy I2C device ID and that the MODALIAS reported will always be of the form i2c:<device>. But this could change in the future so the correct approach is to have an OF device ID table if the devices are registered via OF. Signed-off-by: Zev Weiss <zev@bewilderbeest.net> Link: https://lore.kernel.org/r/20210928092242.30036-7-zev@bewilderbeest.net [groeck: Replaced reference to reasoning with reasoning, fixed checkpatch warnings, fixed compile warning comparing of_id->data w/ i2c_id->driver_data] Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Joel Stanley <joel@jms.id.au>
2021-11-01hwmon: (pmbus/lm25066) Mark lm25066_coeff array constZev Weiss1-2/+2
lm25066_coeff is read-only. Mark it as such. Signed-off-by: Zev Weiss <zev@bewilderbeest.net> Link: https://lore.kernel.org/r/20210928092242.30036-6-zev@bewilderbeest.net [groeck: Added description] Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Joel Stanley <joel@jms.id.au>
2021-11-01hwmon: (pmbus/lm25066) Let compiler determine outer dimension of lm25066_coeffZev Weiss1-1/+1
Maintaining this manually is error prone (there are currently only five chips supported, not six); gcc can do it for us automatically. Signed-off-by: Zev Weiss <zev@bewilderbeest.net> Fixes: 666c14906b49 ("hwmon: (pmbus/lm25066) Drop support for LM25063") Link: https://lore.kernel.org/r/20210928092242.30036-5-zev@bewilderbeest.net Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Joel Stanley <joel@jms.id.au>
2021-11-01hwmon: (pmbus/lm25066) Avoid forward declaration of lm25066_idZev Weiss1-13/+10
Reordering things to put the table before the probe function eliminates the need for it. Signed-off-by: Zev Weiss <zev@bewilderbeest.net> Link: https://lore.kernel.org/r/20210928092242.30036-4-zev@bewilderbeest.net Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Joel Stanley <joel@jms.id.au>
2021-11-01hwmon: (pmbus/lm25066) Adjust lm25066 PSC_CURRENT_IN_L mantissaZev Weiss1-1/+1
At least as of Revision J, the datasheet has a slightly different value than what we'd had in the driver. Signed-off-by: Zev Weiss <zev@bewilderbeest.net> Link: https://lore.kernel.org/r/20210928092242.30036-3-zev@bewilderbeest.net Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Joel Stanley <joel@jms.id.au>
2021-11-01hwmon: (pmbus/lm25066) Add offset coefficientsZev Weiss1-0/+23
With the exception of the lm5066i, all the devices handled by this driver had been missing their offset ('b') coefficients for direct format readings. Cc: stable@vger.kernel.org Fixes: 58615a94f6a1 ("hwmon: (pmbus/lm25066) Add support for LM25056") Fixes: e53e6497fc9f ("hwmon: (pmbus/lm25066) Refactor device specific coefficients") Signed-off-by: Zev Weiss <zev@bewilderbeest.net> Link: https://lore.kernel.org/r/20210928092242.30036-2-zev@bewilderbeest.net Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Joel Stanley <joel@jms.id.au>
2021-11-01hwmon: (pmbus/ibm-cffps) Use MFR_ID to choose versionBrandon Wyman1-1/+12
There are multiple power supplies that will indicate CFFPS_CCIN_VERSION_1, use the manufacturer ID to determine if it should be treated as version cffps1 or version cffps2. Signed-off-by: Brandon Wyman <bjwyman@gmail.com> Link: https://lore.kernel.org/r/20211004144339.2634330-2-bjwyman@gmail.com [groeck: Fixed continuation line alignment] Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Joel Stanley <joel@jms.id.au>
2021-11-01hwmon: (pmbus/ibm-cffps) Add mfg_id debugfs entryBrandon Wyman1-1/+9
Add support for the manufacturer ID to the debugfs entries. OpenBMC-Staging-Count: 2 Signed-off-by: Brandon Wyman <bjwyman@gmail.com> Link: https://lore.kernel.org/r/20211004144339.2634330-1-bjwyman@gmail.com Signed-off-by: Joel Stanley <joel@jms.id.au>
2021-10-02hwmon: (pmbus/mp2975) Add missed POUT attribute for page 1 mp2975 controllerVadim Pasternak1-1/+1
Add missed attribute for reading POUT from page 1. It is supported by device, but has been missed in initial commit. Fixes: 2c6fcbb21149 ("hwmon: (pmbus) Add support for MPS Multi-phase mp2975 controller") Signed-off-by: Vadim Pasternak <vadimp@nvidia.com> Link: https://lore.kernel.org/r/20210927070740.2149290-1-vadimp@nvidia.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2021-10-02hwmon: (pmbus/ibm-cffps) max_power_out swap changesBrandon Wyman1-2/+8
The bytes for max_power_out from the ibm-cffps devices differ in byte order for some power supplies. The Witherspoon power supply returns the bytes in MSB/LSB order. The Rainier power supply returns the bytes in LSB/MSB order. The Witherspoon power supply uses version cffps1. The Rainier power supply should use version cffps2. If version is cffps1, swap the bytes before output to max_power_out. Tested: Witherspoon before: 3148. Witherspoon after: 3148. Rainier before: 53255. Rainier after: 2000. Signed-off-by: Brandon Wyman <bjwyman@gmail.com> Reviewed-by: Eddie James <eajames@linux.ibm.com> Link: https://lore.kernel.org/r/20210928205051.1222815-1-bjwyman@gmail.com [groeck: Replaced yoda programming] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2021-08-18hwmon: (pmbus/bpa-rs600) Add workaround for incorrect Pin maxChris Packham1-0/+23
BPD-RS600 modules running firmware v5.70 misreport the MFR_PIN_MAX. The indicate a maximum of 1640W instead of 700W. Detect the invalid reading and return a sensible value instead. Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz> Link: https://lore.kernel.org/r/20210812014000.26293-3-chris.packham@alliedtelesis.co.nz Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2021-08-18hwmon: (pmbus/bpa-rs600) Don't use rated limits as warn limitsChris Packham1-25/+0
In the initial implementation a number of PMBUS_x_WARN_LIMITs were mapped to MFR fields. This was incorrect as these MFR limits reflect the rated limit as opposed to a limit which will generate warning. Instead return -ENXIO like we were already doing for other WARN_LIMITs. Subsequently these rated limits have been exposed generically as new fields in the sysfs ABI so the values are still available. Fixes: 15b2703e5e02 ("hwmon: (pmbus) Add driver for BluTek BPA-RS600") Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz> Link: https://lore.kernel.org/r/20210812014000.26293-2-chris.packham@alliedtelesis.co.nz Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2021-08-18hwmon: (pmbus/ibm-cffps) Fix write bits for LED controlBrandon Wyman1-3/+3
When doing a PMBus write for the LED control on the IBM Common Form Factor Power Supplies (ibm-cffps), the DAh command requires that bit 7 be low and bit 6 be high in order to indicate that you are truly attempting to do a write. Signed-off-by: Brandon Wyman <bjwyman@gmail.com> Link: https://lore.kernel.org/r/20210806225131.1808759-1-bjwyman@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2021-08-18hwmon: (pmbus/bpa-rs600) Support BPD-RS600Chris Packham1-7/+15
The BPD-RS600 is the DC version of the BPA-RS600. The PMBUS interface is the same between the two models. Keep the same compatible string but accept either BPA-RS600 or BPD-RS600 in the PMBUS_MFR_MODEL. Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz> Link: https://lore.kernel.org/r/20210708220618.23576-1-chris.packham@alliedtelesis.co.nz Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2021-06-18hwmon: (pmbus/dps920ab) Delete some dead codeDan Carpenter1-2/+0
The debugfs_create_dir() function returns error pointers, it doesn't return NULL. But debugfs functions don't need to be checked in normal situations and we can just delete this code. Fixes: 1f442e213ce5 ("hwmon: (pmbus) Add driver for Delta DPS-920AB PSU") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Link: https://lore.kernel.org/r/YMyjmR54ErLtc1sH@mwanda Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2021-06-17hwmon: (pmbus) Add driver for Delta DPS-920AB PSURobert Marko3-0/+218
This adds support for the Delta DPS-920AB PSU. Only missing feature is fan control which the PSU supports. Signed-off-by: Robert Marko <robert.marko@sartura.hr> Link: https://lore.kernel.org/r/20210607103431.2039073-1-robert.marko@sartura.hr [groeck: Add MODULE_IMPORT_NS(PMBUS);] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2021-06-17hwmon: (pmbus/pim4328) Add PMBus driver for PIM4006, PIM4328 and PIM4820Erik Rosen3-0/+243
Add hardware monitoring support for Flex power interface modules PIM4006, PIM4328 and PIM4820. Signed-off-by: Erik Rosen <erik.rosen@metormote.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2021-06-17hwmon: (pmbus) Allow phase function even if it's not on pageErik Rosen1-8/+8
Allow the use of a phase function even if it does not exist on the associated page. Signed-off-by: Erik Rosen <erik.rosen@metormote.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2021-06-17hwmon: (pmbus) Add support for reading direct mode coefficientsErik Rosen1-0/+116
Add support for reading and decoding direct format coefficients to the PMBus core driver. If the new flag PMBUS_USE_COEFFICIENTS_CMD is set, the driver will use the COEFFICIENTS register together with the information in the pmbus_sensor_attr structs to initialize relevant coefficients for the direct mode format. Signed-off-by: Erik Rosen <erik.rosen@metormote.com> [groeck: Initialize ret with -EINVAL in pmbus_init_coefficients()] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2021-06-17hwmon: (pmbus) Add new pmbus flag NO_WRITE_PROTECTErik Rosen1-3/+5
Some PMBus chips respond with invalid data when reading the WRITE_PROTECT register. For such chips, this flag should be set so that the PMBus core driver doesn't use the WRITE_PROTECT command to determine its behavior. Signed-off-by: Erik Rosen <erik.rosen@metormote.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2021-06-17hwmon: (pmbus_core) Check adapter PEC supportMadhava Reddy Siddareddygari1-3/+6
Currently, for Packet Error Checking (PEC) only the controller is checked for support. This causes problems on the cisco-8000 platform where a SMBUS transaction errors are observed. This is because PEC has to be enabled only if both controller and adapter support it. Added code to check PEC capability for adapter and enable it only if both controller and adapter supports PEC. Signed-off-by: Madhava Reddy Siddareddygari <msiddare@cisco.com> [Upstream from SONiC https://github.com/Azure/sonic-linux-kernel/pull/215] Signed-off-by: Paul Menzel <pmenzel@molgen.mpg.de> Link: https://lore.kernel.org/r/20210605052700.541455-1-pmenzel@molgen.mpg.de [groeck: Dropped unnecessary continuation line] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2021-06-17hwmon: (adm1275) enable adm1272 temperature reportingChu Lin1-8/+6
adm1272 supports temperature reporting but it is disabled by default. Tested: ls temp1_* temp1_crit temp1_highest temp1_max temp1_crit_alarm temp1_input temp1_max_alarm cat temp1_input 26642 Signed-off-by: Chu Lin <linchuyuan@google.com> Link: https://lore.kernel.org/r/20210512171043.2433694-1-linchuyuan@google.com [groeck: Updated subject to reflect correct driver] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2021-06-17hwmon: (pmbus) Add support for MPS Multi-phase mp2888 controllerVadim Pasternak3-0/+418
Add support for mp2888 device from Monolithic Power Systems, Inc. (MPS) vendor. This is a digital, multi-phase, pulse-width modulation controller. This device supports: - One power rail. - Programmable Multi-Phase up to 10 Phases. - PWM-VID Interface - One pages 0 for telemetry. - Programmable pins for PMBus Address. - Built-In EEPROM to Store Custom Configurations. - Can configured VOUT readout in direct or VID format and allows setting of different formats on rails 1 and 2. For VID the following protocols are available: VR13 mode with 5-mV DAC; VR13 mode with 10-mV DAC, IMVP9 mode with 5-mV DAC. Signed-off-by: Vadim Pasternak <vadimp@nvidia.com> Reported-by: kernel test robot <lkp@intel.com> Link: https://lore.kernel.org/r/20210511055619.118104-3-vadimp@nvidia.com [groeck: Add MODULE_IMPORT_NS] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2021-06-17hwmon: (pmbus) Increase maximum number of phases per pageVadim Pasternak1-1/+1
Increase maximum number of phases from 8 to 10 to support multi-phase devices allowing up to 10 phases. Signed-off-by: Vadim Pasternak <vadimp@nvidia.com> Link: https://lore.kernel.org/r/20210511055619.118104-2-vadimp@nvidia.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2021-06-17hwmon: (pmbus) Add support for additional Flex BMR converters to pmbusErik Rosen2-5/+21
Add support for Flex BMR310, BMR456, BMR457, BMR458, BMR480, BMR490, BMR491 and BMR492 to the pmbus driver Signed-off-by: Erik Rosen <erik.rosen@metormote.com> Link: https://lore.kernel.org/r/20210507194023.61138-4-erik.rosen@metormote.com [groeck: Fixed minor whitespace error] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2021-06-17hwmon: (pmbus) Add new flag PMBUS_READ_STATUS_AFTER_FAILED_CHECKErik Rosen1-0/+2
Some PMBus chips end up in an undefined state when trying to read an unsupported register. For such chips, it is necessary to reset the chip pmbus controller to a known state after a failed register check. This can be done by reading a known register. By setting this flag the driver will try to read the STATUS register after each failed register check. This read may fail, but it will put the chip into a known state. Signed-off-by: Erik Rosen <erik.rosen@metormote.com> Link: https://lore.kernel.org/r/20210507194023.61138-2-erik.rosen@metormote.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2021-06-17hwmon: (pmbus/zl6100) Add support for ZLS1003, ZLS4009 and ZL8802Erik Rosen1-14/+80
Add support for Renesas ZL8802 Dual Channel/Dual Phase PMBus DC/DC Digital Controller as well as ZLS1003 and ZLS4009 custom DC/DC controller chips. Signed-off-by: Erik Rosen <erik.rosen@metormote.com> Link: https://lore.kernel.org/r/20210423153329.33457-2-erik.rosen@metormote.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>