summaryrefslogtreecommitdiffstats
path: root/drivers/hwmon
Commit message (Collapse)AuthorAgeFilesLines
* hwmon: (ltc2992) Set `can_sleep` flag for GPIO chipLars-Peter Clausen2023-03-151-0/+1
| | | | | | | | | | | | | | The ltc2992 drivers uses a mutex and I2C bus access in its GPIO chip `set` and `get` implementation. This means these functions can sleep and the GPIO chip should set the `can_sleep` property to true. This will ensure that a warning is printed when trying to set or get the GPIO value from a context that potentially can't sleep. Fixes: 9ca26df1ba25 ("hwmon: (ltc2992) Add support for GPIOs.") Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Link: https://lore.kernel.org/r/20230314093146.2443845-2-lars@metafoo.de Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (adm1266) Set `can_sleep` flag for GPIO chipLars-Peter Clausen2023-03-151-0/+1
| | | | | | | | | | | | | | The adm1266 driver uses I2C bus access in its GPIO chip `set` and `get` implementation. This means these functions can sleep and the GPIO chip should set the `can_sleep` property to true. This will ensure that a warning is printed when trying to set or get the GPIO value from a context that potentially can't sleep. Fixes: d98dfad35c38 ("hwmon: (pmbus/adm1266) Add support for GPIOs") Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Link: https://lore.kernel.org/r/20230314093146.2443845-1-lars@metafoo.de Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: tmp512: drop of_match_ptr for ID tableKrzysztof Kozlowski2023-03-121-1/+1
| | | | | | | | | | | | | | The driver will match mostly by DT table (even thought there is regular ID table) so there is little benefit in of_match_ptr (this also allows ACPI matching via PRP0001, even though it might not be relevant here). This also fixes !CONFIG_OF error: drivers/hwmon/tmp513.c:610:34: error: ‘tmp51x_of_match’ defined but not used [-Werror=unused-const-variable=] Fixes: 59dfa75e5d82 ("hwmon: Add driver for Texas Instruments TMP512/513 sensor chips.") Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/20230312193723.478032-2-krzysztof.kozlowski@linaro.org Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (ucd90320) Add minimum delay between bus accessesLars-Peter Clausen2023-03-121-0/+75
| | | | | | | | | | | | | | | | | | | | When probing the ucd90320 access to some of the registers randomly fails. Sometimes it NACKs a transfer, sometimes it returns just random data and the PEC check fails. Experimentation shows that this seems to be triggered by a register access directly back to back with a previous register write. Experimentation also shows that inserting a small delay after register writes makes the issue go away. Use a similar solution to what the max15301 driver does to solve the same problem. Create a custom set of bus read and write functions that make sure that the delay is added. Fixes: a470f11c5ba2 ("hwmon: (pmbus/ucd9000) Add support for UCD90320 Power Sequencer") Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Link: https://lore.kernel.org/r/20230312160312.2227405-1-lars@metafoo.de Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (ina3221) return prober error codeMarcus Folkesson2023-03-121-1/+1
| | | | | | | | | | ret is set to 0 which do not indicate an error. Return -EINVAL instead. Fixes: a9e9dd9c6de5 ("hwmon: (ina3221) Read channel input source info from DT") Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com> Link: https://lore.kernel.org/r/20230310075035.246083-1-marcus.folkesson@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (xgene) Fix use after free bug in xgene_hwmon_remove due to race ↵Zheng Wang2023-03-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | condition In xgene_hwmon_probe, &ctx->workq is bound with xgene_hwmon_evt_work. Then it will be started. If we remove the driver which will call xgene_hwmon_remove to clean up, there may be unfinished work. The possible sequence is as follows: Fix it by finishing the work before cleanup in xgene_hwmon_remove. CPU0 CPU1 |xgene_hwmon_evt_work xgene_hwmon_remove | kfifo_free(&ctx->async_msg_fifo);| | |kfifo_out_spinlocked |//use &ctx->async_msg_fifo Fixes: 2ca492e22cb7 ("hwmon: (xgene) Fix crash when alarm occurs before driver probe") Signed-off-by: Zheng Wang <zyytlz.wz@163.com> Link: https://lore.kernel.org/r/20230310084007.1403388-1-zyytlz.wz@163.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (adt7475) Fix masking of hysteresis registersTony O'Brien2023-03-051-2/+2
| | | | | | | | | | | The wrong bits are masked in the hysteresis register; indices 0 and 2 should zero bits [7:4] and preserve bits [3:0], and index 1 should zero bits [3:0] and preserve bits [7:4]. Fixes: 1c301fc5394f ("hwmon: Add a driver for the ADT7475 hardware monitoring chip") Signed-off-by: Tony O'Brien <tony.obrien@alliedtelesis.co.nz> Link: https://lore.kernel.org/r/20230222005228.158661-3-tony.obrien@alliedtelesis.co.nz Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (adt7475) Display smoothing attributes in correct orderTony O'Brien2023-03-051-2/+2
| | | | | | | | | | | | Throughout the ADT7475 driver, attributes relating to the temperature sensors are displayed in the order Remote 1, Local, Remote 2. Make temp_st_show() conform to this expectation so that values set by temp_st_store() can be displayed using the correct attribute. Fixes: 8f05bcc33e74 ("hwmon: (adt7475) temperature smoothing") Signed-off-by: Tony O'Brien <tony.obrien@alliedtelesis.co.nz> Link: https://lore.kernel.org/r/20230222005228.158661-2-tony.obrien@alliedtelesis.co.nz Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* Merge tag 'mfd-next-6.3' of ↵Linus Torvalds2023-02-231-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd Pull MFD updates from Lee Jones: "Core Framework: - Change MFD support status from Supported to Maintained New Drivers: - Add support for the Intel Platform Management Component Interface (PMCI) Removed Drivers: - HTC PASIC3 LED/DS1WM - Toshiba T7L66XB, TC6387XB and TC6393XB TMIO New Device Support: - Add support for N6000 Flash to Intel M10 BMC PMCI - Add support for Lenovo Yoga Tab 3 to Intel CHTWC PMIC New Functionality: - Provide Reset support to Syscon Fix-ups: - Explicitly provide missing include files - Pass platform type data/info via the SPI/I2C/DT registration strategy - Lots of DT documentation / adaptions - Replace scnprintf() with preferred sysfs_emit() - Remove unused / superfluous code - Fix some trivial whitesspace / spelling / grammatical issues - Replace pm_power_off with new and improved register_sys_off_handler() API Bug Fixes: - Reintroduce RK808-clkout registration - fixing Wi-Fi and Bluetooth - Repair the order of AXPxxx IRQ PEK RISE/FALL definitions - Refuse to build CS5535 on unsupported UML architectures - Fix memory leaks in error return paths - Prevent refcount leaks in error return paths" * tag 'mfd-next-6.3' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (40 commits) dt-bindings: mfd: qcom,tcsr: Add compatible for IPQ5332 dt-bindings: mfd: Add NXP BBNSM mfd: ntxec: Add version number for EC in Tolino Vision dt-bindings: mfd: syscon: Add mt8365-syscfg mfd: Remove toshiba tmio drivers mfd: arizona: Use pm_runtime_resume_and_get() to prevent refcnt leak mfd: syscon: Allow reset control for syscon devices dt-bindings: mfd/syscon: Add resets property dt-bindings: mfd: syscon: Add amd,pensando-elba-syscon compatible dt-bindings: mfd: qcom,tcsr: Add compatible for MSM8226 mfd: simple-mfd-i2c: Fix incoherent comment regarding DT registration mfd: axp20x: Switch to the sys-off handler API mfd: core: Spelling s/compement/complement/ mfd: max8925: Remove the unused function irq_to_max8925() mfd: qcom-pm8xxx: Remove set but unused variable 'rev' dt-bindings: mfd: syscon: Document GXP register compatible mfd: twl4030-power: Drop empty platform remove function mfd: twl: Fix TWL6032 phy vbus detection mfd: pcf50633-adc: Fix potential memleak in pcf50633_adc_async_read() MAINTAINERS: Move MFD from a Supported to Maintaied state ...
| * mfd: intel-m10-bmc: Split into core and spi specific partsIlpo Järvinen2023-01-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Split the common code from intel-m10-bmc driver into intel-m10-bmc-core and move the SPI bus parts into an interface specific file. intel-m10-bmc-core becomes the core MFD functions which can support multiple bus interface like SPI bus. Co-developed-by: Tianfei zhang <tianfei.zhang@intel.com> Signed-off-by: Tianfei zhang <tianfei.zhang@intel.com> Reviewed-by: Russ Weight <russell.h.weight@intel.com> Acked-by: Guenter Roeck <linux@roeck-us.net> # hwmon Reviewed-by: Xu Yilun <yilun.xu@intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20230116100845.6153-5-ilpo.jarvinen@linux.intel.com
* | Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsiLinus Torvalds2023-02-221-6/+5
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pull SCSI updates from James Bottomley: "Updates to the usual drivers (ufs, lpfc, qla2xxx, libsas). The major core change is a rework to remove the two helpers around scsi_execute_cmd and use it as the only submission interface along with other minor fixes and updates" * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (142 commits) scsi: ufs: core: Fix an error handling path in ufshcd_read_desc_param() scsi: ufs: core: Fix device management cmd timeout flow scsi: aic94xx: Add missing check for dma_map_single() scsi: smartpqi: Replace one-element array with flexible-array member scsi: mpt3sas: Fix a memory leak scsi: qla2xxx: Remove the unused variable wwn scsi: ufs: core: Fix kernel-doc syntax scsi: ufs: core: Add hibernation callbacks scsi: snic: Fix memory leak with using debugfs_lookup() scsi: ufs: core: Limit DMA alignment check scsi: Documentation: Correct spelling scsi: Documentation: Correct spelling scsi: target: Documentation: Correct spelling scsi: aacraid: Allocate cmd_priv with scsicmd scsi: ufs: qcom: dt-bindings: Add SM8550 compatible string scsi: ufs: ufs-qcom: Clear qunipro_g4_sel for HW version major 5 scsi: ufs: qcom: fix platform_msi_domain_free_irqs() reference scsi: ufs: core: Enable DMA clustering scsi: ufs: exynos: Fix the maximum segment size scsi: ufs: exynos: Fix DMA alignment for PAGE_SIZE != 4096 ...
| * | scsi: hwmon: drivetemp: Convert to scsi_execute_cmd()Mike Christie2023-01-131-6/+5
| |/ | | | | | | | | | | | | | | | | | | | | scsi_execute_req() is going to be removed. Convert drivetemp to scsi_execute_cmd(). Signed-off-by: Mike Christie <michael.christie@oracle.com> Reviewed-by: John Garry <john.g.garry@oracle.com> Reviewed-by: Bart Van Assche <bvanassche@acm.org> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* | Merge tag 'hwmon-for-v6.3' of ↵Linus Torvalds2023-02-2231-643/+2152
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging Pull hwmon updates from Guenter Roeck: "New drivers: - Infineon TDA38640 Voltage Regulator - NXP MC34VR500 PMIC - GXP fan controller - MPQ7932 Power Management IC New chip or board support added to existing drivers: - it87: IT87952E; also other cleanup/improvements - intel-m10-bmc-hwmon: N6000 - pmbus/max16601: MAX16600 - aquacomputer_d5next: Aquacomputer Aquastream Ultimate, Aquacomputer Poweradjust 3, Aquacomputer Aquaero - nct6775: Support for B650/B660/X670 ASUS boards - oxp-sensors: AYANEO AIR and AIR Pro Other notable changes: - Various kernel documentation fixes - Various devicetree bindings fixes - Explicitly deprecated [devm_]hwmon_device_register_with_groups - ftsteutates: Support for fanX_fault and other cleanup - ltc2945: Support for setting shunt resistor and other cleanup/fixes - coretemp: Avoid RDMSR interrupts to isolated CPUs, and simplify platform device handling ... and various other minor cleanups and fixes" * tag 'hwmon-for-v6.3' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: (66 commits) hwmon: Deprecate [devm_]hwmon_device_register_with_groups hwmon: (mlxreg-fan) Return zero speed for broken fan hwmon: (gxp-fan-ctrl) use devm_platform_get_and_ioremap_resource() hwmon: (aquacomputer_d5next) Add support for Aquacomputer Aquastream Ultimate hwmon: (aquacomputer_d5next) Add support for Aquacomputer Poweradjust 3 hwmon: (iio_hwmon) use dev_err_probe hwmon: intel-m10-bmc-hwmon: Add N6000 sensors Docs/hwmon/index: Add missing SPDX License Identifier hwmon: (it87) Updated documentation for recent updates to it87 hwmon: (it87) Add new chipset IT87952E hwmon: (it87) Allow multiple chip IDs for force_id hwmon: (it87) Add chip_id in some info message hwmon: (it87) List full chip model name hwmon: (it87) Disable configuration exit for certain chips hwmon: (it87) Allow disabling exiting of configuration mode Documentation: hwmon: correct spelling hwmon: (pmbus/max16601) Add support for MAX16600 hwmon: (ltc2945) Allow setting shunt resistor hwmon: (ltc2945) Handle error case in ltc2945_value_store hwmon: (ltc2945) Add devicetree match table ...
| * | hwmon: (mlxreg-fan) Return zero speed for broken fanVadim Pasternak2023-02-121-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently for broken fan driver returns value calculated based on error code (0xFF) in related fan speed register. Thus, for such fan user gets fan{n}_fault to 1 and fan{n}_input with misleading value. Add check for fan fault prior return speed value and return zero if fault is detected. Fixes: 65afb4c8e7e4 ("hwmon: (mlxreg-fan) Add support for Mellanox FAN driver") Signed-off-by: Vadim Pasternak <vadimp@nvidia.com> Link: https://lore.kernel.org/r/20230212145730.24247-1-vadimp@nvidia.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
| * | hwmon: (gxp-fan-ctrl) use devm_platform_get_and_ioremap_resource()Ye Xingchen2023-02-091-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Convert platform_get_resource(), devm_ioremap_resource() to a single call to devm_platform_get_and_ioremap_resource(), as this is exactly what this function does. Signed-off-by: Ye Xingchen <ye.xingchen@zte.com.cn> Link: https://lore.kernel.org/r/202302081546067270324@zte.com.cn Signed-off-by: Guenter Roeck <linux@roeck-us.net>
| * | hwmon: (aquacomputer_d5next) Add support for Aquacomputer Aquastream UltimateAleksa Savic2023-02-031-6/+120
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Extend aquacomputer_d5next driver to expose various hardware sensors of the Aquacomputer Aquastream Ultimate watercooling pump, which communicates through a proprietary USB HID protocol. Coolant temp and external temp sensor readings are available, along with speed, power, voltage and current of both the pump and optionally connected fan. It also exposes pressure and flow speed readings. Additionally, serial number and firmware version are exposed through debugfs. Tested by a user on Github [1]. [1] https://github.com/aleksamagicka/aquacomputer_d5next-hwmon/issues/50 Signed-off-by: Aleksa Savic <savicaleksa83@gmail.com> Link: https://lore.kernel.org/r/20230203120324.579808-1-savicaleksa83@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
| * | hwmon: (aquacomputer_d5next) Add support for Aquacomputer Poweradjust 3Aleksa Savic2023-02-031-7/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Extend aquacomputer_d5next driver to expose the temp sensor of the Aquacomputer Poweradjust 3 fan controller, which communicates through a proprietary USB HID protocol. The Poweradjust 3 is not currently known to expose firmware version and serial number, so don't create debugfs entries if their values can't be retrieved. Tested by a user on Github [1]. [1] https://github.com/aleksamagicka/aquacomputer_d5next-hwmon/issues/57 Signed-off-by: Aleksa Savic <savicaleksa83@gmail.com> Link: https://lore.kernel.org/r/20230131101210.8095-1-savicaleksa83@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
| * | hwmon: (iio_hwmon) use dev_err_probeAlexander Stein2023-02-031-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of just returning an error code, add an error message as well. While at it, simplify the code and use a common return path. Upon deferral this also nicely lists the following message in /sys/kernel/debug/devices_deferred: adc iio_hwmon: Failed to get channels Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com> Link: https://lore.kernel.org/r/20230131103359.625081-1-alexander.stein@ew.tq-group.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
| * | hwmon: intel-m10-bmc-hwmon: Add N6000 sensorsTianfei zhang2023-02-031-0/+229
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add sensors supported by N6000 card with MAX10 BMC to monitor temperature, voltage, current, and power on board. Signed-off-by: Tianfei zhang <tianfei.zhang@intel.com> Link: https://lore.kernel.org/r/20230131135450.43072-1-ilpo.jarvinen@linux.intel.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
| * | hwmon: (it87) Add new chipset IT87952EFrank Crawford2023-02-031-1/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add IT87952E, a new chip ID (DEV ID 0x8695), which appears to be an updated version of the IT8792E and takes the same configuration. The model name comes from the model name printed on the chip. There is no datasheet publicly available. Signed-off-by: Frank Crawford <frank@crawford.emu.id.au> Link: https://lore.kernel.org/r/20230128060308.1549707-7-frank@crawford.emu.id.au Signed-off-by: Guenter Roeck <linux@roeck-us.net>
| * | hwmon: (it87) Allow multiple chip IDs for force_idFrank Crawford2023-02-031-8/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Extend the force_id module parameter to allow specifying one or both chip IDs separately. If only a single parameter is given it defaults to using that value for all chips, similar to previous usage. Signed-off-by: Frank Crawford <frank@crawford.emu.id.au> Link: https://lore.kernel.org/r/20230128060308.1549707-6-frank@crawford.emu.id.au Signed-off-by: Guenter Roeck <linux@roeck-us.net>
| * | hwmon: (it87) Add chip_id in some info messageFrank Crawford2023-02-031-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | In cases where there are multiple chips, print out which chip is referred to, in the informational message. Signed-off-by: Frank Crawford <frank@crawford.emu.id.au> Link: https://lore.kernel.org/r/20230128060308.1549707-5-frank@crawford.emu.id.au Signed-off-by: Guenter Roeck <linux@roeck-us.net>
| * | hwmon: (it87) List full chip model nameFrank Crawford2023-02-031-23/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ITE model names do not always match the chip ID. Convert from just adding a suffix to specifying the full model name. Signed-off-by: Frank Crawford <frank@crawford.emu.id.au> Link: https://lore.kernel.org/r/20230128060308.1549707-4-frank@crawford.emu.id.au Signed-off-by: Guenter Roeck <linux@roeck-us.net>
| * | hwmon: (it87) Disable configuration exit for certain chipsFrank Crawford2023-02-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | IT8790E and IT8792E/IT8795E have been identified as chips that can have issues when disabling configuration mode. Set to never exit configuration mode. Signed-off-by: Frank Crawford <frank@crawford.emu.id.au> Link: https://lore.kernel.org/r/20230128060308.1549707-3-frank@crawford.emu.id.au Signed-off-by: Guenter Roeck <linux@roeck-us.net>
| * | hwmon: (it87) Allow disabling exiting of configuration modeFrank Crawford2023-02-031-8/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Disabling configuration mode on some chips can result in system hang-ups and access failures to the Super-IO chip at the second SIO address. Never exit configuration mode on these chips to avoid the problem. This patch should be applied in conjunction with a previous one to initialise the second chip for certain mother boards. Signed-off-by: Frank Crawford <frank@crawford.emu.id.au> Link: https://lore.kernel.org/r/20230128060308.1549707-2-frank@crawford.emu.id.au [groeck: Change feature bit from 28 to 19 to be continuous] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
| * | hwmon: (pmbus/max16601) Add support for MAX16600Guenter Roeck2023-02-032-7/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | From programming perspective, MAX16600 is identical to MAX16601 and MAX16602. Add support for it. Cc: Steve Foreman <foremans@google.com> Cc: Holly Barrett <holly.barrett@analog.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
| * | hwmon: (ltc2945) Allow setting shunt resistorJohn Pruitt2023-02-031-43/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add the ability to specify the value of the shunt resistor in the device tree instead of assuming it is 1 milliOhm. The value in the device tree has the name shunt-resistor-micro-ohms and the default value is 1000 micro-ohms in order to preserve the current behavior. Signed-off-by: Jonathan Cormier <jcormier@criticallink.com> Signed-off-by: John Pruitt <jpruitt@criticallink.com> [groeck: Fixed multi-line alignment, squashed last patch of series] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
| * | hwmon: (ltc2945) Handle error case in ltc2945_value_storeJonathan Cormier2023-02-031-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ltc2945_val_to_reg errors were not being handled which would have resulted in register being set to 0 (clamped) instead of being left alone. Fixes: 6700ce035f83 ("hwmon: Driver for Linear Technologies LTC2945") Signed-off-by: Jonathan Cormier <jcormier@criticallink.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
| * | hwmon: (ltc2945) Add devicetree match tableJonathan Cormier2023-02-031-2/+9
| | | | | | | | | | | | | | | | | | | | | Add adi,ltc2945 compatible Signed-off-by: Jonathan Cormier <jcormier@criticallink.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
| * | hwmon: (pmbus/tda38640) Add driver for Infineon TDA38640 Voltage RegulatorPatrick Rudolph2023-02-033-0/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add the pmbus driver for the Infineon TDA38640 voltage regulator. Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com> Signed-off-by: Naresh Solanki <Naresh.Solanki@9elements.com> Link: https://lore.kernel.org/r/20230124202317.3704963-2-Naresh.Solanki@9elements.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
| * | hwmon: (asus-ec-sensors) add zenith ii extreme alphaEric Nguyen2023-02-031-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ROG ZENITH II EXTREME ALPHA provides the same set of sensors as the no-ALPHA version. Tested with the hardware [1]. [1] https://github.com/zeule/asus-ec-sensors/issues/31 Signed-off-by: Eric Nguyen <linux@drogman.ch> Signed-off-by: Eugene Shalygin <eugene.shalygin@gmail.com> Link: https://lore.kernel.org/r/20230128102135.5199-1-eugene.shalygin@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
| * | hwmon: add initial NXP MC34VR500 PMIC monitoring supportMario Kicherer2023-02-033-0/+271
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add initial monitoring support for the MC34VR500 PMIC. In its current state, input voltage and temperature alarms are reported to hwmon. Datasheet: - https://www.nxp.com/docs/en/data-sheet/MC34VR500.pdf Signed-off-by: Mario Kicherer <dev@kicherer.org> Link: https://lore.kernel.org/r/20230118123019.3041303-4-dev@kicherer.org [groeck: Silence stray compiler warning, terminate struct of_device_id] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
| * | hwmon: (it87) Group all related MODULE_PARM definitions togetherFrank Crawford2023-02-031-8/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | Group the MODULE_PARM definitions together to make them easier for future maintenance, rather than having them spread across the file. Signed-off-by: Frank Crawford <frank@crawford.emu.id.au> Link: https://lore.kernel.org/r/20230121085754.1693336-2-frank@crawford.emu.id.au Signed-off-by: Guenter Roeck <linux@roeck-us.net>
| * | hwmon: (ftsteutates) Add support for fanX_fault attributesArmin Wolf2023-02-031-8/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The driver knows internally when a fan is not connected, but does not export this knowledge to userspace. Use the standard fanX_fault attributes to notify userspace if a fan is not connected. Tested on a Fujitsu DS3401-B1. Signed-off-by: Armin Wolf <W_Armin@gmx.de> Link: https://lore.kernel.org/r/20230105225107.58308-4-W_Armin@gmx.de Signed-off-by: Guenter Roeck <linux@roeck-us.net>
| * | hwmon: (ftsteutates) Replace fanX_source with pwmX_auto_channels_tempArmin Wolf2023-02-031-49/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace the nonstandard fanX_source attributes with the standardized pwmX_auto_channels_temp attributes and document the special behaviour associated with those attributes. Tested on a Fujitsu DS3401-B1. Signed-off-by: Armin Wolf <W_Armin@gmx.de> Link: https://lore.kernel.org/r/20230105225107.58308-3-W_Armin@gmx.de Signed-off-by: Guenter Roeck <linux@roeck-us.net>
| * | hwmon: (ftsteutates) Convert to devm_hwmon_device_register_with_info()Armin Wolf2023-02-031-328/+204
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Convert driver to use devm_hwmon_device_register_with_info() to reduce module size by ~30%. Tested on a Fujitsu DS3401-B1. Signed-off-by: Armin Wolf <W_Armin@gmx.de> Link: https://lore.kernel.org/r/20230105225107.58308-2-W_Armin@gmx.de Signed-off-by: Guenter Roeck <linux@roeck-us.net>
| * | hwmon: (it87) Set second Super-IO chip in configuration modeFrank Crawford2023-02-031-0/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On various Gigabyte AM4 boards (AB350, AX370), the second Super-IO chip (IT8792E) needs to be in configuration mode before accessing the first due to a bug in IT8792E which otherwise results in LPC bus access errors. This needs to be done before accessing the first Super-IO chip since the second chip may have been accessed prior to loading this driver. The problem is also reported to affect IT8795E, which is used on X299 boards and has the same chip ID as IT8792E (0x8733). It also appears to affect systems with IT8790E, which is used on some Z97X-Gaming boards as well as Z87X-OC, and other more recent Gigabyte boards. Signed-off-by: Frank Crawford <frank@crawford.emu.id.au> Link: https://lore.kernel.org/r/20230104060926.619686-3-frank@crawford.emu.id.au [groeck: Made description pass checkpatch] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
| * | hwmon: (it87) Allow calling __superio_enter outside muxed regionFrank Crawford2023-02-031-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow for superio_enter to be called without requesting the muxed memory region, in particular for initialisation of the second chipset, which must be put into configuration mode, but without an associated call to leave configuration mode. Signed-off-by: Frank Crawford <frank@crawford.emu.id.au> Link: https://lore.kernel.org/r/20230104060926.619686-2-frank@crawford.emu.id.au [groeck: Clarified subject] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
| * | hwmon: ibmpex: remove unnecessary (void*) conversionsXU pengfei2023-02-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Pointer variables of void * type do not require type cast. Signed-off-by: XU pengfei <xupengfei@nfschina.com> Link: https://lore.kernel.org/r/20230111043605.3726-1-xupengfei@nfschina.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
| * | hwmon: (nct6775) B650/B660/X670 ASUS boards supportDenis Pauk2023-02-031-0/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Boards such as: "EX-B660M-V5 PRO D4", "PRIME B650-PLUS", "PRIME B650M-A", "PRIME B650M-A AX", "PRIME B650M-A II", "PRIME B650M-A WIFI", "PRIME B650M-A WIFI II", "PRIME B660M-A D4", "PRIME B660M-A WIFI D4", "PRIME X670-P", "PRIME X670-P WIFI", "PRIME X670E-PRO WIFI", "Pro B660M-C-D4", "ProArt B660-CREATOR D4", "ProArt X670E-CREATOR WIFI", "ROG CROSSHAIR X670E EXTREME", "ROG CROSSHAIR X670E GENE", "ROG CROSSHAIR X670E HERO", "ROG MAXIMUS XIII EXTREME GLACIAL", "ROG MAXIMUS Z690 EXTREME", "ROG MAXIMUS Z690 EXTREME GLACIAL", "ROG STRIX B650-A GAMING WIFI", "ROG STRIX B650E-E GAMING WIFI", "ROG STRIX B650E-F GAMING WIFI", "ROG STRIX B650E-I GAMING WIFI", "ROG STRIX B660-A GAMING WIFI D4", "ROG STRIX B660-F GAMING WIFI", "ROG STRIX B660-G GAMING WIFI", "ROG STRIX B660-I GAMING WIFI", "ROG STRIX X670E-A GAMING WIFI", "ROG STRIX X670E-E GAMING WIFI", "ROG STRIX X670E-F GAMING WIFI", "ROG STRIX X670E-I GAMING WIFI", "ROG STRIX Z590-A GAMING WIFI II", "ROG STRIX Z690-A GAMING WIFI D4", "TUF GAMING B650-PLUS", "TUF GAMING B650-PLUS WIFI", "TUF GAMING B650M-PLUS", "TUF GAMING B650M-PLUS WIFI", "TUF GAMING B660M-PLUS WIFI", "TUF GAMING X670E-PLUS", "TUF GAMING X670E-PLUS WIFI", "TUF GAMING Z590-PLUS WIFI", have got a NCT6799D chip, but by default there's no use of it because of resource conflict with WMI method. This commit adds such boards to the monitoring list with new ACPI device UID. BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=204807 Signed-off-by: Denis Pauk <pauk.denis@gmail.com> Co-developed-by: Ahmad Khalifa <ahmad@khalifa.ws> Signed-off-by: Ahmad Khalifa <ahmad@khalifa.ws> Tested-by: Jeroen Beerstra <jeroen@beerstra.org> Tested-by: Slawomir Stepien <sst@poczta.fm> Link: https://lore.kernel.org/r/20230111212241.7456-2-pauk.denis@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
| * | hwmon: (nct6775) Directly call ASUS ACPI WMI methodDenis Pauk2023-02-032-30/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | New ASUS B650/B660/X670 boards firmware have not exposed WMI monitoring GUID and entrypoint method WMBD could be implemented for different device UID. Implement the direct call to entrypoint method for monitoring the device UID of B550/X570 boards. BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=204807 Signed-off-by: Denis Pauk <pauk.denis@gmail.com> Co-developed-by: Ahmad Khalifa <ahmad@khalifa.ws> Signed-off-by: Ahmad Khalifa <ahmad@khalifa.ws> Link: https://lore.kernel.org/r/20230111212241.7456-1-pauk.denis@gmail.com [groeck: Fix multi-line formatting] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
| * | hwmon: (hih6130) fix kernel-doc warningsRandy Dunlap2023-02-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use the correct function name in kernel-doc comments to prevent these warnings: drivers/hwmon/hih6130.c:164: warning: expecting prototype for hih6130_show_temperature(). Prototype was for hih6130_temperature_show() instead drivers/hwmon/hih6130.c:185: warning: expecting prototype for hih6130_show_humidity(). Prototype was for hih6130_humidity_show() instead Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Cc: Jean Delvare <jdelvare@suse.com> Cc: Guenter Roeck <linux@roeck-us.net> Cc: linux-hwmon@vger.kernel.org Link: https://lore.kernel.org/r/20230113064549.21289-1-rdunlap@infradead.org Signed-off-by: Guenter Roeck <linux@roeck-us.net>
| * | hwmon: (sht15,sht21) fix kernel-doc warningsRandy Dunlap2023-02-032-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use the correct function names in kernel-doc comments to prevent these warnings: drivers/hwmon/sht15.c:682: warning: expecting prototype for sht15_show_status(). Prototype was for sht15_status_show() instead drivers/hwmon/sht15.c:705: warning: expecting prototype for sht15_store_heater(). Prototype was for sht15_status_store() instead drivers/hwmon/sht15.c:738: warning: expecting prototype for sht15_show_temp(). Prototype was for sht15_temp_show() instead drivers/hwmon/sht15.c:760: warning: expecting prototype for sht15_show_humidity(). Prototype was for sht15_humidity_show() instead drivers/hwmon/sht21.c:128: warning: expecting prototype for sht21_show_temperature(). Prototype was for sht21_temperature_show() instead drivers/hwmon/sht21.c:149: warning: expecting prototype for sht21_show_humidity(). Prototype was for sht21_humidity_show() instead Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Cc: Jean Delvare <jdelvare@suse.com> Cc: Guenter Roeck <linux@roeck-us.net> Cc: linux-hwmon@vger.kernel.org Link: https://lore.kernel.org/r/20230113064556.21685-1-rdunlap@infradead.org Signed-off-by: Guenter Roeck <linux@roeck-us.net>
| * | hwmon: (emc2305) fix kernel-doc warningsRandy Dunlap2023-02-031-11/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix kernel-doc warnings: drivers/hwmon/emc2305.c:62: warning: Cannot understand * @cdev: cooling device; on line 62 - I thought it was a doc line drivers/hwmon/emc2305.c:89: warning: Cannot understand * @client: i2c client; on line 89 - I thought it was a doc line and drop ';' at end of each struct member line. Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Cc: Jean Delvare <jdelvare@suse.com> Cc: Guenter Roeck <linux@roeck-us.net> Cc: linux-hwmon@vger.kernel.org Link: https://lore.kernel.org/r/20230113064540.20179-1-rdunlap@infradead.org Signed-off-by: Guenter Roeck <linux@roeck-us.net>
| * | hwmon: (gxp-fan-ctrl) Add GXP fan controllerNick Hawkins2023-02-033-0/+265
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The GXP SoC can support up to 16 fans through the interface provided by the CPLD. The current support is limited to 8 fans. The fans speeds are controlled via 8 different PWMs which can vary in value from 0-255. The fans are also capable of reporting if they have failed to the CPLD which in turn reports the status to the GXP SoC. Signed-off-by: Nick Hawkins <nick.hawkins@hpe.com> Link: https://lore.kernel.org/r/20230103203654.59322-2-nick.hawkins@hpe.com [groeck: Improved alignment of defined, added missing include linux/bits.h] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
| * | hwmon: (coretemp) Simplify platform device handlingRobin Murphy2023-02-031-70/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Coretemp's platform driver is unconventional. All the real work is done globally by the initcall and CPU hotplug notifiers, while the "driver" effectively just wraps an allocation and the registration of the hwmon interface in a long-winded round-trip through the driver core. The whole logic of dynamically creating and destroying platform devices to bring the interfaces up and down is error prone, since it assumes platform_device_add() will synchronously bind the driver and set drvdata before it returns, thus results in a NULL dereference if drivers_autoprobe is turned off for the platform bus. Furthermore, the unusual approach of doing that from within a CPU hotplug notifier, already commented in the code that it deadlocks suspend, also causes lockdep issues for other drivers or subsystems which may want to legitimately register a CPU hotplug notifier from a platform bus notifier. All of these issues can be solved by ripping this unusual behaviour out completely, simply tying the platform devices to the lifetime of the module itself, and directly managing the hwmon interfaces from the hotplug notifiers. There is a slight user-visible change in that /sys/bus/platform/drivers/coretemp will no longer appear, and /sys/devices/platform/coretemp.n will remain present if package n is hotplugged off, but hwmon users should really only be looking for the presence of the hwmon interfaces, whose behaviour remains unchanged. Link: https://lore.kernel.org/lkml/20220922101036.87457-1-janusz.krzysztofik@linux.intel.com/ Link: https://gitlab.freedesktop.org/drm/intel/issues/6641 Signed-off-by: Robin Murphy <robin.murphy@arm.com> Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com> Link: https://lore.kernel.org/r/20230103114620.15319-1-janusz.krzysztofik@linux.intel.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
| * | hwmon: (aquacomputer_d5next) Add support for reading calculated Aquaero sensorsAleksa Savic2023-02-031-5/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for reading four calculated virtual temp sensors on the Aquacomputer Aquaero. Values of these sensors are calculated on the device itself based on what the user configured in the official software. Configuring these sensors is not currently reverse engineered. Signed-off-by: Aleksa Savic <savicaleksa83@gmail.com> Link: https://lore.kernel.org/r/20230101190056.1357124-1-savicaleksa83@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
| * | hwmon: (aht10) Fix some kernel-doc commentsYang Li2023-02-031-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make the description of @aht10_data to @data in aht10_read_values() and remove @client in aht10_init() to clear the below warnings: drivers/hwmon/aht10.c:87: warning: Excess function parameter 'client' description in 'aht10_init' drivers/hwmon/aht10.c:131: warning: Function parameter or member 'data' not described in 'aht10_read_values' drivers/hwmon/aht10.c:131: warning: Excess function parameter 'aht10_data' description in 'aht10_read_values' Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=3543 Reported-by: Abaci Robot <abaci@linux.alibaba.com> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com> Link: https://lore.kernel.org/r/20221223081056.88345-1-yang.lee@linux.alibaba.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
| * | hwmon: (ftsteutates) Use devm_watchdog_register_device()Armin Wolf2023-02-031-9/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use devm_watchdog_register_device() to let devres take care of unregistering the watchdog at device removal. Remove the now pointless fts_remove() function. Tested on a Fujitsu DS3401-B1. Signed-off-by: Armin Wolf <W_Armin@gmx.de> Link: https://lore.kernel.org/r/20221224041855.83981-4-W_Armin@gmx.de Signed-off-by: Guenter Roeck <linux@roeck-us.net>
| * | hwmon: (oxp-sensors) Add AYANEO AIR and AIR ProDerek J. Clark2023-02-031-9/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for the AYANEO AIR and AYANEO AIR Pro models of handheld devices. These devices use the same EC registers and logic as the One X Player mini AMD. Previous AYANEO models are not supported as they use a different EC and do not have the necessary fan speed write enable and setting registers. The driver is tested on AYANEO AIR while AIR Pro model EC functionality and DMI data were verified using command line tools by another user. Add: - AYANEO AIR (AMD 5560U) - AYANEO AIR Pro (AMD 5560U) - AYANEO AIR Pro (AMD 5825U) While at it, fix spelling error (appart -> apart). Link: https://lore.kernel.org/r/20221229025609.147482-1-derekjohn.clark@gmail.com Signed-off-by: Derek J. Clark <derekjohn.clark@gmail.com> [groeck: Sanitize commit description] Signed-off-by: Guenter Roeck <linux@roeck-us.net>