summaryrefslogtreecommitdiff
path: root/drivers/hwmon
AgeCommit message (Collapse)Author
2023-07-27hwmon: (k10temp) Enable AMD3255 Proc to show negative temperatureBaskaran Kannan
Industrial processor i3255 supports temperatures -40 deg celcius to 105 deg Celcius. The current implementation of k10temp_read_temp rounds off any negative temperatures to '0'. To fix this, the following changes have been made. A flag 'disp_negative' is added to struct k10temp_data to support AMD i3255 processors. Flag 'disp_negative' is set if 3255 processor is found during k10temp_probe. Flag 'disp_negative' is used to determine whether to round off negative temperatures to '0' in k10temp_read_temp. Signed-off-by: Baskaran Kannan <Baski.Kannan@amd.com> Link: https://lore.kernel.org/r/20230727162159.1056136-1-Baski.Kannan@amd.com Fixes: aef17ca12719 ("hwmon: (k10temp) Only apply temperature offset if result is positive") Cc: stable@vger.kernel.org [groeck: Fixed multi-line comment] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-07-26hwmon: (pmbus_core) Fix Deadlock in pmbus_regulator_get_statusGuenter Roeck
pmbus_regulator_get_status() acquires update_lock. pmbus_regulator_get_error_flags() acquires it again, resulting in an immediate deadlock. Call _pmbus_get_flags() from pmbus_regulator_get_status() directly to avoid the problem. Reported-by: Patrick Rudolph <patrick.rudolph@9elements.com> Closes: https://lore.kernel.org/linux-hwmon/b7a3ad85-aab4-4718-a001-1d8b1c0eef36@roeck-us.net/T/#u Cc: Naresh Solanki <Naresh.Solanki@9elements.com> Cc: stable@vger.kernel.org # v6.2+ Fixes: c05f477c4ba3 ("hwmon: (pmbus/core) Implement regulator get_status") Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-07-25hwmon: (pmbus_core) Fix NULL pointer dereferencePatrick Rudolph
Pass i2c_client to _pmbus_is_enabled to drop the assumption that a regulator device is passed in. This will fix the issue of a NULL pointer dereference when called from _pmbus_get_flags. Fixes: df5f6b6af01c ("hwmon: (pmbus/core) Generalise pmbus get status") Cc: stable@vger.kernel.org # v6.4 Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com> Signed-off-by: Naresh Solanki <Naresh.Solanki@9elements.com> Link: https://lore.kernel.org/r/20230725125428.3966803-2-Naresh.Solanki@9elements.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-07-25hwmon: (pmbus_core) Fix pmbus_is_enabled()Patrick Rudolph
Refactor pmbus_is_enabled() to return the status without any additional processing as it is already done in _pmbus_is_enabled(). Fixes: df5f6b6af01c ("hwmon: (pmbus/core) Generalise pmbus get status") Cc: stable@vger.kernel.org # v6.4 Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com> Signed-off-by: Naresh Solanki <Naresh.Solanki@9elements.com> Link: https://lore.kernel.org/r/20230725125428.3966803-1-Naresh.Solanki@9elements.com [groeck: Rephrased commit message] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-07-24hwmon: (nct7802) Fix for temp6 (PECI1) processed even if PECI1 disabledGilles Buloz
Because of hex value 0x46 used instead of decimal 46, the temp6 (PECI1) temperature is always declared visible and then displayed even if disabled in the chip Signed-off-by: Gilles Buloz <gilles.buloz@kontron.com> Link: https://lore.kernel.org/r/DU0PR10MB62526435ADBC6A85243B90E08002A@DU0PR10MB6252.EURPRD10.PROD.OUTLOOK.COM Fixes: fcdc5739dce03 ("hwmon: (nct7802) add temperature sensor type attribute") Cc: stable@vger.kernel.org Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-07-19hwmon: (nct6775) Fix IN scaling factors for 6798/6799Ahmad Khalifa
Scaling for VTT/VIN5/VIN6 registers were based on prior chips * Split scaling factors for 6798/6799 and assign at probe() * Pass them through driver data to sysfs functions Tested on nct6799 with old/new input/min/max Fixes: 0599682b826f ("hwmon: (nct6775) Add support for NCT6798D") Signed-off-by: Ahmad Khalifa <ahmad@khalifa.ws> Link: https://lore.kernel.org/r/20230719192848.337508-1-ahmad@khalifa.ws Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-07-18hwmon: (oxp-sensors) Move tt_toggle attribute to dev_groupsJoaquín Ignacio Aramendía
A driver should not be manually adding groups in its probe function (it will race with userspace), so replace the call to devm_device_add_groups() to use the platform dev_groups callback instead. This will allow for removal of the devm_device_add_groups() function. Signed-off-by: Joaquín Ignacio Aramendía <samsagax@gmail.com> Fixes: be144ee49127 ("hwmon: (oxp-sensors) Add tt_toggle attribute on supported boards") Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Link: https://lore.kernel.org/r/20230717222526.229984-2-samsagax@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-07-15hwmon: (aquacomputer_d5next) Fix incorrect PWM value readoutAleksa Savic
Commit 662d20b3a5af ("hwmon: (aquacomputer_d5next) Add support for temperature sensor offsets") changed aqc_get_ctrl_val() to return the value through a parameter instead of through the return value, but didn't fix up a case that relied on the old behavior. Fix it to use the proper received value and not the return code. Fixes: 662d20b3a5af ("hwmon: (aquacomputer_d5next) Add support for temperature sensor offsets") Cc: stable@vger.kernel.org Signed-off-by: Aleksa Savic <savicaleksa83@gmail.com> Link: https://lore.kernel.org/r/20230714120712.16721-1-savicaleksa83@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-07-15hwmon: (nct6775) Fix register for nct6799Ahmad Khalifa
Datasheet and variable name point to 0xe6 Fixes: aee395bb1905 ("hwmon: (nct6755) Add support for NCT6799D") Signed-off-by: Ahmad Khalifa <ahmad@khalifa.ws> Link: https://lore.kernel.org/r/20230715145831.1304633-1-ahmad@khalifa.ws Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-07-03Merge tag 'driver-core-6.5-rc1' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core Pull driver core updates from Greg KH: "Here are a small set of changes for 6.5-rc1 for some driver core changes. Included in here are: - device property cleanups to make it easier to write "agnostic" drivers when regards to the firmware layer underneath them (DT vs. ACPI) - debugfs documentation updates - devres additions - sysfs documentation and changes to handle empty directory creation logic better - tiny kernfs optimizations - other tiny changes All of these have been in linux-next for a while with no reported problems" * tag 'driver-core-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: sysfs: Skip empty folders creation sysfs: Improve readability by following the kernel coding style drivers: fwnode: fix fwnode_irq_get[_byname]() ata: ahci_platform: Make code agnostic to OF/ACPI device property: Implement device_is_compatible() ACPI: Move ACPI_DEVICE_CLASS() to mod_devicetable.h base/node: Use 'property' to identify an access parameter driver core: device.h: add some missing kerneldocs kernfs: fix missing kernfs_idr_lock to remove an ID from the IDR isa: Remove unnecessary checks MAINTAINERS: add entry for auxiliary bus debugfs: Correct the 'debugfs_create_str' docs serial: qcom_geni: Comment use of devm_krealloc rather than devm_krealloc_array iio: adc: Use devm_krealloc_array hwmon: pmbus: Use devm_krealloc_array
2023-07-03Merge tag 'mfd-next-6.5' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd Pull MFD updates from Lee Jones: "New Drivers: - Add support for TI TPS6594/TPS6593/LP8764 PMICs - Add support for Samsung RT5033 Battery Charger - Add support for Analog Devices MAX77540 and MAX77541 PMICs New Device Support: - Add support for SPI to Rockchip RK808 (and friends) - Add support for AXP192 PMIC to X-Powers AXP20X - Add support for AXP313a PMIC to X-Powers AXP20X - Add support for RK806 to Rockchip RK8XX Removed Device Support: - Removed MFD support for Richtek RT5033 Battery Fix-ups: - Remove superfluous code - Switch I2C drivers from .probe_new() to .probe() - Convert over to managed resources (devm_*(), etc) - Use dev_err_probe() for returning errors from .probe() - Add lots of Device Tree bindings / support - Improve cache efficiency by switching to Maple - Use own exported namespaces (NS) - Include missing and remove superfluous headers - Start using / convert to the new shutdown sys-off API - Trivial: variable / define renaming - Make use of of_property_read_reg() when requesting DT 'reg's Bug Fixes: - Fix chip revision readout due to incorrect data masking - Amend incorrect register and mask values used for charger state - Hide unused functionality at compile time - Fix resource leaks following error handling routines - Return correct error values and fix error handling in general - Repair incorrect device names - used for device matching - Remedy broken module auto-loading" * tag 'mfd-next-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (51 commits) dt-bindings: mfd: max77541: Add ADI MAX77541/MAX77540 iio: adc: max77541: Add ADI MAX77541 ADC Support regulator: max77541: Add ADI MAX77541/MAX77540 Regulator Support dt-bindings: regulator: max77541: Add ADI MAX77541/MAX77540 Regulator mfd: Switch two more drivers back to use struct i2c_driver::probe dt-bindings: mfd: samsung,s5m8767: Simplify excluding properties mfd: stmpe: Only disable the regulators if they are enabled mfd: max77541: Add ADI MAX77541/MAX77540 PMIC Support dt-bindings: mfd: gateworks-gsc: Remove unnecessary fan-controller nodes mfd: core: Use of_property_read_reg() to parse "reg" mfd: stmfx: Nullify stmfx->vdd in case of error mfd: stmfx: Fix error path in stmfx_chip_init mfd: intel-lpss: Add missing check for platform_get_resource mfd: stpmic1: Add PMIC poweroff via sys-off handler mfd: stpmic1: Fixup main control register and bits naming dt-bindings: mfd: qcom,tcsr: Add the compatible for IPQ8074 mfd: tps65219: Add support for soft shutdown via sys-off API mfd: pm8008: Drop bogus i2c module alias mfd: pm8008: Fix module autoloading mfd: tps65219: Add GPIO cell instance ...
2023-06-29Merge tag 'soc-arm-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/socLinus Torvalds
Pull ARM SoC updates from Arnd Bergmann: "These are mostly minor cleanups and bugfixes that address harmless problems. The largest branch is a conversion of the omap platform to use GPIO descriptors throughout the tree, for any devices that are not fully converted to devicetree. The Samsung Exynos platform gains back support for the Exynos4212 chip that was previously unused and removed but is now used for the Samsung Galaxy Tab3" * tag 'soc-arm-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (24 commits) ARM: omap2: Fix copy/paste bug MAINTAINERS: Replace my email address Input: ads7846 - fix pointer cast warning Input: ads7846 - Fix usage of match data ARM: omap2: Fix checkpatch issues arm: omap1: replace printk() with pr_err macro ARM: omap: Fix checkpatch issues ARM: s3c: Switch i2c drivers back to use .probe() ARM: versatile: mark mmc_status() static ARM: spear: include "pl080.h" for pl080_get_signal() prototype ARM: sa1100: address missing prototype warnings ARM: pxa: fix missing-prototypes warnings ARM: orion5x: fix d2net gpio initialization ARM: omap2: fix missing tick_broadcast() prototype ARM: omap1: add missing include ARM: lpc32xx: add missing include ARM: imx: add missing include ARM: highbank: add missing include ARM: ep93xx: fix missing-prototype warnings ARM: davinci: fix davinci_cpufreq_init() declaration ...
2023-06-26hwmon: max31827: Switch back to use struct i2c_driver::probeUwe Kleine-König
struct i2c_driver::probe_new is about to go away. Switch the driver to use the probe callback with the same prototype. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20230626085145.554616-1-u.kleine-koenig@pengutronix.de Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-06-24hwmon: (oxp-sensors) Add support for AOKZOE A1 PROJerrod Frost
This device is an iteration over the AOKZOE A1 with the same EC mapping and features. It also has support for tt_toggle. Signed-off-by: Jerrod Frost <jcfrosty@proton.me> Signed-off-by: Joaquín Ignacio Aramendía <samsagax@gmail.com> Link: https://lore.kernel.org/r/20230625012347.121352-2-samsagax@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-06-24hwmon: (corsair-psu) update Series 2022 and 2023 supportWilken Gottwalt
The series 2022/2023 reports slightly longer vendor/product strings and shares USB ids. Technically the reply size is the USB HID packet size (64 bytes) but all the supported commands do not use more than 8 bytes and replies reporting back strings do not use more then 24 bytes (vendor and product are in one string in the newer devices now). The rest of the reply is always filled with '\0'. Also update comments and documentation accordingly. Signed-off-by: Wilken Gottwalt <wilken.gottwalt@posteo.net> Link: https://lore.kernel.org/r/ZJbB72CAPmLflhHG@monster.localdomain Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-06-23hwmon: (corsair-psu) various cleanupsWilken Gottwalt
Fix some typos, adjust documentation and comments to current state of knowledge and update coding style to be more uniform. Signed-off-by: Wilken Gottwalt <wilken.gottwalt@posteo.net> Link: https://lore.kernel.org/r/ZJWf3H972hGgLK-8@monster.localdomain Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-06-22hwmon: (corsair-psu) add support for reading PWM values and modeWilken Gottwalt
Add support for reading PWM values and mode, and update documentation accordingly. Signed-off-by: Wilken Gottwalt <wilken.gottwalt@posteo.net> Link: https://lore.kernel.org/r/ZJSASByXpzoZ0XyH@monster.localdomain Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-06-22hwmon: (pmbus/adm1275) Disable ADC while updating PMON_CONFIGGuenter Roeck
According to ADI, changing PMON_CONFIG while the ADC is running can have unexpected results. ADI recommends halting the ADC with PMON_CONTROL before setting PMON_CONFIG and then resume after. Follow ADI recommendation and disable ADC while PMON_CONFIG is updated. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20230614163605.3688964-3-linux@roeck-us.net Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-06-22hwmon: (pmbus/adm1275) Prepare for protected write to PMON_CONFIGGuenter Roeck
According to ADI, changing PMON_CONFIG while ADC is running can have unexpected results. ADI recommends halting the ADC with PMON_CONTROL before setting PMON_CONFIG and then resume after. To prepare for this change, rename adm1275_read_pmon_config() and adm1275_write_pmon_config() to adm1275_read_samples() and adm1275_write_samples() to more accurately reflect the functionality of the code. Introduce new function adm1275_write_pmon_config() and use it for all code writing into the PMON_CONFIG register. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20230614163605.3688964-2-linux@roeck-us.net Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-06-18hwmon: (oxp-sensors) Simplify logic of error returnJoaquín Ignacio Aramendía
Take return logic on error out of if-else, eliminating duplicated code in tt_togle_store() function. Signed-off-by: Joaquín Ignacio Aramendía <samsagax@gmail.com> Link: https://lore.kernel.org/r/20230617181159.32844-3-samsagax@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-06-18hwmon: (oxp-sensors) Remove unused headerJoaquín Ignacio Aramendía
We are not using <dev_printk.h>, remove that. Signed-off-by: Joaquín Ignacio Aramendía <samsagax@gmail.com> Link: https://lore.kernel.org/r/20230617181159.32844-2-samsagax@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-06-17hwmon: (nct6755) Add support for NCT6799DGuenter Roeck
NCT6799D is mostly compatible to NCT6798D, with minor variations. Note that NCT6798D and NCT6799D have a new means to select temperature sources, and to report temperatures from those sources. This is not currently implemented, meaning that most likely not all temperatures are reported. Cc: Sebastian Arnhold <sebastian.arnhold@posteo.de> Cc: Ahmad Khalifa <ahmad@khalifa.ws> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Tested-by: Sebastian Arnhold <sebastian.arnhold@posteo.de> Tested-by: Corentin Labbe <clabbe.montjoie@gmail.com> Link: https://lore.kernel.org/r/20221228135744.281752-1-linux@roeck-us.net
2023-06-17hwmon: (oxp-sensors) Add tt_toggle attribute on supported boardsJoaquín Ignacio Aramendía
OneXPlayer boards from the last generation (both for OneXPlayer and AOK ZOE brands) have a toggle in the EC to switch the "Turbo/Silent" button into a different keyboard event. Add a means to use that "Turbo button takeover" function and expose it to userspace in a custom sysfs `tt_toggle` attribute. It can be read to take the current state. Write 1|0 to activate the function. The specific keycode is dependent on the board but can be checked by running `evtest` utility. Newer BIOS on the OneXPlayer added this function aside from string changes. Add a board enum to differentiate it from the old OneXplayer Mini AMD BIOS. Currently known supported boards: - AOK ZOE A1 - OneXPlayer Mini AMD (only newer BIOS version supported) - OneXPlayer Mini Pro Signed-off-by: Joaquín Ignacio Aramendía <samsagax@gmail.com> Link: https://lore.kernel.org/r/20230611143332.40590-2-samsagax@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-06-17hwmon: (sht3x) complement sysfs interface for sts3xJuenKit Yip
Compared to sht3x, sts3x has the similar functions and operations but it has no humidity sensor. Signed-off-by: JuenKit Yip <JuenKit_Yip@hotmail.com> Link: https://lore.kernel.org/r/DB4PR10MB6261B912ADFA6BB78240596F9258A@DB4PR10MB6261.EURPRD10.PROD.OUTLOOK.COM Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-06-17hwmon: (sht3x) Add new non-stardard sysfs attributeJuenKit Yip
Add "repeatability" attribute to sysfs, it could be read or written to control the sensor. Signed-off-by: JuenKit Yip <JuenKit_Yip@hotmail.com> Link: https://lore.kernel.org/r/DB4PR10MB6261B507C7656E3568DA33E39258A@DB4PR10MB6261.EURPRD10.PROD.OUTLOOK.COM [groeck: Fixed multi-line alignment; dropped check of unsigned against < 0] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-06-17hwmon: (sht3x) add medium repeatability supportJuenKit Yip
Add support for medium repeatability. Per datasheet: The stated repeatability is 3 times the standard deviation (3σ) of multiple consecutive measurements at the stated repeatability and at constant ambient conditions. It is a measure for the noise on the physical sensor output. Different measurement modes allow for high/medium/low repeatability. For the humidity sensor, repeatability is documented as 0.25% RH for low repeatability, 0.15% RH for medium repeatability, and 0.10% RH for high repeatability. Support all three modes. Signed-off-by: JuenKit Yip <JuenKit_Yip@hotmail.com> Link: https://lore.kernel.org/r/DB4PR10MB6261A70CD0444248ADDCC3219258A@DB4PR10MB6261.EURPRD10.PROD.OUTLOOK.COM [groeck: Added details to description] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-06-17hwmon: (sht3x)replace "high-precision" property to "repeatability"JuenKit Yip
Replace use of "precision" with "repeatability" to match datasheet terminology. No functional change. Signed-off-by: JuenKit Yip <JuenKit_Yip@hotmail.com> Link: https://lore.kernel.org/r/DB4PR10MB626113BFFA66DE32C3479D229258A@DB4PR10MB6261.EURPRD10.PROD.OUTLOOK.COM [groeck: Added commit description] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-06-17hwmon: (sht3x) remove blocking_io propertyJuenKit Yip
Due to no support on clock-strench, blocking mode was removed and now single-shot mode only uses non-blocking mode. Signed-off-by: JuenKit Yip <JuenKit_Yip@hotmail.com> Link: https://lore.kernel.org/r/DB4PR10MB6261DA9202AF37B4F6ECDD6C9258A@DB4PR10MB6261.EURPRD10.PROD.OUTLOOK.COM Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-06-17hwmon: (sht3x) remove sht3x_platform_dataJuenKit Yip
Since no in-tree driver supports it, sht3x_platform_data has been removed and the relevant properties have been moved to sht3x_data. Signed-off-by: JuenKit Yip <JuenKit_Yip@hotmail.com> Link: https://lore.kernel.org/r/DB4PR10MB626126FB7226D5AF341197449258A@DB4PR10MB6261.EURPRD10.PROD.OUTLOOK.COM Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-06-15mfd: intel-m10-bmc: Move m10bmc_sys_read() away from headerIlpo Järvinen
Move m10bmc_sys_read() out from the header to prepare it for adding more code into the function which would make it too large to be a static inline any more. While at it, replace the vague wording in function comment with more precise statements. Reviewed-by: Russ Weight <russell.h.weight@intel.com> Acked-by: Guenter Roeck <linux@roeck-us.net> # For hwmon Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Reviewed-by: Xu Yilun <yilun.xu@intel.com> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20230417092653.16487-4-ilpo.jarvinen@linux.intel.com
2023-06-10hwmon: (pmbus/max16601) Add support for new revisions of MAX16508Guenter Roeck
New revisions of MAX16508 report MAX16508.xx or MAX16508y.xx as device ID, but are functionally similar to MAX16508. Add support for those chip variants. Cc: Vlad Sytchenko <vsytch@google.com> Cc: Steve Foreman <foremans@google.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-06-10hwmon: (tmp464) Use maple tree register cacheMark Brown
The tmp464 is only capable of performing single register read and write operations which means it gains no advantage from using a rbtree register cache, convert it to using the more modern maple tree register cache instead. This should be more efficient. Signed-off-by: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/20230609-hwmon-maple-v1-5-8edacce86b28@kernel.org Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-06-10hwmon: (tmp108) Use maple tree register cacheMark Brown
The tmp108 is only capable of performing single register read and write operations which means it gains no advantage from using a rbtree register cache, convert it to using the more modern maple tree register cache instead. This should be more efficient. Signed-off-by: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/20230609-hwmon-maple-v1-4-8edacce86b28@kernel.org Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-06-10hwmon: (tmp102) Use maple tree register cacheMark Brown
The tmp102 is only capable of performing single register read and write operations which means it gains no advantage from using a rbtree register cache, convert it to using the more modern maple tree register cache instead. This should be more efficient. Signed-off-by: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/20230609-hwmon-maple-v1-3-8edacce86b28@kernel.org Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-06-10hwmon: (lm95245) Use maple tree register cacheMark Brown
The lm95245 is only capable of performing single register read and write operations which means it gains no advantage from using a rbtree register cache, convert it to using the more modern maple tree register cache instead. This should be more efficient. Signed-off-by: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/20230609-hwmon-maple-v1-2-8edacce86b28@kernel.org Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-06-10hwmon: (lm75) Use maple tree register cacheMark Brown
The lm75 is only capable of performing single register read and write operations which means it gains no advantage from using a rbtree register cache, convert it to using the more modern maple tree register cache instead. This should be more efficient. Signed-off-by: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/20230609-hwmon-maple-v1-1-8edacce86b28@kernel.org Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-06-08hwmon: (it87) Generalise support for FAN_CTL ON/OFFFrank Crawford
Support for FAN_CTL ON/OFF is currently disabled only for IT8603E but there are severl chips that don't support the configuration bits to turn off fan control entirely. Generalise this support for any chip. Add feature flag FEAT_FANCTL_ONOFF for chips that support configuration bits for management of fan control off and assign all chips that support the configuration. Signed-off-by: Frank Crawford <frank@crawford.emu.id.au> Link: https://lore.kernel.org/r/20230527094756.3464256-1-frank@crawford.emu.id.au Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-06-08hwmon: (pmbus/adm1266) Drop unnecessary error check for debugfs_create_dirOsama Muhammad
This patch removes the error checking for debugfs_create_dir in adm1266.c. This is because the debugfs_create_dir() does not return NULL but an ERR_PTR after an error. The DebugFS kernel API is developed in a way that the caller can safely ignore the errors that occur during the creation of DebugFS nodes.The debugfs Api handles it gracefully. The check is unnecessary. Link to the comment above debugfs_create_dir: https://elixir.bootlin.com/linux/latest/source/fs/debugfs/inode.c#L565 Signed-off-by: Osama Muhammad <osmtendev@gmail.com> Link: https://lore.kernel.org/r/20230526163938.9903-1-osmtendev@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-06-08hwmon: (pmbus/ucd9000) Drop unnecessary error check for debugfs_create_dirOsama Muhammad
This patch removes the error checking for debugfs_create_dir in ucd9000.c. This is because the debugfs_create_dir() does not return NULL but an ERR_PTR after an error. The DebugFS kernel API is developed in a way that the caller can safely ignore the errors that occur during the creation of DebugFS nodes.The debugfs Api handles it gracefully. The check is unnecessary. Link to the comment above debugfs_create_dir: https://elixir.bootlin.com/linux/latest/source/fs/debugfs/inode.c#L565 Signed-off-by: Osama Muhammad <osmtendev@gmail.com> Link: https://lore.kernel.org/r/20230526154906.6370-1-osmtendev@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-06-08hwmon: (hp-wmi-sensors) fix debugfs checkArnd Bergmann
Checking for Kconfig symbols with #if is wrong: drivers/hwmon/hp-wmi-sensors.c:1141:5: error: "CONFIG_DEBUG_FS" is not defined, evaluates to 0 [-Werror=undef] This could be an #ifdef, but an IS_ENABLED() check is even better to give the best compile coverage. Fixes: 23902f98f8d4 ("hwmon: add HP WMI Sensors driver") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: James Seo <james@equiv.tech> Link: https://lore.kernel.org/r/20230601213216.3220550-1-arnd@kernel.org Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-06-08hwmon: add HP WMI Sensors driverJames Seo
Hewlett-Packard (and some HP Compaq) business-class computers report hardware monitoring information via WMI. This driver exposes that information to hwmon. Initial support is provided for temperature, fan speed, and intrusion sensor types. Provisional support is provided for voltage and current sensor types. HP's WMI implementation permits many other types of numeric sensors. Therefore, a debugfs interface is also provided to enumerate and inspect all numeric sensors visible on the WMI side. This should facilitate adding support for other sensor types in the future. Tested on a HP Z420, a HP EliteOne 800 G1, and a HP Compaq Elite 8300 SFF. Note that provisionally supported sensor types are untested and seem to be rare-to-nonexistent in the wild, having been encountered neither on test systems nor in ACPI dumps from the Linux Hardware Database. They are included because their popularity in general makes their presence on past or future HP systems plausible and because no doubt exists as to how the sensors themselves would be represented in WMI (alarm attributes will need to wait for hardware to be located). A 2005 HP whitepaper gives the relevant sensor object MOF definition and sensor value scaling calculation, and both this driver and the official HP Performance Advisor utility comply with them (confirmed in the latter case by reverse engineering). Link: https://h20331.www2.hp.com/hpsub/downloads/cmi_whitepaper.pdf Signed-off-by: James Seo <james@equiv.tech> Link: https://lore.kernel.org/r/20230522115645.509701-1-james@equiv.tech [groeck: Set error return value for intrusion writes to -EINVAL. Always accept writes of 0 even if there was no intrusion. ] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-06-08hwmon: (oxp-sensors) Stop passing device structureJoaquín Ignacio Aramendía
We don't need to pass device structure to write_to_ec() so we remove that from the function declaration. The same is valid for pwm_enable() and pwm_disable() as we were passing the pointer to hand it off to write_to_ec(). Signed-off-by: Joaquín Ignacio Aramendía <samsagax@gmail.com> Link: https://lore.kernel.org/r/20230525142652.41981-1-samsagax@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-06-08hwmon: Add MAX31827 driverDaniel Matyas
MAX31827 is a low-power temperature switch with I2C interface. The device is a ±1°C accuracy from -40°C to +125°C (12 bits) local temperature switch and sensor with I2C/SM- Bus interface. The combination of small 6-bump wafer-lev- el package (WLP) and high accuracy makes this temper- ature sensor/switch ideal for a wide range of applications. Signed-off-by: Daniel Matyas <daniel.matyas@analog.com> Link: https://lore.kernel.org/r/20230524160131.14081-2-daniel.matyas@analog.com [groeck: Improved define alignment, return -EINVAL after bad user input, fixed up compatible statement] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-06-08hwmon: (aht10) Add support for compatible aht20Kirill Yatsenko
Add support for compatible AHT20 temperature/humidity sensor. The only difference between the two is that AHT20 has additional crc8 byte. It seems like AHT15 is also supported by the driver but it wasn't verified and tested yet. Tested on Beaglebone black rev C. Signed-off-by: Kirill Yatsenko <kiriyatsenko@gmail.com> Link: https://lore.kernel.org/r/20230524201912.815993-1-kiriyatsenko@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-06-08hwmon: (oxp-sensors) Add new DMI match for OXP MiniJoaquín Ignacio Aramendía
A newer BIOS version for the OneXPlayer Mini AMD modified vendor and board name strings. Add those to the match table and set the same board model as older OXP Mini AMD. Signed-off-by: Joaquín Ignacio Aramendía <samsagax@gmail.com> Link: https://lore.kernel.org/r/20230517183540.187383-1-samsagax@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-06-08hwmon: (aquacomputer_d5next) Add support for Aquacomputer LeakshieldAleksa Savic
Extend aquacomputer_d5next driver to expose various hardware sensors of the Aquacomputer Leakshield leak prevention system, which communicates through a proprietary USB HID protocol. Implemented by Noah Bergbauer [1]. Two temperature sensors are exposed, along with pressure (current, min, max and target), reservoir volume (total and filled), pump speed and flow. Pump speed and flow values are user provided and allow the Leakshield to optimize its operation. Writing them to the device is subject of future patches. [1] https://github.com/aleksamagicka/aquacomputer_d5next-hwmon/pull/41 Originally-from: Noah Bergbauer <main@ehvag.de> Signed-off-by: Aleksa Savic <savicaleksa83@gmail.com> Link: https://lore.kernel.org/r/20230520095447.509287-3-savicaleksa83@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-06-08hwmon: (aquacomputer_d5next) Rename AQC_TEMP_SENSOR_DISCONNECTEDAleksa Savic
Rename the macro in question to AQC_SENSOR_NA because more than just temperature sensors use this value to indicate that they don't have a reading. Implemented by Noah Bergbauer [1]. [1] https://github.com/aleksamagicka/aquacomputer_d5next-hwmon/pull/41 Originally-from: Noah Bergbauer <main@ehvag.de> Signed-off-by: Aleksa Savic <savicaleksa83@gmail.com> Link: https://lore.kernel.org/r/20230520095447.509287-2-savicaleksa83@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-06-08hwmon: (aht10) Refactor aht10_read_values functionKirill Yatsenko
Exit from the function immediately if the poll time hasn't yet expired. Therefore the code after the check can be moved one tab to the left which improves readability. Signed-off-by: Kirill Yatsenko <kiriyatsenko@gmail.com> Link: https://lore.kernel.org/r/20230511202633.299174-2-kiriyatsenko@gmail.com [groeck: Dropped else after return] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-06-08hwmon: (aht10) Fix typos in commentsKirill Yatsenko
Fix typos in the description of the return value section of the functions. The word 'succesfull' is incorrect, it should be 'successful'. Signed-off-by: Kirill Yatsenko <kiriyatsenko@gmail.com> Link: https://lore.kernel.org/r/20230511202633.299174-1-kiriyatsenko@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-06-08hwmon: (core) Finish renaming groups parameter in API to extra_groupsJames Seo
Commit 848ba0a2f20d ("hwmon: (core) Rename groups parameter in API to extra_groups") renames the 'groups' parameter of devm_hwmon_device_register_with_info() to 'extra_groups' in hwmon-kernel-api.txt (later .rst) and hwmon.h, but this change was not propagated to the function code itself in hwmon.c. Finish the job. Note that hwmon_device_register_with_info() has the same parameter, and the name of that parameter was changed in all three files. Harmonizing the name between these related functions also removes a potential source of confusion. Signed-off-by: James Seo <james@equiv.tech> Link: https://lore.kernel.org/r/20230507151051.1861929-1-james@equiv.tech [groeck: Fixed up SHA reference in description] Signed-off-by: Guenter Roeck <linux@roeck-us.net>