summaryrefslogtreecommitdiff
path: root/drivers/hwmon
AgeCommit message (Collapse)AuthorFilesLines
2021-09-08Merge branch 'dev-5.10' into dev-5.10-intelJae Hyun Yoo1-3/+3
Pull 5.10.60 stable from OpenBMC upstream Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
2021-08-12hwmon: (pmbus/ibm-cffps) Fix write bits for LED controlB. J. 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. OpenBMC-Staging-Count: 1 Signed-off-by: B. J. Wyman <bjwyman@gmail.com> Link: https://lore.kernel.org/r/20210728224140.3672294-1-bjwyman@gmail.com Signed-off-by: Joel Stanley <joel@jms.id.au>
2021-08-02hwmon: peci: clear time window configurationZbigniew Lukwinski2-0/+3
This patch makes time window setting to be cleared when disabling power capping just like others settings. Change-Id: I3a5fc9c1eb6a5787d131bf69cc18a5dae94a99f0 Signed-off-by: Zbigniew Lukwinski <zbigniew.lukwinski@linux.intel.com>
2021-08-02hwmon: peci: timestamps for sensors correctionZbigniew Lukwinski2-16/+5
This patch makes timestaps catching to happen just after PECI transaction. It makes reading more accurate since PECI request can hang while waiting in PECI driver queue. Change-Id: I1a356caa59148a5cebcfcdf89211038bfadb40d3 Signed-off-by: Zbigniew Lukwinski <zbigniew.lukwinski@linux.intel.com>
2021-08-02hwmon: peci: cleanupOlender, Agata3-44/+30
Add cleanup fixes after implementing energy sensor for all modules: cpu, dimm, platform to make all files consistent. Signed-off-by: Olender, Agata <agata.olender@intel.com>
2021-08-02hwmon: peci: Stop reading DRAM_MIN_PWRZbigniew Lukwinski1-33/+9
This commit is about disabling reading DRAM_MIN_PWR from DRAM_POWER_INFO PCS. Starting from SPR DRAM_MIN_PWR is deprecated. BIOS does not update DRAM min power anymore. Value of 0 shall be reported as DRAM min power. Signed-off-by: Zbigniew Lukwinski <zbigniew.lukwinski@linux.intel.com>
2021-08-02hwmon: peci: TDP used for max DRAM powerZbigniew Lukwinski2-30/+4
This commit replaces 'Maximal DRAM Power' (MSR@61Ch - MSR_DRAM_POWER_INFO_HIGH) with the 'Spec DRAM Power'('TDP') (MSR@61Ch - MSR_DRAM_POWER_INFO_LOW) while maximal DRAM power calculation. This is to be compliant with SPS ME Node Manager. In case package power it already works with the same way - TDP is taken as maximal power. Signed-off-by: Zbigniew Lukwinski <zbigniew.lukwinski@linux.intel.com>
2021-08-02mfd: peci: Add ICX-D generation infoSaravanan Palanisamy2-0/+3
This commit adds CPU generation info for ICX-D Xeon family. Signed-off-by: Saravanan Palanisamy <saravanan.palanisamy@intel.com> Signed-off-by: Anoop S <anoopx.s@intel.com>
2021-08-02mfd: peci: Add ICX generation infoJae Hyun Yoo2-17/+126
This commit adds CPU generation info for ICX family. Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
2021-08-02hwmon: (aspeed-pwm-tacho) Add pwm chip driver supportJae Hyun Yoo1-0/+124
This commit adds pwm chip driver support into aspeed-g6-pwm-tacho driver to enable beep speaker driver. The pwm chip driver cannot be added as a separate platform driver because it makes resource conflicts with existing pwm-tacho driver so it uses hacky tweak on the existing driver. Note: Do not try upstream this hacky implementation. Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@intel.com> Change-Id: I22ad12be2ae3a061d7942fec813cdb11be321db7
2021-08-02hwmon: peci: add energy sensor to peci-dimmpowerOlender, Agata1-56/+232
Add support for energy consumption of DIMMs sensor. Energy is reported in micro Joules and exposed under energyN_input file. Signed-off-by: Olender, Agata <agata.olender@intel.com>
2021-08-02hwmon: peci: cumulative energy sensorOlender, Agata2-69/+133
Change energy sensor to cumulative energy sensor. Actually energy sensor implementation works as simply translation for value read from PCS register to microjoules. With this change, energy sensor will behave as accumulative sensor> After every read on energyN_input file new energy sample will be gathered, and the difference between new sample and previous one will be added to sensor value. This approach solves problems with counters overflow and interpretation of the energy sensor value. Signed-off-by: Olender, Agata <agata.olender@intel.com>
2021-08-02hwmon: peci: adjust energy sensor value to S32 typeOlender, Agata1-2/+2
Adjust energy sensor to be 31 bits counter and return only positive values using S32 type - that is a part of common sensor struct for all hwmon peci sensors. Signed-off-by: Olender, Agata <agata.olender@intel.com>
2021-08-02hwmon: peci: add energy sensor to peci-cpupowerOlender, Agata3-149/+335
Add support for energy consumption of CPU package sensor. Energy is reported in micro Joules and exposed under energyN_input file. Signed-off-by: Olender, Agata <agata.olender@intel.com>
2021-08-02hwmon: peci: dimmpower implementationZbigniew Lukwinski3-0/+517
1. Peci dimmpower module implementation. 2. Enable DIMM avarage power, power limit, power limit max setting, power limit min setting reading and expose them under power1_avarage, power1_cap, power1_cap_max, power1_cap_min in sysfs. 3. Enable DIMM power limit writing through power1_cap. Tested: * on WilsonCity platform, * power1_avarage, power1_cap, power1_cap_max and power1_cap_min work as expected Signed-off-by: Zbigniew Lukwinski <zbigniew.lukwinski@linux.intel.com>
2021-08-02hwmon: peci: cpupower extensionZbigniew Lukwinski2-118/+436
1. Use hwmon peci pcs utils to refactor peci cpupower module. 2. Enable CPU power limit, power limit max (TDP) setting, power limit min setting reading and expose them under power1_cap, power1_cap_max, power1_cap_min. 3. Enable CPU power limit writing through power1_cap. Tested: * on WilsonCity platform, * power1_avarage works as before the change, * power1_cap, power1_cap_max, power1_cap_min work as expected. Signed-off-by: Zbigniew Lukwinski <zbigniew.lukwinski@linux.intel.com>
2021-08-02hwmon: peci: PCS utilsZbigniew Lukwinski2-6/+555
1. Helpers for reading/writing PCS registers added. 2. PECI sensor configuration structure definition and helpers added. 3. New PECI PCS index and parameters definitions added. Tested: * on WilsonCity platform * hwmon/peci modules work as before the change Signed-off-by: Zbigniew Lukwinski <zbigniew.lukwinski@linux.intel.com>
2021-08-02pwm and tach driver changes for ast2600Ayushi Smriti1-157/+171
This commit includes additions/changes in driver code to support 9 PWM outputs and 9 fan tachometer inputs for ast2600 as per archer city usage Signed-off-by: Ayushi Smriti <smriti.ayushi@intel.com>
2021-08-02arm: ast2600: add pwm_tacho driver from aspeedVernon Mauery3-0/+1037
Add the pwm_tacho driver from Aspeed to get pwm working until an upstream PWM/Tacho driver is available. This was copied from the v5.02 BSP from Aspeed. Signed-off-by: Vernon Mauery <vernon.mauery@intel.com>
2021-08-02pmbus: 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-08-02aspeed-pwm-tacho: change default fan speedJames Feist1-1/+1
Change it from max to 58% Signed-off-by: James Feist <james.feist@linux.intel.com>
2021-08-02Add peci-cpupower driverZhikuiRen3-0/+246
peci-cpupower reads CPU energy counter through peci and computes average power in mW since last read. Signed-off-by: ZhikuiRen <zhikui.ren@intel.com>
2021-08-02hwmon: Add PECI dimmtemp driverJae Hyun Yoo3-0/+455
This commit adds PECI dimmtemp hwmon driver. Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com> Reviewed-by: Haiyue Wang <haiyue.wang@linux.intel.com> Reviewed-by: James Feist <james.feist@linux.intel.com> Reviewed-by: Vernon Mauery <vernon.mauery@linux.intel.com>
2021-08-02hwmon: Add PECI cputemp driverJae Hyun Yoo4-0/+533
This commit adds PECI cputemp hwmon driver. Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com> Reviewed-by: Haiyue Wang <haiyue.wang@linux.intel.com> Reviewed-by: James Feist <james.feist@linux.intel.com> Reviewed-by: Vernon Mauery <vernon.mauery@linux.intel.com>
2021-07-26hwmon: (occ) Remove sequence numbering and checksum calculationEddie James4-28/+24
Checksumming of the request and sequence numbering is now done in the OCC interface driver in order to keep unique sequence numbers. So remove those in the hwmon driver. Also, add the command length to the send_cmd function pointer, since the checksum must be placed in the last two bytes of the command. The submit interface must receive the exact size of the command - previously it could be rounded to the nearest 8 bytes with no consequence. Signed-off-by: Eddie James <eajames@linux.ibm.com> Acked-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20210721190231.117185-3-eajames@linux.ibm.com Signed-off-by: Joel Stanley <joel@jms.id.au>
2021-07-26hwmon: replace snprintf in show functions with sysfs_emitGuenter Roeck24-150/+151
coccicheck complains about the use of snprintf() in sysfs show functions. drivers/hwmon/ina3221.c:701:8-16: WARNING: use scnprintf or sprintf This results in a large number of patch submissions. Fix it all in one go using the following coccinelle rules. Use sysfs_emit instead of scnprintf or sprintf since that makes more sense. @depends on patch@ identifier show, dev, attr, buf; @@ ssize_t show(struct device *dev, struct device_attribute *attr, char *buf) { <... return - snprintf(buf, \( PAGE_SIZE \| PAGE_SIZE - 1 \), + sysfs_emit(buf, ...); ...> } @depends on patch@ identifier show, dev, attr, buf, rc; @@ ssize_t show(struct device *dev, struct device_attribute *attr, char *buf) { <... rc = - snprintf(buf, \( PAGE_SIZE \| PAGE_SIZE - 1 \), + sysfs_emit(buf, ...); ...> } While at it, remove unnecessary braces and as well as unnecessary else after return statements to address checkpatch warnings in the resulting patch. Cc: Zihao Tang <tangzihao1@hisilicon.com> Cc: Jay Fang <f.fangjian@huawei.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net> (cherry picked from commit 1f4d4af4d7a1c794a4f003f75fcfd38fafb5dff3) Signed-off-by: Joel Stanley <joel@jms.id.au>
2021-07-26hwmon: (occ) Fix p10 temperature sensor typeJoel Stanley1-0/+10
This reverts commit eb6ccb5ec301 and applies commit db4919ec86ff, the final version that was merged to mainline. The latest version of the On-Chip Controller (OCC) has a different format for the temperature sensor data. Add a new temperature sensor version to handle this data. Signed-off-by: Eddie James <eajames@linux.ibm.com> Reviewed-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Joel Stanley <joel@jms.id.au> Link: https://lore.kernel.org/r/20201120010315.190737-4-joel@jms.id.au Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Joel Stanley <joel@jms.id.au>
2021-07-16Merge tag 'v5.10.50' into dev-5.10Joel Stanley3-69/+37
This is the 5.10.50 stable release Signed-off-by: Joel Stanley <joel@jms.id.au>
2021-07-14hwmon: (max31790) Fix fan speed reporting for fan7..12Guenter Roeck1-1/+1
[ Upstream commit cbbf244f0515af3472084f22b6213121b4a63835 ] Fans 7..12 do not have their own set of configuration registers. So far the code ignored that and read beyond the end of the configuration register range to get the tachometer period. This resulted in more or less random fan speed values for those fans. The datasheet is quite vague when it comes to defining the tachometer period for fans 7..12. Experiments confirm that the period is the same for both fans associated with a given set of configuration registers. Fixes: 54187ff9d766 ("hwmon: (max31790) Convert to use new hwmon registration API") Fixes: 195a4b4298a7 ("hwmon: Driver for Maxim MAX31790") Cc: Jan Kundrát <jan.kundrat@cesnet.cz> Reviewed-by: Jan Kundrát <jan.kundrat@cesnet.cz> Cc: Václav Kubernát <kubernat@cesnet.cz> Reviewed-by: Jan Kundrát <jan.kundrat@cesnet.cz> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20210526154022.3223012-2-linux@roeck-us.net Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-07-14hwmon: (max31722) Remove non-standard ACPI device IDsGuenter Roeck1-9/+0
[ Upstream commit 97387c2f06bcfd79d04a848d35517b32ee6dca7c ] Valid Maxim Integrated ACPI device IDs would start with MXIM, not with MAX1. On top of that, ACPI device IDs reflecting chip names are almost always invalid. Remove the invalid ACPI IDs. Fixes: 04e1e70afec6 ("hwmon: (max31722) Add support for MAX31722/MAX31723 temperature sensors") Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-07-14hwmon: (lm70) Revert "hwmon: (lm70) Add support for ACPI"Guenter Roeck1-25/+1
[ Upstream commit ac61c8aae446b9c0fe18981fe721d4a43e283ad6 ] This reverts commit b58bd4c6dfe709646ed9efcbba2a70643f9bc873. None of the ACPI IDs introduced with the reverted patch is a valid ACPI device ID. Any ACPI users of this driver are advised to use PRP0001 and a devicetree-compatible device identification. Fixes: b58bd4c6dfe7 ("hwmon: (lm70) Add support for ACPI") Cc: Andrej Picej <andpicej@gmail.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-07-14hwmon: (lm70) Use device_get_match_data()Stephen Boyd1-15/+5
[ Upstream commit 6e09d75513d2670b7ab91ab3584fc5bcf2675a75 ] Use the more modern API to get the match data out of the of match table. This saves some code, lines, and nicely avoids referencing the match table when it is undefined with configurations where CONFIG_OF=n. Signed-off-by: Stephen Boyd <swboyd@chromium.org> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Jean Delvare <jdelvare@suse.com> Cc: Guenter Roeck <linux@roeck-us.net> Cc: Rob Herring <robh+dt@kernel.org> Cc: Frank Rowand <frowand.list@gmail.com> Cc: <linux-hwmon@vger.kernel.org> [robh: rework to use device_get_match_data()] Signed-off-by: Rob Herring <robh@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-07-14hwmon: (max31790) Fix pwmX_enable attributesGuenter Roeck1-15/+26
[ Upstream commit 148c847c9e5a54b99850617bf9c143af9a344f92 ] pwmX_enable supports three possible values: 0: Fan control disabled. Duty cycle is fixed to 0% 1: Fan control enabled, pwm mode. Duty cycle is determined by values written into Target Duty Cycle registers. 2: Fan control enabled, rpm mode Duty cycle is adjusted such that fan speed matches the values in Target Count registers The current code does not do this; instead, it mixes pwm control configuration with fan speed monitoring configuration. Worse, it reports that pwm control would be disabled (pwmX_enable==0) when it is in fact enabled in pwm mode. Part of the problem may be that the chip sets the "TACH input enable" bit on its own whenever the mode bit is set to RPM mode, but that doesn't mean that "TACH input enable" accurately reflects the pwm mode. Fix it up and only handle pwm control with the pwmX_enable attributes. In the documentation, clarify that disabling pwm control (pwmX_enable=0) sets the pwm duty cycle to 0%. In the code, explain why TACH_INPUT_EN is set together with RPM_MODE. While at it, only update the configuration register if the configuration has changed, and only update the cached configuration if updating the chip configuration was successful. Cc: Jan Kundrát <jan.kundrat@cesnet.cz> Cc: Václav Kubernát <kubernat@cesnet.cz> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Tested-by: Václav Kubernát <kubernat@cesnet.cz> Reviewed-by: Jan Kundrát <jan.kundrat@cesnet.cz> Link: https://lore.kernel.org/r/20210526154022.3223012-4-linux@roeck-us.net Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-07-14hwmon: (max31790) Report correct current pwm duty cyclesGuenter Roeck1-3/+3
[ Upstream commit 897f6339893b741a5d68ae8e2475df65946041c2 ] The MAX31790 has two sets of registers for pwm duty cycles, one to request a duty cycle and one to read the actual current duty cycle. Both do not have to be the same. When reporting the pwm duty cycle to the user, the actual pwm duty cycle from pwm duty cycle registers needs to be reported. When setting it, the pwm target duty cycle needs to be written. Since we don't know the actual pwm duty cycle after a target pwm duty cycle has been written, set the valid flag to false to indicate that actual pwm duty cycle should be read from the chip instead of using cached values. Cc: Jan Kundrát <jan.kundrat@cesnet.cz> Cc: Václav Kubernát <kubernat@cesnet.cz> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Tested-by: Václav Kubernát <kubernat@ceesnet.cz> Reviewed-by: Jan Kundrát <jan.kundrat@cesnet.cz> Link: https://lore.kernel.org/r/20210526154022.3223012-3-linux@roeck-us.net Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-06-24Merge tag 'v5.10.46' into dev-5.10Joel Stanley1-0/+9
This is the 5.10.46 stable release Signed-off-by: Joel Stanley <joel@jms.id.au>
2021-06-23hwmon: (scpi-hwmon) shows the negative temperature properlyRiwen Lu1-0/+9
[ Upstream commit 78d13552346289bad4a9bf8eabb5eec5e5a321a5 ] The scpi hwmon shows the sub-zero temperature in an unsigned integer, which would confuse the users when the machine works in low temperature environment. This shows the sub-zero temperature in an signed value and users can get it properly from sensors. Signed-off-by: Riwen Lu <luriwen@kylinos.cn> Tested-by: Xin Chen <chenxin@kylinos.cn> Link: https://lore.kernel.org/r/20210604030959.736379-1-luriwen@kylinos.cn Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-06-10Merge tag 'v5.10.43' into dev-5.10Joel Stanley2-4/+4
This is the 5.10.43 stable release Signed-off-by: Joel Stanley <joel@jms.id.au>
2021-06-10hwmon: (pmbus/isl68137) remove READ_TEMPERATURE_3 for RAA228228Grant Peltier1-2/+2
[ Upstream commit 2a29db088c7ae7121801a0d7a60740ed2d18c4f3 ] The initial version of the RAA228228 datasheet claimed that the device supported READ_TEMPERATURE_3 but not READ_TEMPERATURE_1. It has since been discovered that the datasheet was incorrect. The RAA228228 does support READ_TEMPERATURE_1 but does not support READ_TEMPERATURE_3. Signed-off-by: Grant Peltier <grantpeltier93@gmail.com> Fixes: 51fb91ed5a6f ("hwmon: (pmbus/isl68137) remove READ_TEMPERATURE_1 telemetry for RAA228228") Link: https://lore.kernel.org/r/20210514211954.GA24646@raspberrypi Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-06-10hwmon: (dell-smm-hwmon) Fix index valuesArmin Wolf1-2/+2
[ Upstream commit 35d470b5fbc9f82feb77b56bb0d5d0b5cd73e9da ] When support for up to 10 temp sensors and for disabling automatic BIOS fan control was added, noone updated the index values used for disallowing fan support and fan type calls. Fix those values. Signed-off-by: Armin Wolf <W_Armin@gmx.de> Reviewed-by: Pali Rohár <pali@kernel.org> Link: https://lore.kernel.org/r/20210513154546.12430-1-W_Armin@gmx.de Fixes: 1bb46a20e73b ("hwmon: (dell-smm) Support up to 10 temp sensors") Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-06-04Merge tag 'v5.10.42' into dev-5.10Joel Stanley1-9/+2
This is the 5.10.42 stable release Signed-off-by: Joel Stanley <joel@jms.id.au>
2021-05-26Revert "hwmon: (lm80) fix a missing check of bus read in lm80 probe"Greg Kroah-Hartman1-9/+2
commit 99ae3417672a6d4a3bf68d4fc43d7c6ca074d477 upstream. This reverts commit 9aa3aa15f4c2f74f47afd6c5db4b420fadf3f315. Because of recent interactions with developers from @umn.edu, all commits from them have been recently re-reviewed to ensure if they were correct or not. Upon review, it was determined that this commit is not needed at all so just revert it. Also, the call to lm80_init_client() was not properly handled, so if error handling is needed in the lm80_probe() function, then it should be done properly, not half-baked like the commit being reverted here did. Cc: Kangjie Lu <kjlu@umn.edu> Fixes: 9aa3aa15f4c2 ("hwmon: (lm80) fix a missing check of bus read in lm80 probe") Cc: stable <stable@vger.kernel.org> Acked-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20210503115736.2104747-5-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-05-24Merge tag 'v5.10.39' into dev-5.10Joel Stanley3-3/+13
This is the 5.10.39 stable release Signed-off-by: Joel Stanley <joel@jms.id.au>
2021-05-19hwmon: (occ) Fix poll rate limitingEddie James2-3/+4
[ Upstream commit 5216dff22dc2bbbbe6f00335f9fd2879670e753b ] The poll rate limiter time was initialized at zero. This breaks the comparison in time_after if jiffies is large. Switch to storing the next update time rather than the previous time, and initialize the time when the device is probed. Fixes: c10e753d43eb ("hwmon (occ): Add sensor types and versions") Signed-off-by: Eddie James <eajames@linux.ibm.com> Link: https://lore.kernel.org/r/20210429151336.18980-1-eajames@linux.ibm.com Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-05-14hwmon: (pmbus/pxe1610) don't bail out when not all pages are activePaul Fertser1-0/+9
[ Upstream commit f025314306ae17a3fdaf2874d7e878ce19cea363 ] Certain VRs might be configured to use only the first output channel and so the mode for the second will be 0. Handle this gracefully. Fixes: b9fa0a3acfd8 ("hwmon: (pmbus/core) Add support for vid mode detection per page bases") Signed-off-by: Paul Fertser <fercerpav@gmail.com> Link: https://lore.kernel.org/r/20210416102926.13614-1-fercerpav@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-04-06hwmon: (occ) Print response status in first poll error messageEddie James1-2/+3
In order to better debug problems starting up the driver, print the response status from the OCC in the error logged when the first poll command fails. OpenBMC-Staging-Count: 1 Signed-off-by: Eddie James <eajames@linux.ibm.com> Acked-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20210209171235.20624-5-eajames@linux.ibm.com Signed-off-by: Joel Stanley <joel@jms.id.au>
2021-04-06hwmon: (occ) Start sequence number at oneEddie James1-0/+2
Initialize the sequence number at one, rather than zero, in order to prevent false matches with the zero-initialized OCC SRAM buffer before the OCC is fully initialized. OpenBMC-Staging-Count: 1 Signed-off-by: Eddie James <eajames@linux.ibm.com> Acked-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20210209171235.20624-4-eajames@linux.ibm.com Signed-off-by: Joel Stanley <joel@jms.id.au>
2021-04-06hwmon: (sbtsi) Add basic support for SB-TSI sensorsKun Yi3-0/+261
SB Temperature Sensor Interface (SB-TSI) is an SMBus compatible interface that reports AMD SoC's Ttcl (normalized temperature), and resembles a typical 8-pin remote temperature sensor's I2C interface to BMC. This commit adds basic support using this interface to read CPU temperature, and read/write high/low CPU temp thresholds. To instantiate this driver on an AMD CPU with SB-TSI support, the i2c bus number would be the bus connected from the board management controller (BMC) to the CPU. The i2c address is specified in Section 6.3.1 of the spec [1]: The SB-TSI address is normally 98h for socket 0 and 90h for socket 1, but it could vary based on hardware address select pins. [1]: https://www.amd.com/system/files/TechDocs/56255_OSRR.pdf Test status: tested reading temp1_input, and reading/writing temp1_max/min. OpenBMC-Staging-Count: 1 Signed-off-by: Kun Yi <kunyi@google.com> Link: https://lore.kernel.org/r/20201211215427.3281681-2-kunyi@google.com Signed-off-by: Joel Stanley <joel@jms.id.au>
2021-03-12hwmon: (pmbus/ibm-cffps) Set the PMBUS_NO_CAPABILITY flagEddie James1-1/+1
Several power supplies supported by the IBM CFFPS driver don't report valid data in the CAPABILITY register. This results in PEC being enabled when it's not supported by the device, and since the automatic version detection might fail, disable use of the CAPABILITY register across the board for this driver. Signed-off-by: Eddie James <eajames@linux.ibm.com> Link: https://lore.kernel.org/r/20201222152640.27749-3-eajames@linux.ibm.com Signed-off-by: Guenter Roeck <linux@roeck-us.net> (cherry picked from commit f7a652182cc7f07cf658b8eee8d545ac109fd02e) Signed-off-by: Joel Stanley <joel@jms.id.au>
2021-03-12hwmon: (pmbus) Add a PMBUS_NO_CAPABILITY platform data flagEddie James1-3/+5
Some PMBus chips don't respond with valid data when reading the CAPABILITY register. Add a flag that device drivers can set so that the PMBus core driver doesn't use CAPABILITY to determine it's behavior. Signed-off-by: Eddie James <eajames@linux.ibm.com> Link: https://lore.kernel.org/r/20201222152640.27749-2-eajames@linux.ibm.com Signed-off-by: Guenter Roeck <linux@roeck-us.net> (cherry picked from commit e5befc024cb4515d815662ed8746712cc5366bfc) Signed-off-by: Joel Stanley <joel@jms.id.au>
2021-03-12hwmon: (pmbus) shrink code and remove pmbus_do_remove()Bartosz Golaszewski30-40/+9
The only action currently performed in pmbus_do_remove() is removing the debugfs hierarchy. We can schedule a devm action at probe time and remove pmbus_do_remove() entirely from all pmbus drivers. Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com> Link: https://lore.kernel.org/r/20201026105352.20359-1-brgl@bgdev.pl [groeck: Removed references to pmbus_do_remove from documentation] Signed-off-by: Guenter Roeck <linux@roeck-us.net> (cherry picked from commit 3bce071a301f44ffd08bada9b2e8238b625f8f8c) Signed-off-by: Joel Stanley <joel@jms.id.au>