Skip to contentSkip to conversation

Add Richtek RT5190A PMIC support

PATCH In review cy_huang 3 participants 5 messages Mar 9, 2022 – Mar 10, 2022

Subsystems (2)
lore
Share & tools
lore

cy_huang

author
#0 lore raw

v2 cover Add Richtek RT5190A PMIC support

From: ChiYuan Huang <[email protected]>

This patch series add Richtek RT5190A PMIC support.

v2:
1. use standard bindings regulator-min/max-microvolt to replace fixed-microvolt property
2. change dt-bindings sample node name from rt5190a@64 to pmic@64.
3. add dt-binding header to defin e the opmode mapping number.
4. refine 'richtek,mute-enable' description in dt-binding.
4. due to fixed-microvolt property removal, use of_regulator_match to get the regulator init data.
5. fix checkpatch warning and error.

ChiYuan Huang (2):
dt-bindings: regulator: Add bindings for Richtek RT5190A PMIC
regulator: rt5190a: Add support for Richtek RT5190A PMIC

 .../regulator/richtek,rt5190a-regulator.yaml       | 141 ++++++
 drivers/regulator/Kconfig                          |  10 +
 drivers/regulator/Makefile                         |   1 +
 drivers/regulator/rt5190a-regulator.c              | 513 +++++++++++++++++++++
 .../regulator/richtek,rt5190a-regulator.h          |  15 +
 5 files changed, 680 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/regulator/richtek,rt5190a-regulator.yaml
 create mode 100644 drivers/regulator/rt5190a-regulator.c
 create mode 100644 include/dt-bindings/regulator/richtek,rt5190a-regulator.h
Signature · 1 line
2.7.4
author
#1 lore raw

PATCH v2 1/2 dt-bindings: regulator: Add bindings for Richtek RT5190A PMIC

From: ChiYuan Huang <[email protected]>

Add bindings for Richtek RT5190A PMIC.

---
 .../regulator/richtek,rt5190a-regulator.yaml       | 141 +++++++++++++++++++++
 .../regulator/richtek,rt5190a-regulator.h          |  15 +++
 2 files changed, 156 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/regulator/richtek,rt5190a-regulator.yaml
 create mode 100644 include/dt-bindings/regulator/richtek,rt5190a-regulator.h
Documentation/devicetree/bindings/regulator/richtek,rt5190a-regulator.yaml new file +141 -0
new file mode 100644
index 00000000..28725c5
@@ -0,0 +1,141 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/regulator/richtek,rt5190a-regulator.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Richtek RT5190A PMIC Regulator
+
+maintainers:
+  - ChiYuan Huang <[email protected]>
+
+description: |
+  The RT5190A integrates 1 channel buck controller, 3 channels high efficiency
+  synchronous buck converters, 1 LDO, I2C control interface and peripherial
+  logical control.
+
+  It also supports mute AC OFF depop sound and quick setting storage while
+  input power is removed.
+
+properties:
+  compatible:
+    enum:
+      - richtek,rt5190a
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  vin2-supply:
+    description: phandle to buck2 input voltage.
+
+  vin3-supply:
+    description: phandle to buck3 input voltage.
+
+  vin4-supply:
+    description: phandle to buck4 input voltage.
+
+  vinldo-supply:
+    description: phandle to ldo input voltage
+
+  richtek,mute-enable:
+    description: |
+      The mute function uses 'mutein', 'muteout', and 'vdet' pins as the control
+      signal. When enabled, The normal behavior is to bypass the 'mutein' signal
+      'muteout'. But if the power source removal is detected from 'vdet',
+      whatever the 'mutein' signal is, it will pull down the 'muteout' to force
+      speakers mute. this function is commonly used to prevent the speaker pop
+      noise during AC power turned off in the modern TV system design.
+    type: boolean
+
+  regulators:
+    type: object
+
+    patternProperties:
+      "^buck[1-4]$|^ldo$":
+        type: object
+        $ref: regulator.yaml#
+        description: |
+          regulator description for buck1 and buck4.
+
+        properties:
+          regulator-allowed-modes:
+            description: |
+             buck operating mode, only buck1/4 support mode operating.
+              0: auto mode
+              1: force pwm mode
+            items:
+              enum: [0, 1]
+
+          richtek,latchup-enable:
+            type: boolean
+            description: |
+              If specified, undervolt protection mode changes from the default
+              hiccup to latchup.
+
+        unevaluatedProperties: false
+
+    additionalProperties: false
+
+required:
+  - compatible
+  - reg
+  - regulators
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    #include <dt-bindings/regulator/richtek,rt5190a-regulator.h>
+
+    i2c {
+      #address-cells = <1>;
+      #size-cells = <0>;
+
+      pmic@64 {
+        compatible = "richtek,rt5190a";
+        reg = <0x64>;
+        interrupts-extended = <&gpio26 0 IRQ_TYPE_LEVEL_LOW>;
+        vin2-supply = <&rt5190_buck1>;
+        vin3-supply = <&rt5190_buck1>;
+        vin4-supply = <&rt5190_buck1>;
+
+        regulators {
+          rt5190_buck1: buck1 {
+            regulator-name = "rt5190a-buck1";
+            regulator-min-microvolt = <5090000>;
+            regulator-max-microvolt = <5090000>;
+            regulator-allowed-modes = <RT5190A_OPMODE_AUTO RT5190A_OPMODE_FPWM>;
+            regulator-boot-on;
+          };
+          buck2 {
+            regulator-name = "rt5190a-buck2";
+            regulator-min-microvolt = <600000>;
+            regulator-max-microvolt = <1400000>;
+            regulator-boot-on;
+          };
+          buck3 {
+            regulator-name = "rt5190a-buck3";
+            regulator-min-microvolt = <600000>;
+            regulator-max-microvolt = <1400000>;
+            regulator-boot-on;
+          };
+          buck4 {
+            regulator-name = "rt5190a-buck4";
+            regulator-min-microvolt = <850000>;
+            regulator-max-microvolt = <850000>;
+            regulator-allowed-modes = <RT5190A_OPMODE_AUTO RT5190A_OPMODE_FPWM>;
+            regulator-boot-on;
+          };
+          ldo {
+            regulator-name = "rt5190a-ldo";
+            regulator-min-microvolt = <1200000>;
+            regulator-max-microvolt = <1200000>;
+            regulator-boot-on;
+          };
+        };
+      };
+    };
include/dt-bindings/regulator/richtek,rt5190a-regulator.h new file +15 -0
new file mode 100644
index 00000000..63f99d4
@@ -0,0 +1,15 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+
+#ifndef __DT_BINDINGS_RICHTEK_RT5190A_REGULATOR_H__
+#define __DT_BINDINGS_RICHTEK_RT5190A_REGULATOR_H__
+
+/*
+ * BUCK/LDO mode constants which may be used in devicetree properties
+ * (eg. regulator-allowed-modes).
+ * See the manufacturer's datasheet for more information on these modes.
+ */
+
+#define RT5190A_OPMODE_AUTO	0
+#define RT5190A_OPMODE_FPWM	1
+
+#endif
Signature · 1 line
2.7.4
Reviewed-by on v2 1/2
#2 lore raw

