Commit 6acd0e82 authored by Bartosz Golaszewski's avatar Bartosz Golaszewski
Browse files

Merge tag 'ib-mfd-clk-gpio-power-regulator-rtc-v6.20' of...

Merge tag 'ib-mfd-clk-gpio-power-regulator-rtc-v6.20' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd into gpio/for-next

Immutable branch between MFD, Clk, GPIO, Power, Regulator and RTC due for the v6.20 merge window
parents 4aa57300 e39951f8
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -10,11 +10,12 @@ maintainers:
  - Matti Vaittinen <mazziesaccount@gmail.com>

description: |
  This module is part of the ROHM BD71828 MFD device. For more details
  see Documentation/devicetree/bindings/mfd/rohm,bd71828-pmic.yaml.
  This module is part of the ROHM BD71828 and BD72720 MFD device. For more
  details see Documentation/devicetree/bindings/mfd/rohm,bd71828-pmic.yaml
  and Documentation/devicetree/bindings/mfd/rohm,bd72720-pmic.yaml

  The LED controller is represented as a sub-node of the PMIC node on the device
  tree.
  tree. This should be located under "leds" - node in PMIC node.

  The device has two LED outputs referred as GRNLED and AMBLED in data-sheet.

+339 −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/mfd/rohm,bd72720-pmic.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: ROHM BD72720 Power Management Integrated Circuit

maintainers:
  - Matti Vaittinen <mazziesaccount@gmail.com>

description:
  BD72720 is a single-chip power management IC for battery-powered portable
  devices. The BD72720 integrates 10 bucks and 11 LDOs, and a 3000 mA
  switching charger. The IC also includes a Coulomb counter, a real-time
  clock (RTC), GPIOs and a 32.768 kHz clock gate.

# In addition to the properties found from the charger node, the ROHM BD72720
# uses properties from a static battery node. Please see the:
# Documentation/devicetree/bindings/power/supply/battery.yaml
#
# Following properties are used
# when present:
#
# charge-full-design-microamp-hours: Battry capacity in mAh
# voltage-max-design-microvolt:      Maximum voltage
# voltage-min-design-microvolt:      Minimum voltage system is still operating.
# degrade-cycle-microamp-hours:      Capacity lost due to aging at each full
#                                    charge cycle.
# ocv-capacity-celsius:              Array of OCV table temperatures. 1/table.
# ocv-capacity-table-<N>:            Table of OCV voltage/SOC pairs. Corresponds
#                                    N.th temperature in ocv-capacity-celsius
#
# volt-drop-thresh-microvolt: Threshold for starting the VDR correction
# volt-drop-soc:                Table of capacity values matching the
#                                    values in VDR tables.
#
# volt-drop-temperatures-millicelsius: Temperatures corresponding to the volage
# drop values given in volt-drop-[0-9]-microvolt
#
# volt-drop-[0-9]-microvolt: VDR table for a temperature specified in
# volt-drop-temperatures-millicelsius
#
# VDR tables are (usually) determined for a specific battery by ROHM.
# The battery node would then be referred from the charger node:
#
# monitored-battery = <&battery>;

properties:
  compatible:
    const: rohm,bd72720

  reg:
    description:
      I2C slave address.
    maxItems: 1

  interrupts:
    maxItems: 1

  gpio-controller: true

  "#gpio-cells":
    const: 2
    description:
      The first cell is the pin number and the second cell is used to specify
      flags. See the gpio binding document for more information.

  clocks:
    maxItems: 1

  "#clock-cells":
    const: 0

  clock-output-names:
    const: bd71828-32k-out

  rohm,clkout-open-drain:
    description: clk32kout mode. Set to 1 for "open-drain" or 0 for "cmos".
    $ref: /schemas/types.yaml#/definitions/uint32
    maximum: 1

  rohm,charger-sense-resistor-micro-ohms:
    minimum: 10000
    maximum: 50000
    description:
      BD72720 has a SAR ADC for measuring charging currents. External sense
      resistor (RSENSE in data sheet) should be used. If some other but
      30 mOhm resistor is used the resistance value should be given here in
      micro Ohms.

  regulators:
    $ref: /schemas/regulator/rohm,bd72720-regulator.yaml
    description:
      List of child nodes that specify the regulators.

  leds:
    $ref: /schemas/leds/rohm,bd71828-leds.yaml

  rohm,pin-fault_b:
    $ref: /schemas/types.yaml#/definitions/string
    description:
      BD72720 has an OTP option to use fault_b-pin for different
      purposes. Set this property accordingly. OTP options are
      OTP0 - bi-directional FAULT_B or READY indicator depending on a
      'sub option'
      OTP1 - GPO
      OTP2 - Power sequencer output.
    enum:
      - faultb
      - readyind
      - gpo
      - pwrseq

