Skip to contentSkip to conversation

TI TPS6594 PMIC support (Core, ESM, PFSM)

PATCH Superseded Julien Panis 6 participants 16 messages Mar 15, 2023 – Mar 21, 2023

Subsystems (4)

v2 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

v2 cover TI TPS6594 PMIC support (Core, ESM, PFSM)

TPS6594 is a Power Management IC which provides regulators and others features like GPIOs, RTC, watchdog, ESMs (Error Signal Monitor), and PFSM (Pre-configurable Finite State Machine). The SoC and the PMIC can communicate through the I2C or SPI interfaces.
TPS6594 is the super-set device while TPS6593 and LP8764X are derivatives.

This series adds support to TI TPS6594 PMIC and its derivatives.

The features implemented in this series are:
- Core (MFD I2C and SPI entry points)
- ESM (child device)
- PFSM (child device)

- Core description:
I2C and SPI interface protocols are implemented, with and without the bit-integrity error detection feature (CRC mode). In multi-PMIC configuration, all instances share a single GPIO of the SoC to generate interrupt requests via their respective nINT output pin.

- ESM description:
This device monitors the SoC error output signal at its nERR_SOC input pin. In error condition, ESM toggles its nRSTOUT_SOC pin to reset the SoC.
Basically, ESM driver starts ESM hardware.

- PFSM description:
Strictly speaking, PFSM is not hardware. It is a piece of code. PMIC integrates a state machine which manages operational modes. Depending on the current operational mode, some voltage domains remain energized while others can be off.
PFSM driver can be used to trigger transitions between configured states.

Link to v1:
https://lore.kernel.org/all/[email protected]/

Others series will be submitted over the next few weeks, providing drivers for others child devices like GPIOs (pinctrl), RTC, and regulators. Board support will also be added (device trees).

Julien Panis (4):
dt-bindings: mfd: Add TI TPS6594 PMIC
mfd: tps6594: Add driver for TI TPS6594 PMIC
misc: tps6594-esm: Add driver for TI TPS6594 ESM
misc: tps6594-pfsm: Add driver for TI TPS6594 PFSM

 .../devicetree/bindings/mfd/ti,tps6594.yaml   |  191 +++
 .../userspace-api/ioctl/ioctl-number.rst      |    1 +
 drivers/mfd/Kconfig                           |   32 +
 drivers/mfd/Makefile                          |    3 +
 drivers/mfd/tps6594-core.c                    |  453 ++++++++
 drivers/mfd/tps6594-i2c.c                     |  244 ++++
 drivers/mfd/tps6594-spi.c                     |  129 +++
 drivers/misc/Kconfig                          |   23 +
 drivers/misc/Makefile                         |    2 +
 drivers/misc/tps6594-esm.c                    |  132 +++
 drivers/misc/tps6594-pfsm.c                   |  304 +++++
 include/linux/mfd/tps6594.h                   | 1020 +++++++++++++++++
 include/uapi/linux/tps6594_pfsm.h             |   45 +
 13 files changed, 2579 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mfd/ti,tps6594.yaml
 create mode 100644 drivers/mfd/tps6594-core.c
 create mode 100644 drivers/mfd/tps6594-i2c.c
 create mode 100644 drivers/mfd/tps6594-spi.c
 create mode 100644 drivers/misc/tps6594-esm.c
 create mode 100644 drivers/misc/tps6594-pfsm.c
 create mode 100644 include/linux/mfd/tps6594.h
 create mode 100644 include/uapi/linux/tps6594_pfsm.h

base-commit: fe15c26ee26efa11741a7b632e9f23b01aca4cc6

Signature · 1 line
2.37.3
#1 lore raw

PATCH v2 1/4 dt-bindings: mfd: Add TI TPS6594 PMIC

TPS6594 is a Power Management IC which provides regulators and others features like GPIOs, RTC, watchdog, ESMs (Error Signal Monitor), and PFSM (Pre-configurable Finite State Machine) managing the state of the device.
TPS6594 is the super-set device while TPS6593 and LP8764X are derivatives.

---
 .../devicetree/bindings/mfd/ti,tps6594.yaml   | 191 ++++++++++++++++++
 1 file changed, 191 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mfd/ti,tps6594.yaml