Re: [PATCH v2 1/2] dt-bindings: regulator: Add bindings for Richtek RT5190A PMIC

Quoted 4 lines · cy_huang

From: ChiYuan Huang <[email protected]>

Add bindings for Richtek RT5190A PMIC.

Quoted 8 lines
---
 .../regulator/richtek,rt5190a-regulator.yaml       | 141 +++++++++++++++++++++
 .../regulator/richtek,rt5190a-regulator.h          |  15 +++
 2 files changed, 156 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/regulator/richtek,rt5190a-regulator.yaml
 create mode 100644 include/dt-bindings/regulator/richtek,rt5190a-regulator.h

Best regards,
Krzysztof

author
#3 lore raw

PATCH v2 2/2 regulator: rt5190a: Add support for Richtek RT5190A PMIC

In reply to cy_huang

From: ChiYuan Huang <[email protected]>

Add support for Richtek RT5190A PMIC.

---
 drivers/regulator/Kconfig             |  10 +
 drivers/regulator/Makefile            |   1 +
 drivers/regulator/rt5190a-regulator.c | 513 ++++++++++++++++++++++++++++++++++
 3 files changed, 524 insertions(+)
 create mode 100644 drivers/regulator/rt5190a-regulator.c
drivers/regulator/Kconfig +10 -0
index 1c35fed2..850e954 100644
@@ -1046,6 +1046,16 @@ config REGULATOR_RT5033
 	  RT5033 PMIC. The device supports multiple regulators like
 	  current source, LDO and Buck.
 
+config REGULATOR_RT5190A
+	tristate "Richtek RT5190A PMIC"
+	depends on I2C
+	select REGMAP_I2C
+	help
+	  This adds support for voltage regulator in Richtek RT5190A PMIC.
+	  It integratas 1 channel buck controller, 3 channels high efficiency
+	  buck converters, 1 LDO, mute AC OFF depop function, with the general
+	  I2C control interface.
+
 config REGULATOR_RT6160
 	tristate "Richtek RT6160 BuckBoost voltage regulator"
 	depends on I2C
drivers/regulator/Makefile +1 -0
index 2e1b087..28d816a9 100644
@@ -126,6 +126,7 @@ obj-$(CONFIG_REGULATOR_ROHM)	+= rohm-regulator.o
 obj-$(CONFIG_REGULATOR_RT4801)	+= rt4801-regulator.o
 obj-$(CONFIG_REGULATOR_RT4831)	+= rt4831-regulator.o
 obj-$(CONFIG_REGULATOR_RT5033)	+= rt5033-regulator.o
+obj-$(CONFIG_REGULATOR_RT5190A) += rt5190a-regulator.o
 obj-$(CONFIG_REGULATOR_RT6160)	+= rt6160-regulator.o
 obj-$(CONFIG_REGULATOR_RT6245)	+= rt6245-regulator.o
 obj-$(CONFIG_REGULATOR_RTMV20)	+= rtmv20-regulator.o
drivers/regulator/rt5190a-regulator.c new file +513 -0

513 lines not on this page · raw message

Signature · 1 line
2.7.4
maintainer
#4 lore raw
In reply to cy_huang
Quoted 14 lines · cy_huang

From: ChiYuan Huang <[email protected]>

This patch series add Richtek RT5190A PMIC support.

v2:
1. use standard bindings regulator-min/max-microvolt to replace fixed-microvolt property
2. change dt-bindings sample node name from rt5190a@64 to pmic@64.
3. add dt-binding header to defin e the opmode mapping number.
4. refine 'richtek,mute-enable' description in dt-binding.
4. due to fixed-microvolt property removal, use of_regulator_match to get the regulator init data.
5. fix checkpatch warning and error.

Quoted 1 line

[...]

Applied to

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

Thanks!

[1/2] dt-bindings: regulator: Add bindings for Richtek RT5190A PMIC

      commit: b77e70f6b8f2cc62fba847f3008a430a09ef275d
[2/2] regulator: rt5190a: Add support for Richtek RT5190A PMIC
      commit: 760423dfad53877b468490758fe7ea968ded9402

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