patternProperties:
  "^rohm,pin-dvs[0-1]$":
    $ref: /schemas/types.yaml#/definitions/string
    description:
      BD72720 has 4 different OTP options to determine the use of dvs<X>-pins.
      OTP0 - regulator RUN state control.
      OTP1 - GPI.
      OTP2 - GPO.
      OTP3 - Power sequencer output.
      This property specifies the use of the pin.
    enum:
      - dvs-input
      - gpi
      - gpo
      - pwrseq

  "^rohm,pin-exten[0-1]$":
    $ref: /schemas/types.yaml#/definitions/string
    description: BD72720 has an OTP option to use exten0-pin for different
      purposes. Set this property accordingly.
      OTP0 - GPO
      OTP1 - Power sequencer output.
    enum:
      - gpo
      - pwrseq

required:
  - compatible
  - reg
  - interrupts
  - clocks
  - "#clock-cells"
  - regulators
  - gpio-controller
  - "#gpio-cells"

additionalProperties: false

examples:
  - |
    #include <dt-bindings/interrupt-controller/irq.h>
    #include <dt-bindings/leds/common.h>
    i2c {
        #address-cells = <1>;
        #size-cells = <0>;
        pmic: pmic@4b {
            compatible = "rohm,bd72720";
            reg = <0x4b>;

            interrupt-parent = <&gpio1>;
            interrupts = <29 IRQ_TYPE_LEVEL_LOW>;

            clocks = <&osc 0>;
            #clock-cells = <0>;
            clock-output-names = "bd71828-32k-out";

            gpio-controller;
            #gpio-cells = <2>;

            rohm,pin-dvs0 = "gpi";
            rohm,pin-dvs1 = "gpi";
            rohm,pin-exten0 = "gpo";
            rohm,pin-exten1 = "gpo";
            rohm,pin-fault_b = "faultb";

            rohm,charger-sense-resistor-micro-ohms = <10000>;

            regulators {
                buck1 {
                    regulator-name = "buck1";
                    regulator-min-microvolt = <500000>;
                    regulator-max-microvolt = <2000000>;
                    regulator-ramp-delay = <2500>;
                };
                buck2 {
                    regulator-name = "buck2";
                    regulator-min-microvolt = <500000>;
                    regulator-max-microvolt = <2000000>;
                    regulator-ramp-delay = <2500>;
                };
                buck3 {
                    regulator-name = "buck3";
                    regulator-min-microvolt = <1200000>;
                    regulator-max-microvolt = <2000000>;
                };
                buck4 {
                    regulator-name = "buck4";
                    regulator-min-microvolt = <1000000>;
                    regulator-max-microvolt = <1800000>;
                };
                buck5 {
                    regulator-name = "buck5";
                    regulator-min-microvolt = <2500000>;
                    regulator-max-microvolt = <3300000>;
                };
                buck6 {
                    regulator-name = "buck6";
                    regulator-min-microvolt = <500000>;
                    regulator-max-microvolt = <2000000>;
                    regulator-ramp-delay = <2500>;
                };
                buck7 {
                    regulator-name = "buck7";
                    regulator-min-microvolt = <500000>;
                    regulator-max-microvolt = <2000000>;
                    regulator-ramp-delay = <2500>;
                };
                buck8 {
                    regulator-name = "buck8";
                    regulator-min-microvolt = <500000>;
                    regulator-max-microvolt = <1700000>;
                    regulator-ramp-delay = <2500>;
                    rohm,dvs-run-voltage = <1700000>;
                    rohm,dvs-idle-voltage = <1>;
                    rohm,dvs-suspend-voltage = <1>;
                    rohm,dvs-lpsr-voltage = <0>;
                    regulator-boot-on;
                };
                buck9 {
                    regulator-name = "buck9";
                    regulator-min-microvolt = <500000>;
                    regulator-max-microvolt = <1700000>;
                    regulator-ramp-delay = <2500>;
                    rohm,dvs-run-voltage = <1700000>;
                    rohm,dvs-idle-voltage = <1>;
                    rohm,dvs-suspend-voltage = <1>;
                    rohm,dvs-lpsr-voltage = <0>;
                    regulator-boot-on;
                };
                buck10 {
                    regulator-name = "buck10";
                    regulator-min-microvolt = <500000>;
                    regulator-max-microvolt = <1700000>;
                    regulator-ramp-delay = <2500>;
                    rohm,dvs-run-voltage = <1700000>;
                    rohm,dvs-idle-voltage = <1>;
                    rohm,dvs-suspend-voltage = <1>;
                    rohm,dvs-lpsr-voltage = <0>;
                    regulator-boot-on;
                };
                ldo1 {
                    regulator-name = "ldo1";
                    regulator-min-microvolt = <800000>;
                    regulator-max-microvolt = <3300000>;
                };
                ldo2 {
                    regulator-name = "ldo2";
                    regulator-min-microvolt = <800000>;
                    regulator-max-microvolt = <3300000>;
                };
                ldo3 {
                    regulator-name = "ldo3";
                    regulator-min-microvolt = <800000>;
                    regulator-max-microvolt = <3300000>;
                };
                ldo4 {
                    regulator-name = "ldo4";
                    regulator-min-microvolt = <800000>;
                    regulator-max-microvolt = <3300000>;
                };
                ldo5 {
                    regulator-name = "ldo5";
                    regulator-min-microvolt = <800000>;
                    regulator-max-microvolt = <3300000>;
                };
                ldo6 {
                    regulator-name = "ldo6";
                    regulator-min-microvolt = <1800000>;
                    regulator-max-microvolt = <1800000>;
                };
                ldo7 {
                    regulator-name = "ldo7";
                    regulator-min-microvolt = <800000>;
                    regulator-max-microvolt = <3300000>;
                };
                ldo8 {
                    regulator-name = "ldo8";
                    regulator-min-microvolt = <750000>;
                    regulator-max-microvolt = <3300000>;
                    rohm,dvs-suspend-voltage = <0>;
                    rohm,dvs-lpsr-voltage = <1>;
                    rohm,dvs-run-voltage = <750000>;
                };
                ldo9 {
                    regulator-name = "ldo9";
                    regulator-min-microvolt = <750000>;
                    regulator-max-microvolt = <3300000>;
                    rohm,dvs-suspend-voltage = <0>;
                    rohm,dvs-lpsr-voltage = <1>;
                    rohm,dvs-run-voltage = <750000>;
                };
                ldo10 {
                    regulator-name = "ldo10";
                    regulator-min-microvolt = <750000>;
                    regulator-max-microvolt = <3300000>;
                    rohm,dvs-suspend-voltage = <0>;
                    rohm,dvs-lpsr-voltage = <1>;
                    rohm,dvs-run-voltage = <750000>;
                };
                ldo11 {
                    regulator-name = "ldo11";
                    regulator-min-microvolt = <750000>;
                    regulator-max-microvolt = <3300000>;
                    rohm,dvs-suspend-voltage = <0>;
                    rohm,dvs-lpsr-voltage = <1>;
                    rohm,dvs-run-voltage = <750000>;
                };
            };

            leds {
                compatible = "rohm,bd71828-leds";

                led-1 {
                    rohm,led-compatible = "bd71828-grnled";
                    function = LED_FUNCTION_INDICATOR;
                    color = <LED_COLOR_ID_GREEN>;
                };
                led-2 {
                    rohm,led-compatible = "bd71828-ambled";
                    function = LED_FUNCTION_CHARGING;
                    color = <LED_COLOR_ID_AMBER>;
                };
            };
        };
    };
