summaryrefslogtreecommitdiff
path: root/drivers/hwmon
AgeCommit message (Collapse)AuthorFilesLines
2023-07-03Merge tag 'driver-core-6.5-rc1' of ↵Linus Torvalds1-3/+3
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 Torvalds1-0/+1
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-30Merge tag 'soc-arm-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/socLinus Torvalds1-0/+1
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önig1-1/+1
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-25hwmon: (oxp-sensors) Add support for AOKZOE A1 PROJerrod Frost1-0/+7
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 Gottwalt1-3/+6
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 Gottwalt1-12/+11
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 Gottwalt1-1/+61
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 Roeck1-1/+17
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 Roeck1-25/+31
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ía1-4/+3
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ía1-1/+0
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-18hwmon: (nct6755) Add support for NCT6799DGuenter Roeck4-6/+94
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-18hwmon: (oxp-sensors) Add tt_toggle attribute on supported boardsJoaquín Ignacio Aramendía1-1/+133
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 Yip1-0/+8
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 Yip1-0/+33
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 Yip1-0/+24
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 Yip1-8/+13
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 Yip1-22/+11
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 Yip1-12/+8
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ärvinen1-0/+1
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 Roeck1-3/+3
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 Brown1-1/+1
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 Brown1-1/+1
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 Brown1-1/+1
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 Brown1-1/+1
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 Brown1-1/+1
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 Crawford1-26/+37
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 Muhammad1-2/+0
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 Muhammad1-2/+0
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 Bergmann1-13/+2
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 Seo3-0/+2028
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ía1-8/+8
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 Matyas3-1/+478
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 Yatsenko2-21/+68
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ía1-0/+7
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 Savic1-4/+105
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 Savic1-4/+4
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 Yatsenko1-33/+35
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 Yatsenko1-2/+2
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 Seo1-3/+3
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>
2023-06-08hwmon: (core) Add missing beep-related standard attributesJames Seo1-0/+5
beep_enable, inX_beep, currX_beep, fanX_beep, and tempX_beep are standard attributes mentioned in the sysfs interface specification but not implemented in the hwmon core. Since these are not deprecated, implement them. Adding beep_mask is not necessary, as it is deprecated and the drivers already using it are manually defining it. Signed-off-by: James Seo <james@equiv.tech> Link: https://lore.kernel.org/r/20230507152216.1862653-1-james@equiv.tech Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-06-08hwmon: (nct6683) Add another customer ID for NCT6687D sensor chip on some ↵Gopal Prasad1-0/+3
MSI boards. This value was found on a MSI Z690-A PRO DDR5 with NCT6687D. Signed-off-by: Gopal Prasad <llyyr.public@gmail.com> Link: https://lore.kernel.org/r/20230517042025.16942-1-llyyr.public@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-06-08hwmon: Switch i2c drivers back to use .probe()Uwe Kleine-König163-163/+163
After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new() call-back type"), all drivers being converted to .probe_new() and then 03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert back to (the new) .probe() to be able to eventually drop .probe_new() from struct i2c_driver. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20230505131718.1210071-1-u.kleine-koenig@pengutronix.de [groeck: Added missing change in pmbus/acbel-fsg032.c] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-06-08hwmon: (it87) Allow for chips with only 4 temp sensorsFrank Crawford1-2/+6
Some chips are known to only have 4 temperature sensors and there is no requirement to test for more. Currently only the IT8622E fits this category. Signed-off-by: Frank Crawford <frank@crawford.emu.id.au> Link: https://lore.kernel.org/r/20230430045032.1723288-1-frank@crawford.emu.id.au Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-06-08hwmon: (adt7475) Convert to use device_property APIsChris Packham1-4/+4
Instead of of_property_read_*() use the equivalent device_property_read_*() API. This will allow these properties to be used on DT unaware platforms. For DT aware platforms this will be a noop. Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz> Link: https://lore.kernel.org/r/20230418233656.869055-3-chris.packham@alliedtelesis.co.nz Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-06-08hwmon: (it87) Update IT8732F chip for 4 fans and PWMsFrank Crawford1-1/+30
Add support for 4 fans and 4 PWMs to chipset IT8732F. Signed-off-by: Frank Crawford <frank@crawford.emu.id.au> Link: https://lore.kernel.org/r/20230429115205.1547251-4-frank@crawford.emu.id.au Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-06-08hwmon: (it87) Add controls for chips with only 4 PWMsFrank Crawford1-3/+9
Add feature and support for chips with only 4 PWMs. Signed-off-by: Frank Crawford <frank@crawford.emu.id.au> Link: https://lore.kernel.org/r/20230429115205.1547251-3-frank@crawford.emu.id.au Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-06-08hwmon: (it87) Add controls for chips with only 4 fansFrank Crawford1-11/+13
Add feature and support for chips with only 4 fans. Reorder macro definitions to bring all fan definitions together. Signed-off-by: Frank Crawford <frank@crawford.emu.id.au> Link: https://lore.kernel.org/r/20230429115205.1547251-2-frank@crawford.emu.id.au Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-06-08hwmon: (oxp-sensors) Use less convoluted enum castJoaquín Ignacio Aramendía1-8/+8
Change .driver_data = (void *) &(enum type) {enum_literal}; to more readable form: .driver_data = (void *) enum_literal; and corresponding cast usage as board type flag. Signed-off-by: Joaquín Ignacio Aramendía <samsagax@gmail.com> Link: https://lore.kernel.org/r/20230429142547.328125-1-samsagax@gmail.com [groeck: Use double cast for assignment from driver_data to fix clang build warning] Signed-off-by: Guenter Roeck <linux@roeck-us.net>