Documentation/devicetree/bindings/mfd/ti,tps6594.yaml new file +191 -0
new file mode 100644
index 000000000000..18f47cd6a2f9
@@ -0,0 +1,191 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/mfd/ti,tps6594.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: TI TPS6594 Power Management Integrated Circuit
+
+maintainers:
+  - Julien Panis <[email protected]>
+
+description: |
+  TPS6594 is a Power Management IC which provides regulators and others
+  features like GPIOs, RTC, watchdog, ESMs (Error Signal Monitor), and
+  PFSM (Pre-configurable Finite State Machine) managing the state of the device.
+  TPS6594 is the super-set device while TPS6593 and LP8764X are derivatives.
+
+properties:
+  compatible:
+    enum:
+      - ti,lp8764x
+      - ti,tps6593
+      - ti,tps6594
+
+  reg:
+    description: I2C slave address or SPI chip select number.
+    maxItems: 1
+
+  ti,spmi-controller:
+    type: boolean
+    description: |
+      Identify the primary PMIC on SPMI bus.
+      A multi-PMIC synchronization scheme is implemented in the PMIC device
+      to synchronize the power state changes with other PMIC devices. This is
+      accomplished through a SPMI bus: the primary PMIC is the controller
+      device on the SPMI bus, and the secondary PMICs are the target devices
+      on the SPMI bus.
+
+  system-power-controller: true
+
+  interrupts:
+    maxItems: 1
+
+  ti,multi-phase-id:
+    description: |
+      Describes buck multi-phase configuration, if any. For instance, XY id means
+      that outputs of buck converters X and Y are combined in multi-phase mode.
+    $ref: /schemas/types.yaml#/definitions/uint32
+    enum: [12, 34, 123, 1234]
+
+  regulators:
+    type: object
+    description: List of regulators provided by this controller.
+
+    patternProperties:
+      "^buck([1-5]|12|34|123|1234)$":
+        type: object
+        $ref: /schemas/regulator/regulator.yaml#
+
+        unevaluatedProperties: false
+
+      "^ldo[1-4]$":
+        type: object
+        $ref: /schemas/regulator/regulator.yaml#
+
+        unevaluatedProperties: false
+
+    allOf:
+      - if:
+          required:
+            - buck12
+        then:
+          properties:
+            buck123: false
+            buck1234: false
+      - if:
+          required:
+            - buck123
+        then:
+          properties:
+            buck34: false
+      - if:
+          required:
+            - buck1234
+        then:
+          properties:
+            buck34: false
+
+    additionalProperties: false
+
+patternProperties:
+  "^buck([1-5]|12|34|123|1234)-supply$":
+    description: Input supply phandle for each buck.
+
+  "^ldo[1-4]-supply$":
+    description: Input supply phandle for each ldo.
+
+required:
+  - compatible
+  - reg
+  - interrupts
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        tps6593: pmic@48 {
+            compatible = "ti,tps6593";
+            reg = <0x48>;
+            ti,spmi-controller;
+            system-power-controller;
+
+            pinctrl-names = "default";
+            pinctrl-0 = <&pmic_irq_pins_default>;
+            interrupt-parent = <&mcu_gpio0>;
+            interrupts = <0 IRQ_TYPE_EDGE_FALLING>;
+
+            ti,multi-phase-id = <123>;
+
+            buck123-supply = <&vcc_3v3_sys>;
+            buck4-supply = <&vcc_3v3_sys>;
+            buck5-supply = <&vcc_3v3_sys>;
+            ldo1-supply = <&vcc_3v3_sys>;
+            ldo2-supply = <&vcc_3v3_sys>;
+            ldo3-supply = <&buck5>;
+            ldo4-supply = <&vcc_3v3_sys>;
+
+            regulators {
+                buck123: buck123 {
+                    regulator-name = "vcc_core";
+                    regulator-min-microvolt = <750000>;
+                    regulator-max-microvolt = <850000>;
+                    regulator-boot-on;
+                    regulator-always-on;
+                };
+
+                buck4: buck4 {
+                    regulator-name = "vcc_1v1";
+                    regulator-min-microvolt = <1100000>;
+                    regulator-max-microvolt = <1100000>;
+                    regulator-boot-on;
+                    regulator-always-on;
+                };
+
+                buck5: buck5 {
+                    regulator-name = "vcc_1v8_sys";
+                    regulator-min-microvolt = <1800000>;
+                    regulator-max-microvolt = <1800000>;
+                    regulator-boot-on;
+                    regulator-always-on;
+                };
+
+                ldo1: ldo1 {
+                    regulator-name = "vddshv5_sdio";
+                    regulator-min-microvolt = <3300000>;
+                    regulator-max-microvolt = <3300000>;
+                    regulator-boot-on;
+                    regulator-always-on;
+                };
+
+                ldo2: ldo2 {
+                    regulator-name = "vpp_1v8";
+                    regulator-min-microvolt = <1800000>;
+                    regulator-max-microvolt = <1800000>;
+                    regulator-boot-on;
+                    regulator-always-on;
+                };
+
+                ldo3: ldo3 {
+                    regulator-name = "vcc_0v85";
+                    regulator-min-microvolt = <850000>;
+                    regulator-max-microvolt = <850000>;
+                    regulator-boot-on;
+                    regulator-always-on;
+                };
+
+                ldo4: ldo4 {
+                    regulator-name = "vdda_1v8";
+                    regulator-min-microvolt = <1800000>;
+                    regulator-max-microvolt = <1800000>;
+                    regulator-boot-on;
+                    regulator-always-on;
+                };
+            };
+        };
+    };
Signature · 1 line
2.37.3
maintainer
#2 lore raw

Re: [PATCH v2 1/4] dt-bindings: mfd: Add TI TPS6594 PMIC

Quoted 5 lines · Julien Panis

TPS6594 is a Power Management IC which provides regulators and others features like GPIOs, RTC, watchdog, ESMs (Error Signal Monitor), and PFSM (Pre-configurable Finite State Machine) managing the state of the device.
TPS6594 is the super-set device while TPS6593 and LP8764X are derivatives.

As mentioned, the binding needs to be complete. It's missing GPIO at least. RTC and watchdog may or may not need binding changes.

Quoted 15 lines
---
 .../devicetree/bindings/mfd/ti,tps6594.yaml   | 191 ++++++++++++++++++
 1 file changed, 191 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mfd/ti,tps6594.yaml
Documentation/devicetree/bindings/mfd/ti,tps6594.yaml new file +2 -0
new file mode 100644
index 000000000000..18f47cd6a2f9
@@ -0,0 +1,191 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2

Documentation/devicetree/bindings/mfd/ti,tps6594.yaml line 12

Quoted 10 lines
Documentation/devicetree/bindings/mfd/ti,tps6594.yaml new file +10 -0
+---
+$id: http://devicetree.org/schemas/mfd/ti,tps6594.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: TI TPS6594 Power Management Integrated Circuit
+
+maintainers:
+  - Julien Panis <[email protected]>
+
+description: |

Don't need '|'.

Quoted 10 lines
Documentation/devicetree/bindings/mfd/ti,tps6594.yaml new file +10 -0
+  TPS6594 is a Power Management IC which provides regulators and others
+  features like GPIOs, RTC, watchdog, ESMs (Error Signal Monitor), and
+  PFSM (Pre-configurable Finite State Machine) managing the state of the device.
+  TPS6594 is the super-set device while TPS6593 and LP8764X are derivatives.
+
+properties:
+  compatible:
+    enum:
+      - ti,lp8764x
+      - ti,tps6593

Documentation/devicetree/bindings/mfd/ti,tps6594.yaml line 32

Quoted 10 lines
Documentation/devicetree/bindings/mfd/ti,tps6594.yaml new file +10 -0
+      - ti,tps6594
+
+  reg:
+    description: I2C slave address or SPI chip select number.
+    maxItems: 1
+
+  ti,spmi-controller:
+    type: boolean
+    description: |
+      Identify the primary PMIC on SPMI bus.

Perhaps the property name should include 'primary' and 'pmic'. Otherwise, it looks like it is just marked as 'a SPMI controller'.

Documentation/devicetree/bindings/mfd/ti,tps6594.yaml line 37

Quoted 5 lines
Documentation/devicetree/bindings/mfd/ti,tps6594.yaml new file +5 -0
+      A multi-PMIC synchronization scheme is implemented in the PMIC device
+      to synchronize the power state changes with other PMIC devices. This is
+      accomplished through a SPMI bus: the primary PMIC is the controller
+      device on the SPMI bus, and the secondary PMICs are the target devices
+      on the SPMI bus.

Is this a TI specific feature?

Documentation/devicetree/bindings/mfd/ti,tps6594.yaml line 49

