Skip to contentSkip to conversation

Add Richtek RTQ2208 SubPMIC support

PATCH Superseded [email protected] 5 participants 11 messages Jul 19, 2023 – Jul 24, 2023

Subsystems (2)

v4 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

v4 cover Add Richtek RTQ2208 SubPMIC support

From: alinayu <[email protected]>

This patch series adds support for RTQ2208 SubPMIC regulators. The RTQ2208 is a multi-phase, programmable power management IC that integrate with dual multi-configurable, synchronous buck converters and two ldos. The bucks features wide output voltage range from 0.4V to 2.05V and the capability to configure the corresponding power stages.

Thank you,
Alina yu
---
Change in v4:
- In Patch 1/2:
- Modify filename to "richtek,rtq2208"
- Add more desciptions for "regulator-allowed-modes"
Change in v3:
- In Patch 1/2:
- Fix some typos
- Modify the descriptions for "richtek,mtp-sel"
- Modify the node name to lowercase and remove underscore
- Remove '|' from description
- Remove "regulator-compatible" from property
- Remove "regulator-state-mem" from pattern
- Modify node name to generic one
---
alinayu (2):
regulator: dt-bindings: rtq2208: Add Richtek RTQ2208 SubPMIC
regulator: rtq2208: Add Richtek RTQ2208 SubPMIC driver

 .../bindings/regulator/richtek,rtq2208.yaml        | 208 ++++++++
 drivers/regulator/Kconfig                          |  11 +
 drivers/regulator/Makefile                         |   1 +
 drivers/regulator/rtq2208-regulator.c              | 538 +++++++++++++++++++++
 4 files changed, 758 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/regulator/richtek,rtq2208.yaml
 create mode 100644 drivers/regulator/rtq2208-regulator.c
Signature · 1 line
2.7.4
#1 lore raw

PATCH v4 1/2 regulator: dt-bindings: rtq2208: Add Richtek RTQ2208 SubPMIC

From: alinayu <[email protected]>

Add bindings for Richtek RTQ2208 IC controlled SubPMIC

---
v4
- Modify filename to "richtek,rtq2208"
- Add more desciptions for "regulator-allowed-modes"

---
 .../bindings/regulator/richtek,rtq2208.yaml        | 208 +++++++++++++++++++++
 1 file changed, 208 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/regulator/richtek,rtq2208.yaml