+32 −1
Original line number Diff line number Diff line
@@ -64,7 +64,16 @@ properties:
    description: battery design capacity

  trickle-charge-current-microamp:
    description: current for trickle-charge phase
    description: current for trickle-charge phase.
      Please note that the trickle-charging here, refers "wake-up" or
      "pre-pre" -charging, for very empty batteries. Similar term is also
      used for "maintenance" or "top-off" -charging of batteries (like
      NiMh bq24400) - that is different and not controlled by this
      property.

  tricklecharge-upper-limit-microvolt:
    description: limit when to change to precharge from trickle charge
      Trickle-charging here refers "wake-up" or "pre-pre" -charging.

  precharge-current-microamp:
    description: current for pre-charge phase
@@ -119,6 +128,21 @@ properties:
      - description: alert when battery temperature is lower than this value
      - description: alert when battery temperature is higher than this value

  # The volt-drop* -properties describe voltage-drop for a battery, described
  # as VDROP in:
  # https://patentimages.storage.googleapis.com/6c/f5/17/c1d901c220f6a9/US20150032394A1.pdf
  volt-drop-thresh-microvolt:
    description: Threshold for starting the VDR correction
    maximum: 48000000

  volt-drop-soc-bp:
    description: Table of capacity values matching the values in VDR tables.
      The value should be given as basis points, 1/100 of a percent.

  volt-drop-temperatures-millicelsius:
    description: An array containing the temperature in milli celsius, for each
      of the VDR lookup table.

