Commit c6e8c51f authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull power supply and reset updates from Sebastian Reichel:
 "Battery/charger driver changes:

   - convert charger-manager binding to YAML

   - drop bd70528-charger driver

   - drop pm2301-charger driver

   - introduce rt5033-battery driver

   - misc improvements and fixes"

* tag 'for-v5.14' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply: (42 commits)
  power: supply: ab8500: Fix an old bug
  power: supply: axp288_fuel_gauge: remove redundant continue statement
  power: supply: axp288_fuel_gauge: Make "T3 MRD" no_battery_list DMI entry more generic
  power: supply: axp288_fuel_gauge: Rename fuel_gauge_blacklist to no_battery_list
  power: supply: bq24190_charger: drop of_match_ptr() from device ID table
  drivers: power: add missing MODULE_DEVICE_TABLE in keystone-reset.c
  power: supply: ab8500: add missing MODULE_DEVICE_TABLE
  power: supply: charger-manager: add missing MODULE_DEVICE_TABLE
  power: reset: regulator-poweroff: add missing MODULE_DEVICE_TABLE
  power: supply: cpcap-charger: get the battery inserted infomation from cpcap-battery
  power: supply: cpcap-battery: invalidate config when incompatible measurements are read
  power: supply: axp20x_battery: allow disabling battery charging
  power: supply: max17040: drop unused platform data support
  power: supply: max17040: simplify POWER_SUPPLY_PROP_ONLINE
  power: supply: max17040: remove non-working POWER_SUPPLY_PROP_STATUS
  power: reset: at91-sama5d2_shdwc: Remove redundant error printing in at91_shdwc_probe()
  power: reset: gpio-poweroff: add missing MODULE_DEVICE_TABLE
  power: supply: rt5033_battery: Fix device tree enumeration
  dt-bindings: power: supply: Add DT schema for richtek,rt5033-battery
  power: supply: Drop BD70528 support
  ...
parents 9d69294b f1c74a6c
Loading
Loading
Loading
Loading
+0 −91
Original line number Diff line number Diff line
charger-manager bindings
~~~~~~~~~~~~~~~~~~~~~~~~

Required properties :
 - compatible : "charger-manager"
 - <>-supply : for regulator consumer, named according to cm-regulator-name
 - cm-chargers : name of chargers
 - cm-fuel-gauge : name of battery fuel gauge
 - subnode <regulator> :
	- cm-regulator-name : name of charger regulator
	- subnode <cable> :
		- cm-cable-name : name of charger cable - one of USB, USB-HOST,
			SDP, DCP, CDP, ACA, FAST-CHARGER, SLOW-CHARGER, WPT,
			PD, DOCK, JIG, or MECHANICAL
		- cm-cable-extcon : name of extcon dev
(optional)	- cm-cable-min : minimum current of cable
(optional)	- cm-cable-max : maximum current of cable

Optional properties :
 - cm-name : charger manager's name (default : "battery")
 - cm-poll-mode : polling mode - 0 for disabled, 1 for always, 2 for when
	external power is connected, or 3 for when charging.  If not present,
	then polling is disabled
 - cm-poll-interval : polling interval (in ms)
 - cm-battery-stat : battery status - 0 for battery always present, 1 for no
	battery, 2 to check presence via fuel gauge, or 3 to check presence
	via charger
 - cm-fullbatt-vchkdrop-volt : voltage drop (in uV) before restarting charging
 - cm-fullbatt-voltage : voltage (in uV) of full battery
 - cm-fullbatt-soc : state of charge to consider as full battery
 - cm-fullbatt-capacity : capcity (in uAh) to consider as full battery
 - cm-thermal-zone : name of external thermometer's thermal zone
 - cm-battery-* : threshold battery temperature for charging
	-cold : critical cold temperature of battery for charging
	-cold-in-minus : flag that cold temperature is in minus degrees
	-hot : critical hot temperature of battery for charging
	-temp-diff : temperature difference to allow recharging
 - cm-dis/charging-max = limits of charging duration

Deprecated properties:
 - cm-num-chargers
 - cm-fullbatt-vchkdrop-ms

