linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Douglas Anderson <dianders@chromium.org>
To: broonie@kernel.org
Cc: linux-arm-msm@vger.kernel.org, bjorn.andersson@linaro.org,
	collinsd@codeaurora.org, swboyd@chromium.org,
	Douglas Anderson <dianders@chromium.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH 3/4] regulator: core: Add consumer-requested load in regulator_summary
Date: Tue, 14 Aug 2018 10:06:16 -0700	[thread overview]
Message-ID: <20180814170617.100087-4-dianders@chromium.org> (raw)
In-Reply-To: <20180814170617.100087-1-dianders@chromium.org>

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


  parent reply	other threads:[~2018-08-14 17:07 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-14 17:06 [PATCH 0/4] regulator: core: A few useful patches for regulators that need load set Douglas Anderson
2018-08-14 17:06 ` [PATCH 1/4] regulator: core: If consumers don't call regulator_set_load() assume max Douglas Anderson
2018-08-14 18:30   ` David Collins
2018-08-14 20:03     ` Doug Anderson
2018-08-14 21:59       ` David Collins
2018-08-14 23:56         ` Doug Anderson
2018-08-15  1:32           ` David Collins
2018-08-15 11:13           ` Mark Brown
2018-08-16 20:07             ` Doug Anderson
2018-08-16 20:58               ` David Collins
2018-08-16 21:03                 ` Doug Anderson
2018-08-15 11:06       ` Mark Brown
2018-08-15 10:57   ` Mark Brown
2018-08-17 21:36   ` Bjorn Andersson
2018-08-20 17:18     ` Mark Brown
2018-08-14 17:06 ` [PATCH 2/4] regulator: core: Add the opmode to regulator_summary Douglas Anderson
2018-08-14 17:06 ` Douglas Anderson [this message]
2018-08-14 17:06 ` [PATCH 4/4] regulator: core: Add locking to debugfs regulator_summary Douglas Anderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180814170617.100087-4-dianders@chromium.org \
    --to=dianders@chromium.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=broonie@kernel.org \
    --cc=collinsd@codeaurora.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=swboyd@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).