Skip to content

Commit 030158c

Browse files
andredbroonie
authored andcommitted
regulator: dt-bindings: add s2mpg11-pmic regulators
The S2MPG11 PMIC is a Power Management IC for mobile applications with buck converters, various LDOs, power meters, NTC thermistor inputs, and additional GPIO interfaces. It typically complements an S2MPG10 PMIC in a main/sub configuration as the sub-PMIC. S2MPG11 has 12 buck, 1 buck-boost, and 15 LDO rails. Several of these can either be controlled via software (register writes) or via external signals, in particular by: * one out of several input pins connected to a main processor's: * GPIO pins * other pins that are e.g. firmware- or power-domain-controlled without explicit driver intervention * a combination of input pins and register writes. Control via input pins allows PMIC rails to be controlled by firmware, e.g. during standby/suspend, or as part of power domain handling where otherwise that would not be possible. Additionally toggling a pin is faster than register writes, and it also allows the PMIC to ensure that any necessary timing requirements between rails are respected automatically if multiple rails are to be enabled or disabled quasi simultaneously. While external control via input pins appears to exist on other versions of this PMIC, there is more flexibility in this version, in particular there is a selection of input pins to choose from for each rail (which must therefore be configured accordingly if in use), whereas other versions don't have this flexibility. Add documentation related to the regulator (buck & ldo) parts like devicetree definitions, regulator naming patterns, and additional properties. Since S2MPG11 is typically used as the sub-PMIC together with an S2MPG10 as the main-PMIC, the datasheet and the binding both suffix the rails with an 's'. Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Signed-off-by: André Draszik <andre.draszik@linaro.org> Link: https://patch.msgid.link/20260122-s2mpg1x-regulators-v7-3-3b1f9831fffd@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 71bc6ad commit 030158c

2 files changed

Lines changed: 150 additions & 0 deletions

File tree

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/regulator/samsung,s2mpg11-regulator.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Samsung S2MPG11 Power Management IC regulators
8+
9+
maintainers:
10+
- André Draszik <andre.draszik@linaro.org>
11+
12+
description: |
13+
This is part of the device tree bindings for the S2MG11 Power Management IC
14+
(PMIC).
15+
16+
The S2MPG11 PMIC provides 12 buck, 1 buck-boost, and 15 LDO regulators.
17+
18+
See also Documentation/devicetree/bindings/mfd/samsung,s2mps11.yaml for
19+
additional information and example.
20+
21+
properties:
22+
buckboost:
23+
type: object
24+
$ref: regulator.yaml#
25+
unevaluatedProperties: false
26+
description:
27+
Properties for the buck-boost regulator.
28+
29+
properties:
30+
regulator-ramp-delay: false
31+
32+
patternProperties:
33+
# 12 bucks
34+
"^buck(([1-9]|10)s|[ad])$":
35+
type: object
36+
$ref: regulator.yaml#
37+
unevaluatedProperties: false
38+
description:
39+
Properties for a single buck regulator.
40+
41+
allOf:
42+
- $ref: "#/$defs/s2mpg11-ext-control"
43+
44+
properties:
45+
regulator-ramp-delay:
46+
enum: [6250, 12500, 25000]
47+
default: 6250
48+
49+
# 11 standard LDOs
50+
"^ldo([3-79]|1[01245])s$":
51+
type: object
52+
$ref: regulator.yaml#
53+
unevaluatedProperties: false
54+
description:
55+
Properties for a single LDO regulator.
56+
57+
properties:
58+
regulator-ramp-delay: false
59+
60+
# 2 LDOs with possible external control
61+
"^ldo(8|13)s$":
62+
type: object
63+
$ref: regulator.yaml#
64+
unevaluatedProperties: false
65+
description:
66+
Properties for single LDO regulator.
67+
68+
allOf:
69+
- $ref: "#/$defs/s2mpg11-ext-control"
70+
71+
properties:
72+
regulator-ramp-delay: false
73+
74+
# 2 LDOs with ramp support and possible external control
75+
"^ldo[12]s$":
76+
type: object
77+
$ref: regulator.yaml#
78+
unevaluatedProperties: false
79+
description:
80+
Properties for a single LDO regulator.
81+
82+
allOf:
83+
- $ref: "#/$defs/s2mpg11-ext-control"
84+
85+
properties:
86+
regulator-ramp-delay:
87+
enum: [6250, 12500]
88+
default: 6250
89+
90+
$defs:
91+
s2mpg11-ext-control:
92+
properties:
93+
samsung,ext-control:
94+
description: |
95+
These rails can be controlled via one of several possible external
96+
(hardware) signals. If so, this property configures the signal the PMIC
97+
should monitor. The following values generally corresponding to the
98+
respective on-chip pin are valid:
99+
- 0 # S2MPG11_EXTCTRL_PWREN - PWREN pin
100+
- 1 # S2MPG11_EXTCTRL_PWREN_MIF - PWREN_MIF pin
101+
- 2 # S2MPG11_EXTCTRL_AP_ACTIVE_N - ~AP_ACTIVE_N pin
102+
- 3 # S2MPG11_EXTCTRL_G3D_EN - G3D_EN pin
103+
- 4 # S2MPG11_EXTCTRL_G3D_EN2 - G3D_EN & ~AP_ACTIVE_N pins
104+
- 5 # S2MPG11_EXTCTRL_AOC_VDD - AOC_VDD pin
105+
- 6 # S2MPG11_EXTCTRL_AOC_RET - AOC_RET pin
106+
- 7 # S2MPG11_EXTCTRL_UFS_EN - UFS_EN pin
107+
- 8 # S2MPG11_EXTCTRL_LDO13S_EN - VLDO13S_EN pin
108+
109+
$ref: /schemas/types.yaml#/definitions/uint32
110+
minimum: 0
111+
maximum: 8
112+
113+
enable-gpios:
114+
description:
115+
For rails where external control is done via a GPIO, this optional
116+
property describes the GPIO line used.
117+
118+
dependentRequired:
119+
enable-gpios: [ "samsung,ext-control" ]
120+
121+
allOf:
122+
# Bucks 4, 6, 7 and 10 can not be controlled externally - above definition
123+
# allows it and we deny it here. This approach reduces repetition.
124+
- if:
125+
anyOf:
126+
- required: [buck4s]
127+
- required: [buck6s]
128+
- required: [buck7s]
129+
- required: [buck10s]
130+
then:
131+
patternProperties:
132+
"^buck([467]|10)s$":
133+
properties:
134+
samsung,ext-control: false
135+
136+
additionalProperties: false

