summaryrefslogtreecommitdiff
path: root/drivers/hwmon
AgeCommit message (Collapse)AuthorFilesLines
2023-09-18hwmon: (nct6775) Fix non-existent ALARM warningAhmad Khalifa1-0/+4
Skip non-existent ALARM attribute to avoid a shift-out-of-bounds dmesg warning. Reported-by: Doug Smythies <dsmythies@telus.net> Closes: https://lore.kernel.org/linux-hwmon/ZQVzdlHgWdFhOVyQ@debian.me/T/#mc69b690660eb50734a6b07506d74a119e0266f1b Fixes: b7f1f7b2523a ("hwmon: (nct6775) Additional TEMP registers for nct6799") Signed-off-by: Ahmad Khalifa <ahmad@khalifa.ws> Link: https://lore.kernel.org/r/20230918184722.2033225-1-ahmad@khalifa.ws Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-09-01Merge tag 'char-misc-6.6-rc1' of ↵Linus Torvalds2-0/+68
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc Pull char/misc driver updates from Greg KH: "Here is the big set of char/misc and other small driver subsystem changes for 6.6-rc1. Stuff all over the place here, lots of driver updates and changes and new additions. Short summary is: - new IIO drivers and updates - Interconnect driver updates - fpga driver updates and additions - fsi driver updates - mei driver updates - coresight driver updates - nvmem driver updates - counter driver updates - lots of smaller misc and char driver updates and additions All of these have been in linux-next for a long time with no reported problems" * tag 'char-misc-6.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (267 commits) nvmem: core: Notify when a new layout is registered nvmem: core: Do not open-code existing functions nvmem: core: Return NULL when no nvmem layout is found nvmem: core: Create all cells before adding the nvmem device nvmem: u-boot-env:: Replace zero-length array with DECLARE_FLEX_ARRAY() helper nvmem: sec-qfprom: Add Qualcomm secure QFPROM support dt-bindings: nvmem: sec-qfprom: Add bindings for secure qfprom dt-bindings: nvmem: Add compatible for QCM2290 nvmem: Kconfig: Fix typo "drive" -> "driver" nvmem: Explicitly include correct DT includes nvmem: add new NXP QorIQ eFuse driver dt-bindings: nvmem: Add t1023-sfp efuse support dt-bindings: nvmem: qfprom: Add compatible for MSM8226 nvmem: uniphier: Use devm_platform_get_and_ioremap_resource() nvmem: qfprom: do some cleanup nvmem: stm32-romem: Use devm_platform_get_and_ioremap_resource() nvmem: rockchip-efuse: Use devm_platform_get_and_ioremap_resource() nvmem: meson-mx-efuse: Convert to devm_platform_ioremap_resource() nvmem: lpc18xx_otp: Convert to devm_platform_ioremap_resource() nvmem: brcm_nvram: Use devm_platform_get_and_ioremap_resource() ...
2023-08-29Merge tag 'hwmon-for-v6.6' of ↵Linus Torvalds63-1304/+1394
git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging Pull hwmon updates from Guenter Roeck: "New drivers: - Renesas HS3001 Chip support added to existing drivers: - pmbus/mp2975 driver now supports MP2971 and MP2973 Functional improvements: - Additional voltage and temperature sensor support for NCT6798/NCT6799 in nt6755 driver - it87 driver now detects AMDTSI sensor type - dimmtemp now supports more than 32 DIMMs Driver removals: - sm665 driver removed as unsupportable and long since obsolete .. and minor fixes, cleanups, and simplifications in several drivers" * tag 'hwmon-for-v6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: (57 commits) hwmon: (tmp513) Simplify probe() hwmon: (tmp513) Fix the channel number in tmp51x_is_visible() hwmon: (mlxreg-fan) Extend number of supported fans hwmon: (sis5595) Do PCI error checks on own line hwmon: (vt8231) Do PCI error checks on own line hwmon: (via686a) Do PCI error checks on own line hwmon: pmbus: Fix -EIO seen on pli1209 hwmon: pmbus: Drop unnecessary clear fault page hwmon: pmbus: Reduce clear fault page invocations hwmon: (nsa320-hwmon) Remove redundant of_match_ptr() hwmon: (pmbus/ucd9200) fix Wvoid-pointer-to-enum-cast warning hwmon: (pmbus/ucd9000) fix Wvoid-pointer-to-enum-cast warning hwmon: (pmbus/tps53679) fix Wvoid-pointer-to-enum-cast warning hwmon: (pmbus/ibm-cffps) fix Wvoid-pointer-to-enum-cast warning hwmon: (tmp513) fix Wvoid-pointer-to-enum-cast warning hwmon: (max6697) fix Wvoid-pointer-to-enum-cast warning hwmon: (max20730) fix Wvoid-pointer-to-enum-cast warning hwmon: (lm90) fix Wvoid-pointer-to-enum-cast warning hwmon: (lm85) fix Wvoid-pointer-to-enum-cast warning hwmon: (lm75) fix Wvoid-pointer-to-enum-cast warning ...
2023-08-29Merge tag 'x86_misc_for_v6.6_rc1' of ↵Linus Torvalds1-1/+7
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull misc x86 updates from Borislav Petkov: - Add PCI device IDs for a new AMD family 0x1a CPUs and use them in the respective drivers - Update HPE Superdome Flex maintainers list * tag 'x86_misc_for_v6.6_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/uv: Update HPE Superdome Flex Maintainers EDAC/amd64: Add support for AMD family 1Ah models 00h-1Fh and 40h-4Fh hwmon: (k10temp) Add thermal support for AMD Family 1Ah-based models x86/amd_nb: Add PCI IDs for AMD Family 1Ah-based models
2023-08-25hwmon: (tmp513) Simplify probe()Biju Das1-4/+1
Simpilfy probe() by replacing device_get_match_data() and id lookup for retrieving match data by i2c_get_match_data(). Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> Link: https://lore.kernel.org/r/20230824204456.401580-3-biju.das.jz@bp.renesas.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-08-25hwmon: (tmp513) Fix the channel number in tmp51x_is_visible()Biju Das1-1/+1
The supported channels for this driver are {0..3}. Fix the incorrect channel in tmp51x_is_visible(). Reported-by: Guenter Roeck <linux@roeck-us.net> Closes: https://lore.kernel.org/all/ea0eccc0-a29f-41e4-9049-a1a13f8b16f1@roeck-us.net/ Fixes: 59dfa75e5d82 ("hwmon: Add driver for Texas Instruments TMP512/513 sensor chips.") Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> Link: https://lore.kernel.org/r/20230824204456.401580-2-biju.das.jz@bp.renesas.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-08-25hwmon: (mlxreg-fan) Extend number of supported fansVadim Pasternak1-1/+11
Some new big modular systems can be equipped with up to 24 fans. Extend maximum number of fans accordingly. Signed-off-by: Vadim Pasternak <vadimp@nvidia.com> Link: https://lore.kernel.org/r/20230824164006.26868-1-vadimp@nvidia.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-08-25hwmon: (sis5595) Do PCI error checks on own lineIlpo Järvinen1-15/+20
Instead of if conditions with line splits, use the usual error handling pattern with a separate variable to improve readability. Handle error print with a label instead of trying to chain everything into a single if condition. No functional changes intended. Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Link: https://lore.kernel.org/r/20230824132832.78705-14-ilpo.jarvinen@linux.intel.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-08-25hwmon: (vt8231) Do PCI error checks on own lineIlpo Järvinen1-5/+6
Instead of if conditions with line splits, use the usual error handling pattern with a separate variable to improve readability. No functional changes intended. Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Link: https://lore.kernel.org/r/20230824132832.78705-7-ilpo.jarvinen@linux.intel.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-08-25hwmon: (via686a) Do PCI error checks on own lineIlpo Järvinen1-9/+9
Instead of if conditions with line splits, use the usual error handling pattern with a separate variable to improve readability. No functional changes intended. Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Link: https://lore.kernel.org/r/20230824132832.78705-6-ilpo.jarvinen@linux.intel.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-08-21hwmon: pmbus: Fix -EIO seen on pli1209Patrick Rudolph1-0/+26
After doing performance optimizations the pli1209 driver failed to probe with a probabilty of 2%. It wasn't able to read the PMBUS_OPERATION register due to an -EIO error. An investigation showed that the PLI1209 takes 230 usec to execute the CLEAR_FAULTS command. During that time it's busy and NACKs all requests on the SMBUS interface. It also NACKs reads on PMBUS_STATUS_BYTE making it impossible to poll the BUSY flag. Add a custom write_data function to just wait for not BUSY unconditionally after sending a CLEAR_FAULTS command. TEST: Verified using an I2C bus analyser that no more NACKs are seen after sending a CLEAR_FAULTS command. Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com> Signed-off-by: Naresh Solanki <Naresh.Solanki@9elements.com> Link: https://lore.kernel.org/r/20230817092527.808631-3-Naresh.Solanki@9elements.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-08-21hwmon: pmbus: Drop unnecessary clear fault pagePatrick Rudolph1-1/+0
The pmbus_check_byte_register function already calls clear fault page, so there's no need to do it again in pmbus_identify_common. TEST: Verified using an I2C bus analyser to confirm that only one clear fault page is being send instead of two in a row. Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com> Signed-off-by: Naresh Solanki <Naresh.Solanki@9elements.com> Link: https://lore.kernel.org/r/20230817092527.808631-2-Naresh.Solanki@9elements.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-08-21hwmon: pmbus: Reduce clear fault page invocationsPatrick Rudolph1-1/+2
Observing I2C traffic revealed consecutive transmission of CLEAR_FAULT commands. While this doesn't cause issues, it extends driver probe time. Avoid invoking pmbus_clear_fault_page for virtual registers, as they're managed by the driver, not the chip. TEST: Verified using an I2C bus analyzer that only one CLEAR_FAULT command is send instead 5 in a row. Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com> Signed-off-by: Naresh Solanki <Naresh.Solanki@9elements.com> Link: https://lore.kernel.org/r/20230817092527.808631-1-Naresh.Solanki@9elements.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-08-21hwmon: (nsa320-hwmon) Remove redundant of_match_ptr()Ruan Jinjie1-1/+1
The driver depends on CONFIG_OF, it is not necessary to use of_match_ptr() here. Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com> Link: https://lore.kernel.org/r/20230810062635.1947552-1-ruanjinjie@huawei.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-08-21hwmon: (pmbus/ucd9200) fix Wvoid-pointer-to-enum-cast warningKrzysztof Kozlowski1-1/+1
'chip' is an enum, thus cast of pointer on 64-bit compile test with W=1 causes: ucd9200.c:106:10: error: cast to smaller integer type 'enum chips' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast] Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/20230810093157.94244-15-krzysztof.kozlowski@linaro.org Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-08-21hwmon: (pmbus/ucd9000) fix Wvoid-pointer-to-enum-cast warningKrzysztof Kozlowski1-1/+1
'chip' is an enum, thus cast of pointer on 64-bit compile test with W=1 causes: ucd9000.c:591:10: error: cast to smaller integer type 'enum chips' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast] Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/20230810093157.94244-14-krzysztof.kozlowski@linaro.org Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-08-21hwmon: (pmbus/tps53679) fix Wvoid-pointer-to-enum-cast warningKrzysztof Kozlowski1-1/+1
'chip_id' is an enum, thus cast of pointer on 64-bit compile test with W=1 causes: tps53679.c:238:13: error: cast to smaller integer type 'enum chips' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast] Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/20230810093157.94244-13-krzysztof.kozlowski@linaro.org Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-08-21hwmon: (pmbus/ibm-cffps) fix Wvoid-pointer-to-enum-cast warningKrzysztof Kozlowski1-1/+1
'vs' is an enum, thus cast of pointer on 64-bit compile test with W=1 causes: ibm-cffps.c:492:8: error: cast to smaller integer type 'enum versions' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast] Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/20230810093157.94244-12-krzysztof.kozlowski@linaro.org Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-08-21hwmon: (tmp513) fix Wvoid-pointer-to-enum-cast warningKrzysztof Kozlowski1-1/+1
'id' is an enum, thus cast of pointer on 64-bit compile test with W=1 causes: tmp513.c:724:14: error: cast to smaller integer type 'enum tmp51x_ids' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast] Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/20230810093157.94244-11-krzysztof.kozlowski@linaro.org Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-08-21hwmon: (max6697) fix Wvoid-pointer-to-enum-cast warningKrzysztof Kozlowski1-1/+1
'type' is an enum, thus cast of pointer on 64-bit compile test with W=1 causes: max6697.c:705:16: error: cast to smaller integer type 'enum chips' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast] Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/20230810093157.94244-10-krzysztof.kozlowski@linaro.org Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-08-21hwmon: (max20730) fix Wvoid-pointer-to-enum-cast warningKrzysztof Kozlowski1-1/+1
'chip_id' is an enum, thus cast of pointer on 64-bit compile test with W=1 causes: max20730.c:719:13: error: cast to smaller integer type 'enum chips' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast] Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/20230810093157.94244-9-krzysztof.kozlowski@linaro.org Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-08-21hwmon: (lm90) fix Wvoid-pointer-to-enum-cast warningKrzysztof Kozlowski1-1/+1
'kind' is an enum, thus cast of pointer on 64-bit compile test with W=1 causes: lm90.c:2768:16: error: cast to smaller integer type 'enum chips' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast] Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/20230810093157.94244-8-krzysztof.kozlowski@linaro.org Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-08-21hwmon: (lm85) fix Wvoid-pointer-to-enum-cast warningKrzysztof Kozlowski1-1/+1
'type' is an enum, thus cast of pointer on 64-bit compile test with W=1 causes: lm85.c:1562:16: error: cast to smaller integer type 'enum chips' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast] Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/20230810093157.94244-7-krzysztof.kozlowski@linaro.org Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-08-21hwmon: (lm75) fix Wvoid-pointer-to-enum-cast warningKrzysztof Kozlowski1-1/+1
'kind' is an enum, thus cast of pointer on 64-bit compile test with W=1 causes: lm75.c:581:10: error: cast to smaller integer type 'enum lm75_type' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast] Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/20230810093157.94244-6-krzysztof.kozlowski@linaro.org Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-08-21hwmon: (lm63) fix Wvoid-pointer-to-enum-cast warningKrzysztof Kozlowski1-1/+1
'kind' is an enum, thus cast of pointer on 64-bit compile test with W=1 causes: lm63.c:1108:16: error: cast to smaller integer type 'enum chips' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast] Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/20230810093157.94244-5-krzysztof.kozlowski@linaro.org Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-08-21hwmon: (ina2xx) fix Wvoid-pointer-to-enum-cast warningKrzysztof Kozlowski1-1/+1
'chip' is an enum, thus cast of pointer on 64-bit compile test with W=1 causes: ina2xx.c:627:10: error: cast to smaller integer type 'enum ina2xx_ids' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast] Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/20230810093157.94244-4-krzysztof.kozlowski@linaro.org Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-08-21hwmon: (ads7828) fix Wvoid-pointer-to-enum-cast warningKrzysztof Kozlowski1-2/+1
'chip' is an enum, thus cast of pointer on 64-bit compile test with W=1 causes: ads7828.c:142:10: error: cast to smaller integer type 'enum ads7828_chips' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast] Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/20230810093157.94244-3-krzysztof.kozlowski@linaro.org Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-08-21hwmon: (ad7418) fix Wvoid-pointer-to-enum-cast warningKrzysztof Kozlowski1-1/+1
'type' is an enum, thus cast of pointer on 64-bit compile test with W=1 causes: ad7418.c:256:16: error: cast to smaller integer type 'enum chips' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast] Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/20230810093157.94244-2-krzysztof.kozlowski@linaro.org Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-08-21hwmon: (adt7475) fix Wvoid-pointer-to-enum-cast warningKrzysztof Kozlowski1-1/+1
'chip' is an enum, thus cast of pointer on 64-bit compile test with W=1 causes: adt7475.c:1655:10: error: cast to smaller integer type 'enum chips' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast] Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/20230810093157.94244-1-krzysztof.kozlowski@linaro.org Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-08-21hwmon: (max6639) Add compatible stringNaresh Solanki1-0/+6
Use maxim,max6639 as compatible string for the driver. Signed-off-by: Naresh Solanki <Naresh.Solanki@9elements.com> Link: https://lore.kernel.org/r/20230803144401.1151065-2-Naresh.Solanki@9elements.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-08-21hwmon: (nct6775) Additional TEMP registers for nct6799Ahmad Khalifa2-31/+121
Additional TEMP registers for nct6798d, nct6799d-r and nct6796d-s This allows the max/max_hyst/crit attributes to be shown/stored * Increase NUM_TEMP from 10 to 12 * Separate TEMP/MON_TEMP/OVER/HYST/CRIT registers * Rename "PECI Calibration" to include "TSI" too * Update ALARM/BEEP bits for temps for 6799 * For 6799, keep temp_fixed_num at 6, but increase num_temp_alarms/num_temp_beeps to 7/8 Tested with NCT6799D-R showing additional sysfs attributes: * temp3-temp8: max/max_hyst/beep/alarm * temp3-temp6: crit/offset Signed-off-by: Ahmad Khalifa <ahmad@khalifa.ws> Link: https://lore.kernel.org/r/20230802185820.3642399-1-ahmad@khalifa.ws [groeck: Addressed cosmetic checkpatch complaints] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-08-21hwmon: Add driver for Renesas HS3001Andre Werner3-0/+253
Add base support for Renesas HS3001 temperature and humidity sensors and its compatibles HS3002, HS3003 and HS3004. The sensor has a fix I2C address 0x44. The resolution is fixed to 14bit (ref. Missing feature). Missing feature: - Accessing non-volatile memory: Custom board has no possibility to control voltage supply of sensor. Thus, we cannot send the necessary control commands within the first 10ms after power-on. Signed-off-by: Andre Werner <andre.werner@systec-electronic.com> Link: https://lore.kernel.org/r/20230725042207.22310-2-andre.werner@systec-electronic.com [groeck: Cosmetic documentation fixup; added documentation to index; replaced probe_new with probe dropped unused variable] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-08-21hwmon: (hp-wmi-sensors) Initialize pevents in hp_wmi_sensors_init()James Seo1-1/+1
The following warning is given by the Smatch static checker: drivers/hwmon/hp-wmi-sensors.c:1937 hp_wmi_sensors_init() error: uninitialized symbol 'pevents'. If there are no instances of the HPBIOS_PlatformEvents WMI object available, init_platform_events() never initializes this pointer, which may then be passed to hp_wmi_debugfs_init() uninitialized. The impact should be limited because hp_wmi_debugfs_init() uses this pointer only if the count of HPBIOS_PlatformEvents instances is _not_ zero, while conversely, it will be uninitialized only if the count of such instances _is_ zero. However, passing it uninitialized still constitutes a bug. Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Closes: https://lore.kernel.org/linux-hwmon/f72c129b-8c57-406a-bf41-bd889b65ea0f@moroto.mountain/ Signed-off-by: James Seo <james@equiv.tech> Link: https://lore.kernel.org/r/20230725094817.588640-1-james@equiv.tech Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-08-21hwmon: (hp-wmi-sensors) Get WMI instance count from WMI driver coreJames Seo1-17/+3
Commit 2a2b13ae50cf ("platform/x86: wmi: Allow retrieving the number of WMI object instances") means we no longer need to find this ourselves. Signed-off-by: James Seo <james@equiv.tech> Link: https://lore.kernel.org/r/20230722172513.9324-2-james@equiv.tech Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-08-21hwmon: (nct6775) Add support for 18 IN readings for nct6799Ahmad Khalifa2-11/+45
* Add additional VIN/IN_MIN/IN_MAX register values * Separate ALARM/BEEP bits for nct6799 * Update scaling factors for nct6799 Registers/alarms match for NCT6796D-S and NCT6799D-R Tested on NCT6799D-R for new IN/MIN/MAX and ALARMS Signed-off-by: Ahmad Khalifa <ahmad@khalifa.ws> Link: https://lore.kernel.org/r/20230719224142.411237-1-ahmad@khalifa.ws Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-08-21hwmon: (sht3x) convert some of sysfs interface to hwmonJuenKit Yip1-136/+251
update_interval, temperature/humidity max/min and hyst were moved to new hwmon interface, and only heater and repeatability were reserved as non-stardard sysfs interface. Signed-off-by: JuenKit Yip <JuenKit_Yip@hotmail.com> Link: https://lore.kernel.org/r/DB4PR10MB626157BC697F2CD6100431359229A@DB4PR10MB6261.EURPRD10.PROD.OUTLOOK.COM Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-08-21hwmon: (pmbus/mp2975) Fix PGOOD in READ_STATUS_WORDPatrick Rudolph1-0/+5
MP2973 & MP2971 return PGOOD instead of PB_STATUS_POWER_GOOD_N. Fix that in the read_word_data hook. MP2975 should not be affected, but that has not been confirmed with hardware. Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com> Signed-off-by: Naresh Solanki <Naresh.Solanki@9elements.com> Link: https://lore.kernel.org/r/20230731092204.2933045-1-Naresh.Solanki@9elements.com [groeck: Rephrased description to indicate that MP2975 is likely not affected] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-08-21hwmon: (pmbus/mp2975) Add OCP limitPatrick Rudolph1-11/+65
Add support for PMBUS_IOUT_OC_FAULT_LIMIT. Add a helper function to convert the limit to LINEAR11 format and read data->info.phases[0] on MP2971 and MP2973 as well. Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com> Signed-off-by: Naresh Solanki <Naresh.Solanki@9elements.com> Link: https://lore.kernel.org/r/20230714135124.2645339-8-Naresh.Solanki@9elements.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-08-21hwmon: (pmbus/mp2975) Add regulator supportPatrick Rudolph2-0/+22
Add support to expose the PMBUS regulator. Tested on MP2973 and MP2971. Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com> Signed-off-by: Naresh Solanki <Naresh.Solanki@9elements.com> Link: https://lore.kernel.org/r/20230714135124.2645339-7-Naresh.Solanki@9elements.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-08-21hwmon: (pmbus/mp2975) Add support for MP2971 and MP2973Patrick Rudolph1-33/+214
Add support for MP2971 and MP2973, the successor of MP2975. The major differences are: - On MP2973 and MP2971 the Vref cannot be read and thus most of the OVP/current calculations won't work. - MP2973 and MP2971 also support LINEAR format for VOUT - MP2973 and MP2971 do not support OVP2 - On MP2973 and MP2971 most registers are in LINEAR format - The IMVP9_EN bit has a different position - Per phase current sense haven't been implemented. As on MP2975 most of the FAULT_LIMIT and WARN_LIMIT registers have been redefined and doesn't provide the functionality as defined in PMBUS spec. Tested on MP2973 and MP2971. Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com> Signed-off-by: Naresh Solanki <Naresh.Solanki@9elements.com> Link: https://lore.kernel.org/r/20230714135124.2645339-6-Naresh.Solanki@9elements.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-08-21hwmon: (pmbus/mp2975) Make phase count variablePatrick Rudolph1-13/+20
In order to add support for MP2973 and MP2971 replace hardcoded phase count for both channels by a variable. Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com> Signed-off-by: Naresh Solanki <Naresh.Solanki@9elements.com> Link: https://lore.kernel.org/r/20230714135124.2645339-5-Naresh.Solanki@9elements.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-08-21hwmon: (pmbus/mp2975) Simplify VOUT codePatrick Rudolph1-50/+10
In order to upstream MP2973/MP2971 simplify the code by removing support for various VOUT formats. The MP2973 and MP2971 supports all PMBUS supported formats for VOUT, while the MP2975 only support DIRECT and VID for VOUT. In DIRECT mode all chips report the voltage in 1mV/LSB. Configure the chip to use DIRECT format for VOUT and drop the code conversion code for other formats. The to be added chips MP2973/MP2971 will be configured to also report VOUT in DIRECT format. The maximum voltage that can be reported in DIRECT format is 32768mV. This is sufficient as the maximum output voltage for VR12/VR13 is 3040 mV. Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com> Signed-off-by: Naresh Solanki <Naresh.Solanki@9elements.com> Link: https://lore.kernel.org/r/20230714135124.2645339-4-Naresh.Solanki@9elements.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-08-21hwmon: (pmbus/mp2975) Prepare for MP2973 and MP2971Patrick Rudolph1-8/+19
Add support for differntiating between the chips. The following commits will make use of this mechanism. Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com> Signed-off-by: Naresh Solanki <Naresh.Solanki@9elements.com> Link: https://lore.kernel.org/r/20230714135124.2645339-3-Naresh.Solanki@9elements.com [groeck: double-cast of_device_get_match_data() to make gcc happy] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-08-21hwmon: (pmbus/mp2975) Fix whitespace errorPatrick Rudolph1-1/+1
Fix whitespace error reported by checkpatch.pl Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com> Signed-off-by: Naresh Solanki <Naresh.Solanki@9elements.com> Link: https://lore.kernel.org/r/20230714135124.2645339-1-Naresh.Solanki@9elements.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-08-21hwmon: (it87) Add support to detect sensor type AMDTSIFrank Crawford1-4/+31
Add test for sensor type AMDTSI which is available on certain recent chipsets. Signed-off-by: Frank Crawford <frank@crawford.emu.id.au> Link: https://lore.kernel.org/r/20230707123005.956415-4-frank@crawford.emu.id.au Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-08-21hwmon: (it87) Improve temperature reporting supportFrank Crawford1-0/+6
Add test if thermistor sensor type attribute should be visible, i.e. test if the attribute is defined. Signed-off-by: Frank Crawford <frank@crawford.emu.id.au> Link: https://lore.kernel.org/r/20230707123005.956415-3-frank@crawford.emu.id.au [groeck: Dropped unnecessary 'type' variable in it87_temp_is_visible()] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-08-21hwmon: (it87) Split temperature sensor detection to separate functionFrank Crawford1-13/+28
The temperature sensor type will need to be used in multiple places, so split it out into its own function. Signed-off-by: Frank Crawford <frank@crawford.emu.id.au> Link: https://lore.kernel.org/r/20230707123005.956415-2-frank@crawford.emu.id.au [groeck: Dropped unnecessary 'type' variable in show_temp_type()] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-08-21hwmon: (oxp-sensors) Move board detection to the init functionJoaquín Ignacio Aramendía1-14/+15
Move detection logic to the start of init() function so we won't instantiate the driver if the board is not compatible. Signed-off-by: Joaquín Ignacio Aramendía <samsagax@gmail.com> Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Link: https://lore.kernel.org/r/20230717222526.229984-3-samsagax@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-08-21hwmon: (nct6775) Increase and reorder ALARM/BEEP bitsAhmad Khalifa2-99/+93
* Increase available bits, IN: 16 to 24, FAN: 8 to 12, TEMP: 6 to 12 * Reorder alarm/beep definitions to match in order to allow additional inputs in the future * Remove comments about 'unused' bits as probe() is a better reference Testing note: * Tested on nct6799 with IN/FAN/TEMP, and changing min/max/high/hyst, that triggers the corresponding alarms correctly. Good confirmation on the original mapping of the registers and masks. As to be expected, only 4 fans and 2 temps (fixed) have limits currently on nct6799 on my board. * Trouble with testing intrusion alarms and beeps, no way to confirm those. As I understand now, intrusion/caseopen is probably not connected on my board. And I haven't seen a buzzer on a board in ages. Signed-off-by: Ahmad Khalifa <ahmad@khalifa.ws> Link: https://lore.kernel.org/r/20230717201050.1657809-1-ahmad@khalifa.ws Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-08-21hwmon: Remove smm665 driverGuenter Roeck3-721/+0
SMM665 and related chips are power controller/sequencer chips from Summit Microelectronics. The company was acquired by Qualcomm in 2012, and support for the chip series stopped. The chips are long since gone from active use, making the driver unsupportable and just consuming space and compile time. Remove it. Signed-off-by: Guenter Roeck <linux@roeck-us.net>