required:
  - compatible

@@ -137,6 +161,13 @@ patternProperties:
        - description: battery capacity percent
          maximum: 100

  '^volt-drop-[0-9]-microvolt':
    description: Table of the voltage drop rate (VDR) values. Each entry in the
      table should match a capacity value in the volt-drop-soc table.
      Furthermore, the values should be obtained for the temperature given in
      volt-drop-temperatures-millicelsius table at index matching the
      number in this table's name.

additionalProperties: false

examples:
+148 −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/regulator/rohm,bd72720-regulator.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: ROHM BD72720 Power Management Integrated Circuit regulators

maintainers:
  - Matti Vaittinen <mazziesaccount@gmail.com>

description: |
  This module is part of the ROHM BD72720 MFD device. For more details
  see Documentation/devicetree/bindings/mfd/rohm,bd72720-pmic.yaml.

  The regulator controller is represented as a sub-node of the PMIC node
  on the device tree.

  Regulator nodes should be named to BUCK_<number> and LDO_<number>.
  The valid names for BD72720 regulator nodes are
  buck1, buck2, buck3, buck4, buck5, buck6, buck7, buck8, buck9, buck10
  ldo1, ldo2, ldo3, ldo4, ldo5, ldo6, ldo7, ldo8, ldo9, ldo10, ldo11

