[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180814170617.100087-4-dianders@chromium.org>
Date: Tue, 14 Aug 2018 10:06:16 -0700
From: Douglas Anderson <dianders@...omium.org>
To: broonie@...nel.org
Cc: linux-arm-msm@...r.kernel.org, bjorn.andersson@...aro.org,
collinsd@...eaurora.org, swboyd@...omium.org,
Douglas Anderson <dianders@...omium.org>,
Liam Girdwood <lgirdwood@...il.com>,
linux-kernel@...r.kernel.org
Subject: [PATCH 3/4] regulator: core: Add consumer-requested load in regulator_summary
It's handy to see the load requested by a regulator consumer in the
regulator_summary. Add it. Since this patch comes after the patch
("regulator: core: If consumers don't call regulator_set_load() assume
max") we'll also differentiate between the case where a consumer
hasn't called regulator_set_load() and the case where a consumer
called it but the load is currently 0 mA.
Signed-off-by: Douglas Anderson <dianders@...omium.org>
---
drivers/regulator/core.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index b8b8048efbdd..23f64faa6961 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -4709,9 +4709,16 @@ static void regulator_summary_show_subtree(struct seq_file *s,
switch (rdev->desc->type) {
case REGULATOR_VOLTAGE:
- seq_printf(s, "%45dmV %5dmV",
- consumer->voltage[PM_SUSPEND_ON].min_uV / 1000,
- consumer->voltage[PM_SUSPEND_ON].max_uV / 1000);
+ if (consumer->uA_load_set) {
+ seq_printf(s, "%37dmA %5dmV %5dmV",
+ consumer->uA_load / 1000,
+ consumer->voltage[PM_SUSPEND_ON].min_uV / 1000,
+ consumer->voltage[PM_SUSPEND_ON].max_uV / 1000);
+ } else {
+ seq_printf(s, "%45dmV %5dmV",
+ consumer->voltage[PM_SUSPEND_ON].min_uV / 1000,
+ consumer->voltage[PM_SUSPEND_ON].max_uV / 1000);
+ }
break;
case REGULATOR_CURRENT:
break;
--
2.18.0.865.gffc8e1a3cd6-goog
Powered by blists - more mailing lists