lkml.org 
[lkml]   [2018]   [Aug]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 3/4] regulator: core: Add consumer-requested load in regulator_summary
Date
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@chromium.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
\
 
 \ /
  Last update: 2018-08-14 19:09    [W:0.081 / U:1.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site