Commit c27ea952 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull hwmon updates from Guenter Roeck:
 "New drivers:
   - driver for Sophgo SG2042 external hardware monitor
   - thermal sensor driver for Surface Aggregator Module

  Added support to existing drivers:
   - oxp-sensors: Support for multiple new devices.
   - nct6775: Added G15CF to ASUS WMI monitoring list

  Modernizations:
   - driver cleanup and update to use with_info API: ina2xx, lm92,
     lm95234, max1619, max1668, and max6697.

  API updates:
   - removed unused devm_hwmon_device_unregister() API function

  Other notable changes
   - implement and use generic bus access delay for pmbus drivers
   - use with scoped for each OF child loop in several drivers
   - module unloading fixes for gsc-hwmon and ntc_thermistor drivers
   - converted various drivers to use multi-byte regmap operations
   - adt7475: Improved devicetree based configuration
   - ltc2947: Move to firmware agnostic API
   - ltc2978: Converted devicetree description to yaml
   - max16065: Addressed overflows when writing limit attributes

  Various other minor cleanups, fixes and improvements"

* tag 'hwmon-for-v6.12' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: (96 commits)
  hwmon: Remove devm_hwmon_device_unregister() API function
  hwmon: (sch5636) Print unknown ID in error string via %*pE
  hwmon: (sht21) Use %*ph to print small buffer
  hwmon: (pmbus/mpq7932) Constify struct regulator_desc
  hwmon: pmbus: pli12096bc: Add write delay
  hwmon: pmbus: zl6100: Use generic code
  hwmon: pmbus: ucd9000: Use generic code
  hwmon: pmbus: max15301: Use generic code
  hwmon: pmbus: Implement generic bus access delay
  hwmon: (ina2xx) Use shunt voltage to calculate current
  hwmon: (ina2xx) Add support for current limits
  hwmon: (ina2xx) Pass register to alert limit write functions
  hwmon: (ina2xx) Convert to use with_info hwmon API
  hwmon: (ina2xx) Move ina2xx_get_value()
  hwmon: (ina2xx) Set alert latch
  hwmon: (ina2xx) Consolidate chip initialization code
  hwmon: (ina2xx) Fix various overflow issues
  hwmon: (ina2xx) Re-initialize chip using regmap functions
  hwmon: (ina2xx) Use local regmap pointer if used more than once
  hwmon: (ina2xx) Mark regmap_config as const
  ...
parents 39b3f4e0 2cb4acf2
Loading
Loading
Loading
Loading
+35 −2
Original line number Diff line number Diff line
@@ -45,12 +45,31 @@ properties:
      the pwm uses a logic low output for 100% duty cycle. If set to 1 the pwm
      uses a logic high output for 100% duty cycle.
    $ref: /schemas/types.yaml#/definitions/uint32-array
    deprecated: true
    minItems: 3
    maxItems: 3
    items:
      enum: [0, 1]
      default: 1

  "#pwm-cells":
    const: 4
    description: |
      Number of cells in a PWM specifier.
      - 0: The PWM channel
      - 1: The PWM period in nanoseconds
           - 90909091 (11 Hz)
           - 71428571 (14 Hz)
           - 45454545 (22 Hz)
           - 34482759 (29 Hz)
           - 28571429 (35 Hz)
           - 22727273 (44 Hz)
           - 17241379 (58 Hz)
           - 11363636 (88 Hz)
           - 44444 (22 kHz)
      - 2: PWM flags 0 or PWM_POLARITY_INVERTED
      - 3: The default PWM duty cycle in nanoseconds

patternProperties:
  "^adi,bypass-attenuator-in[0-4]$":
    description: |
@@ -81,6 +100,10 @@ patternProperties:
      - smbalert#
      - gpio

  "^fan-[0-9]+$":
    $ref: fan-common.yaml#
    unevaluatedProperties: false

required:
  - compatible
  - reg