Documentation/devicetree/bindings/regulator/richtek,rtq2208.yaml new file +208 -0
new file mode 100644
index 0000000..6cc441f
@@ -0,0 +1,208 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/regulator/richtek,rtq2208-regulator.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Richtek RTQ2208 SubPMIC Regulator
+
+maintainers:
+  - Alina Yu <[email protected]>
+
+description: |
+  RTQ2208 is a highly integrated power converter that offers functional safety dual
+  multi-configurable synchronous buck converters and two LDOs.
+
+  Bucks support "regulator-allowed-modes" and "regulator-mode". The former defines the permitted
+  switching operation in normal mode; the latter defines the operation in suspend to RAM mode.
+
+  No matter the RTQ2208 is configured to normal or suspend to RAM mode, there are two switching
+  operation modes for all buck rails, automatic power saving mode (Auto mode) and forced continuous
+  conduction mode (FCCM).
+
+  The definition of modes is in the datasheet which is available in below link
+  and their meaning is::
+    0 - Auto mode for power saving, which reducing the switching frequency at light load condition
+    to maintain high frequency.
+    1 - FCCM to meet the strict voltage regulation accuracy, which keeping constant switching frequency.
+
+  Datasheet will be available soon at
+  https://www.richtek.com/assets/Products
+
+properties:
+  compatible:
+    enum:
+      - richtek,rtq2208
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+    
+  richtek,mtp-sel:
+    type: boolean
+    description:
+      vout register selection based on this boolean value.
+      false - Using DVS0 register setting to adjust vout
+      true - Using DVS1 register setting to adjust vout
+
+  regulators:
+    type: object
+
+    patternProperties:
+      "^buck-[a-h]$":
+        type: object
+        $ref: regulator.yaml#
+        unevaluatedProperties: false
+        description:
+          description for buck-[a-h] regulator.
+
+        properties:
+          regulator-allowed-modes:
+            description:
+              two buck modes in different switching accuracy.
+              0 - Auto mode
+              1 - FCCM
+            items:
+              enum: [0, 1]
+
+          regulator-mode:
+            enum: [0, 1]
+            description:
+              describe buck initial operating mode in suspend state.
+
+      "^ldo[1-2]$":
+        type: object
+        $ref: regulator.yaml#
+        description:
+          regulator description for ldo[1-2].
+
+        properties:
+          regulator-compatible:
+            pattern: "^LDO[1-2]$"
+
+          richtek,fixed-uV:
+            $ref: "/schemas/types.yaml#/definitions/uint32"
+            enum: [ 900000, 1200000, 1800000, 3300000 ]
+            description:
+              the fixed voltage in micro volt which is decided at the factory.
+
+required:
+  - compatible
+  - reg
+  - regulators
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    i2c {
+      #address-cells = <1>;
+      #size-cells = <0>;
+
+      pmic@10 {
+        compatible = "richtek,rtq2208";
+        reg = <0x10>;
+        interrupts-extended = <&gpio26 0 IRQ_TYPE_LEVEL_LOW>;
+        richtek,mtp-sel;
+
+        regulators {
+         buck-a {
+            regulator-min-microvolt = <400000>;
+            regulator-max-microvolt = <2050000>;
+            regulator-allowed-modes = <0 1>;
+            regulator-always-on;
+            regulator-state-mem {
+              regulator-on-in-suspend;
+              regulator-mode = <1>;
+            };
+          };
+         buck-b {
+            regulator-min-microvolt = <400000>;
+            regulator-max-microvolt = <2050000>;
+            regulator-allowed-modes = <0 1>;
+            regulator-always-on;
+            regulator-state-mem {
+              regulator-on-in-suspend;
+              regulator-mode = <1>;
+            };
+          };
+         buck-c {
+            regulator-min-microvolt = <400000>;
+            regulator-max-microvolt = <2050000>;
+            regulator-allowed-modes = <0 1>;
+            regulator-always-on;
+            regulator-state-mem {
+              regulator-on-in-suspend;
+              regulator-mode = <1>;
+            };
+          };
+         buck-d {
+            regulator-min-microvolt = <400000>;
+            regulator-max-microvolt = <2050000>;
+            regulator-allowed-modes = <0 1>;
+            regulator-always-on;
+            regulator-state-mem {
+              regulator-on-in-suspend;
+              regulator-mode = <1>;
+            };
+          };
+         buck-e {
+            regulator-min-microvolt = <400000>;
+            regulator-max-microvolt = <2050000>;
+            regulator-allowed-modes = <0 1>;
+            regulator-always-on;
+            regulator-state-mem {
+              regulator-on-in-suspend;
+              regulator-mode = <1>;
+            };
+          };
+         buck-f {
+            regulator-min-microvolt = <400000>;
+            regulator-max-microvolt = <2050000>;
+            regulator-allowed-modes = <0 1>;
+            regulator-always-on;
+            regulator-state-mem {
+              regulator-on-in-suspend;
+              regulator-mode = <1>;
+            };
+          };
+         buck-g {
+            regulator-min-microvolt = <400000>;
+            regulator-max-microvolt = <2050000>;
+            regulator-allowed-modes = <0 1>;
+            regulator-always-on;
+            regulator-state-mem {
+              regulator-on-in-suspend;
+              regulator-mode = <1>;
+            };
+          };
+         buck-h {
+            regulator-min-microvolt = <400000>;
+            regulator-max-microvolt = <2050000>;
+            regulator-allowed-modes = <0 1>;
+            regulator-always-on;
+            regulator-state-mem {
+              regulator-on-in-suspend;
+              regulator-mode = <1>;
+            };
+          };
+         ldo1 {
+            richtek,fixed-uV = <1200000>;
+            regulator-always-on;
+            regulator-state-mem {
+              regulator-on-in-suspend;
+            };
+          };
+         ldo2 {
+            regulator-always-on;
+            richtek,fixed-uV = <3300000>;
+            regulator-state-mem {
+              regulator-on-in-suspend;
+            };
+          };
+        };
+      };
+    };
Signature · 1 line
2.7.4
#2 lore raw