patternProperties:
  "^ldo([1-9]|1[0-1])$":
    type: object
    description:
      Properties for single LDO regulator.
    $ref: regulator.yaml#

    properties:
      regulator-name:
        pattern: "^ldo([1-9]|1[0-1])$"

      rohm,dvs-run-voltage:
        description:
          PMIC default "RUN" state voltage in uV. See below table for
          LDOs which support this. 0 means disabled.
        $ref: /schemas/types.yaml#/definitions/uint32
        minimum: 0
        maximum: 3300000

      rohm,dvs-idle-voltage:
        description:
          PMIC default "IDLE" state voltage in uV. See below table for
          LDOs which support this. 0 means disabled.
        $ref: /schemas/types.yaml#/definitions/uint32
        minimum: 0
        maximum: 3300000

      rohm,dvs-suspend-voltage:
        description:
          PMIC default "SUSPEND" state voltage in uV. See below table for
          LDOs which support this. 0 means disabled.
        $ref: /schemas/types.yaml#/definitions/uint32
        minimum: 0
        maximum: 3300000

      rohm,dvs-lpsr-voltage:
        description:
          PMIC default "deep-idle" state voltage in uV. See below table for
          LDOs which support this. 0 means disabled.
        $ref: /schemas/types.yaml#/definitions/uint32
        minimum: 0
        maximum: 3300000

        # Supported default DVS states:
        #     ldo        |    run     |   idle    | suspend   | lpsr
        # --------------------------------------------------------------
        # 1, 2, 3, and 4 | supported  | supported | supported | supported
        # --------------------------------------------------------------
        # 5 - 11         |                    supported (*)
        # --------------------------------------------------------------
        #
        # (*) All states use same voltage but have own enable / disable
        #      settings. Voltage 0 can be specified for a state to make
        #      regulator disabled on that state.

    unevaluatedProperties: false

  "^buck([1-9]|10)$":
    type: object
    description:
      Properties for single BUCK regulator.
    $ref: regulator.yaml#

    properties:
      regulator-name:
        pattern: "^buck([1-9]|10)$"

      rohm,ldon-head-microvolt:
        description:
          Set this on boards where BUCK10 is used to supply LDOs 1-4. The bucki
          voltage will be changed by the PMIC to follow the LDO output voltages
          with the offset voltage given here. This will improve the LDO efficiency.
        minimum: 50000
        maximum: 300000

      rohm,dvs-run-voltage:
        description:
          PMIC default "RUN" state voltage in uV. See below table for
          bucks which support this. 0 means disabled.
        $ref: /schemas/types.yaml#/definitions/uint32
        minimum: 0
        maximum: 3300000

      rohm,dvs-idle-voltage:
        description:
          PMIC default "IDLE" state voltage in uV. See below table for
          bucks which support this. 0 means disabled.
        $ref: /schemas/types.yaml#/definitions/uint32
        minimum: 0
        maximum: 3300000

      rohm,dvs-suspend-voltage:
        description:
          PMIC default "SUSPEND" state voltage in uV. See below table for
          bucks which support this. 0 means disabled.
        $ref: /schemas/types.yaml#/definitions/uint32
        minimum: 0
        maximum: 3300000

      rohm,dvs-lpsr-voltage:
        description:
          PMIC default "deep-idle" state voltage in uV. See below table for
          bucks which support this. 0 means disabled.
        $ref: /schemas/types.yaml#/definitions/uint32
        minimum: 0
        maximum: 3300000

        # Supported default DVS states:
        #     buck       |    run     |   idle    | suspend   | lpsr
        # --------------------------------------------------------------
        # 1, 2, 3, and 4 | supported  | supported | supported | supported
        # --------------------------------------------------------------
        # 5 - 10    |                    supported (*)
        # --------------------------------------------------------------
        #
        # (*) All states use same voltage but have own enable / disable
        #      settings. Voltage 0 can be specified for a state to make
        #      regulator disabled on that state.

    required:
      - regulator-name

    unevaluatedProperties: false

additionalProperties: false
+2 −0
Original line number Diff line number Diff line
@@ -22759,6 +22759,7 @@ S: Supported
F:	drivers/clk/clk-bd718x7.c
F:	drivers/gpio/gpio-bd71815.c
F:	drivers/gpio/gpio-bd71828.c
F:	drivers/gpio/gpio-bd72720.c
F:	drivers/mfd/rohm-bd71828.c
F:	drivers/mfd/rohm-bd718x7.c
F:	drivers/mfd/rohm-bd9576.c
@@ -22775,6 +22776,7 @@ F: drivers/watchdog/bd96801_wdt.c
F:	include/linux/mfd/rohm-bd71815.h
F:	include/linux/mfd/rohm-bd71828.h
F:	include/linux/mfd/rohm-bd718x7.h
F:	include/linux/mfd/rohm-bd72720.h
F:	include/linux/mfd/rohm-bd957x.h
F:	include/linux/mfd/rohm-bd96801.h
F:	include/linux/mfd/rohm-bd96802.h
Loading