Quoted 12 lines
Documentation/devicetree/bindings/mfd/ti,tps6594.yaml new file +12 -0
+
+  system-power-controller: true
+
+  interrupts:
+    maxItems: 1
+
+  ti,multi-phase-id:
+    description: |
+      Describes buck multi-phase configuration, if any. For instance, XY id means
+      that outputs of buck converters X and Y are combined in multi-phase mode.
+    $ref: /schemas/types.yaml#/definitions/uint32
+    enum: [12, 34, 123, 1234]

coupled regulator stuff doesn't work here?

Quoted 145 lines
Documentation/devicetree/bindings/mfd/ti,tps6594.yaml new file +142 -0
+
+  regulators:
+    type: object
+    description: List of regulators provided by this controller.
+
+    patternProperties:
+      "^buck([1-5]|12|34|123|1234)$":
+        type: object
+        $ref: /schemas/regulator/regulator.yaml#
+
+        unevaluatedProperties: false
+
+      "^ldo[1-4]$":
+        type: object
+        $ref: /schemas/regulator/regulator.yaml#
+
+        unevaluatedProperties: false
+
+    allOf:
+      - if:
+          required:
+            - buck12
+        then:
+          properties:
+            buck123: false
+            buck1234: false
+      - if:
+          required:
+            - buck123
+        then:
+          properties:
+            buck34: false
+      - if:
+          required:
+            - buck1234
+        then:
+          properties:
+            buck34: false
+
+    additionalProperties: false
+
+patternProperties:
+  "^buck([1-5]|12|34|123|1234)-supply$":
+    description: Input supply phandle for each buck.
+
+  "^ldo[1-4]-supply$":
+    description: Input supply phandle for each ldo.
+
+required:
+  - compatible
+  - reg
+  - interrupts
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        tps6593: pmic@48 {
+            compatible = "ti,tps6593";
+            reg = <0x48>;
+            ti,spmi-controller;
+            system-power-controller;
+
+            pinctrl-names = "default";
+            pinctrl-0 = <&pmic_irq_pins_default>;
+            interrupt-parent = <&mcu_gpio0>;
+            interrupts = <0 IRQ_TYPE_EDGE_FALLING>;
+
+            ti,multi-phase-id = <123>;
+
+            buck123-supply = <&vcc_3v3_sys>;
+            buck4-supply = <&vcc_3v3_sys>;
+            buck5-supply = <&vcc_3v3_sys>;
+            ldo1-supply = <&vcc_3v3_sys>;
+            ldo2-supply = <&vcc_3v3_sys>;
+            ldo3-supply = <&buck5>;
+            ldo4-supply = <&vcc_3v3_sys>;
+
+            regulators {
+                buck123: buck123 {
+                    regulator-name = "vcc_core";
+                    regulator-min-microvolt = <750000>;
+                    regulator-max-microvolt = <850000>;
+                    regulator-boot-on;
+                    regulator-always-on;
+                };
+
+                buck4: buck4 {
+                    regulator-name = "vcc_1v1";
+                    regulator-min-microvolt = <1100000>;
+                    regulator-max-microvolt = <1100000>;
+                    regulator-boot-on;
+                    regulator-always-on;
+                };
+
+                buck5: buck5 {
+                    regulator-name = "vcc_1v8_sys";
+                    regulator-min-microvolt = <1800000>;
+                    regulator-max-microvolt = <1800000>;
+                    regulator-boot-on;
+                    regulator-always-on;
+                };
+
+                ldo1: ldo1 {
+                    regulator-name = "vddshv5_sdio";
+                    regulator-min-microvolt = <3300000>;
+                    regulator-max-microvolt = <3300000>;
+                    regulator-boot-on;
+                    regulator-always-on;
+                };
+
+                ldo2: ldo2 {
+                    regulator-name = "vpp_1v8";
+                    regulator-min-microvolt = <1800000>;
+                    regulator-max-microvolt = <1800000>;
+                    regulator-boot-on;
+                    regulator-always-on;
+                };
+
+                ldo3: ldo3 {
+                    regulator-name = "vcc_0v85";
+                    regulator-min-microvolt = <850000>;
+                    regulator-max-microvolt = <850000>;
+                    regulator-boot-on;
+                    regulator-always-on;
+                };
+
+                ldo4: ldo4 {
+                    regulator-name = "vdda_1v8";
+                    regulator-min-microvolt = <1800000>;
+                    regulator-max-microvolt = <1800000>;
+                    regulator-boot-on;
+                    regulator-always-on;
+                };
+            };
+        };
+    };
Signature · 1 line
2.37.3
#3 lore raw

Re: [PATCH v2 1/4] dt-bindings: mfd: Add TI TPS6594 PMIC

Quoted 8 lines · Rob Herring
Quoted 5 lines · Julien Panis

TPS6594 is a Power Management IC which provides regulators and others features like GPIOs, RTC, watchdog, ESMs (Error Signal Monitor), and PFSM (Pre-configurable Finite State Machine) managing the state of the device.
TPS6594 is the super-set device while TPS6593 and LP8764X are derivatives.

As mentioned, the binding needs to be complete. It's missing GPIO at least. RTC and watchdog may or may not need binding changes.

Thank you for your feedback.

About GPIO, do you speak about 'gpio-controller' and/or '#gpio-cells' properties ?
For RTC (and for watchdog, once the driver will be implemented), our driver do not require any node to work. What could make an explicit instantiation necessary in DT ?

Quoted 41 lines
Quoted 15 lines
---
  .../devicetree/bindings/mfd/ti,tps6594.yaml   | 191 ++++++++++++++++++
  1 file changed, 191 insertions(+)

create mode 100644 Documentation/devicetree/bindings/mfd/ti,tps6594.yaml

Documentation/devicetree/bindings/mfd/ti,tps6594.yaml new file +2 -0
new file mode 100644
index 000000000000..18f47cd6a2f9
@@ -0,0 +1,191 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2

Documentation/devicetree/bindings/mfd/ti,tps6594.yaml line 12

Quoted 10 lines
Documentation/devicetree/bindings/mfd/ti,tps6594.yaml new file +10 -0
+---
+$id: http://devicetree.org/schemas/mfd/ti,tps6594.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: TI TPS6594 Power Management Integrated Circuit
+
+maintainers:
+  - Julien Panis <[email protected]>
+
+description: |

Don't need '|'.