Example :
	charger-manager@0 {
		compatible = "charger-manager";
		chg-reg-supply = <&charger_regulator>;

		cm-name = "battery";
		/* Always polling ON : 30s */
		cm-poll-mode = <1>;
		cm-poll-interval = <30000>;

		cm-fullbatt-vchkdrop-volt = <150000>;
		cm-fullbatt-soc = <100>;

		cm-battery-stat = <3>;

		cm-chargers = "charger0", "charger1", "charger2";

		cm-fuel-gauge = "fuelgauge0";

		cm-thermal-zone = "thermal_zone.1"
		/* in deci centigrade */
		cm-battery-cold = <50>;
		cm-battery-cold-in-minus;
		cm-battery-hot = <800>;
		cm-battery-temp-diff = <100>;

		/* Allow charging for 5hr */
		cm-charging-max = <18000000>;
		/* Allow discharging for 2hr */
		cm-discharging-max = <7200000>;

		regulator@0 {
			cm-regulator-name = "chg-reg";
			cable@0 {
				cm-cable-name = "USB";
				cm-cable-extcon = "extcon-dev.0";
				cm-cable-min = <475000>;
				cm-cable-max = <500000>;
			};
			cable@1 {
				cm-cable-name = "SDP";
				cm-cable-extcon = "extcon-dev.0";
				cm-cable-min = <650000>;
				cm-cable-max = <675000>;
			};
		};

	};
+215 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/charger-manager.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Charger Manager

maintainers:
  - Sebastian Reichel <sre@kernel.org>

description: |
  Binding for the legacy charger manager driver.
  Please do not use for new products.

properties:
  compatible:
    const: charger-manager

  cm-chargers:
    description: name of chargers
    $ref: /schemas/types.yaml#/definitions/string-array

  cm-num-chargers:
    $ref: /schemas/types.yaml#/definitions/uint32
    deprecated: true

  cm-fuel-gauge:
    description: name of battery fuel gauge
    $ref: /schemas/types.yaml#/definitions/string

  cm-name:
    description: name of the charger manager
    default: battery
    $ref: /schemas/types.yaml#/definitions/string

  cm-poll-mode:
    description: polling mode
    default: 0
    enum:
      - 0 # disabled
      - 1 # always
      - 2 # when external power is connected
      - 3 # when charging

  cm-poll-interval:
    description: polling interval (in ms)
    $ref: /schemas/types.yaml#/definitions/uint32

  cm-battery-stat:
    description: battery status
    enum:
      - 0 # battery always present
      - 1 # no battery
      - 2 # check presence via fuel gauge
      - 3 # check presence via charger

  cm-fullbatt-vchkdrop-volt:
    description: voltage drop before restarting charging in uV
    $ref: /schemas/types.yaml#/definitions/uint32

  cm-fullbatt-vchkdrop-ms:
    deprecated: true

  cm-fullbatt-voltage:
    description: voltage of full battery in uV
    $ref: /schemas/types.yaml#/definitions/uint32

  cm-fullbatt-soc:
    description: state of charge to consider as full battery in %
    $ref: /schemas/types.yaml#/definitions/uint32

  cm-fullbatt-capacity:
    description: capcity to consider as full battery in uAh
    $ref: /schemas/types.yaml#/definitions/uint32

  cm-thermal-zone:
    description: name of external thermometer's thermal zone
    $ref: /schemas/types.yaml#/definitions/string

  cm-discharging-max:
    description: limits of discharging duration in ms
    $ref: /schemas/types.yaml#/definitions/uint32

  cm-charging-max:
    description: limits of charging duration in ms
    $ref: /schemas/types.yaml#/definitions/uint32

  cm-battery-cold:
    description: critical cold temperature of battery for charging in deci-degree celsius
    $ref: /schemas/types.yaml#/definitions/uint32

  cm-battery-cold-in-minus:
    description: if set cm-battery-cold temperature is in minus degrees
    type: boolean

  cm-battery-hot:
    description: critical hot temperature of battery for charging in deci-degree celsius
    $ref: /schemas/types.yaml#/definitions/uint32

  cm-battery-temp-diff:
    description: temperature difference to allow recharging in deci-degree celsius
    $ref: /schemas/types.yaml#/definitions/uint32

patternProperties:
  "-supply$":
    description: regulator consumer, named according to cm-regulator-name
    $ref: /schemas/types.yaml#/definitions/phandle

  "^regulator[@-][0-9]$":
    type: object
    properties:
      cm-regulator-name:
        description: name of charger regulator
        $ref: /schemas/types.yaml#/definitions/string

    required:
      - cm-regulator-name

    additionalProperties: false

    patternProperties:
      "^cable[@-][0-9]$":
        type: object
        properties:
          cm-cable-name:
            description: name of charger cable
            enum:
              - USB
              - USB-HOST
              - SDP
              - DCP
              - CDP
              - ACA
              - FAST-CHARGER
              - SLOW-CHARGER
              - WPT
              - PD
              - DOCK
              - JIG
              - MECHANICAL

          cm-cable-extcon:
            description: name of extcon dev
            $ref: /schemas/types.yaml#/definitions/string

          cm-cable-min:
            description: minimum current of cable in uA
            $ref: /schemas/types.yaml#/definitions/uint32

          cm-cable-max:
            description: maximum current of cable in uA
            $ref: /schemas/types.yaml#/definitions/uint32

        required:
          - cm-cable-name
          - cm-cable-extcon

        additionalProperties: false

required:
  - compatible
  - cm-chargers
  - cm-fuel-gauge

additionalProperties: false

examples:
  - |
    charger-manager {
        compatible = "charger-manager";
        chg-reg-supply = <&charger_regulator>;

        cm-name = "battery";
        /* Always polling ON : 30s */
        cm-poll-mode = <1>;
        cm-poll-interval = <30000>;

        cm-fullbatt-vchkdrop-volt = <150000>;
        cm-fullbatt-soc = <100>;

        cm-battery-stat = <3>;

        cm-chargers = "charger0", "charger1", "charger2";

        cm-fuel-gauge = "fuelgauge0";

        cm-thermal-zone = "thermal_zone.1";
        /* in deci centigrade */
        cm-battery-cold = <50>;
        cm-battery-cold-in-minus;
        cm-battery-hot = <800>;
        cm-battery-temp-diff = <100>;

        /* Allow charging for 5hr */
        cm-charging-max = <18000000>;
        /* Allow discharging for 2hr */
        cm-discharging-max = <7200000>;

        regulator-0 {
            cm-regulator-name = "chg-reg";
            cable-0 {
                cm-cable-name = "USB";
                cm-cable-extcon = "extcon-dev.0";
                cm-cable-min = <475000>;
                cm-cable-max = <500000>;
            };
            cable-1 {
                cm-cable-name = "SDP";
                cm-cable-extcon = "extcon-dev.0";
                cm-cable-min = <650000>;
                cm-cable-max = <675000>;
            };
        };
    };
+1 −1
Original line number Diff line number Diff line
@@ -89,7 +89,7 @@ examples:
        reg = <0x36>;
        maxim,alert-low-soc-level = <10>;
        interrupt-parent = <&gpio7>;
        interrupts = <2 IRQ_TYPE_EDGE_FALLING>;
        interrupts = <2 IRQ_TYPE_LEVEL_LOW>;
        wakeup-source;
      };
    };
+54 −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/power/supply/richtek,rt5033-battery.yaml#"
$schema: "http://devicetree.org/meta-schemas/core.yaml#"

title: Richtek RT5033 PMIC Fuel Gauge

maintainers:
  - Stephan Gerhold <stephan@gerhold.net>

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

properties:
  compatible:
    const: richtek,rt5033-battery

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

required:
  - compatible
  - reg

additionalProperties: false

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

      battery@35 {
        compatible = "richtek,rt5033-battery";
        reg = <0x35>;
      };
    };
  - |
    #include <dt-bindings/interrupt-controller/irq.h>
    i2c {
      #address-cells = <1>;
      #size-cells = <0>;

      battery@35 {
        compatible = "richtek,rt5033-battery";
        reg = <0x35>;
        interrupt-parent = <&msmgpio>;
        interrupts = <121 IRQ_TYPE_EDGE_FALLING>;
      };
    };
+2 −1
Original line number Diff line number Diff line
@@ -14827,6 +14827,7 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply.git
F:	Documentation/ABI/testing/sysfs-class-power
F:	Documentation/devicetree/bindings/power/supply/
F:	drivers/power/supply/
F:	include/linux/power/
F:	include/linux/power_supply.h
POWERNV OPERATOR PANEL LCD DISPLAY DRIVER
@@ -16213,7 +16214,7 @@ W: http://www.ibm.com/developerworks/linux/linux390/
F:	drivers/s390/scsi/zfcp_*
S3C ADC BATTERY DRIVER
M:	Krzysztof Kozlowski <krzk@kernel.org>
M:	Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
L:	linux-samsung-soc@vger.kernel.org
S:	Odd Fixes
F:	drivers/power/supply/s3c_adc_battery.c
Loading