2017-11-19 05:11:06

by J. Neuschäfer

[permalink] [raw]
Subject: [PATCH 1/2] MAINTAINERS: regulator: Add Documentation/power/regulator/

Signed-off-by: Jonathan Neuschäfer <[email protected]>
---
MAINTAINERS | 1 +
1 file changed, 1 insertion(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 2811a211632c..a644d41e088c 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -14447,6 +14447,7 @@ W: http://www.slimlogic.co.uk/?p=48
T: git git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git
S: Supported
F: Documentation/devicetree/bindings/regulator/
+F: Documentation/power/regulator/
F: drivers/regulator/
F: include/dt-bindings/regulator/
F: include/linux/regulator/
--
2.11.0


From 1585403386504785499@xxx Wed Nov 29 12:28:10 +0000 2017
X-GM-THRID: 1576972122641129236
X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread


2017-11-19 05:11:06

by J. Neuschäfer

[permalink] [raw]
Subject: [PATCH 2/2] regulator: Update code examples in documentation

This involves using the REGULATOR_SUPPLY initializer macro and
reindenting some of the code.

Signed-off-by: Jonathan Neuschäfer <[email protected]>
---
Documentation/power/regulator/machine.txt | 36 ++++++++++++++-----------------
1 file changed, 16 insertions(+), 20 deletions(-)

diff --git a/Documentation/power/regulator/machine.txt b/Documentation/power/regulator/machine.txt
index 757e3b53dc11..eff4dcaaa252 100644
--- a/Documentation/power/regulator/machine.txt
+++ b/Documentation/power/regulator/machine.txt
@@ -23,16 +23,12 @@ struct regulator_consumer_supply {
e.g. for the machine above

static struct regulator_consumer_supply regulator1_consumers[] = {
-{
- .dev_name = "dev_name(consumer B)",
- .supply = "Vcc",
-},};
+ REGULATOR_SUPPLY("Vcc", "consumer B"),
+};

static struct regulator_consumer_supply regulator2_consumers[] = {
-{
- .dev = "dev_name(consumer A"),
- .supply = "Vcc",
-},};
+ REGULATOR_SUPPLY("Vcc", "consumer A"),
+};

This maps Regulator-1 to the 'Vcc' supply for Consumer B and maps Regulator-2
to the 'Vcc' supply for Consumer A.
@@ -78,20 +74,20 @@ static struct regulator_init_data regulator2_data = {
Finally the regulator devices must be registered in the usual manner.

static struct platform_device regulator_devices[] = {
-{
- .name = "regulator",
- .id = DCDC_1,
- .dev = {
- .platform_data = &regulator1_data,
+ {
+ .name = "regulator",
+ .id = DCDC_1,
+ .dev = {
+ .platform_data = &regulator1_data,
+ },
},
-},
-{
- .name = "regulator",
- .id = DCDC_2,
- .dev = {
- .platform_data = &regulator2_data,
+ {
+ .name = "regulator",
+ .id = DCDC_2,
+ .dev = {
+ .platform_data = &regulator2_data,
+ },
},
-},
};
/* register regulator 1 device */
platform_device_register(&regulator_devices[0]);
--
2.11.0


From 1584445727110580345@xxx Sat Nov 18 22:46:35 +0000 2017
X-GM-THRID: 1583483345097010805
X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread