Skip to contentSkip to conversation

Add Richtek RT5739 switching voltage regulator support

PATCH Superseded [email protected] 2 participants 4 messages Feb 17, 2023

Subsystems (2)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover Add Richtek RT5739 switching voltage regulator support

From: ChiYuan Huang <[email protected]>

This patch set is to add Richtek RT5739 regulator support.

The RT5739 is a step-down switching voltage regulator that delivers a digitally programmable output from an input voltage supply from 2.5V to 5.5V. The output voltage is programmed through an I2C interface.

Since v2:
- Refine dt-binding patch subject
- Shorten and refine title and description without too much marketing text.
- Fix the typo from 'connecton' to 'connection' in 'richtek,vsel-active-high' property description
- Remove maxItems in property 'regulator-allowed-modes'
- Fix the wrong min/max microvolt in binding example. Must be '300000' and '1300000', respectively.

ChiYuan Huang (2):
dt-bindings: regulator: Add Richtek RT5739
regulator: Add support for Richtek RT5739 voltage regulator

 .../bindings/regulator/richtek,rt5739.yaml         |  72 +++++
 drivers/regulator/Kconfig                          |  13 +
 drivers/regulator/Makefile                         |   1 +
 drivers/regulator/rt5739.c                         | 290 +++++++++++++++++++++
 4 files changed, 376 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/regulator/richtek,rt5739.yaml
 create mode 100644 drivers/regulator/rt5739.c
Signature · 1 line
2.7.4
#1 lore raw

PATCH v2 1/2 dt-bindings: regulator: Add Richtek RT5739

From: ChiYuan Huang <[email protected]>

Add the binding document for Richtek RT5739.

---
Since v2:
- Refine dt-binding patch subject
- Shorten and refine title and description without too much marketing text.
- Fix the typo from 'connecton' to 'connection' in 'richtek,vsel-active-high' property description
- Remove maxItems in property 'regulator-allowed-modes'
- Fix the wrong min/max microvolt in binding example. Must be '300000' and '1300000', respectively.

---
 .../bindings/regulator/richtek,rt5739.yaml         | 72 ++++++++++++++++++++++
 1 file changed, 72 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/regulator/richtek,rt5739.yaml
Documentation/devicetree/bindings/regulator/richtek,rt5739.yaml new file +72 -0
new file mode 100644
index 00000000..358297d
@@ -0,0 +1,72 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/regulator/richtek,rt5739.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Richtek RT5739 Step-Down Buck Converter
+
+maintainers:
+  - ChiYuan Huang <[email protected]>
+
+description: |
+  The RT5739 is a step-down switching buck converter that can deliver the
+  programmable output voltage from 300mV to 1300mV with wide input voltage
+  supply of 2.5V to 5.5V. It can provide up to 3.5A continuous current
+  capability at over 80% high efficiency.
+
+allOf:
+  - $ref: regulator.yaml#
+
+properties:
+  compatible:
+    enum:
+      - richtek,rt5739
+
+  reg:
+    maxItems: 1
+
+  enable-gpios:
+    maxItems: 1
+
+  richtek,vsel-active-high:
+    description: |
+      If property is present, use the 'VSEL1' register group for buck control.
+      Else, use the 'VSEL0' register group. This depends on external hardware
+      'VSEL' pin connection.
+    type: boolean
+
+  regulator-allowed-modes:
+    description: |
+      buck allowed operating mode
+        0: Auto PFM/PWM mode
+        1: Forced PWM mode
+    items:
+      enum: [0, 1]
+
+required:
+  - compatible
+  - reg
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+
+    i2c {
+      #address-cells = <1>;
+      #size-cells = <0>;
+
+      regulator@50 {
+        compatible = "richtek,rt5739";
+        reg = <0x50>;
+        enable-gpios = <&gpio26 1 GPIO_ACTIVE_HIGH>;
+        richtek,vsel-active-high;
+        regulator-name = "richtek,rt5739-buck";
+        regulator-min-microvolt = <300000>;
+        regulator-max-microvolt = <1300000>;
+        regulator-allowed-modes = <0 1>;
+        regulator-boot-on;
+      };
+    };
Signature · 1 line
2.7.4
Reviewed-by on v2 1/2
#2 lore raw

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

Quoted 5 lines · On 17/02/2023 03:06, [email protected] wrote:

From: ChiYuan Huang <[email protected]>

Add the binding document for Richtek RT5739.

Quoted 9 lines

---
Since v2:
- Refine dt-binding patch subject
- Shorten and refine title and description without too much marketing text.
- Fix the typo from 'connecton' to 'connection' in 'richtek,vsel-active-high' property description
- Remove maxItems in property 'regulator-allowed-modes'
- Fix the wrong min/max microvolt in binding example. Must be '300000' and '1300000', respectively.

Best regards,
Krzysztof

#3 lore raw

PATCH v2 2/2 regulator: Add support for Richtek RT5739 voltage regulator

In reply to [email protected]

From: ChiYuan Huang <[email protected]>

The RT5739 is a step-down switching voltage regulator that supports output voltage ragne from 300mV to 1300mV with the wide input supply voltage range from 2.5V to 5.5V.

---
Since v2: no change

---
 drivers/regulator/Kconfig  |  13 ++
 drivers/regulator/Makefile |   1 +
 drivers/regulator/rt5739.c | 290 +++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 304 insertions(+)
 create mode 100644 drivers/regulator/rt5739.c
drivers/regulator/Kconfig +13 -0
index 820c9a0..f7f992c 100644
@@ -1112,6 +1112,19 @@ config REGULATOR_RT5190A
 	  buck converters, 1 LDO, mute AC OFF depop function, with the general
 	  I2C control interface.
 
+config REGULATOR_RT5739
+	tristate "Rcihtek RT5739 Regulator"
+	depends on I2C
+	select REGMAP_I2C
+	help
+	  This adds support for voltage regulator in Richtek RT5739.
+	  It's a step-down switching voltage regulator. Using a proprietary
+	  architecture with synchronous rectification, it is capable of
+	  delivering 3.5A continuously at over 80% efficiency.
+
+	  This driver can also be built as a module. If so, the module
+	  will be called rt5739.
+
 config REGULATOR_RT5759
 	tristate "Richtek RT5759 Regulator"
 	depends on I2C
drivers/regulator/Makefile +1 -0
index b9f5eb3..30a61fc 100644
@@ -133,6 +133,7 @@ obj-$(CONFIG_REGULATOR_RT4831)	+= rt4831-regulator.o
 obj-$(CONFIG_REGULATOR_RT5033)	+= rt5033-regulator.o
 obj-$(CONFIG_REGULATOR_RT5120)	+= rt5120-regulator.o
 obj-$(CONFIG_REGULATOR_RT5190A) += rt5190a-regulator.o
+obj-$(CONFIG_REGULATOR_RT5739)	+= rt5739.o
 obj-$(CONFIG_REGULATOR_RT5759)	+= rt5759-regulator.o
 obj-$(CONFIG_REGULATOR_RT6160)	+= rt6160-regulator.o
 obj-$(CONFIG_REGULATOR_RT6190)	+= rt6190-regulator.o
drivers/regulator/rt5739.c new file +290 -0

290 lines not on this page · raw message

Signature · 1 line
2.7.4