Re: [PATCH v4 1/2] regulator: dt-bindings: rtq2208: Add Richtek RTQ2208 SubPMIC

Quoted 20 lines · On 19/07/2023 11:24, [email protected] wrote:

From: alinayu <[email protected]>

Add bindings for Richtek RTQ2208 IC controlled SubPMIC

---
v4
- Modify filename to "richtek,rtq2208"
- Add more desciptions for "regulator-allowed-modes"

---
 .../bindings/regulator/richtek,rtq2208.yaml        | 208 +++++++++++++++++++++
 1 file changed, 208 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/regulator/richtek,rtq2208.yaml
Documentation/devicetree/bindings/regulator/richtek,rtq2208.yaml new file +0 -0
new file mode 100644
index 0000000..6cc441f

Documentation/devicetree/bindings/regulator/richtek,rtq2208.yaml line 4

Quoted 4 lines
Documentation/devicetree/bindings/regulator/richtek,rtq2208.yaml new file +4 -0
@@ -0,0 +1,208 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/regulator/richtek,rtq2208-regulator.yaml#

Please test the patch before sending.

It does not look like you tested the bindings, at least after quick look. Please run make dt_binding_check (see Documentation/devicetree/bindings/writing-schema.rst for instructions).

Also, one patchset version per day... give people time to review.

Quoted 59 lines
Documentation/devicetree/bindings/regulator/richtek,rtq2208.yaml new file +59 -0
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Richtek RTQ2208 SubPMIC Regulator
+
+maintainers:
+  - Alina Yu <[email protected]>
+
+description: |
+  RTQ2208 is a highly integrated power converter that offers functional safety dual
+  multi-configurable synchronous buck converters and two LDOs.
+
+  Bucks support "regulator-allowed-modes" and "regulator-mode". The former defines the permitted
+  switching operation in normal mode; the latter defines the operation in suspend to RAM mode.
+
+  No matter the RTQ2208 is configured to normal or suspend to RAM mode, there are two switching
+  operation modes for all buck rails, automatic power saving mode (Auto mode) and forced continuous
+  conduction mode (FCCM).
+
+  The definition of modes is in the datasheet which is available in below link
+  and their meaning is::
+    0 - Auto mode for power saving, which reducing the switching frequency at light load condition
+    to maintain high frequency.
+    1 - FCCM to meet the strict voltage regulation accuracy, which keeping constant switching frequency.
+
+  Datasheet will be available soon at
+  https://www.richtek.com/assets/Products
+
+properties:
+  compatible:
+    enum:
+      - richtek,rtq2208
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+    
+  richtek,mtp-sel:
+    type: boolean
+    description:
+      vout register selection based on this boolean value.
+      false - Using DVS0 register setting to adjust vout
+      true - Using DVS1 register setting to adjust vout
+
+  regulators:
+    type: object
+
+    patternProperties:
+      "^buck-[a-h]$":
+        type: object
+        $ref: regulator.yaml#
+        unevaluatedProperties: false
+        description:
+          description for buck-[a-h] regulator.
+
+        properties:
+          regulator-allowed-modes:
+            description:

Documentation/devicetree/bindings/regulator/richtek,rtq2208.yaml line 73

