aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2024-08-27hwmon: (pc87360) Use min() macroShen Lichuan1-1/+1
Use the min() macro to simplify the pc87360_init_device() function and improve its readability. Signed-off-by: Shen Lichuan <shenlichuan@vivo.com> Message-ID: <20240827070442.40667-1-shenlichuan@vivo.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-08-27hwmon: Add sophgo SG2042 external hardware monitor supportInochi Amaoto5-0/+479
SG2042 use an external MCU to provide basic hardware information and thermal sensors. Add driver support for the onboard MCU of SG2042. Signed-off-by: Inochi Amaoto <inochiama@outlook.com> Message-ID: <IA1PR20MB49536C786048D1E676BB9C20BB822@IA1PR20MB4953.namprd20.prod.outlook.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-08-27dt-bindings: hwmon: Add Sophgo SG2042 external hardware monitor supportInochi Amaoto1-0/+43
Due to the design, Sophgo SG2042 use an external MCU to provide hardware information, thermal information and reset control. Add bindings for this monitor device. Signed-off-by: Inochi Amaoto <inochiama@outlook.com> Reviewed-by: Conor Dooley <conor.dooley@microchip.com> Tested-by: Chen Wang <unicorn_wang@outlook.com> Reviewed-by: Chen Wang <unicorn_wang@outlook.com> Message-ID: <IA1PR20MB49538276F283C4D01364AEB6BB822@IA1PR20MB4953.namprd20.prod.outlook.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-08-27hwmon: (tmp464): Simplify with scoped for each OF child loopJinjie Ruan1-5/+2
Use scoped for_each_child_of_node_scoped() when iterating over device nodes to make code a bit simpler. Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com> Message-ID: <20240822062956.3490387-9-ruanjinjie@huawei.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-08-27hwmon: (tmp421): Simplify with scoped for each OF child loopJinjie Ruan1-5/+2
Use scoped for_each_child_of_node_scoped() when iterating over device nodes to make code a bit simpler. Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com> Message-ID: <20240822062956.3490387-8-ruanjinjie@huawei.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-08-27hwmon: (npcm750-pwm-fan): Simplify with scoped for each OF child loopJinjie Ruan1-3/+2
Use scoped for_each_child_of_node_scoped() when iterating over device nodes to make code a bit simpler. Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com> Message-ID: <20240822062956.3490387-7-ruanjinjie@huawei.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-08-27hwmon: (nct7802): Simplify with scoped for each OF child loopJinjie Ruan1-5/+2
Use scoped for_each_child_of_node_scoped() when iterating over device nodes to make code a bit simpler. Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com> Message-ID: <20240822062956.3490387-6-ruanjinjie@huawei.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-08-27hwmon: (lm90): Simplify with scoped for each OF child loopJinjie Ruan1-5/+2
Use scoped for_each_child_of_node_scoped() when iterating over device nodes to make code a bit simpler. Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com> Message-ID: <20240822062956.3490387-5-ruanjinjie@huawei.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-08-27hwmon: (ina3221): Simplify with scoped for each OF child loopJinjie Ruan1-5/+2
Use scoped for_each_child_of_node_scoped() when iterating over device nodes to make code a bit simpler. Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com> Message-ID: <20240822062956.3490387-4-ruanjinjie@huawei.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-08-27hwmon: (aspeed-pwm-tacho): Simplify with scoped for each OF child loopJinjie Ruan1-5/+3
Use scoped for_each_child_of_node_scoped() when iterating over device nodes to make code a bit simpler. Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com> Reviewed-by: Andrew Jeffery <andrew@codeconstruct.com.au> Message-ID: <20240822062956.3490387-3-ruanjinjie@huawei.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-08-27hwmon: (aspeed-g6-pwm-tacho): Simplify with scoped for each OF child loopJinjie Ruan1-3/+1
Use scoped for_each_child_of_node_scoped() when iterating over device nodes to make code a bit simpler. Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com> Reviewed-by: Andrew Jeffery <andrew@codeconstruct.com.au> Message-ID: <20240822062956.3490387-2-ruanjinjie@huawei.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-08-27hwmon: (k10temp): Use cpu_feature_enabled() for detecting zenMario Limonciello1-16/+10
This removes some boilerplate from the code and will allow adding future CPUs by just device IDs. Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Message-ID: <20240820053558.1052853-1-superm1@kernel.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-08-27dt-bindings: hwmon: Add maxim max31790Chanh Nguyen1-0/+70
Add device tree bindings and an example for max31790 device. Signed-off-by: Chanh Nguyen <chanh@os.amperecomputing.com> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Message-ID: <20240822084808.299884-1-chanh@os.amperecomputing.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-08-27hwmon: (oxp-sensors) Add support for multiple new devices.Derek J. Clark2-63/+290
Add support for the OrangePi NEO-01. It uses different registers for PWM manual mode, set PWM, and read fan speed than previous devices. Valid PWM input and duty cycle is 1-244, we scale this from 1-255 to maintain compatibility with the existing interface. Add OneXPlayer 2 series, OneXFly, and X1 series models. The 2/X1 series use new registers for turbo button takeover and read fan speed. X1 has an Intel variant so change the CPU detection at init to only check for the affected devices. While at it, adjust formatting of some constants and reorder all cases alphabetically for consistency. Rename OXP_OLD constants to OXP_MINI for disambiguation. Update code comments for clarity. Add support for AYANEO models 2S, AIR 1S, Flip series, GEEK 1S, and KUN. Signed-off-by: Derek J. Clark <derekjohn.clark@gmail.com> Tested-by: Kevin Greenberg <kdgreenberg234@protonmail.com> Tested-by: Joshua Tam <csinaction@pm.me> Tested-by: Parth Menon <parthasarathymenon@gmail.com> Tested-by: Philip Müller <philm@manjaro.org> Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202408160329.TLNbIwRC-lkp@intel.com/ Message-ID: <20240822183525.27289-2-derekjohn.clark@gmail.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-08-27hwmon: (stts751) Add "st" vendor prefix to "stts751" compatible stringRob Herring (Arm)1-1/+1
The documented compatible string is "st,stts751", not "stts751". Even if "stts751" was in use, there's no need to list "stts751" in the DT match table. The I2C core will strip any vendor prefix and match against the i2c_device_id table which has an "stts751" entry. Signed-off-by: Rob Herring (Arm) <robh@kernel.org> Message-ID: <20240826191811.1416011-1-robh@kernel.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-08-27hwmon: (ntc_thermistor) fix module autoloadingYuntao Liu1-0/+1
Add MODULE_DEVICE_TABLE(), so modules could be properly autoloaded based on the alias from of_device_id table. Fixes: 9e8269de100d ("hwmon: (ntc_thermistor) Add DT with IIO support to NTC thermistor driver") Signed-off-by: Yuntao Liu <liuyuntao12@huawei.com> Message-ID: <20240815083021.756134-1-liuyuntao12@huawei.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-08-27hwmon: (sch5627) Remove unused declaration sch56xx_watchdog_unregister()Yue Haibing1-1/+0
Commit 2be5f0d75325 ("hwmon: (sch56xx) Use devres functions for watchdog") removed the implementation but leave declaration. Signed-off-by: Yue Haibing <yuehaibing@huawei.com> Message-ID: <20240816095740.877729-1-yuehaibing@huawei.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-08-27hwmon: (gsc-hwmon) fix module autoloadingLiao Chen1-0/+1
Add MODULE_DEVICE_TABLE(), so modules could be properly autoloaded based on the alias from of_device_id table. Signed-off-by: Liao Chen <liaochen4@huawei.com> Message-ID: <20240814024555.3875387-1-liaochen4@huawei.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-08-27hwmon: Add thermal sensor driver for Surface Aggregator ModuleMaximilian Luz4-0/+253
Some of the newer Microsoft Surface devices (such as the Surface Book 3 and Pro 9) have thermal sensors connected via the Surface Aggregator Module (the embedded controller on those devices). Add a basic driver to read out the temperature values of those sensors. The EC can have up to 16 thermal sensors connected via a single sub-device, each providing temperature readings and a label string. Link: https://github.com/linux-surface/surface-aggregator-module/issues/59 Reviewed-by: Hans de Goede <hdegoede@redhat.com> Co-developed-by: Ivor Wanders <ivor@iwanders.net> Signed-off-by: Ivor Wanders <ivor@iwanders.net> Signed-off-by: Maximilian Luz <luzmaximilian@gmail.com> Message-ID: <20240811001503.753728-1-luzmaximilian@gmail.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-08-27hwmon: (nct6775) add G15CF to ASUS WMI monitoring listDenis Pauk1-0/+1
Boards G15CF has got a nct6775 chip, but by default there's no use of it because of resource conflict with WMI method. Add the board to the WMI monitoring list. Link: https://bugzilla.kernel.org/show_bug.cgi?id=204807 Signed-off-by: Denis Pauk <pauk.denis@gmail.com> Tested-by: Attila <attila@fulop.one> Message-ID: <20240812152652.1303-1-pauk.denis@gmail.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-08-27hwmon: (chipcap2) Drop cc2_disable() in the probe and return dev_err_probe()Javier Carrasco1-22/+11
There is no need to actively disable a regulator that has not been enabled by the driver, which makes the call to cc2_disable() in the probe function meaningless, because the probe function never enables the device's dedicated regulator. Once the call to cc2_disable() is dropped, the error paths can directly return dev_err_probe() in all cases. Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com> Message-ID: <20240813-chipcap2-probe-improvements-v2-1-e9a2932a8a00@gmail.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-08-27hwmon: (lm92) Update documentationGuenter Roeck2-14/+14
Update datasheet references. Replace misleading 'force parameter needed' with 'must be instantiated explicitly'. Explain the reason for the missing auto-detection. Mention all supported chips in Kconfig. Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-08-27hwmon: (lm92) Convert to with_info hwmon APIGuenter Roeck1-145/+174
Convert driver to with_info hwmon API to simplify the code and to reduce its size. No functional change. Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-08-27hwmon: (lm92) Convert to use regmapGuenter Roeck2-74/+131
Use regmap for local caching and for multi-byte operations to be able to use regmap API functions and to reduce the need for locking in the driver. Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-08-27hwmon: (lm92) Replace chip IDs with limit register resolutionGuenter Roeck1-8/+10
The chip IDs are not used by the driver. Drop them. Use driver data to store the limit register resolution instead, and use this information when writing temperature limits to improve chip specific rounding and to avoid writing into unused register bits. Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-08-27hwmon: (lm92) Reorder include files to alphabetic orderGuenter Roeck1-6/+6
Simplify driver maintenance by reordering files to alphabetic order. No functional change. Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-08-27hwmon: (lm92) Improve auto-detection accuracyGuenter Roeck1-9/+17
Checking three configuration register bits and the manufacturer ID register to auto-detect LM92 is a bit vague. Repeat twice on replicated register addresses to improve detection accuracy. Check the manufacturer ID first and bail out immediately without reading the other register if there is a mismatch to reduce the number of i2c transfers needed in that case. Also explicitly test for an error from reading the configuration register to avoid potential situations where the returned error masked against 0xe0 is 0. While at it, drop "lm92: Found National Semiconductor LM92 chip" detection noise. Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-08-27hwmon: (vexpress) Use of_property_present()Rob Herring (Arm)1-1/+1
Use of_property_present() to test for property presence rather than of_get_property(). This is part of a larger effort to remove callers of of_get_property() and similar functions. of_get_property() leaks the DT property data pointer which is a problem for dynamically allocated nodes which may be freed. Signed-off-by: Rob Herring (Arm) <robh@kernel.org> Reviewed-by: Sudeep Holla <sudeep.holla@arm.com> Link: https://lore.kernel.org/r/20240731191312.1710417-13-robh@kernel.org Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-07-31hwmon: (max1619) Improve chip detection codeGuenter Roeck1-18/+14
Bail out immediately if reading any of the registers used for chip detection fails, or if it returns an unexpected value. Drop all log messages from detection code. Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-07-31hwmon: (max1619) Add support for update_interval attributeGuenter Roeck1-8/+42
The chip supports reading and writing the conversion rate. Add support for the update_interval sysfs attribute. Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-07-31hwmon: (max1619) Convert to with_info APIGuenter Roeck1-113/+158
Convert driver to with_info hwmon API to simplify the code and with it its maintainability. Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-07-31hwmon: (max1619) Convert to use regmapGuenter Roeck2-127/+138
Use regmap for local caching, to hide register read/write address differences, and for multi-byte operations. With this change, the driver specific lock is no longer necessary. While at it, check errors seen when initializing the chip and bail out if chip initialization fails. Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-07-31hwmon: (max1619) Mask valid alarm bitsGuenter Roeck1-0/+1
Bit 0, 5, and 6 in the status register are reserved and, if set, do not indicate an alarm. Bit 7 is the 'busy' bit and also does not indicate an alarm. Mask the non-alarm bits to avoid reporting them to userspace. Cc: Tzung-Bi Shih <tzungbi@kernel.org> Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-07-31hwmon: (max1619) Reorder include files to alphabetic orderGuenter Roeck1-6/+6
Simplify maintenance by reordering include files to alphabetic order. Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-07-31hwmon: (max1619) Clamp temperature range when writing limitsGuenter Roeck1-12/+2
Module test code reports underflows when writing sensor limits. temp2_min: Suspected underflow: [min=-77000, read 101000, written -2147483648] temp2_max: Suspected underflow: [min=-77000, read 101000, written -2147483648] temp2_crit: Suspected underflow: [min=-77000, read 101000, written -2147483648] Clamp temperature ranges when writing limits to fix the problem. While at it, use sign_extend32() when reading temperatures to make the code easier to understand. Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-07-31hwmon: (max6697) Document discrepancy in overtemperature status bit valuesGuenter Roeck1-0/+10
In the MAX6581 datasheet Revision 0 to 3, the local channel overtemperature status is reported in bit 6 of register 0x45, and the overtemperature status for remote channel 7 is reported in bit 7. In Revision 4 and later, the local channel overtemperature status is reported in bit 7, and the remote channel 7 overtemperature status is reported in bit 6. A real chip was found to match the functionality documented in Revision 4 and later. The code was fixed with commit 1ea3fd1eb986 ("hwmon: (max6697) Fix swapped temp{1,8} critical alarms"). At that time it looked like this was an original bug. It only turned out later that the problem was the result of incorrect information in the chip datasheet. Document the discrepancy to avoid confusion caused by old versions of the datasheet. Cc: Tzung-Bi Shih <tzungbi@kernel.org> Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-07-31hwmon: (max1668) Convert to use with_info hwmon APIGuenter Roeck1-225/+116
Convert to use with_info API to simplify the code and to reduce its size. This patch reduces object file size by approximately 25%. Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-07-31hwmon: (max1668) Replace chip type with number of channelsGuenter Roeck1-8/+6
The only difference between supported chips is the number of channels. Drop enum chips and list the number of channels in struct i2c_device_id directly. Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-07-31hwmon: (max1668) Convert to use regmapGuenter Roeck1-116/+99
Use regmap for caching to simplify the code and to hide read/write register address differences. Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-07-31hwmon: (max1668) Use BIT macroGuenter Roeck1-2/+3
Use bit macro to make the code easier to understand and reduce duplication. Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-07-31hwmon: (max1668) Reorder include files to alphabetic orderGuenter Roeck1-6/+6
Reorder include files to alphabetic order to simplify driver maintenance. Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-07-31hwmon: (oxp-sensors) Fix typo in driver documentationCryolitia PukNgae1-1/+1
RMP -> RPM Signed-off-by: Cryolitia PukNgae <Cryolitia@gmail.com> Link: https://lore.kernel.org/r/20240726-typo-v1-1-3ca3f07f93e9@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-07-31hwmon: (ltc2947) Move to firmware agnostic APINuno Sa1-10/+10
Use the device property APIs so the driver does not depend on OF to work. While at it, properly include mod_devicetable for struct of_device_id and fix some parameter alignment in the changed places. Signed-off-by: Nuno Sa <nuno.sa@analog.com> Link: https://lore.kernel.org/r/20240726-dev-hwmon-ltc6947-fw-agnostic-v1-1-f7d6cab7d438@analog.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-07-31hwmon: (adt7475) Add support for configuring initial PWM stateChris Packham1-0/+130
By default the PWM duty cycle in hardware is 100%. On some systems this can cause unwanted fan noise. Add the ability to specify the fan connections and initial state of the PWMs via device properties. Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz> Link: https://lore.kernel.org/r/20240722221737.3407958-4-chris.packham@alliedtelesis.co.nz [groeck: Cleaned up formatting] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-07-31dt-bindings: hwmon: adt7475: Deprecate adi,pwm-active-stateChris Packham1-1/+1
Now that we have fan child nodes that can specify flags for the PWM outputs we no longer need the adi,pwm-active-state property. Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz> Acked-by: Rob Herring (Arm) <robh@kernel.org> Link: https://lore.kernel.org/r/20240722221737.3407958-3-chris.packham@alliedtelesis.co.nz Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-07-31dt-bindings: hwmon: Add adt7475 fan/pwm propertiesChris Packham1-1/+34
Add fan child nodes that allow describing the connections for the ADT7475 to the fans it controls. This also allows setting some initial values for the pwm duty cycle and frequency. Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz> Reviewed-by: Rob Herring (Arm) <robh@kernel.org> Link: https://lore.kernel.org/r/20240722221737.3407958-2-chris.packham@alliedtelesis.co.nz Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-07-31hwmon: (max6697) Add support for tempX_min and tempX_min_alarmGuenter Roeck1-11/+48
MAX6581 supports setting the minimum temperature as well as minimum temperature alarms. Add support for it. Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-07-31hwmon: (max6697) Convert to with_info hwmon APIGuenter Roeck1-289/+171
Convert to with_info hwmon API to simplify the code and reduce its size. This patch reduces object file size by approximately 25%. Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-07-31hwmon: (max6697) Convert to use regmapGuenter Roeck1-196/+121
Use regmap for register caching, and use regmap API for bit operations to simplify the code. This patch reduces object file size by approximately 10%. Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-07-31hwmon: (max6697) Use bit operations where possibleGuenter Roeck1-15/+28
Use bit operations to improve code maintainability. Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net>