Skip to contentSkip to conversation

DA9121 regulator support

PATCH In review Vincent Whitchurch 3 participants 7 messages Nov 3, 2020 – Nov 20, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

v2 cover DA9121 regulator support

This series adds support for the DA9121, a "High-Performance, 10 A, Dual-Phase DC-DC Converter". The datasheet is currently available here:

https://www.dialog-semiconductor.com/sites/default/files/da9121_datasheet_2v3.pdf

v2:
- Let the core get the constraints itself from a subnode in the device tree.

Vincent Whitchurch (2):
dt-bindings: regulator: Add DA9121
regulator: Add support for DA9121 regulator

 .../bindings/regulator/dlg,da9121.yaml        |  47 ++++++++
 drivers/regulator/Kconfig                     |  12 ++
 drivers/regulator/Makefile                    |   1 +
 drivers/regulator/da9121-regulator.c          | 108 ++++++++++++++++++
 4 files changed, 168 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/regulator/dlg,da9121.yaml
 create mode 100644 drivers/regulator/da9121-regulator.c
Signature · 1 line
2.28.0
#1 lore raw

PATCH v2 1/2 dt-bindings: regulator: Add DA9121

Add bindings for the Dialog Semiconductor DA9121 voltage regulator.

---
 .../bindings/regulator/dlg,da9121.yaml        | 47 +++++++++++++++++++
 1 file changed, 47 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/regulator/dlg,da9121.yaml
Documentation/devicetree/bindings/regulator/dlg,da9121.yaml new file +47 -0
new file mode 100644
index 000000000000..cde0d82dd201
@@ -0,0 +1,47 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/regulator/dlg,da9121.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Dialog Semiconductor DA9121 voltage regulator
+
+maintainers:
+  - Vincent Whitchurch <[email protected]>
+
+properties:
+  compatible:
+    const: dlg,da9121
+
+  reg:
+    maxItems: 1
+
+  buck1:
+    description:
+      Initial data for the Buck1 regulator.
+    $ref: "regulator.yaml#"
+    type: object
+
+unevaluatedProperties: false
+
+required:
+  - compatible
+  - reg
+
+examples:
+  - |
+    i2c {
+      #address-cells = <1>;
+      #size-cells = <0>;
+      regulator@68 {
+        compatible = "dlg,da9121";
+        reg = <0x68>;
+
+        buck1 {
+          regulator-min-microvolt = <680000>;
+          regulator-max-microvolt = <820000>;
+        };
+      };
+    };
+
+...
Signature · 1 line
2.28.0
maintainer
#2 lore raw

Re: [PATCH v2 1/2] dt-bindings: regulator: Add DA9121

Quoted 8 lines · Vincent Whitchurch

Add bindings for the Dialog Semiconductor DA9121 voltage regulator.

---
 .../bindings/regulator/dlg,da9121.yaml        | 47 +++++++++++++++++++
 1 file changed, 47 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/regulator/dlg,da9121.yaml

My bot found errors running 'make dt_binding_check' on your patch:

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/regulator/dlg,da9121.yaml: 'additionalProperties' is a required property /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/regulator/dlg,da9121.yaml: ignoring, error in schema:
warning: no schema found in file: ./Documentation/devicetree/bindings/regulator/dlg,da9121.yaml

See https://patchwork.ozlabs.org/patch/1392753

The base for the patch is generally the last rc1. Any dependencies should be noted.

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.

#3 lore raw

Re: [PATCH v2 1/2] dt-bindings: regulator: Add DA9121

Quoted 12 lines · Rob Herring
Quoted 8 lines · Vincent Whitchurch

Add bindings for the Dialog Semiconductor DA9121 voltage regulator.

---
 .../bindings/regulator/dlg,da9121.yaml        | 47 +++++++++++++++++++
 1 file changed, 47 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/regulator/dlg,da9121.yaml

My bot found errors running 'make dt_binding_check' on your patch:

Quoted 8 lines

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/regulator/dlg,da9121.yaml: 'additionalProperties' is a required property /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/regulator/dlg,da9121.yaml: ignoring, error in schema:
warning: no schema found in file: ./Documentation/devicetree/bindings/regulator/dlg,da9121.yaml

See https://patchwork.ozlabs.org/patch/1392753

OK, thanks. I'll fix it by changing the unevaluatedProperties to an additionalProperties (since the $ref has moved).

I think I should also move the unevaluatedProperties to the buck1 level instead of removing it completely, because I see a bunch of other regulator bindings doing it, but the checks don't complain about that being missing and I can't see that making any difference for the validation.

For example, I was hoping that this:

buck1:
description:
Initial data for the Buck1 regulator.
$ref: "regulator.yaml#"
type: object
unevaluatedProperties: false

would complain about something like:

        buck1 {
	  not-a-real-property;
          regulator-min-microvolt = <680000>;
          regulator-max-microvolt = <820000>;
        };

but it doesn't, so I don't quite understand what "unevaluatedProperties:
false" prevents.

Quoted 9 lines

The base for the patch is generally the last rc1. Any dependencies should be noted.

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

Not sure if it's just something wrong in my setup, but I had dtschema installed from master a while ago, and the above command didn't upgrade it for me. I had to explicitly upgrade it with the full URL again to get the latest version:

pip3 install --upgrade git+https://github.com/devicetree-org/dt-schema.git@master

maintainer
#4 lore raw

Re: [PATCH v2 1/2] dt-bindings: regulator: Add DA9121

Quoted 23 lines · Vincent Whitchurch
Quoted 12 lines · Rob Herring
Quoted 8 lines · Vincent Whitchurch

Add bindings for the Dialog Semiconductor DA9121 voltage regulator.

---
 .../bindings/regulator/dlg,da9121.yaml        | 47 +++++++++++++++++++
 1 file changed, 47 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/regulator/dlg,da9121.yaml

My bot found errors running 'make dt_binding_check' on your patch:

Quoted 8 lines

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/regulator/dlg,da9121.yaml: 'additionalProperties' is a required property /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/regulator/dlg,da9121.yaml: ignoring, error in schema:
warning: no schema found in file: ./Documentation/devicetree/bindings/regulator/dlg,da9121.yaml

See https://patchwork.ozlabs.org/patch/1392753

Quoted 8 lines

OK, thanks. I'll fix it by changing the unevaluatedProperties to an additionalProperties (since the $ref has moved).

I think I should also move the unevaluatedProperties to the buck1 level instead of removing it completely, because I see a bunch of other regulator bindings doing it, but the checks don't complain about that being missing and I can't see that making any difference for the validation.

Because the meta-schema is not recursing down levels. It probably should, but that's another round of fixing all the current cases. And the top-level is more well defined as to what the structure is (IOW, we might not be able to define a rule that works everywhere).

Quoted 11 lines

For example, I was hoping that this:

buck1:
description:
Initial data for the Buck1 regulator.
$ref: "regulator.yaml#"
type: object
unevaluatedProperties: false

would complain about something like:

Quoted 8 lines
        buck1 {
          not-a-real-property;
          regulator-min-microvolt = <680000>;
          regulator-max-microvolt = <820000>;
        };

but it doesn't, so I don't quite understand what "unevaluatedProperties:
false" prevents.

That's because it's currently a nop as the Python jsonschema package doesn't yet support 2019.09 version of jsonschema.

If you aren't defining properties in addition to what's defined by a $ref, then use additionalProperties.

Rob

#5 lore raw

PATCH v2 2/2 regulator: Add support for DA9121 regulator

In reply to Vincent Whitchurch

Add support for the Dialog Semiconductor DA9121, a single-channel dual-phase buck converter controlled via I2C.

---
 drivers/regulator/Kconfig            |  12 +++
 drivers/regulator/Makefile           |   1 +
 drivers/regulator/da9121-regulator.c | 108 +++++++++++++++++++++++++++
 3 files changed, 121 insertions(+)
 create mode 100644 drivers/regulator/da9121-regulator.c
drivers/regulator/Kconfig +12 -0
index 020a00d6696b..005a6036dd38 100644
@@ -303,6 +303,18 @@ config REGULATOR_DA9063
 	  This driver can also be built as a module. If so, the module
 	  will be called da9063-regulator.
 
+config REGULATOR_DA9121
+	tristate "Dialog Semiconductor DA9121 regulator"
+	depends on I2C && OF
+	select REGMAP_I2C
+	help
+	  Say y here to support for the Dialog Semiconductor DA9121.  The
+	  DA9210 is a dual-phase buck converter controlled through an I2C
+	  interface.
+
+	  This driver can also be built as a module. If so, the module
+	  will be called da9121-regulator.
+
 config REGULATOR_DA9210
 	tristate "Dialog Semiconductor DA9210 regulator"
 	depends on I2C
drivers/regulator/Makefile +1 -0
index 6ebae516258e..6096862a1d60 100644
@@ -38,6 +38,7 @@ obj-$(CONFIG_REGULATOR_DA9052)	+= da9052-regulator.o
 obj-$(CONFIG_REGULATOR_DA9055)	+= da9055-regulator.o
 obj-$(CONFIG_REGULATOR_DA9062)	+= da9062-regulator.o
 obj-$(CONFIG_REGULATOR_DA9063)	+= da9063-regulator.o
+obj-$(CONFIG_REGULATOR_DA9121) += da9121-regulator.o
 obj-$(CONFIG_REGULATOR_DA9210) += da9210-regulator.o
 obj-$(CONFIG_REGULATOR_DA9211) += da9211-regulator.o
 obj-$(CONFIG_REGULATOR_DBX500_PRCMU) += dbx500-prcmu.o
drivers/regulator/da9121-regulator.c new file +108 -0

108 lines not on this page · raw message

Signature · 1 line
2.28.0
maintainer
#6 lore raw
In reply to Vincent Whitchurch
Quoted 9 lines · Vincent Whitchurch

This series adds support for the DA9121, a "High-Performance, 10 A, Dual-Phase DC-DC Converter". The datasheet is currently available here:

https://www.dialog-semiconductor.com/sites/default/files/da9121_datasheet_2v3.pdf

v2:
- Let the core get the constraints itself from a subnode in the device tree.

[...]

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-next

Thanks!

[1/2] regulator: Add DA9121

      commit: 1119c59404141200125af31f775d3fbbba52c651
[2/2] regulator: Add support for DA9121 regulator
      commit: e6ff10f24c587c1af705b898761e5df615fb0e1a

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark