Commit 11c747e5 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull power supply and reset updates from Sebastian Reichel:

 - new maintenance charging documentation

 - mt6370: new charger driver

 - bq25890: support input current limit

 - added Qualcomm PMK8350 PON support

 - misc minor fixes

* tag 'for-v6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply: (22 commits)
  power: supply: ab8500: remove unused static local variable
  power: supply: mt6370: Fix return value check in mt6370_chg_probe()
  power: supply: ab8500: Remove unused struct ab8500_chargalg_sysfs_entry
  power: supply: mt6370: uses IIO interfaces, depends on IIO
  power: supply: max1721x: Fix spelling mistake "Gauage" -> "Gauge"
  power: supply: mt6370: Add MediaTek MT6370 charger driver
  dt-bindings: power: supply: Add MediaTek MT6370 Charger
  lib: add linear range index macro
  power: supply: bq25890: Fix enum conversion in bq25890_power_supply_set_property()
  power: supply: bq27xxx: fix NULL vs 0 warnings
  power: supply: bq27xxx: fix __be16 warnings
  power: supply: bq25890: Add support for setting IINLIM
  power: supply: bq25890: Disable PUMPX_EN on errors
  power: supply: Fix repeated word in comments
  power: supply: adp5061: show unknown capacity_level as text
  power: supply: adp5061: fix out-of-bounds read in adp5061_get_chg_type()
  power: supply: tps65217: Fix comments typo
  power: reset: qcom-pon: add support for qcom,pmk8350-pon compatible string
  dt-bindings: power: reset: qcom-pon: Add new compatible "qcom,pmk8350-pon"
  power: supply: cw2015: Use device managed API to simplify the code
  ...
parents 83da5ec6 189a2aae
Loading
Loading
Loading
Loading
+46 −4
Original line number Diff line number Diff line
@@ -15,18 +15,27 @@ description: |

  This DT node has pwrkey and resin as sub nodes.

allOf:
  - $ref: reboot-mode.yaml#

properties:
  compatible:
    enum:
      - qcom,pm8916-pon
      - qcom,pms405-pon
      - qcom,pm8998-pon
      - qcom,pmk8350-pon

  reg:
    maxItems: 1
    description: |
      Specifies the SPMI base address for the PON (power-on) peripheral.  For
      PMICs that have the PON peripheral (GEN3) split into PON_HLOS and PON_PBS
      (e.g. PMK8350), this can hold addresses of both PON_HLOS and PON_PBS
      peripherals.  In that case, the PON_PBS address needs to be specified to
      facilitate software debouncing on some PMIC.
    minItems: 1
    maxItems: 2

  reg-names:
    minItems: 1
    maxItems: 2

  pwrkey:
    type: object
@@ -46,6 +55,39 @@ required:

unevaluatedProperties: false

allOf:
  - $ref: reboot-mode.yaml#
  - if:
      properties:
        compatible:
          contains:
            enum:
              - qcom,pm8916-pon
              - qcom,pms405-pon
              - qcom,pm8998-pon
    then:
      properties:
        reg:
          maxItems: 1
        reg-names:
          items:
            - const: pon
  - if:
      properties:
        compatible:
          contains:
            const: qcom,pmk8350-pon
    then:
      properties:
        reg:
          minItems: 1
          maxItems: 2
        reg-names:
          minItems: 1
          items:
            - const: hlos
            - const: pbs

examples:
  - |
   #include <dt-bindings/interrupt-controller/irq.h>
+96 −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/mediatek,mt6370-charger.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: MediaTek MT6370 Battery Charger

maintainers:
  - ChiaEn Wu <chiaen_wu@richtek.com>

description: |
  This module is part of the MT6370 MFD device.
  Provides Battery Charger, Boost for OTG devices and BC1.2 detection.