Quoted 10 lines
Documentation/devicetree/bindings/regulator/richtek,rtq2208.yaml new file +10 -0
+              two buck modes in different switching accuracy.
+              0 - Auto mode
+              1 - FCCM
+            items:
+              enum: [0, 1]
+
+          regulator-mode:
+            enum: [0, 1]
+            description:
+              describe buck initial operating mode in suspend state.

There is no such property on this level. Aren't you mixing initial one?

Documentation/devicetree/bindings/regulator/richtek,rtq2208.yaml line 77

Quoted 4 lines
Documentation/devicetree/bindings/regulator/richtek,rtq2208.yaml new file +4 -0
+
+      "^ldo[1-2]$":
+        type: object
+        $ref: regulator.yaml#

Missing unevaluatedProperties: false.

Documentation/devicetree/bindings/regulator/richtek,rtq2208.yaml line 86

Quoted 9 lines
Documentation/devicetree/bindings/regulator/richtek,rtq2208.yaml new file +9 -0
+        description:
+          regulator description for ldo[1-2].
+
+        properties:
+          regulator-compatible:
+            pattern: "^LDO[1-2]$"
+
+          richtek,fixed-uV:
+            $ref: "/schemas/types.yaml#/definitions/uint32"

This is pointed out by schema, so standard text:
It does not look like you tested the bindings, at least after quick look. Please run make dt_binding_check (see Documentation/devicetree/bindings/writing-schema.rst for instructions). Maybe you need to update your dtschema and yamllint.

Documentation/devicetree/bindings/regulator/richtek,rtq2208.yaml line 89

Quoted 3 lines
Documentation/devicetree/bindings/regulator/richtek,rtq2208.yaml new file +3 -0
+            enum: [ 900000, 1200000, 1800000, 3300000 ]
+            description:
+              the fixed voltage in micro volt which is decided at the factory.

I don't understand this property. Why this is different from min/max microvolt? Plus, you use incorrect unit suffix.

Documentation/devicetree/bindings/regulator/richtek,rtq2208.yaml line 96

Quoted 7 lines
Documentation/devicetree/bindings/regulator/richtek,rtq2208.yaml new file +7 -0
+
+required:
+  - compatible
+  - reg
+  - regulators
+
+unevaluatedProperties: false

Instead: additionalProperties: false

Quoted 6 lines
Documentation/devicetree/bindings/regulator/richtek,rtq2208.yaml new file +6 -0
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    i2c {
+      #address-cells = <1>;

Documentation/devicetree/bindings/regulator/richtek,rtq2208.yaml line 112

Quoted 10 lines
Documentation/devicetree/bindings/regulator/richtek,rtq2208.yaml new file +10 -0
+      #size-cells = <0>;
+
+      pmic@10 {
+        compatible = "richtek,rtq2208";
+        reg = <0x10>;
+        interrupts-extended = <&gpio26 0 IRQ_TYPE_LEVEL_LOW>;
+        richtek,mtp-sel;
+
+        regulators {
+         buck-a {

Wrong indentation. If you use 2 spaces, use it consistently.

Quoted 3 lines
Documentation/devicetree/bindings/regulator/richtek,rtq2208.yaml new file +3 -0
+            regulator-min-microvolt = <400000>;
+            regulator-max-microvolt = <2050000>;
+            regulator-allowed-modes = <0 1>;

...

Documentation/devicetree/bindings/regulator/richtek,rtq2208.yaml line 200

Quoted 3 lines
Documentation/devicetree/bindings/regulator/richtek,rtq2208.yaml new file +3 -0
+          };
+         ldo2 {
+            regulator-always-on;

And three spaces here?

Documentation/devicetree/bindings/regulator/richtek,rtq2208.yaml line 208

Quoted 8 lines
Documentation/devicetree/bindings/regulator/richtek,rtq2208.yaml new file +8 -0
+            richtek,fixed-uV = <3300000>;
+            regulator-state-mem {
+              regulator-on-in-suspend;
+            };
+          };
+        };
+      };
+    };