include/dt-bindings/regulator/samsung,s2mpg10-regulator.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020
*
2121
* ldo20m supports external control, but using a different set of control
2222
* signals.
23+
*
24+
* S2MPG11 regulators supporting these are:
25+
* - buck1s .. buck3s buck5s buck8s buck9s bucka buckd
26+
* - ldo1s ldo2s ldo8s ldo13s
2327
*/
2428
#define S2MPG10_EXTCTRL_PWREN 0 /* PWREN pin */
2529
#define S2MPG10_EXTCTRL_PWREN_MIF 1 /* PWREN_MIF pin */
@@ -36,4 +40,14 @@
3640
#define S2MPG10_EXTCTRL_LDO20M_EN2 11 /* VLDO20M_EN & LDO20M_SFR */
3741
#define S2MPG10_EXTCTRL_LDO20M_EN 12 /* VLDO20M_EN pin */
3842

43+
#define S2MPG11_EXTCTRL_PWREN 0 /* PWREN pin */
44+
#define S2MPG11_EXTCTRL_PWREN_MIF 1 /* PWREN_MIF pin */
45+
#define S2MPG11_EXTCTRL_AP_ACTIVE_N 2 /* ~AP_ACTIVE_N pin */
46+
#define S2MPG11_EXTCTRL_G3D_EN 3 /* G3D_EN pin */
47+
#define S2MPG11_EXTCTRL_G3D_EN2 4 /* G3D_EN & ~AP_ACTIVE_N pins */
48+
#define S2MPG11_EXTCTRL_AOC_VDD 5 /* AOC_VDD pin */
49+
#define S2MPG11_EXTCTRL_AOC_RET 6 /* AOC_RET pin */
50+
#define S2MPG11_EXTCTRL_UFS_EN 7 /* UFS_EN pin */
51+
#define S2MPG11_EXTCTRL_LDO13S_EN 8 /* VLDO13S_EN pin */
52+
3953
#endif /* _DT_BINDINGS_REGULATOR_SAMSUNG_S2MPG10_H */

0 commit comments

Comments
 (0)