properties:
  compatible:
    const: mediatek,mt6370-charger

  interrupts:
    description: |
      Specify what irqs are needed to be handled by MT6370 Charger driver.
      We need to use the IRQ "MT6370_IRQ_OVPCTRL_UVP_D" to know when USB
      is plugged in, and then the driver will enable BC1.2 detection.
      After the hardware of MT6370 completes the BC1.2 detection,
      IRQ "MT6370_IRQ_ATTACH" will be triggered, and the driver will know
      the result of BC1.2 detection.
      When the IRQ "MT6370_IRQ_CHG_MIVR" is triggered, it means that the
      hardware enters the "Minimum Input Voltage Regulation loop" and
      a workaround needs to be applied at this time.
      In summary, "MT6370_IRQ_OVPCTRL_UVP_D", "MT6370_IRQ_ATTACH" and
      "MT6370_IRQ_CHG_MIVR" are required in this charger driver.
    items:
      - description: irq of "USB is plugged in"
      - description: irq of "BC1.2 is done"
      - description: irq of "Minimum Input Voltage Regulation loop is active"

  interrupt-names:
    items:
      - const: uvp_d_evt
      - const: attach_i
      - const: mivr

  io-channels:
    description: |
      Use ADC channel to read VBUS, IBUS, IBAT, etc., info.
    minItems: 1
    items:
      - description: |
          VBUS voltage with lower accuracy (+-75mV) but higher measure
          range (1~22V)
      - description: |
          VBUS voltage with higher accuracy (+-30mV) but lower measure
          range (1~9.76V)
      - description: the main system input voltage
      - description: battery voltage
      - description: battery temperature-sense input voltage
      - description: IBUS current (required)
      - description: battery current
      - description: |
          regulated output voltage to supply for the PWM low-side gate driver
          and the bootstrap capacitor
      - description: IC junction temperature

  io-channel-names:
    minItems: 1
    items:
      - const: vbusdiv5
      - const: vbusdiv2
      - const: vsys
      - const: vbat
      - const: ts_bat
      - const: ibus
      - const: ibat
      - const: chg_vddp
      - const: temp_jc

  usb-otg-vbus-regulator:
    type: object
    description: OTG boost regulator.
    unevaluatedProperties: false
    $ref: /schemas/regulator/regulator.yaml#

    properties:
      enable-gpios:
        maxItems: 1

required:
  - compatible
  - interrupts
  - interrupt-names
  - io-channels

additionalProperties: false

...
+1 −0
Original line number Diff line number Diff line
@@ -82,6 +82,7 @@ static const struct of_device_id pm8916_pon_id_table[] = {
	{ .compatible = "qcom,pm8916-pon", .data = (void *)GEN1_REASON_SHIFT },
	{ .compatible = "qcom,pms405-pon", .data = (void *)GEN1_REASON_SHIFT },
	{ .compatible = "qcom,pm8998-pon", .data = (void *)GEN2_REASON_SHIFT },
	{ .compatible = "qcom,pmk8350-pon", .data = (void *)GEN2_REASON_SHIFT },
	{ }
};
MODULE_DEVICE_TABLE(of, pm8916_pon_id_table);
+15 −0
Original line number Diff line number Diff line
@@ -619,6 +619,21 @@ config CHARGER_MT6360
	  Average Input Current Regulation, Battery Temperature Sensing,
	  Over-Temperature Protection, DPDM Detection for BC1.2.

config CHARGER_MT6370
	tristate "MediaTek MT6370 Charger Driver"
	depends on MFD_MT6370
	depends on REGULATOR
	depends on IIO
	select LINEAR_RANGES
	help
	  Say Y here to enable MT6370 Charger Part.
	  The device supports High-Accuracy Voltage/Current Regulation,
	  Average Input Current Regulation, Battery Temperature Sensing,
	  Over-Temperature Protection, DPDM Detection for BC1.2.

	  This driver can also be built as a module. If so, the module
	  will be called "mt6370-charger".

config CHARGER_QCOM_SMBB
	tristate "Qualcomm Switch-Mode Battery Charger and Boost"
	depends on MFD_SPMI_PMIC || COMPILE_TEST
+1 −0
Original line number Diff line number Diff line
@@ -82,6 +82,7 @@ obj-$(CONFIG_CHARGER_MAX8997) += max8997_charger.o
obj-$(CONFIG_CHARGER_MAX8998)	+= max8998_charger.o
obj-$(CONFIG_CHARGER_MP2629)	+= mp2629_charger.o
obj-$(CONFIG_CHARGER_MT6360)	+= mt6360_charger.o
obj-$(CONFIG_CHARGER_MT6370)	+= mt6370-charger.o
obj-$(CONFIG_CHARGER_QCOM_SMBB)	+= qcom_smbb.o
obj-$(CONFIG_CHARGER_BQ2415X)	+= bq2415x_charger.o
obj-$(CONFIG_CHARGER_BQ24190)	+= bq24190_charger.o
Loading