Best regards,
Krzysztof

author
#3 lore raw

Re: [PATCH v4 1/2] regulator: dt-bindings: rtq2208: Add Richtek RTQ2208 SubPMIC

Hi,
Krzysztof:

Quoted 10 lines · Krzysztof Kozlowski
Quoted 9 lines · On 19/07/2023 11:24, [email protected] wrote:

From: alinayu <[email protected]>

Add bindings for Richtek RTQ2208 IC controlled SubPMIC

---
v4
- Modify filename to "richtek,rtq2208"
- Add more desciptions for "regulator-allowed-modes"

...

Quoted 7 lines

Documentation/devicetree/bindings/regulator/richtek,rtq2208.yaml line 73

Quoted 5 lines
Documentation/devicetree/bindings/regulator/richtek,rtq2208.yaml new file +5 -0
+
+          regulator-mode:
+            enum: [0, 1]
+            description:
+              describe buck initial operating mode in suspend state.

There is no such property on this level. Aren't you mixing initial one?

It's the initial mode in suspend-mem state, should I modify that like this ?

        patternProperties:
          "^regulator-state-(standby|mem|disk)$":
	    type: object
	    $ref: regulator.yaml#
	    properties:
	      regulator-mode:
	        enum: [0, 1]
		description:
                  describe byck initial operating mode in suspend state.

...

Quoted 6 lines

Documentation/devicetree/bindings/regulator/richtek,rtq2208.yaml line 89

Quoted 4 lines
Documentation/devicetree/bindings/regulator/richtek,rtq2208.yaml new file +3 -0
+            enum: [ 900000, 1200000, 1800000, 3300000 ]
+            description:
+              the fixed voltage in micro volt which is decided at the factory.

I don't understand this property. Why this is different from min/max

Because ldo has fixed voltage, so I thinks I could use a property to represent the fixed voltage directly. Do you suggest me modifying that like this:

regulator-min-microvolt = <900000>;
regulator-max-microvolt = <900000>;

Using min voltage equals to max voltage to represent fixed voltage, instead of self-defined property ?

Quoted 1 line

microvolt? Plus, you use incorrect unit suffix.

if I change "richtek,fixed-uV" to "richtek, fixed-microvolt", will it be a correct unit suffix ?

Best regards,
Alina

#4 lore raw

Re: [PATCH v4 1/2] regulator: dt-bindings: rtq2208: Add Richtek RTQ2208 SubPMIC

Quoted 26 lines · Alina Yu

Hi,
Krzysztof:

Quoted 10 lines · Krzysztof Kozlowski
Quoted 9 lines · On 19/07/2023 11:24, [email protected] wrote:

From: alinayu <[email protected]>

Add bindings for Richtek RTQ2208 IC controlled SubPMIC

---
v4
- Modify filename to "richtek,rtq2208"
- Add more desciptions for "regulator-allowed-modes"

...

Quoted 7 lines

Documentation/devicetree/bindings/regulator/richtek,rtq2208.yaml line 73

Quoted 5 lines
Documentation/devicetree/bindings/regulator/richtek,rtq2208.yaml new file +5 -0
+
+          regulator-mode:
+            enum: [0, 1]
+            description:
+              describe buck initial operating mode in suspend state.

There is no such property on this level. Aren't you mixing initial one?

It's the initial mode in suspend-mem state, should I modify that like this ?

Quoted 9 lines
        patternProperties:
          "^regulator-state-(standby|mem|disk)$":
	    type: object
	    $ref: regulator.yaml#
	    properties:
	      regulator-mode:
	        enum: [0, 1]
		description:
                  describe byck initial operating mode in suspend state.

Please check how other bindings do it.

Quoted 10 lines

...

Quoted 6 lines

Documentation/devicetree/bindings/regulator/richtek,rtq2208.yaml line 89

Quoted 4 lines
Documentation/devicetree/bindings/regulator/richtek,rtq2208.yaml new file +3 -0
+            enum: [ 900000, 1200000, 1800000, 3300000 ]
+            description:
+              the fixed voltage in micro volt which is decided at the factory.

I don't understand this property. Why this is different from min/max

Quoted 7 lines

Because ldo has fixed voltage, so I thinks I could use a property to represent the fixed voltage directly. Do you suggest me modifying that like this:

regulator-min-microvolt = <900000>;
regulator-max-microvolt = <900000>;

Using min voltage equals to max voltage to represent fixed voltage, instead of self-defined property ?

Yes.

Best regards,
Krzysztof

author
#5 lore raw

Re: [PATCH v4 1/2] regulator: dt-bindings: rtq2208: Add Richtek RTQ2208 SubPMIC

Hi,
Krzysztof:

Quoted 21 lines
Quoted 11 lines

...

Quoted 7 lines

Documentation/devicetree/bindings/regulator/richtek,rtq2208.yaml line 73

Quoted 5 lines
Documentation/devicetree/bindings/regulator/richtek,rtq2208.yaml new file +5 -0
+
+          regulator-mode:
+            enum: [0, 1]
+            description:
+              describe buck initial operating mode in suspend state.

There is no such property on this level. Aren't you mixing initial one?

It's the initial mode in suspend-mem state, should I modify that like this ?

Quoted 9 lines
        patternProperties:
          "^regulator-state-(standby|mem|disk)$":
	    type: object
	    $ref: regulator.yaml#
	    properties:
	      regulator-mode:
	        enum: [0, 1]
		description:
                  describe byck initial operating mode in suspend state.
Quoted 2 lines

Please check how other bindings do it.

If I modify that like this, will it be correct ?

...
regulator-state-mem:
type: object
$ref: regulator.yaml#
properties:
regulator-mode:
description:
describe buck initial operating mode in suspend state. 0 - Auto mode
1 - FCCM

Best regards,
Alina

author
#6 lore raw

Re: [PATCH v4 1/2] regulator: dt-bindings: rtq2208: Add Richtek RTQ2208 SubPMIC

Hi,
Krzysztof:

Quoted 27 lines
Quoted 21 lines
Quoted 11 lines

...

Quoted 7 lines

Documentation/devicetree/bindings/regulator/richtek,rtq2208.yaml line 73

Quoted 5 lines
Documentation/devicetree/bindings/regulator/richtek,rtq2208.yaml new file +5 -0
+
+          regulator-mode:
+            enum: [0, 1]
+            description:
+              describe buck initial operating mode in suspend state.

There is no such property on this level. Aren't you mixing initial one?

It's the initial mode in suspend-mem state, should I modify that like this ?

Quoted 9 lines
        patternProperties:
          "^regulator-state-(standby|mem|disk)$":
	    type: object
	    $ref: regulator.yaml#
	    properties:
	      regulator-mode:
	        enum: [0, 1]
		description:
                  describe byck initial operating mode in suspend state.
Quoted 2 lines

Please check how other bindings do it.

If I modify that like this, will it be correct ?

Quoted 11 lines

...
regulator-state-mem:
type: object
$ref: regulator.yaml#
properties:
regulator-mode:
description:
describe buck initial operating mode in suspend state. 0 - Auto mode
1 - FCCM

Sorry, I think I didn't explain well why to add "regulator-mode".
I just want to add description for this property, for people can get its meaning when they see the yaml. If it's optional and it's already a general property in regulator.yaml.
May I remove it from my yaml ?

Best regards,
Alina

maintainer
#7 lore raw

Re: [PATCH v4 1/2] regulator: dt-bindings: rtq2208: Add Richtek RTQ2208 SubPMIC

In reply to [email protected]
Quoted 5 lines · On Wed, 19 Jul 2023 17:24:45 +0800, [email protected] wrote:

From: alinayu <[email protected]>

Add bindings for Richtek RTQ2208 IC controlled SubPMIC

Quoted 9 lines

---
v4
- Modify filename to "richtek,rtq2208"
- Add more desciptions for "regulator-allowed-modes"

---
 .../bindings/regulator/richtek,rtq2208.yaml        | 208 +++++++++++++++++++++
 1 file changed, 208 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/regulator/richtek,rtq2208.yaml

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check' on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/regulator/richtek,rtq2208.yaml: $id: Cannot determine base path from $id, relative path/filename doesn't match actual path or filename
$id: http://devicetree.org/schemas/regulator/richtek,rtq2208-regulator.yaml
file: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/regulator/richtek,rtq2208.yaml

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/[email protected]

The base for the series is generally the latest rc1. A different dependency should be noted in *this* patch.

If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date:

pip3 install dtschema --upgrade

Please check and re-submit after running the above command yourself. Note that DT_SCHEMA_FILES can be set to your schema file to speed up checking your schema. However, it must be unset to test all examples with your schema.

#8 lore raw

PATCH v4 2/2 regulator: rtq2208: Add Richtek RTQ2208 SubPMIC driver

In reply to [email protected]

From: alinayu <[email protected]>

Add support for the RTQ2208 SubPMIC
This ic integrates with configurable, synchrnous buck converters and two ldos.

---
 drivers/regulator/Kconfig             |  11 +
 drivers/regulator/Makefile            |   1 +
 drivers/regulator/rtq2208-regulator.c | 538 ++++++++++++++++++++++++++++++++++
 3 files changed, 550 insertions(+)
 create mode 100644 drivers/regulator/rtq2208-regulator.c
drivers/regulator/Kconfig +11 -0
index e5f3613..a6b2c84 100644
@@ -1213,6 +1213,17 @@ config REGULATOR_RTQ6752
 	  synchronous boost converters for PAVDD, and one synchronous NAVDD
 	  buck-boost. This device is suitable for automotive TFT-LCD panel.
 
+config REGULATOR_RTQ2208
+	tristate "Richtek RTQ2208 SubPMIC Regulator"
+	depends on I2C
+	select REGMAP_I2C
+	help
+	  This driver adds support for RTQ2208 SubPMIC regulators.
+	  The RTQ2208 is a multi-phase, programmable power management IC that
+	  integrate with dual multi-configurable, synchronous buck converters
+	  and two ldos. It features wide output voltage range from 0.4V to 2.05V
+	  and the capability to configure the corresponding power stages.
+
 config REGULATOR_S2MPA01
 	tristate "Samsung S2MPA01 voltage regulator"
 	depends on MFD_SEC_CORE || COMPILE_TEST
drivers/regulator/Makefile +1 -0
index 58dfe01..04cbad17 100644
@@ -143,6 +143,7 @@ obj-$(CONFIG_REGULATOR_RT6245)	+= rt6245-regulator.o
 obj-$(CONFIG_REGULATOR_RTMV20)	+= rtmv20-regulator.o
 obj-$(CONFIG_REGULATOR_RTQ2134) += rtq2134-regulator.o
 obj-$(CONFIG_REGULATOR_RTQ6752)	+= rtq6752-regulator.o
+obj-$(CONFIG_REGULATOR_RTQ2208) += rtq2208-regulator.o
 obj-$(CONFIG_REGULATOR_S2MPA01) += s2mpa01.o
 obj-$(CONFIG_REGULATOR_S2MPS11) += s2mps11.o
 obj-$(CONFIG_REGULATOR_S5M8767) += s5m8767.o
drivers/regulator/rtq2208-regulator.c new file +538 -0

538 lines not on this page · raw message

Signature · 1 line
2.7.4
maintainer
#9 lore raw

Re: [PATCH v4 2/2] regulator: rtq2208: Add Richtek RTQ2208 SubPMIC driver

