summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* hwmon: (tmp421) support HWMON_T_ENABLEKrzysztof Adamski2021-10-161-4/+29
| | | | | | | | | | Since the recent patches added possibility of disabling sensor channels via DT, it only make sense to allow controlling that from userspace via HWMON_T_ENABLE mechanism. This patches adds support for that. Signed-off-by: Krzysztof Adamski <krzysztof.adamski@nokia.com> Link: https://lore.kernel.org/r/a64c22e7323bd5a083f37aaaca91a745ac1beef3.1634206677.git.krzysztof.adamski@nokia.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (tmp421) really disable channelsKrzysztof Adamski2021-10-161-6/+38
| | | | | | | | | | | | | Recent patch added possibility to disable selected channels. That would only make sure that the ENODATA is returned for those channels but would not configure the actual hardware. With this patch, the config register is written to make sure the channels are disabled also at hardware level. Signed-off-by: Krzysztof Adamski <krzysztof.adamski@nokia.com> Link: https://lore.kernel.org/r/d451cacdf21bf8eff38a47c055aad8c0c6e8755a.1634206677.git.krzysztof.adamski@nokia.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (tmp421) support specifying n-factor via DTKrzysztof Adamski2021-10-161-0/+18
| | | | | | | | | | | | | | | | Previous patches added a way to specify some channel specific parameters in DT and n-factor is definitely one of them. This calibration mechanism is board specific as its value depends on the diodes/transistors being connected to the sensor and thus the DT seems like a right fit for that information. It is very similar to the value of shunt resistor that some drivers allows specifying in DT. This patch adds a possibility to set n-factor for each channel via "n-factor" DT property in each channel subnode. Signed-off-by: Krzysztof Adamski <krzysztof.adamski@nokia.com> Link: https://lore.kernel.org/r/69d0bfcc5ba27c67f21d3eabfb100656a14c75b9.1634206677.git.krzysztof.adamski@nokia.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (tmp421) support disabling channels from DTKrzysztof Adamski2021-10-161-1/+9
| | | | | | | | | | | | | | | The previous patch introduced per channel subnodes in DT that let us specify some channel specific properties. This built a ground for easily disabling individual channels of the sensor that may not be connected to any external diode and thus are not returning any meaningful data. This patch adds support for parsing the "status" property of channels DT subnodes and makes sure the -ENODATA is returned when disabled channels value is read. Signed-off-by: Krzysztof Adamski <krzysztof.adamski@nokia.com> Link: https://lore.kernel.org/r/a85d623f0792b862870933a875bdf802f4c017f1.1634206677.git.krzysztof.adamski@nokia.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (tmp421) add support for defining labels from DTKrzysztof Adamski2021-10-161-0/+61
| | | | | | | | | | | | | | | | | | tmp42x is a multichannel temperature sensor with several external channels. Since those channels can be used to connect diodes placed anywhere in the system, their meaning will vary depending on the project. For this case, the hwmon framework has an idea of labels which allows us to assign the meaning to each channel. The similar concept is already implemented in ina3221 - the label for each channel can be defined via device tree. See commit a9e9dd9c6de5 ("hwmon: (ina3221) Read channel input source info from DT") This patch adds support for similar feature to tmp421. Signed-off-by: Krzysztof Adamski <krzysztof.adamski@nokia.com> Link: https://lore.kernel.org/r/dab0fda6ac0e8d7f163c3762a7fb1e595a4d8159.1634206677.git.krzysztof.adamski@nokia.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* dt-bindings: hwmon: add missing tmp421 bindingKrzysztof Adamski2021-10-161-0/+43
| | | | | | | | | Add basic description of the tmp421 driver DT bindings. Signed-off-by: Krzysztof Adamski <krzysztof.adamski@nokia.com> Reviewed-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/84ac871e30a406a1613d140a084b4f3390753099.1634206677.git.krzysztof.adamski@nokia.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (tmp421) introduce a channel structKrzysztof Adamski2021-10-121-5/+9
| | | | | | | | | This is a preparatory change. Upcoming patches will introduce more per-channel parameters so it's worth organizing them into a struct. Signed-off-by: Krzysztof Adamski <krzysztof.adamski@nokia.com> Link: https://lore.kernel.org/r/baf34d95983a6b58a3e39e4c098e5979e541572e.1634029538.git.krzysztof.adamski@nokia.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (adt7x10) Make adt7x10_remove() return voidUwe Kleine-König2021-10-124-5/+6
| | | | | | | | | | | | Up to now adt7x10_remove() returns zero unconditionally. Make it return void instead which makes it easier to see in the callers that there is no error to handle. Also the return value of i2c and spi remove callbacks is ignored anyway. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20211011132754.2479853-3-u.kleine-koenig@pengutronix.de Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (dell-smm) Remove unnecessary includesArmin Wolf2021-10-121-2/+0
| | | | | | | | sched.h and io.h are not used anywhere in dell-smm-hwmon.c. Signed-off-by: Armin Wolf <W_Armin@gmx.de> Link: https://lore.kernel.org/r/20210926221044.14327-3-W_Armin@gmx.de Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* dt-bindings: hwmon: jedec,jc42: add nxp,se97bKrzysztof Kozlowski2021-10-121-0/+9
| | | | | | | | | | Document bindings for NXP SE97B, a DDR memory module temperature sensor with integrated SPD and EEPROM via Atmel's AT24 interface. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Reviewed-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20210920182114.339419-6-krzysztof.kozlowski@canonical.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: cleanup non-bool "valid" data fieldsPaul Fertser2021-10-1269-152/+152
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have bool so use it consistently in all the drivers. The following Coccinelle script was used: @@ identifier T; type t = { char, int }; @@ struct T { ... - t valid; + bool valid; ... } @@ identifier v; @@ ( - v->valid = 0 + v->valid = false | - v->valid = 1 + v->valid = true ) followed by sed to fixup the comments: sed '/bool valid;/{s/!=0/true/;s/zero/false/}' Few whitespace changes were fixed manually. All modified drivers were compile-tested. Signed-off-by: Paul Fertser <fercerpav@gmail.com> Link: https://lore.kernel.org/r/20210924195202.27917-1-fercerpav@gmail.com [groeck: Fixed up 'u8 valid' to 'boool valid' in atxp1.c] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (tmp103) Convert tmp103 to use new hwmon registration APIOleksij Rempel2021-10-121-31/+74
| | | | | | | | | Use devm_hwmon_device_register_with_info() which will make thermal framework work. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Link: https://lore.kernel.org/r/20211007125301.3030-1-o.rempel@pengutronix.de Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (mlxreg-fan) Support distinctive names per different cooling devicesVadim Pasternak2021-10-121-2/+9
| | | | | | | | | | | | Provide different names for cooling devices registration to allow binding each cooling devices to relevant thermal zone. Thus, specific cooling device can be associated with related thermal sensor by setting thermal cooling device type for example to "mlxreg_fan2" and passing this type to thermal_zone_bind_cooling_device() through 'cdev->type'. Signed-off-by: Vadim Pasternak <vadimp@nvidia.com> Link: https://lore.kernel.org/r/20210926053541.1806937-3-vadimp@nvidia.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (mlxreg-fan) Modify PWM connectivity validationVadim Pasternak2021-10-121-3/+8
| | | | | | | | | | | | Validate PWM connectivity only for additional PWM - "pwm1" is connected on all systems, while "pwm2" - "pwm4" are optional. Validate connectivity only for optional attributes by reading of related "pwm{n}" registers - in case "pwm{n}" is not connected, register value is supposed to be 0xff. Signed-off-by: Vadim Pasternak <vadimp@nvidia.com> Link: https://lore.kernel.org/r/20210926053541.1806937-2-vadimp@nvidia.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (nct6775) add Pro WS X570-ACEOleksandr Natalenko2021-10-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ASUS Pro WS X570-ACE board has got an nct6775 chip, but by default there's no use of it because of resource conflict: ``` ACPI Warning: SystemIO range 0x0000000000000295-0x0000000000000296 conflicts with OpRegion 0x0000000000000290-0x0000000000000299 (\AMW0.SHWM) (20210604/utaddress-204 ) ACPI: OSL: Resource conflict; ACPI support missing from driver? ACPI: OSL: Resource conflict: System may be unstable or behave erratically ``` A workaround is to use `acpi_enforce_resources=lax`, but a proper support needs to be added instead. This commit adds Pro WS X570-ACE to the list of boards that can be monitored using ASUS WMI. Tested by me on this hardware: ``` Base Board Information Manufacturer: ASUSTeK COMPUTER INC. Product Name: Pro WS X570-ACE BIOS Information Vendor: American Megatrends Inc. Version: 3801 Release Date: 07/30/2021 ``` Signed-off-by: Oleksandr Natalenko <oleksandr@natalenko.name> Link: https://lore.kernel.org/r/20211003133344.9036-2-oleksandr@natalenko.name Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (pmbus/ibm-cffps) Use MFR_ID to choose versionBrandon Wyman2021-10-121-1/+12
| | | | | | | | | | | There are multiple power supplies that will indicate CFFPS_CCIN_VERSION_1, use the manufacturer ID to determine if it should be treated as version cffps1 or version cffps2. Signed-off-by: Brandon Wyman <bjwyman@gmail.com> Link: https://lore.kernel.org/r/20211004144339.2634330-2-bjwyman@gmail.com [groeck: Fixed continuation line alignment] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (pmbus/ibm-cffps) Add mfg_id debugfs entryBrandon Wyman2021-10-121-1/+9
| | | | | | | | Add support for the manufacturer ID to the debugfs entries. Signed-off-by: Brandon Wyman <bjwyman@gmail.com> Link: https://lore.kernel.org/r/20211004144339.2634330-1-bjwyman@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (nct6775) Add additional ASUS motherboards.Denis Pauk2021-10-121-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support: * PRIME B360-PLUS * PRIME X570-PRO * ROG CROSSHAIR VIII FORMULA * ROG STRIX B550-I GAMING * ROG STRIX X570-F GAMING * ROG STRIX Z390-E GAMING * TUF GAMING B550-PRO * TUF GAMING Z490-PLUS * TUF GAMING Z490-PLUS (WI-FI) BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=204807 Signed-off-by: Denis Pauk <pauk.denis@gmail.com> Tested-by: matt-testalltheway <sefoci9222@rerunway.com> Tested-by: Kamil Dudka <kdudka@redhat.com> Tested-by: Robert Swiecki <robert@swiecki.net> Tested-by: Kamil Pietrzak <kpietrzak@disroot.org> Tested-by: Igor <igor@svelig.com> Tested-by: Tor Vic <torvic9@mailbox.org> Tested-by: Poezevara <nephartyz@gmail.com> Cc: Andy Shevchenko <andriy.shevchenko@intel.com> Cc: Guenter Roeck <linux@roeck-us.net> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20211002210857.709956-2-pauk.denis@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* dt-bindings: hwmon/pmbus: Add ti,lm25066 power-management ICZev Weiss2021-10-121-0/+54
| | | | | | | Signed-off-by: Zev Weiss <zev@bewilderbeest.net> Reviewed-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20210928092242.30036-9-zev@bewilderbeest.net Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (pmbus/lm25066) Support configurable sense resistor valuesZev Weiss2021-10-122-0/+13
| | | | | | | | | | | | | | The appropriate mantissa values for the lm25066 family's direct-format current and power readings are a function of the sense resistor employed between the SENSE and VIN pins of the chip. Instead of assuming that resistance is always the same 1mOhm as used in the datasheet, allow it to be configured via a device-tree property ("shunt-resistor-micro-ohms"). Signed-off-by: Zev Weiss <zev@bewilderbeest.net> Link: https://lore.kernel.org/r/20210928092242.30036-8-zev@bewilderbeest.net [groeck: Fixed checkpatch warnings] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (pmbus/lm25066) Add OF device ID tableZev Weiss2021-10-121-2/+23
| | | | | | | | | | | | | | | | The driver doesn't have a struct of_device_id table but supported devices are registered via Device Trees. This is working on the assumption that a I2C device registered via OF will always match a legacy I2C device ID and that the MODALIAS reported will always be of the form i2c:<device>. But this could change in the future so the correct approach is to have an OF device ID table if the devices are registered via OF. Signed-off-by: Zev Weiss <zev@bewilderbeest.net> Link: https://lore.kernel.org/r/20210928092242.30036-7-zev@bewilderbeest.net [groeck: Replaced reference to reasoning with reasoning, fixed checkpatch warnings, fixed compile warning comparing of_id->data w/ i2c_id->driver_data] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (pmbus/lm25066) Mark lm25066_coeff array constZev Weiss2021-10-121-2/+2
| | | | | | | | | lm25066_coeff is read-only. Mark it as such. Signed-off-by: Zev Weiss <zev@bewilderbeest.net> Link: https://lore.kernel.org/r/20210928092242.30036-6-zev@bewilderbeest.net [groeck: Added description] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (pmbus/lm25066) Let compiler determine outer dimension of lm25066_coeffZev Weiss2021-10-121-1/+1
| | | | | | | | | | Maintaining this manually is error prone (there are currently only five chips supported, not six); gcc can do it for us automatically. Signed-off-by: Zev Weiss <zev@bewilderbeest.net> Fixes: 666c14906b49 ("hwmon: (pmbus/lm25066) Drop support for LM25063") Link: https://lore.kernel.org/r/20210928092242.30036-5-zev@bewilderbeest.net Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (pmbus/lm25066) Avoid forward declaration of lm25066_idZev Weiss2021-10-121-13/+10
| | | | | | | | | Reordering things to put the table before the probe function eliminates the need for it. Signed-off-by: Zev Weiss <zev@bewilderbeest.net> Link: https://lore.kernel.org/r/20210928092242.30036-4-zev@bewilderbeest.net Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (pmbus/lm25066) Adjust lm25066 PSC_CURRENT_IN_L mantissaZev Weiss2021-10-121-1/+1
| | | | | | | | | At least as of Revision J, the datasheet has a slightly different value than what we'd had in the driver. Signed-off-by: Zev Weiss <zev@bewilderbeest.net> Link: https://lore.kernel.org/r/20210928092242.30036-3-zev@bewilderbeest.net Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (pmbus/lm25066) Add offset coefficientsZev Weiss2021-10-121-0/+23
| | | | | | | | | | | | | With the exception of the lm5066i, all the devices handled by this driver had been missing their offset ('b') coefficients for direct format readings. Cc: stable@vger.kernel.org Fixes: 58615a94f6a1 ("hwmon: (pmbus/lm25066) Add support for LM25056") Fixes: e53e6497fc9f ("hwmon: (pmbus/lm25066) Refactor device specific coefficients") Signed-off-by: Zev Weiss <zev@bewilderbeest.net> Link: https://lore.kernel.org/r/20210928092242.30036-2-zev@bewilderbeest.net Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* dt-bindings: hwmon: ibm,cffps: move to trivial devicesKrzysztof Kozlowski2021-10-123-27/+6
| | | | | | | | | | The IBM Common Form Factor Power Supply Versions 1 and 2 bindings are trivial, so they can be integrated into trivial devices bindings. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Reviewed-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20210921102832.143352-3-krzysztof.kozlowski@canonical.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* dt-bindings: hwmon: Convert NTC thermistor to YAMLLinus Walleij2021-10-122-44/+141
| | | | | | | | | | | | | | | | This converts the NTC thermistor DT bindings to YAML. Some care had to be taken since I had to add some illustrations to make the connection layouts graspable. Cc: Javier Martinez Canillas <javier@dowhile0.org> Cc: Johannes Pointner <johannes.pointner@gmail.com> Cc: Peter Rosin <peda@axentia.se> Cc: Jonathan Cameron <Jonathan.Cameron@huawei.com> Cc: devicetree@vger.kernel.org Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20210922233901.1871274-1-linus.walleij@linaro.org Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (tmp421) introduce MAX_CHANNELS defineKrzysztof Adamski2021-10-121-4/+5
| | | | | | | | | | | | There are few places where the maximal number of channels is used define the size of arrays but when raw number is used it is not clear that they really related to this quantity. This commit introduces MAX_CHANNELS define and uses it those places to give some context to the number. Signed-off-by: Krzysztof Adamski <krzysztof.adamski@nokia.com> Link: https://lore.kernel.org/r/abc1a213a25b890b799b35ad94bb543a2ade7fc8.1632473318.git.krzysztof.adamski@nokia.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* dt-bindings: hwmon: jedec,jc42: convert to dtschemaKrzysztof Kozlowski2021-10-123-46/+70
| | | | | | | | | | Convert the Jedec JC-42.4 temperature sensor bindings to DT schema format. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Reviewed-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20210920182114.339419-5-krzysztof.kozlowski@canonical.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* dt-bindings: hwmon: hih6130: move to trivial devicesKrzysztof Kozlowski2021-10-122-12/+2
| | | | | | | | | | The hih6130 bindings are trivial, so it can be integrated into trivial devices bindings. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Reviewed-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20210920182114.339419-4-krzysztof.kozlowski@canonical.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* dt-bindings: hwmon: dps650ab: move to trivial devicesKrzysztof Kozlowski2021-10-122-11/+2
| | | | | | | | | | The dps650ab bindings are trivial, so it can be integrated into trivial devices bindings. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Reviewed-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20210920182114.339419-3-krzysztof.kozlowski@canonical.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* dt-bindings: hwmon: lm75: remove gmt,g751 from trivial devicesKrzysztof Kozlowski2021-10-121-2/+0
| | | | | | | | | | | | gmt,g751 is covered by LM75 sensor bindings. This fixes warning: arch/arm/boot/dts/gemini-dlink-dns-313.dt.yaml: temperature-sensor@48: '#thermal-sensor-cells' does not match any of the regexes: 'pinctrl-[0-9]+' Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Reviewed-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20210920182114.339419-2-krzysztof.kozlowski@canonical.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (nct6683) Add another customer ID for NCT6683D sensor chip on some ↵Daniel Dawson2021-10-121-0/+3
| | | | | | | | | | | ASRock boards This value was found on a Z370M Pro4 rev. 1.01, with an NCT6683D-T chip. Signed-off-by: Daniel Dawson <danielcdawson@gmail.com> Link: https://lore.kernel.org/r/20210921165859.48714-1-danielcdawson@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* dt-bindings: hwmon: sensirion,sht15: convert to dtschemaKrzysztof Kozlowski2021-10-122-19/+43
| | | | | | | | | Convert the Sensirion SHT15 humidity sensor to DT schema format. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Reviewed-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20210921102832.143352-6-krzysztof.kozlowski@canonical.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* dt-bindings: hwmon: microchip,mcp3021: convert to dtschemaKrzysztof Kozlowski2021-10-122-21/+43
| | | | | | | | | Convert the Microchip MCP3021 ADC bindings to DT schema format. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Reviewed-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20210921102832.143352-5-krzysztof.kozlowski@canonical.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* dt-bindings: hwmon: lltc,ltc4151: convert to dtschemaKrzysztof Kozlowski2021-10-122-18/+41
| | | | | | | | | | Convert the LTC4151 current and voltage sensor bindings to DT schema format. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Reviewed-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20210921102832.143352-4-krzysztof.kozlowski@canonical.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* dt-bindings: hwmon: ti,tmp102: add bindings and remove from trivial devicesKrzysztof Kozlowski2021-10-122-2/+47
| | | | | | | | | | The TI TMP102 temperature sensor does not fit into trivial devices bindings due to additional properties. Add separate bindings for it. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Reviewed-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20210921102832.143352-2-krzysztof.kozlowski@canonical.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* dt-bindings: hwmon: ti,tmp108: convert to dtschemaKrzysztof Kozlowski2021-10-122-18/+50
| | | | | | | | | Convert the TI TMP108 temperature sensor bindings to DT schema format. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Reviewed-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20210921102832.143352-1-krzysztof.kozlowski@canonical.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* dt-bindings: hwmon: lm70: move to trivial devicesKrzysztof Kozlowski2021-10-122-22/+8
| | | | | | | | | | The lm70 thermometer bindings are trivial, so like many other I2C/SPI temperature sensors can be integrated into trivial devices bindings. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Reviewed-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20210920182114.339419-1-krzysztof.kozlowski@canonical.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* dt-bindings: hwmon: lm90: do not require VCC supplyKrzysztof Kozlowski2021-10-121-1/+0
| | | | | | | | | | | | The LM90-like sensors usually need VCC supply, however this can be hard-wired to the board main supply (like in SiFive HiFive Unmatched RISC-V board). Original bindings made VCC supply as required but in practice several other boards skipped it. Make it optional. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Reviewed-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20210920181913.338772-2-krzysztof.kozlowski@canonical.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* dt-bindings: hwmon: lm90: convert to dtschemaKrzysztof Kozlowski2021-10-124-56/+80
| | | | | | | | | Convert the National LM90 hwmon sensor bindings to DT schema format. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Reviewed-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20210920181913.338772-1-krzysztof.kozlowski@canonical.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (mlxreg-fan) Fix out of bounds read on array fan->pwmColin Ian King2021-10-121-1/+1
| | | | | | | | | | | | | | Array fan->pwm[] is MLXREG_FAN_MAX_PWM elements in size, however the for-loop has a off-by-one error causing index i to be out of range causing an out of bounds read on the array. Fix this by replacing the <= operator with < in the for-loop. Addresses-Coverity: ("Out-of-bounds read") Reported-by: Vadim Pasternak <vadimp@nvidia.com> Fixes: 35edbaab3bbf ("hwmon: (mlxreg-fan) Extend driver to support multiply cooling devices") Signed-off-by: Colin Ian King <colin.king@canonical.com> Link: https://lore.kernel.org/r/20210920180921.16246-1-colin.king@canonical.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (nct6775) Support access via Asus WMIDenis Pauk2021-10-122-21/+220
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Support accessing the NCT677x via Asus WMI functions. On mainboards that support this way of accessing the chip, the driver will usually not work without this option since in these mainboards, ACPI will mark the I/O port as used. Code uses ACPI firmware interface to communicate with sensors with ASUS motherboards: * PRIME B460-PLUS, * ROG CROSSHAIR VIII IMPACT, * ROG STRIX B550-E GAMING, * ROG STRIX B550-F GAMING, * ROG STRIX B550-F GAMING (WI-FI), * ROG STRIX Z490-I GAMING, * TUF GAMING B550M-PLUS, * TUF GAMING B550M-PLUS (WI-FI), * TUF GAMING B550-PLUS, * TUF GAMING X570-PLUS, * TUF GAMING X570-PRO (WI-FI). BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=204807 Signed-off-by: Denis Pauk <pauk.denis@gmail.com> Co-developed-by: Bernhard Seibold <mail@bernhard-seibold.de> Signed-off-by: Bernhard Seibold <mail@bernhard-seibold.de> Tested-by: Pär Ekholm <pehlm@pekholm.org> Tested-by: <to.eivind@gmail.com> Tested-by: Artem S. Tashkinov <aros@gmx.com> Tested-by: Vittorio Roberto Alfieri <me@rebtoor.com> Tested-by: Sahan Fernando <sahan.h.fernando@gmail.com> Cc: Andy Shevchenko <andriy.shevchenko@intel.com> Cc: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20210917220240.56553-4-pauk.denis@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (nct6775) Use nct6775_*() function pointers in nct6775_data.Denis Pauk2021-10-121-140/+143
| | | | | | | | | | | | | | | | Prepare for platform specific callbacks usage: * Use nct6775 function pointers in struct nct6775_data instead direct calls. BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=204807 Signed-off-by: Denis Pauk <pauk.denis@gmail.com> Co-developed-by: Bernhard Seibold <mail@bernhard-seibold.de> Signed-off-by: Bernhard Seibold <mail@bernhard-seibold.de> Cc: Andy Shevchenko <andriy.shevchenko@intel.com> Cc: Guenter Roeck <linux@roeck-us.net> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20210917220240.56553-3-pauk.denis@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (nct6775) Use superio_*() function pointers in sio_data.Denis Pauk2021-10-121-85/+104
| | | | | | | | | | | | | | | | | | Prepare for platform specific callbacks usage: * Rearrange code for directly use struct nct6775_sio_data in superio_*() functions. * Use superio function pointers in nct6775_sio_data struct instead direct calls. BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=204807 Signed-off-by: Denis Pauk <pauk.denis@gmail.com> Co-developed-by: Bernhard Seibold <mail@bernhard-seibold.de> Signed-off-by: Bernhard Seibold <mail@bernhard-seibold.de> Cc: Andy Shevchenko <andriy.shevchenko@intel.com> Cc: Guenter Roeck <linux@roeck-us.net> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20210917220240.56553-2-pauk.denis@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (mlxreg-fan) Extend driver to support multiply cooling devicesVadim Pasternak2021-10-121-26/+47
| | | | | | | | Add support for additional cooling devices in order to support the systems, which can be equipped with up-to four PWM controllers. Signed-off-by: Vadim Pasternak <vadimp@nvidia.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (mlxreg-fan) Extend driver to support multiply PWMVadim Pasternak2021-10-121-12/+43
| | | | | | | | | | | Add additional PWM attributes in order to support the systems, which can be equipped with up-to four PWM controllers. System capability of additional PWM support is validated through the reading of relevant registers. Signed-off-by: Vadim Pasternak <vadimp@nvidia.com> Link: https://lore.kernel.org/r/20210916194719.871413-3-vadimp@nvidia.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (mlxreg-fan) Extend the maximum number of tachometersVadim Pasternak2021-10-121-1/+3
| | | | | | | | | Extend support of maximum tachometers from 12 to 14 in order to support new systems, equipped with more fans. Signed-off-by: Vadim Pasternak <vadimp@nvidia.com> Link: https://lore.kernel.org/r/20210916194719.871413-2-vadimp@nvidia.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: Add Maxim MAX6620 hardware monitoring driverArun Saravanan Balachandran2021-10-125-0/+572
| | | | | | | | | | Add hardware monitoring driver for Maxim MAX6620 Fan controller Originally-from: L. Grunenberg <contact@lgrunenberg.de> Originally-from: Cumulus Networks <support@cumulusnetworks.com> Originally-from: Shuotian Cheng <shuche@microsoft.com> Signed-off-by: Arun Saravanan Balachandran <Arun_Saravanan_Balac@dell.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>