summaryrefslogtreecommitdiffstats
path: root/Documentation/power
diff options
context:
space:
mode:
authorJonathan Neuschäfer <j.neuschaefer@gmx.net>2017-11-19 00:09:07 -0500
committerMark Brown <broonie@kernel.org>2017-11-29 05:41:16 -0500
commit983ba99a8f275aae9614a30469d0f480550fbc24 (patch)
tree9a080369eeefe80337e8a1f7b14e0f25ff629a96 /Documentation/power
parent2befc01bf7358ab635ca362f3f5ba37d99ef31c4 (diff)
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 <j.neuschaefer@gmx.net> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'Documentation/power')
-rw-r--r--Documentation/power/regulator/machine.txt36
1 files 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 {
23e.g. for the machine above 23e.g. for the machine above
24 24
25static struct regulator_consumer_supply regulator1_consumers[] = { 25static struct regulator_consumer_supply regulator1_consumers[] = {
26{ 26 REGULATOR_SUPPLY("Vcc", "consumer B"),
27 .dev_name = "dev_name(consumer B)", 27};
28 .supply = "Vcc",
29},};
30 28
31static struct regulator_consumer_supply regulator2_consumers[] = { 29static struct regulator_consumer_supply regulator2_consumers[] = {
32{ 30 REGULATOR_SUPPLY("Vcc", "consumer A"),
33 .dev = "dev_name(consumer A"), 31};
34 .supply = "Vcc",
35},};
36 32
37This maps Regulator-1 to the 'Vcc' supply for Consumer B and maps Regulator-2 33This maps Regulator-1 to the 'Vcc' supply for Consumer B and maps Regulator-2
38to the 'Vcc' supply for Consumer A. 34to the 'Vcc' supply for Consumer A.
@@ -78,20 +74,20 @@ static struct regulator_init_data regulator2_data = {
78Finally the regulator devices must be registered in the usual manner. 74Finally the regulator devices must be registered in the usual manner.
79 75
80static struct platform_device regulator_devices[] = { 76static struct platform_device regulator_devices[] = {
81{ 77 {
82 .name = "regulator", 78 .name = "regulator",
83 .id = DCDC_1, 79 .id = DCDC_1,
84 .dev = { 80 .dev = {
85 .platform_data = &regulator1_data, 81 .platform_data = &regulator1_data,
82 },
86 }, 83 },
87}, 84 {
88{ 85 .name = "regulator",
89 .name = "regulator", 86 .id = DCDC_2,
90 .id = DCDC_2, 87 .dev = {
91 .dev = { 88 .platform_data = &regulator2_data,
92 .platform_data = &regulator2_data, 89 },
93 }, 90 },
94},
95}; 91};
96/* register regulator 1 device */ 92/* register regulator 1 device */
97platform_device_register(&regulator_devices[0]); 93platform_device_register(&regulator_devices[0]);