Quoted 2 lines · On Wed, Jul 19, 2023 at 05:24:46PM +0800, [email protected] wrote:

From: alinayu <[email protected]>

It'd be better to format this like you do in your e-mail and signoff so that git doesn't generate the extra line and the logs look a bit neater (there might also be some warnings about signoffs due to the mismatch). 'git commit --amend --author=' should help.

Quoted 2 lines

Add support for the RTQ2208 SubPMIC
This ic integrates with configurable, synchrnous buck converters and two ldos.

The driver looks good, just needs the bindings sorting.

#10 lore raw

Re: [PATCH v4 2/2] regulator: rtq2208: Add Richtek RTQ2208 SubPMIC driver

In reply to [email protected]
kernel test robot noticed the following build errors:

Hi,

kernel test robot noticed the following build errors:

[auto build test ERROR on broonie-regulator/for-next]
[also build test ERROR on linus/master v6.5-rc2 next-20230720] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/alina_yu-richtek-com/regulator-dt-bindings-rtq2208-Add-Richtek-RTQ2208-SubPMIC/20230719-172722
base:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-next
patch link:    https://lore.kernel.org/r/1689758686-14409-3-git-send-email-alina_yu%40richtek.com
patch subject: [PATCH v4 2/2] regulator: rtq2208: Add Richtek RTQ2208 SubPMIC driver
config: s390-allmodconfig (https://download.01.org/0day-ci/archive/20230721/[email protected]/config)
compiler: s390-linux-gcc (GCC) 12.3.0
reproduce: (https://download.01.org/0day-ci/archive/20230721/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

drivers/regulator/rtq2208-regulator.c: In function 'rtq2208_set_ramp_delay':

>> drivers/regulator/rtq2208-regulator.c:154:15: error: implicit declaration of function 'FIELD_PREP' [-Werror=implicit-function-declaration]
     154 |         val = FIELD_PREP(RTQ2208_BUCK_RSPUP_MASK, sel) | FIELD_PREP(RTQ2208_BUCK_RSPDN_MASK, sel);
         |               ^~~~~~~~~~

cc1: some warnings being treated as errors

vim +/FIELD_PREP +154 drivers/regulator/rtq2208-regulator.c

124
125 static int rtq2208_set_ramp_delay(struct regulator_dev *rdev, int ramp_delay)
126 {
127 const struct regulator_desc *rdesc = rdev->desc;
128 unsigned int sel = 0, val;
129
130 ramp_delay = max(ramp_delay, RTQ2208_RAMP_VALUE_MIN_uV);
131 ramp_delay = min(ramp_delay, RTQ2208_RAMP_VALUE_MAX_uV);
132
133 ramp_delay /= RTQ2208_RAMP_VALUE_MIN_uV;
134
135 /*
136 * fls(ramp_delay) - 1: doing LSB shift, let it starts from 0
137 *
138 * RTQ2208_BUCK_RAMP_SEL_MASK - sel: doing descending order shifting.
139 * Because the relation of seleltion and value is like that
140 *
141 * seletion: value
142 * 000: 64mv
143 * 001: 32mv
144 * ...
145 * 111: 0.5mv
146 *
147 * For example, if I would like to select 64mv, the fls(ramp_delay) - 1 will be 0b111,
148 * and I need to use 0b111 - sel to do the shifting
149 */
150
151 sel = fls(ramp_delay) - 1;
152 sel = RTQ2208_BUCK_RAMP_SEL_MASK - sel;
153

 > 154		val = FIELD_PREP(RTQ2208_BUCK_RSPUP_MASK, sel) | FIELD_PREP(RTQ2208_BUCK_RSPDN_MASK, sel);

155
156 return regmap_update_bits(rdev->regmap, rdesc->ramp_reg,
157 RTQ2208_BUCK_RSPUP_MASK | RTQ2208_BUCK_RSPDN_MASK, val);
158 }
159

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki