Commit f9ae1804 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull power supply and reset updates from Sebastian Reichel:
 "Core changes:
   - propagate of_node to child device
   - change from atomic to blocking notifier_call_chain

  New drivers:
   - pm8916 battery management system
   - mm8013 fuel gauge

  New features:
   - maxim max17040: add temperature support
   - gpio-poweroff: make priority configurable

  Cleanups:
   - simplify reset drivers using builtin_platform_driver()
   - convert all platform drivers to remove_new callback
   - replace all strncpy occurrences with strscpy
   - started converting drivers to i2c_get_match_data()
   - misc fixes and cleanups"

* tag 'for-v6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply: (91 commits)
  power: reset: vexpress: Use device_get_match_data()
  power: supply: surface-charger: replace deprecated strncpy with strscpy
  power: supply: surface_battery: replace deprecated strncpy with strscpy
  power: supply: charger-manager: replace deprecated strncpy with strscpy
  power: supply: bq25980: replace deprecated strncpy with strscpy
  power: supply: bq256xx: replace deprecated strncpy with strscpy
  power: supply: bq2515x: replace deprecated strncpy with strscpy
  power: supply: bq24190_charger: replace deprecated strncpy with strscpy
  power: supply: cpcap: Drop non-DT driver matching
  power: reset: brcmstb: Depend on actual SoC dependencies
  power: reset: gpio-poweroff: make sys handler priority configurable
  dt-bindings: power: reset: gpio-poweroff: Add priority property
  power: reset: gpio-poweroff: use sys-off handler API
  power: reset: gpio-poweroff: use a struct to store the module variables
  power: supply: rt5033_charger: Replace "&pdev->dev" by "charger->dev" in probe
  power: supply: rt5033_charger: Simplify initialization of rt5033_charger_data
  power: supply: rt5033_charger: Add cable detection and USB OTG supply
  power: supply: core: remove opencoded string_lower()
  dt-bindings: power: supply: sbs-manager: Add missing unevaluatedProperties on child node schemas
  power: supply: mm8013: Fix an error checking issue in mm8013_checkdevice()
  ...
parents fe4ae2fa 469d3174
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -18,6 +18,9 @@ description: >
  Finally the operating system assumes the power off failed if
  the system is still running after waiting some time (timeout-ms).

allOf:
  - $ref: restart-handler.yaml#

properties:
  compatible:
    const: gpio-poweroff
@@ -40,6 +43,9 @@ properties:
    default: 100
    description: Delay to wait after driving gpio inactive

  priority:
    default: 0

  timeout-ms:
    default: 3000
    description: Time to wait before assuming the power off sequence failed.
+7 −3
Original line number Diff line number Diff line
@@ -15,6 +15,9 @@ description: |+
  defined by the register map pointed by syscon reference plus the offset
  with the value and mask defined in the poweroff node.
  Default will be little endian mode, 32 bit access only.
  The SYSCON register map is normally retrieved from the parental dt-node. So
  the SYSCON poweroff node should be represented as a sub-node of a "syscon",
  "simple-mfd" node.

properties:
  compatible:
@@ -30,7 +33,10 @@ properties:

  regmap:
    $ref: /schemas/types.yaml#/definitions/phandle
    description: Phandle to the register map node.
    deprecated: true
    description:
      Phandle to the register map node. This property is deprecated in favor of
      the syscon-poweroff node being a child of a system controller node.

  value:
    $ref: /schemas/types.yaml#/definitions/uint32
@@ -38,7 +44,6 @@ properties:

required:
  - compatible
  - regmap
  - offset

additionalProperties: false
@@ -56,7 +61,6 @@ examples:
  - |
    poweroff {
        compatible = "syscon-poweroff";
        regmap = <&regmapnode>;
        offset = <0x0>;
        mask = <0x7a>;
    };
+31 −0
Original line number Diff line number Diff line
@@ -55,6 +55,14 @@ properties:
  interrupts:
    maxItems: 1

  io-channels:
    items:
      - description: battery temperature

  io-channel-names:
    items:
      - const: temp

  wakeup-source:
    type: boolean
    description: |
@@ -95,3 +103,26 @@ examples:
        wakeup-source;
      };
    };
  - |
    #include <dt-bindings/interrupt-controller/irq.h>
    i2c {
      #address-cells = <1>;
      #size-cells = <0>;

      fuel-gauge@36 {
        compatible = "maxim,max17043";
        reg = <0x36>;

        interrupt-parent = <&gpio>;
        interrupts = <144 IRQ_TYPE_EDGE_FALLING>;

        monitored-battery = <&battery>;
        power-supplies = <&charger>;

        io-channels = <&adc 8>;
        io-channel-names = "temp";

        maxim,alert-low-soc-level = <10>;
        wakeup-source;
      };
    };
+38 −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/power/supply/mitsumi,mm8013.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Mitsumi MM8013 fuel gauge

maintainers:
  - Konrad Dybcio <konradybcio@kernel.org>

allOf:
  - $ref: power-supply.yaml#

properties:
  compatible:
    const: mitsumi,mm8013

  reg:
    maxItems: 1

required:
  - compatible
  - reg

additionalProperties: false

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

      fuel-gauge@55 {
        compatible = "mitsumi,mm8013";
        reg = <0x55>;
      };
    };
+83 −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/power/supply/qcom,pm8916-bms-vm.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Qualcomm Voltage Mode BMS

maintainers:
  - Nikita Travkin <nikita@trvn.ru>

description:
  Voltage Mode BMS is a hardware block found in some Qualcomm PMICs
  such as pm8916. This block performs battery voltage monitoring.

allOf:
  - $ref: power-supply.yaml#

properties:
  compatible:
    const: qcom,pm8916-bms-vm

  reg:
    maxItems: 1

  interrupts:
    items:
      - description: BMS FSM left S3 mode
      - description: BMS FSM entered S2 mode
      - description: OCV measured in S3 mode
      - description: OCV below threshold
      - description: FIFO update done
      - description: BMS FSM switched state

  interrupt-names:
    items:
      - const: cv_leave
      - const: cv_enter
      - const: ocv_good
      - const: ocv_thr
      - const: fifo
      - const: state_chg

  monitored-battery: true

  power-supplies: true

required:
  - compatible
  - reg
  - interrupts
  - interrupt-names
  - monitored-battery

additionalProperties: false

examples:
  - |
    #include <dt-bindings/interrupt-controller/irq.h>
    pmic {
      #address-cells = <1>;
      #size-cells = <0>;

      battery@4000 {
        compatible = "qcom,pm8916-bms-vm";
        reg = <0x4000>;
        interrupts = <0x0 0x40 0 IRQ_TYPE_EDGE_RISING>,
                     <0x0 0x40 1 IRQ_TYPE_EDGE_RISING>,
                     <0x0 0x40 2 IRQ_TYPE_EDGE_RISING>,
                     <0x0 0x40 3 IRQ_TYPE_EDGE_RISING>,
                     <0x0 0x40 4 IRQ_TYPE_EDGE_RISING>,
                     <0x0 0x40 5 IRQ_TYPE_EDGE_RISING>;
        interrupt-names = "cv_leave",
                          "cv_enter",
                          "ocv_good",
                          "ocv_thr",
                          "fifo",
                          "state_chg";

        monitored-battery = <&battery>;
        power-supplies = <&pm8916_charger>;
      };
    };
Loading