1 From b77e70f6b8f2cc62fba847f3008a430a09ef275d Mon Sep 17 00:00:00 2001
2 From: ChiYuan Huang <cy_huang@richtek.com>
3 Date: Wed, 9 Mar 2022 16:01:42 +0800
4 Subject: [PATCH 1/2] regulator: Add bindings for Richtek RT5190A PMIC
6 Add bindings for Richtek RT5190A PMIC.
8 Signed-off-by: ChiYuan Huang <cy_huang@richtek.com>
9 Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
10 Link: https://lore.kernel.org/r/1646812903-32496-2-git-send-email-u0084500@gmail.com
11 Signed-off-by: Mark Brown <broonie@kernel.org>
13 .../regulator/richtek,rt5190a-regulator.yaml | 141 ++++++++++++++++++
14 .../regulator/richtek,rt5190a-regulator.h | 15 ++
15 2 files changed, 156 insertions(+)
16 create mode 100644 Documentation/devicetree/bindings/regulator/richtek,rt5190a-regulator.yaml
17 create mode 100644 include/dt-bindings/regulator/richtek,rt5190a-regulator.h
20 +++ b/Documentation/devicetree/bindings/regulator/richtek,rt5190a-regulator.yaml
22 +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
25 +$id: http://devicetree.org/schemas/regulator/richtek,rt5190a-regulator.yaml#
26 +$schema: http://devicetree.org/meta-schemas/core.yaml#
28 +title: Richtek RT5190A PMIC Regulator
31 + - ChiYuan Huang <cy_huang@richtek.com>
34 + The RT5190A integrates 1 channel buck controller, 3 channels high efficiency
35 + synchronous buck converters, 1 LDO, I2C control interface and peripherial
38 + It also supports mute AC OFF depop sound and quick setting storage while
39 + input power is removed.
53 + description: phandle to buck2 input voltage.
56 + description: phandle to buck3 input voltage.
59 + description: phandle to buck4 input voltage.
62 + description: phandle to ldo input voltage
64 + richtek,mute-enable:
66 + The mute function uses 'mutein', 'muteout', and 'vdet' pins as the control
67 + signal. When enabled, The normal behavior is to bypass the 'mutein' signal
68 + 'muteout'. But if the power source removal is detected from 'vdet',
69 + whatever the 'mutein' signal is, it will pull down the 'muteout' to force
70 + speakers mute. this function is commonly used to prevent the speaker pop
71 + noise during AC power turned off in the modern TV system design.
78 + "^buck[1-4]$|^ldo$":
80 + $ref: regulator.yaml#
82 + regulator description for buck1 and buck4.
85 + regulator-allowed-modes:
87 + buck operating mode, only buck1/4 support mode operating.
93 + richtek,latchup-enable:
96 + If specified, undervolt protection mode changes from the default
99 + unevaluatedProperties: false
101 + additionalProperties: false
108 +additionalProperties: false
112 + #include <dt-bindings/interrupt-controller/irq.h>
113 + #include <dt-bindings/regulator/richtek,rt5190a-regulator.h>
116 + #address-cells = <1>;
120 + compatible = "richtek,rt5190a";
122 + interrupts-extended = <&gpio26 0 IRQ_TYPE_LEVEL_LOW>;
123 + vin2-supply = <&rt5190_buck1>;
124 + vin3-supply = <&rt5190_buck1>;
125 + vin4-supply = <&rt5190_buck1>;
128 + rt5190_buck1: buck1 {
129 + regulator-name = "rt5190a-buck1";
130 + regulator-min-microvolt = <5090000>;
131 + regulator-max-microvolt = <5090000>;
132 + regulator-allowed-modes = <RT5190A_OPMODE_AUTO RT5190A_OPMODE_FPWM>;
136 + regulator-name = "rt5190a-buck2";
137 + regulator-min-microvolt = <600000>;
138 + regulator-max-microvolt = <1400000>;
142 + regulator-name = "rt5190a-buck3";
143 + regulator-min-microvolt = <600000>;
144 + regulator-max-microvolt = <1400000>;
148 + regulator-name = "rt5190a-buck4";
149 + regulator-min-microvolt = <850000>;
150 + regulator-max-microvolt = <850000>;
151 + regulator-allowed-modes = <RT5190A_OPMODE_AUTO RT5190A_OPMODE_FPWM>;
155 + regulator-name = "rt5190a-ldo";
156 + regulator-min-microvolt = <1200000>;
157 + regulator-max-microvolt = <1200000>;
164 +++ b/include/dt-bindings/regulator/richtek,rt5190a-regulator.h
166 +/* SPDX-License-Identifier: GPL-2.0 */
168 +#ifndef __DT_BINDINGS_RICHTEK_RT5190A_REGULATOR_H__
169 +#define __DT_BINDINGS_RICHTEK_RT5190A_REGULATOR_H__
172 + * BUCK/LDO mode constants which may be used in devicetree properties
173 + * (eg. regulator-allowed-modes).
174 + * See the manufacturer's datasheet for more information on these modes.
177 +#define RT5190A_OPMODE_AUTO 0
178 +#define RT5190A_OPMODE_FPWM 1