Commit 3ee22ad4 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull power supply and reset updates from Sebastian Reichel:
 "Power-supply core:
   - introduce adc-battery-helper for capacity estimation based on
     simple ADC readings of battery voltage and current
   - add new properties for battery internal resistance and state of
     health

  Power-supply drivers:
   - ug3105_battery: convert to adc-battery-helper
   - intel_dc_ti_battery: New driver for Intel Dollar Cove TI batteries
   - rt9467-charger: add voltage and current ADC support
   - sbs-charger: support multiple instances
   - qcom_battmgr:
       - add charge control support
       - add support for state of health and internal resistance
   - max77705_charger:
       - big driver cleanup
       - add support for setting charge current
   - misc minor fixes and cleanups"

* tag 'for-v6.18' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply: (38 commits)
  power: supply: qcom_battmgr: handle charging state change notifications
  power: supply: max77705_charger: use REGMAP_IRQ_REG_LINE macro
  power: supply: max77705_charger: rework interrupts
  power: supply: max77705_charger: add writable properties
  power: supply: max77705_charger: return error when config fails
  power: supply: max77705_charger: use regfields for config registers
  power: supply: max77705_charger: refactoring: rename charger to chg
  mfd: max77705: max77705_charger: move active discharge setting to mfd parent
  power: supply: max77976_charger: fix constant current reporting
  power: supply: qcom_battmgr: Add charge control support
  dt-bindings: soc: qcom,pmic-glink: Add charge limit nvmem properties
  power: supply: qcom_battmgr: update compats for SM8550 and X1E80100
  power: supply: qcom_battmgr: Add state_of_health property
  power: supply: qcom_battmgr: Add resistance power supply property
  power: supply: core: Add state_of_health power supply property
  power: supply: core: Add resistance power supply property
  power: supply: rx51: remove redundant condition checks
  dt-bindings: power: supply: bq24190: document charge enable pin
  dt-bindings: power: supply: bq27xxx: document optional interrupt
  power: supply: intel_dc_ti_battery: Drop no longer relevant comment
  ...
parents dba8acc3 41307ec7
Loading
Loading
Loading
Loading
+37 −0
Original line number Diff line number Diff line
@@ -553,6 +553,43 @@ Description:
			Integer > 0: representing full cycles
			Integer = 0: cycle_count info is not available

What:		/sys/class/power_supply/<supply_name>/internal_resistance
Date:		August 2025
Contact:	linux-arm-msm@vger.kernel.org
Description:
		Represent the battery's internal resistance, often referred
		to as Equivalent Series Resistance (ESR). It is a dynamic
		parameter that reflects the opposition to current flow within
		the cell. It is not a fixed value but varies significantly
		based on several operational conditions, including battery
		state of charge (SoC), temperature, and whether the battery
		is in a charging or discharging state.

		Access: Read

		Valid values: Represented in microohms

What:		/sys/class/power_supply/<supply_name>/state_of_health
Date:		August 2025
Contact:	linux-arm-msm@vger.kernel.org
Description:
		The state_of_health parameter quantifies the overall condition
		of a battery as a percentage, reflecting its ability to deliver
		rated performance relative to its original specifications. It is
		dynamically computed using a combination of learned capacity
		and impedance-based degradation indicators, both of which evolve
		over the battery's lifecycle.
		Note that the exact algorithms are kept secret by most battery
		vendors and the value from different battery vendors cannot be
		compared with each other as there is no vendor-agnostic definition
		of "performance". Also this usually cannot be used for any
		calculations (i.e. this is not the factor between charge_full and
		charge_full_design).

		Access: Read

		Valid values: 0 - 100 (percent)

**USB Properties**

What:		/sys/class/power_supply/<supply_name>/input_current_limit
+6 −0
Original line number Diff line number Diff line
@@ -30,6 +30,12 @@ properties:
  interrupts:
    maxItems: 1

  ce-gpios:
    description:
      Active low Charge Enable pin. Battery charging is enabled when
      REG01[5:4] = 01 and CE pin is Low. CE pin must be pulled high or low.
    maxItems: 1

  usb-otg-vbus:
    $ref: /schemas/regulator/regulator.yaml#
    description: |
+34 −3
Original line number Diff line number Diff line
@@ -16,9 +16,6 @@ description: |
  Support various Texas Instruments fuel gauge devices that share similar
  register maps and power supply properties

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

properties:
  compatible:
    enum:
@@ -58,6 +55,10 @@ properties:
    maxItems: 1
    description: integer, I2C address of the fuel gauge.

  interrupts:
    maxItems: 1
    description: the SOC_INT or GPOUT pin

  monitored-battery:
    description: |
       The fuel gauge uses the following battery properties:
@@ -68,6 +69,36 @@ properties:

  power-supplies: true

allOf:
  - $ref: power-supply.yaml#
  - if:
      properties:
        compatible:
          contains:
            enum:
              - ti,bq27200
              - ti,bq27210
              - ti,bq27500 # deprecated, use revision specific property below
              - ti,bq27510 # deprecated, use revision specific property below
              - ti,bq27520 # deprecated, use revision specific property below
              - ti,bq27500-1
              - ti,bq27510g1
              - ti,bq27510g2
              - ti,bq27521
              - ti,bq27541
              - ti,bq27542
              - ti,bq27546
              - ti,bq27742
              - ti,bq27545
              - ti,bq27411
              - ti,bq27z561
              - ti,bq28z610
              - ti,bq34z100
              - ti,bq78z100
    then:
      properties:
        interrupts: false

required:
  - compatible
  - reg
+14 −0
Original line number Diff line number Diff line
@@ -56,6 +56,20 @@ properties:
      The array should contain a gpio entry for each PMIC Glink connector, in reg order.
      It is defined that GPIO active level means "CC2" or Reversed/Flipped orientation.

  nvmem-cells:
    minItems: 3
    maxItems: 3
    description:
      The nvmem cells contain the charge control settings, including the charge control
      enable status, the battery state of charge (SoC) threshold for stopping charging,
      and the battery SoC delta required to restart charging.

  nvmem-cell-names:
    items:
      - const: charge_limit_en
      - const: charge_limit_end
      - const: charge_limit_delta

patternProperties:
  '^connector@\d$':
    $ref: /schemas/connector/usb-connector.yaml#
+3 −0
Original line number Diff line number Diff line
@@ -108,6 +108,9 @@ static int max77705_i2c_probe(struct i2c_client *i2c)
	if (pmic_rev != MAX77705_PASS3)
		return dev_err_probe(dev, -ENODEV, "Rev.0x%x is not tested\n", pmic_rev);

	/* Active Discharge Enable */
	regmap_update_bits(max77705->regmap, MAX77705_PMIC_REG_MAINCTRL1, 1, 1);

	ret = devm_regmap_add_irq_chip(dev, max77705->regmap,
					i2c->irq,
					IRQF_ONESHOT, 0,
Loading