Quoted 14 lines
Documentation/devicetree/bindings/mfd/ti,tps6594.yaml new file +14 -0
+  TPS6594 is a Power Management IC which provides regulators and others
+  features like GPIOs, RTC, watchdog, ESMs (Error Signal Monitor), and
+  PFSM (Pre-configurable Finite State Machine) managing the state of the device.
+  TPS6594 is the super-set device while TPS6593 and LP8764X are derivatives.
+
+properties:
+  compatible:
+    enum:
+      - ti,lp8764x
+      - ti,tps6593
+      - ti,tps6594
+
+  reg:
+    description: I2C slave address or SPI chip select number.
Quoted 8 lines

Documentation/devicetree/bindings/mfd/ti,tps6594.yaml line 32

Quoted 6 lines
Documentation/devicetree/bindings/mfd/ti,tps6594.yaml new file +6 -0
+    maxItems: 1
+
+  ti,spmi-controller:
+    type: boolean
+    description: |
+      Identify the primary PMIC on SPMI bus.

Perhaps the property name should include 'primary' and 'pmic'. Otherwise, it looks like it is just marked as 'a SPMI controller'.

Including 'primary' and 'pmic' will be more understandable indeed. I will change that in v3.

Quoted 8 lines

Documentation/devicetree/bindings/mfd/ti,tps6594.yaml line 37

Quoted 7 lines
Documentation/devicetree/bindings/mfd/ti,tps6594.yaml new file +5 -0
+      A multi-PMIC synchronization scheme is implemented in the PMIC device
+      to synchronize the power state changes with other PMIC devices. This is
+      accomplished through a SPMI bus: the primary PMIC is the controller
+      device on the SPMI bus, and the secondary PMICs are the target devices
+      on the SPMI bus.

Is this a TI specific feature?

I don't think so. I will double-check that.
If not, shall I remove the 'ti,' prefix ?

Quoted 14 lines

Documentation/devicetree/bindings/mfd/ti,tps6594.yaml line 49

Quoted 13 lines
Documentation/devicetree/bindings/mfd/ti,tps6594.yaml new file +12 -0
+
+  system-power-controller: true
+
+  interrupts:
+    maxItems: 1
+
+  ti,multi-phase-id:
+    description: |
+      Describes buck multi-phase configuration, if any. For instance, XY id means
+      that outputs of buck converters X and Y are combined in multi-phase mode.
+    $ref: /schemas/types.yaml#/definitions/uint32
+    enum: [12, 34, 123, 1234]

coupled regulator stuff doesn't work here?

Coupled regulator stuff works here.
Is it also necessary to specify some 'allOf' logic here to ensure that mutual exclusions described below (for regulators) will be applied ?

Quoted 146 lines
Quoted 146 lines
Documentation/devicetree/bindings/mfd/ti,tps6594.yaml new file +142 -0
+
+  regulators:
+    type: object
+    description: List of regulators provided by this controller.
+
+    patternProperties:
+      "^buck([1-5]|12|34|123|1234)$":
+        type: object
+        $ref: /schemas/regulator/regulator.yaml#
+
+        unevaluatedProperties: false
+
+      "^ldo[1-4]$":
+        type: object
+        $ref: /schemas/regulator/regulator.yaml#
+
+        unevaluatedProperties: false
+
+    allOf:
+      - if:
+          required:
+            - buck12
+        then:
+          properties:
+            buck123: false
+            buck1234: false
+      - if:
+          required:
+            - buck123
+        then:
+          properties:
+            buck34: false
+      - if:
+          required:
+            - buck1234
+        then:
+          properties:
+            buck34: false
+
+    additionalProperties: false
+
+patternProperties:
+  "^buck([1-5]|12|34|123|1234)-supply$":
+    description: Input supply phandle for each buck.
+
+  "^ldo[1-4]-supply$":
+    description: Input supply phandle for each ldo.
+
+required:
+  - compatible
+  - reg
+  - interrupts
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        tps6593: pmic@48 {
+            compatible = "ti,tps6593";
+            reg = <0x48>;
+            ti,spmi-controller;
+            system-power-controller;
+
+            pinctrl-names = "default";
+            pinctrl-0 = <&pmic_irq_pins_default>;
+            interrupt-parent = <&mcu_gpio0>;
+            interrupts = <0 IRQ_TYPE_EDGE_FALLING>;
+
+            ti,multi-phase-id = <123>;
+
+            buck123-supply = <&vcc_3v3_sys>;
+            buck4-supply = <&vcc_3v3_sys>;
+            buck5-supply = <&vcc_3v3_sys>;
+            ldo1-supply = <&vcc_3v3_sys>;
+            ldo2-supply = <&vcc_3v3_sys>;
+            ldo3-supply = <&buck5>;
+            ldo4-supply = <&vcc_3v3_sys>;
+
+            regulators {
+                buck123: buck123 {
+                    regulator-name = "vcc_core";
+                    regulator-min-microvolt = <750000>;
+                    regulator-max-microvolt = <850000>;
+                    regulator-boot-on;
+                    regulator-always-on;
+                };
+
+                buck4: buck4 {
+                    regulator-name = "vcc_1v1";
+                    regulator-min-microvolt = <1100000>;
+                    regulator-max-microvolt = <1100000>;
+                    regulator-boot-on;
+                    regulator-always-on;
+                };
+
+                buck5: buck5 {
+                    regulator-name = "vcc_1v8_sys";
+                    regulator-min-microvolt = <1800000>;
+                    regulator-max-microvolt = <1800000>;
+                    regulator-boot-on;
+                    regulator-always-on;
+                };
+
+                ldo1: ldo1 {
+                    regulator-name = "vddshv5_sdio";
+                    regulator-min-microvolt = <3300000>;
+                    regulator-max-microvolt = <3300000>;
+                    regulator-boot-on;
+                    regulator-always-on;
+                };
+
+                ldo2: ldo2 {
+                    regulator-name = "vpp_1v8";
+                    regulator-min-microvolt = <1800000>;
+                    regulator-max-microvolt = <1800000>;
+                    regulator-boot-on;
+                    regulator-always-on;
+                };
+
+                ldo3: ldo3 {
+                    regulator-name = "vcc_0v85";
+                    regulator-min-microvolt = <850000>;
+                    regulator-max-microvolt = <850000>;
+                    regulator-boot-on;
+                    regulator-always-on;
+                };
+
+                ldo4: ldo4 {
+                    regulator-name = "vdda_1v8";
+                    regulator-min-microvolt = <1800000>;
+                    regulator-max-microvolt = <1800000>;
+                    regulator-boot-on;
+                    regulator-always-on;
+                };
+            };
+        };
+    };
Signature · 1 line
2.37.3
#4 lore raw

Re: [PATCH v2 1/4] dt-bindings: mfd: Add TI TPS6594 PMIC

Quoted 9 lines · Julien Panis
Quoted 6 lines · Rob Herring
Quoted 5 lines · Julien Panis

TPS6594 is a Power Management IC which provides regulators and others features like GPIOs, RTC, watchdog, ESMs (Error Signal Monitor), and PFSM (Pre-configurable Finite State Machine) managing the state of the device.
TPS6594 is the super-set device while TPS6593 and LP8764X are derivatives.

Quoted 7 lines
Quoted 2 lines

As mentioned, the binding needs to be complete. It's missing GPIO at least. RTC and watchdog may or may not need binding changes.

Thank you for your feedback.

About GPIO, do you speak about 'gpio-controller'
and/or '#gpio-cells' properties ?

Yes.

Quoted 4 lines

For RTC (and for watchdog, once the driver will be implemented), our driver do not require any node to work. What could make an explicit instantiation necessary in DT ?

Properties from RTC schema, e.g. start-year, wakeup etc.

Quoted 17 lines
Quoted 6 lines

Documentation/devicetree/bindings/mfd/ti,tps6594.yaml line 32

Quoted 4 lines
Documentation/devicetree/bindings/mfd/ti,tps6594.yaml new file +4 -0
+  ti,spmi-controller:
+    type: boolean
+    description: |
+      Identify the primary PMIC on SPMI bus.

Perhaps the property name should include 'primary' and 'pmic'. Otherwise, it looks like it is just marked as 'a SPMI controller'.

Including 'primary' and 'pmic' will be more understandable indeed. I will change that in v3.

Quoted 7 lines
Quoted 7 lines
Documentation/devicetree/bindings/mfd/ti,tps6594.yaml new file +5 -0
+      A multi-PMIC synchronization scheme is implemented in the PMIC device
+      to synchronize the power state changes with other PMIC devices. This is
+      accomplished through a SPMI bus: the primary PMIC is the controller
+      device on the SPMI bus, and the secondary PMICs are the target devices
+      on the SPMI bus.
Quoted 4 lines
Quoted 1 line

Is this a TI specific feature?

I don't think so. I will double-check that.
If not, shall I remove the 'ti,' prefix ?

Somehow reminds me qcom,bus-id, but the wording and code are not exactly the same. The question here is whether this is generic feature of all SPMI devices or PMICs, or device specific. If it is generic, then naming and type should be chosen a bit more carefully and then indeed skip "ti," prefix.

Quoted 16 lines
Quoted 15 lines
Quoted 4 lines
Documentation/devicetree/bindings/mfd/ti,tps6594.yaml new file +2 -0
+
+  system-power-controller: true

Documentation/devicetree/bindings/mfd/ti,tps6594.yaml line 49

Quoted 10 lines
Documentation/devicetree/bindings/mfd/ti,tps6594.yaml new file +10 -0
+
+  interrupts:
+    maxItems: 1
+
+  ti,multi-phase-id:
+    description: |
+      Describes buck multi-phase configuration, if any. For instance, XY id means
+      that outputs of buck converters X and Y are combined in multi-phase mode.
+    $ref: /schemas/types.yaml#/definitions/uint32
+    enum: [12, 34, 123, 1234]

coupled regulator stuff doesn't work here?

Quoted 4 lines

Coupled regulator stuff works here.
Is it also necessary to specify some 'allOf' logic here to ensure that mutual exclusions described below (for regulators) will be applied ?

None of other regulators do it but you could add something.

Best regards,
Krzysztof

#5 lore raw

Re: [PATCH v2 1/4] dt-bindings: mfd: Add TI TPS6594 PMIC

Quoted 15 lines · Krzysztof Kozlowski
Quoted 8 lines · Julien Panis
Quoted 6 lines · Rob Herring
Quoted 5 lines · Julien Panis

TPS6594 is a Power Management IC which provides regulators and others features like GPIOs, RTC, watchdog, ESMs (Error Signal Monitor), and PFSM (Pre-configurable Finite State Machine) managing the state of the device.
TPS6594 is the super-set device while TPS6593 and LP8764X are derivatives.

Quoted 6 lines
Quoted 2 lines

As mentioned, the binding needs to be complete. It's missing GPIO at least. RTC and watchdog may or may not need binding changes.

Thank you for your feedback.

About GPIO, do you speak about 'gpio-controller'
and/or '#gpio-cells' properties ?

Quoted 7 lines

Yes.

Quoted 4 lines

For RTC (and for watchdog, once the driver will be implemented), our driver do not require any node to work. What could make an explicit instantiation necessary in DT ?

Properties from RTC schema, e.g. start-year, wakeup etc.

TPS6594 RTC driver is being reviewed (this is another patch series, not merged yet). These properties are not used by our driver, that's why we did not have to add some RTC node in the DT (until now, using such properties in our driver was not requested by RTC sub-system maintainers).

Quoted 15 lines
Quoted 15 lines
Quoted 6 lines

Documentation/devicetree/bindings/mfd/ti,tps6594.yaml line 32

Quoted 4 lines
Documentation/devicetree/bindings/mfd/ti,tps6594.yaml new file +4 -0
+  ti,spmi-controller:
+    type: boolean
+    description: |
+      Identify the primary PMIC on SPMI bus.

Perhaps the property name should include 'primary' and 'pmic'. Otherwise, it looks like it is just marked as 'a SPMI controller'.

Including 'primary' and 'pmic' will be more understandable indeed. I will change that in v3.

Quoted 6 lines
Quoted 6 lines
Documentation/devicetree/bindings/mfd/ti,tps6594.yaml new file +5 -0
+      A multi-PMIC synchronization scheme is implemented in the PMIC device
+      to synchronize the power state changes with other PMIC devices. This is
+      accomplished through a SPMI bus: the primary PMIC is the controller
+      device on the SPMI bus, and the secondary PMICs are the target devices
+      on the SPMI bus.
Quoted 8 lines
Quoted 3 lines
Quoted 1 line

Is this a TI specific feature?

I don't think so. I will double-check that.
If not, shall I remove the 'ti,' prefix ?

Somehow reminds me qcom,bus-id, but the wording and code are not exactly the same. The question here is whether this is generic feature of all SPMI devices or PMICs, or device specific. If it is generic, then naming and type should be chosen a bit more carefully and then indeed skip "ti," prefix.