@@ -89,17 +112,27 @@ additionalProperties: false

examples:
  - |
    #include <dt-bindings/pwm/pwm.h>
    i2c {
      #address-cells = <1>;
      #size-cells = <0>;

      hwmon@2e {
      pwm: hwmon@2e {
        compatible = "adi,adt7476";
        reg = <0x2e>;
        adi,bypass-attenuator-in0 = <1>;
        adi,bypass-attenuator-in1 = <0>;
        adi,pwm-active-state = <1 0 1>;
        adi,pin10-function = "smbalert#";
        adi,pin14-function = "tach4";
        #pwm-cells = <4>;

        /* PWMs at 22.5 kHz frequency, 50% duty*/
        fan-0 {
          pwms = <&pwm 0 44444 0 22222>;
        };

        fan-1 {
          pwms = <&pwm 2 44444 0 22222>;
        };
      };
    };
+94 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/hwmon/lltc,ltc2978.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Octal Digital Power-supply monitor/supervisor/sequencer/margin controller.

maintainers:
  - Frank Li <Frank.Li@nxp.com>

properties:
  compatible:
    enum:
      - lltc,ltc2972
      - lltc,ltc2974
      - lltc,ltc2975
      - lltc,ltc2977
      - lltc,ltc2978
      - lltc,ltc2979
      - lltc,ltc2980
      - lltc,ltc3880
      - lltc,ltc3882
      - lltc,ltc3883
      - lltc,ltc3884
      - lltc,ltc3886
      - lltc,ltc3887
      - lltc,ltc3889
      - lltc,ltc7880
      - lltc,ltm2987
      - lltc,ltm4664
      - lltc,ltm4675
      - lltc,ltm4676
      - lltc,ltm4677
      - lltc,ltm4678
      - lltc,ltm4680
      - lltc,ltm4686
      - lltc,ltm4700

  reg:
    maxItems: 1

  regulators:
    type: object
    description: |
      list of regulators provided by this controller.
      Valid names of regulators depend on number of supplies supported per device:
      * ltc2972 vout0 - vout1
      * ltc2974, ltc2975 : vout0 - vout3
      * ltc2977, ltc2979, ltc2980, ltm2987 : vout0 - vout7
      * ltc2978 : vout0 - vout7
      * ltc3880, ltc3882, ltc3884, ltc3886, ltc3887, ltc3889 : vout0 - vout1
      * ltc7880 : vout0 - vout1
      * ltc3883 : vout0
      * ltm4664 : vout0 - vout1
      * ltm4675, ltm4676, ltm4677, ltm4678 : vout0 - vout1
      * ltm4680, ltm4686 : vout0 - vout1
      * ltm4700 : vout0 - vout1

    patternProperties:
      "^vout[0-7]$":
        $ref: /schemas/regulator/regulator.yaml#
        type: object
        unevaluatedProperties: false

    additionalProperties: false

required:
  - compatible
  - reg

additionalProperties: false

examples:
  - |
    i2c {
        #address-cells = <1>;
        #size-cells = <0>;

        regulator@5e {
            compatible = "lltc,ltc2978";
            reg = <0x5e>;

            regulators {
                vout0 {
                     regulator-name = "FPGA-2.5V";
                };
                vout2 {
                     regulator-name = "FPGA-1.5V";
                };
            };
        };
    };
+0 −62
Original line number Diff line number Diff line
ltc2978

Required properties:
- compatible: should contain one of:
  * "lltc,ltc2972"
  * "lltc,ltc2974"
  * "lltc,ltc2975"
  * "lltc,ltc2977"
  * "lltc,ltc2978"
  * "lltc,ltc2979"
  * "lltc,ltc2980"
  * "lltc,ltc3880"
  * "lltc,ltc3882"
  * "lltc,ltc3883"
  * "lltc,ltc3884"
  * "lltc,ltc3886"
  * "lltc,ltc3887"
  * "lltc,ltc3889"
  * "lltc,ltc7880"
  * "lltc,ltm2987"
  * "lltc,ltm4664"
  * "lltc,ltm4675"
  * "lltc,ltm4676"
  * "lltc,ltm4677"
  * "lltc,ltm4678"
  * "lltc,ltm4680"
  * "lltc,ltm4686"
  * "lltc,ltm4700"
- reg: I2C slave address

Optional properties:
- regulators: A node that houses a sub-node for each regulator controlled by
  the device. Each sub-node is identified using the node's name, with valid
  values listed below. The content of each sub-node is defined by the
  standard binding for regulators; see regulator.txt.

Valid names of regulators depend on number of supplies supported per device:
  * ltc2972 vout0 - vout1
  * ltc2974, ltc2975 : vout0 - vout3
  * ltc2977, ltc2979, ltc2980, ltm2987 : vout0 - vout7
  * ltc2978 : vout0 - vout7
  * ltc3880, ltc3882, ltc3884, ltc3886, ltc3887, ltc3889 : vout0 - vout1
  * ltc7880 : vout0 - vout1
  * ltc3883 : vout0
  * ltm4664 : vout0 - vout1
  * ltm4675, ltm4676, ltm4677, ltm4678 : vout0 - vout1
  * ltm4680, ltm4686 : vout0 - vout1
  * ltm4700 : vout0 - vout1

Example:
ltc2978@5e {
	compatible = "lltc,ltc2978";
	reg = <0x5e>;
	regulators {
		vout0 {
			regulator-name = "FPGA-2.5V";
		};
		vout2 {
			regulator-name = "FPGA-1.5V";
		};
	};
};
+70 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/hwmon/maxim,max31790.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: The Maxim MAX31790 Fan Controller

maintainers:
  - Guenter Roeck <linux@roeck-us.net>
  - Chanh Nguyen <chanh@os.amperecomputing.com>

description: >
  The MAX31790 controls the speeds of up to six fans using six
  independent PWM outputs. The desired fan speeds (or PWM duty cycles)
  are written through the I2C interface.

  Datasheets:
    https://datasheets.maximintegrated.com/en/ds/MAX31790.pdf

properties:
  compatible:
    const: maxim,max31790

  reg:
    maxItems: 1

  clocks:
    maxItems: 1

  resets:
    maxItems: 1

  "#pwm-cells":
    const: 1

patternProperties:
  "^fan-[0-9]+$":
    $ref: fan-common.yaml#
    unevaluatedProperties: false

required:
  - compatible
  - reg

additionalProperties: false

examples:
  - |
    i2c {
      #address-cells = <1>;
      #size-cells = <0>;

      pwm_provider: fan-controller@20 {
        compatible = "maxim,max31790";
        reg = <0x20>;
        clocks = <&sys_clk>;
        resets = <&reset 0>;
        #pwm-cells = <1>;

        fan-0 {
          pwms = <&pwm_provider 1>;
        };

        fan-1 {
          pwms = <&pwm_provider 2>;
        };
      };
    };
+43 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/hwmon/sophgo,sg2042-hwmon-mcu.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Sophgo SG2042 onboard MCU support

maintainers:
  - Inochi Amaoto <inochiama@outlook.com>

properties:
  compatible:
    const: sophgo,sg2042-hwmon-mcu

  reg:
    maxItems: 1

  "#thermal-sensor-cells":
    const: 1

required:
  - compatible
  - reg
  - "#thermal-sensor-cells"

allOf:
  - $ref: /schemas/thermal/thermal-sensor.yaml#

unevaluatedProperties: false

examples:
  - |
    i2c {
        #address-cells = <1>;
        #size-cells = <0>;

        hwmon@17 {
            compatible = "sophgo,sg2042-hwmon-mcu";
            reg = <0x17>;
            #thermal-sensor-cells = <1>;
        };
    };
Loading