Apparently, it's not TI specific. Besides, all the information I found about SPMI were related to PMIC devices. I have to double-check with TI, though.
I will either rename it to 'ti,primary-pmic' if TI specific or 'primary-pmic' if not TI specific.

Quoted 24 lines
Quoted 14 lines
Quoted 14 lines

Documentation/devicetree/bindings/mfd/ti,tps6594.yaml line 49

Quoted 13 lines
Documentation/devicetree/bindings/mfd/ti,tps6594.yaml new file +12 -0
+
+  system-power-controller: true
+
+  interrupts:
+    maxItems: 1
+
+  ti,multi-phase-id:
+    description: |
+      Describes buck multi-phase configuration, if any. For instance, XY id means
+      that outputs of buck converters X and Y are combined in multi-phase mode.
+    $ref: /schemas/types.yaml#/definitions/uint32
+    enum: [12, 34, 123, 1234]

coupled regulator stuff doesn't work here?

Quoted 4 lines

Coupled regulator stuff works here.
Is it also necessary to specify some 'allOf' logic here to ensure that mutual exclusions described below (for regulators) will be applied ?

None of other regulators do it but you could add something.

Best regards,
Krzysztof

#6 lore raw

Re: [PATCH v2 1/4] dt-bindings: mfd: Add TI TPS6594 PMIC

Quoted 24 lines · Julien Panis
Quoted 21 lines · Krzysztof Kozlowski
Quoted 8 lines · Julien Panis
Quoted 6 lines · Rob Herring
Quoted 5 lines · Julien Panis

TPS6594 is a Power Management IC which provides regulators and others features like GPIOs, RTC, watchdog, ESMs (Error Signal Monitor), and PFSM (Pre-configurable Finite State Machine) managing the state of the device.
TPS6594 is the super-set device while TPS6593 and LP8764X are derivatives.

Quoted 6 lines
Quoted 2 lines

As mentioned, the binding needs to be complete. It's missing GPIO at least. RTC and watchdog may or may not need binding changes.

Thank you for your feedback.

About GPIO, do you speak about 'gpio-controller' and/or '#gpio-cells' properties ?

Yes.

Quoted 4 lines

For RTC (and for watchdog, once the driver will be implemented), our driver do not require any node to work. What could make an explicit instantiation necessary in DT ?

Quoted 7 lines
Quoted 1 line

Properties from RTC schema, e.g. start-year, wakeup etc.

TPS6594 RTC driver is being reviewed (this is another patch series, not merged yet). These properties are not used by our driver, that's why we did not have to add some RTC node in the DT (until now, using such properties in our driver was not requested by RTC sub-system maintainers).

Bindings should be complete, regardless whether you now need this in driver or not. Does your comment mean that you will never need these, because hardware does not support them, and never going to add? Otherwise I don't get why you refer to driver when we talk about bindings...

Best regards,
Krzysztof

#7 lore raw

Re: [PATCH v2 1/4] dt-bindings: mfd: Add TI TPS6594 PMIC

Quoted 29 lines · Krzysztof Kozlowski
Quoted 22 lines · Julien Panis
Quoted 20 lines · Krzysztof Kozlowski
Quoted 7 lines · Julien Panis
Quoted 6 lines · Rob Herring
Quoted 5 lines · Julien Panis

TPS6594 is a Power Management IC which provides regulators and others features like GPIOs, RTC, watchdog, ESMs (Error Signal Monitor), and PFSM (Pre-configurable Finite State Machine) managing the state of the device.
TPS6594 is the super-set device while TPS6593 and LP8764X are derivatives.

Quoted 6 lines
Quoted 2 lines

As mentioned, the binding needs to be complete. It's missing GPIO at least. RTC and watchdog may or may not need binding changes.

Thank you for your feedback.

About GPIO, do you speak about 'gpio-controller' and/or '#gpio-cells' properties ?

Yes.

Quoted 4 lines

For RTC (and for watchdog, once the driver will be implemented), our driver do not require any node to work. What could make an explicit instantiation necessary in DT ?

Quoted 6 lines
Quoted 1 line

Properties from RTC schema, e.g. start-year, wakeup etc.

TPS6594 RTC driver is being reviewed (this is another patch series, not merged yet). These properties are not used by our driver, that's why we did not have to add some RTC node in the DT (until now, using such properties in our driver was not requested by RTC sub-system maintainers).

Quoted 4 lines

Bindings should be complete, regardless whether you now need this in driver or not. Does your comment mean that you will never need these, because hardware does not support them, and never going to add? Otherwise I don't get why you refer to driver when we talk about bindings...

OK, I understand now (I misinterpreted "RTC and watchdog may or may not need binding changes").

Quoted 3 lines

Best regards,
Krzysztof

#8 lore raw

RE: [EXTERNAL] Re: [PATCH v2 1/4] dt-bindings: mfd: Add TI TPS6594 PMIC

In reply to Rob Herring
Quoted 8 lines

Documentation/devicetree/bindings/mfd/ti,tps6594.yaml line 37

Quoted 5 lines
Documentation/devicetree/bindings/mfd/ti,tps6594.yaml new file +5 -0
+      A multi-PMIC synchronization scheme is implemented in the PMIC device
+      to synchronize the power state changes with other PMIC devices. This is
+      accomplished through a SPMI bus: the primary PMIC is the controller
+      device on the SPMI bus, and the secondary PMICs are the target devices
+      on the SPMI bus.

Is this a TI specific feature?

This implementation of SPMI bus is a TI specific feature and is only supported between devices which have this specific implementation.

#9 lore raw

PATCH v2 2/4 mfd: tps6594: Add driver for TI TPS6594 PMIC

In reply to Julien Panis

This patch adds support for TPS6594 PMIC MFD core. It provides communication through the I2C and SPI interfaces, and supports protocols with embedded CRC data fields for safety applications.

---
 drivers/mfd/Kconfig         |   32 ++
 drivers/mfd/Makefile        |    3 +
 drivers/mfd/tps6594-core.c  |  453 ++++++++++++++++
 drivers/mfd/tps6594-i2c.c   |  244 +++++++++
 drivers/mfd/tps6594-spi.c   |  129 +++++
 include/linux/mfd/tps6594.h | 1020 +++++++++++++++++++++++++++++++++++
 6 files changed, 1881 insertions(+)
 create mode 100644 drivers/mfd/tps6594-core.c
 create mode 100644 drivers/mfd/tps6594-i2c.c
 create mode 100644 drivers/mfd/tps6594-spi.c
 create mode 100644 include/linux/mfd/tps6594.h
drivers/mfd/Kconfig +32 -0
index fcc141e067b9..328f160b88e2 100644
@@ -1662,6 +1662,38 @@ config MFD_TPS65912_SPI
 	  If you say yes here you get support for the TPS65912 series of
 	  PM chips with SPI interface.
 
+config MFD_TPS6594
+	tristate
+	select MFD_CORE
+	select REGMAP
+	select REGMAP_IRQ
+
+config MFD_TPS6594_I2C
+	tristate "TI TPS6594 Power Management chip with I2C"
+	select MFD_TPS6594
+	select REGMAP_I2C
+	select CRC8
+	depends on I2C
+	help
+	  If you say yes here you get support for the TPS6594 series of
+	  PM chips with I2C interface.
+
+	  This driver can also be built as a module.  If so, the module
+	  will be called tps6594-i2c.
+
+config MFD_TPS6594_SPI
+	tristate "TI TPS6594 Power Management chip with SPI"
+	select MFD_TPS6594
+	select REGMAP_SPI
+	select CRC8
+	depends on SPI_MASTER
+	help
+	  If you say yes here you get support for the TPS6594 series of
+	  PM chips with SPI interface.
+
+	  This driver can also be built as a module.  If so, the module
+	  will be called tps6594-spi.
+
 config TWL4030_CORE
 	bool "TI TWL4030/TWL5030/TWL6030/TPS659x0 Support"
 	depends on I2C=y
drivers/mfd/Makefile +3 -0
index 2f6c89d1e277..27d0d5c9cff9 100644
@@ -96,6 +96,9 @@ obj-$(CONFIG_MFD_TPS65910)	+= tps65910.o
 obj-$(CONFIG_MFD_TPS65912)	+= tps65912-core.o
 obj-$(CONFIG_MFD_TPS65912_I2C)	+= tps65912-i2c.o
 obj-$(CONFIG_MFD_TPS65912_SPI)  += tps65912-spi.o
+obj-$(CONFIG_MFD_TPS6594)	+= tps6594-core.o
+obj-$(CONFIG_MFD_TPS6594_I2C)	+= tps6594-i2c.o
+obj-$(CONFIG_MFD_TPS6594_SPI)	+= tps6594-spi.o
 obj-$(CONFIG_MENELAUS)		+= menelaus.o
 
 obj-$(CONFIG_TWL4030_CORE)	+= twl-core.o twl4030-irq.o twl6030-irq.o
drivers/mfd/tps6594-core.c new file +453 -0

453 lines not on this page · raw message

drivers/mfd/tps6594-i2c.c new file +244 -0

244 lines not on this page · raw message

drivers/mfd/tps6594-spi.c new file +129 -0

129 lines not on this page · raw message

include/linux/mfd/tps6594.h new file +1020 -0

1,020 lines not on this page · raw message

Signature · 1 line
2.37.3
maintainer
#10 lore raw

Re: [PATCH v2 2/4] mfd: tps6594: Add driver for TI TPS6594 PMIC

Quoted 5 lines · Julien Panis

This patch adds support for TPS6594 PMIC MFD core. It provides communication through the I2C and SPI interfaces, and supports protocols with embedded CRC data fields for safety applications.

Quoted 12 lines
---
 drivers/mfd/Kconfig         |   32 ++
 drivers/mfd/Makefile        |    3 +
 drivers/mfd/tps6594-core.c  |  453 ++++++++++++++++
 drivers/mfd/tps6594-i2c.c   |  244 +++++++++
 drivers/mfd/tps6594-spi.c   |  129 +++++
 include/linux/mfd/tps6594.h | 1020 +++++++++++++++++++++++++++++++++++
 6 files changed, 1881 insertions(+)
 create mode 100644 drivers/mfd/tps6594-core.c
 create mode 100644 drivers/mfd/tps6594-i2c.c
 create mode 100644 drivers/mfd/tps6594-spi.c
 create mode 100644 include/linux/mfd/tps6594.h

Once you have the misc Acks, I plan to take this via MFD:

For my own reference (apply this as-is to your sign-off block):

--
Lee Jones [李琼斯]

#11 lore raw

PATCH v2 3/4 misc: tps6594-esm: Add driver for TI TPS6594 ESM

In reply to Julien Panis

This patch adds support for TPS6594 ESM (Error Signal Monitor). This device monitors the SoC error output signal at its nERR_SOC input pin. In error condition, ESM toggles its nRSTOUT_SOC pin to reset the SoC.

---
 drivers/misc/Kconfig       |  11 ++++
 drivers/misc/Makefile      |   1 +
 drivers/misc/tps6594-esm.c | 132 +++++++++++++++++++++++++++++++++++++
 3 files changed, 144 insertions(+)
 create mode 100644 drivers/misc/tps6594-esm.c
drivers/misc/Kconfig +11 -0
index 433aa4197785..c73c02801330 100644
@@ -538,6 +538,17 @@ config TMR_INJECT
 
 	  Say N here unless you know what you are doing.
 
+config TPS6594_ESM
+	tristate "TI TPS6594 Error Signal Monitor support"
+	depends on MFD_TPS6594
+	default MFD_TPS6594
+	help
+	  Support ESM (Error Signal Monitor) on TPS6594 PMIC devices.
+	  ESM is used typically to reboot the board in error condition.
+
+	  This driver can also be built as a module.  If so, the module
+	  will be called tps6594-esm.
+
 source "drivers/misc/c2port/Kconfig"
 source "drivers/misc/eeprom/Kconfig"
 source "drivers/misc/cb710/Kconfig"
drivers/misc/Makefile +1 -0
index 56de43943cd5..3dc69ec69912 100644
@@ -65,3 +65,4 @@ obj-$(CONFIG_GP_PCI1XXXX)	+= mchp_pci1xxxx/
 obj-$(CONFIG_VCPU_STALL_DETECTOR)	+= vcpu_stall_detector.o
 obj-$(CONFIG_TMR_MANAGER)      += xilinx_tmr_manager.o
 obj-$(CONFIG_TMR_INJECT)	+= xilinx_tmr_inject.o
+obj-$(CONFIG_TPS6594_ESM)	+= tps6594-esm.o
drivers/misc/tps6594-esm.c new file +132 -0

132 lines not on this page · raw message

Signature · 1 line
2.37.3
#12 lore raw

PATCH v2 4/4 misc: tps6594-pfsm: Add driver for TI TPS6594 PFSM

In reply to Julien Panis

This PFSM controls the operational modes of the PMIC:
- STANDBY and LP_STANDBY,
- ACTIVE state,
- MCU_ONLY state,
- RETENTION state, with or without DDR and/or GPIO retention. Depending on the current operational mode, some voltage domains remain energized while others can be off.

This PFSM is also used to trigger a firmware update, and provides R/W access to device registers.

---
 .../userspace-api/ioctl/ioctl-number.rst      |   1 +
 drivers/misc/Kconfig                          |  12 +
 drivers/misc/Makefile                         |   1 +
 drivers/misc/tps6594-pfsm.c                   | 304 ++++++++++++++++++
 include/uapi/linux/tps6594_pfsm.h             |  45 +++
 5 files changed, 363 insertions(+)
 create mode 100644 drivers/misc/tps6594-pfsm.c
 create mode 100644 include/uapi/linux/tps6594_pfsm.h
Documentation/userspace-api/ioctl/ioctl-number.rst +1 -0
index 0a1882e296ae..07ff4d619db4 100644
@@ -180,6 +180,7 @@ Code  Seq#    Include File                                           Comments
 'P'   00-0F  drivers/usb/class/usblp.c                               conflict!
 'P'   01-09  drivers/misc/pci_endpoint_test.c                        conflict!
 'P'   00-0F  xen/privcmd.h                                           conflict!
+'P'   00-03  linux/tps6594_pfsm.h                                    conflict!
 'Q'   all    linux/soundcard.h
 'R'   00-1F  linux/random.h                                          conflict!
 'R'   01     linux/rfkill.h                                          conflict!
drivers/misc/Kconfig +12 -0
index c73c02801330..75e427f124b2 100644
@@ -549,6 +549,18 @@ config TPS6594_ESM
 	  This driver can also be built as a module.  If so, the module
 	  will be called tps6594-esm.
 
+config TPS6594_PFSM
+	tristate "TI TPS6594 Pre-configurable Finite State Machine support"
+	depends on MFD_TPS6594
+	default MFD_TPS6594
+	help
+	  Support PFSM (Pre-configurable Finite State Machine) on TPS6594 PMIC devices.
+	  These devices integrate a finite state machine engine, which manages the state
+	  of the device during operating state transition.
+
+	  This driver can also be built as a module.  If so, the module
+	  will be called tps6594-pfsm.
+
 source "drivers/misc/c2port/Kconfig"
 source "drivers/misc/eeprom/Kconfig"
 source "drivers/misc/cb710/Kconfig"
drivers/misc/Makefile +1 -0
index 3dc69ec69912..f2a4d1ff65d4 100644
@@ -66,3 +66,4 @@ obj-$(CONFIG_VCPU_STALL_DETECTOR)	+= vcpu_stall_detector.o
 obj-$(CONFIG_TMR_MANAGER)      += xilinx_tmr_manager.o
 obj-$(CONFIG_TMR_INJECT)	+= xilinx_tmr_inject.o
 obj-$(CONFIG_TPS6594_ESM)	+= tps6594-esm.o
+obj-$(CONFIG_TPS6594_PFSM)	+= tps6594-pfsm.o
drivers/misc/tps6594-pfsm.c new file +304 -0

304 lines not on this page · raw message

include/uapi/linux/tps6594_pfsm.h new file +45 -0

45 lines not on this page · raw message

Signature · 1 line
2.37.3
maintainer
#13 lore raw

Re: [PATCH v2 4/4] misc: tps6594-pfsm: Add driver for TI TPS6594 PFSM

Quoted 1 line · Julien Panis

+// SPDX-License-Identifier: GPL-2.0-or-later

Are you sure about "or-later"? (I have to ask.)

Quoted 4 lines

+/*
+ * PFSM (Pre-configurable Finite State Machine) driver for TI TPS6594/TPS6593/LP8764X PMICs
+ *
+ * Copyright (C) 2022 BayLibre Incorporated - https://www.baylibre.com/

It's 2023 now :)

#14 lore raw

Re: [PATCH v2 4/4] misc: tps6594-pfsm: Add driver for TI TPS6594 PFSM

Quoted 3 lines · Greg KH
Quoted 1 line · Julien Panis

+// SPDX-License-Identifier: GPL-2.0-or-later

Are you sure about "or-later"? (I have to ask.)

Some others drivers are used with it ("or-later"), even in misc directory.
But to be honest I'm not sure about the restrictions, if any. I will ask that as well.

Quoted 6 lines
Quoted 4 lines

+/*
+ * PFSM (Pre-configurable Finite State Machine) driver for TI TPS6594/TPS6593/LP8764X PMICs
+ *
+ * Copyright (C) 2022 BayLibre Incorporated - https://www.baylibre.com/

It's 2023 now :)

OK, hehe. :) I'll fix that for next version.

maintainer
#15 lore raw
In reply to Julien Panis
Quoted 34 lines · Julien Panis

TPS6594 is a Power Management IC which provides regulators and others features like GPIOs, RTC, watchdog, ESMs (Error Signal Monitor), and PFSM (Pre-configurable Finite State Machine). The SoC and the PMIC can communicate through the I2C or SPI interfaces.
TPS6594 is the super-set device while TPS6593 and LP8764X are derivatives.

This series adds support to TI TPS6594 PMIC and its derivatives.

The features implemented in this series are:
- Core (MFD I2C and SPI entry points)
- ESM (child device)
- PFSM (child device)

- Core description:
I2C and SPI interface protocols are implemented, with and without the bit-integrity error detection feature (CRC mode). In multi-PMIC configuration, all instances share a single GPIO of the SoC to generate interrupt requests via their respective nINT output pin.

- ESM description:
This device monitors the SoC error output signal at its nERR_SOC input pin. In error condition, ESM toggles its nRSTOUT_SOC pin to reset the SoC.
Basically, ESM driver starts ESM hardware.

- PFSM description:
Strictly speaking, PFSM is not hardware. It is a piece of code. PMIC integrates a state machine which manages operational modes. Depending on the current operational mode, some voltage domains remain energized while others can be off.
PFSM driver can be used to trigger transitions between configured states.

Quoted 6 lines

Link to v1:
https://lore.kernel.org/all/[email protected]/

Others series will be submitted over the next few weeks, providing drivers for others child devices like GPIOs (pinctrl), RTC, and regulators. Board support will also be added (device trees).

I don't care about the drivers, but I need a complete binding for the device to review it.

Rob