From: "Michał Mirosław" <mirq-linux@rere.qmqm.pl>
To: linux-kernel@vger.kernel.org
Cc: Liam Girdwood <lgirdwood@gmail.com>, Mark Brown <broonie@kernel.org>
Subject: [PATCH v2 1/2] regulator: include 'enabled' status in debugfs/regulator_summary
Date: Tue, 13 Jun 2017 16:50:35 +0200 [thread overview]
Message-ID: <2714dc5997438adb20f5ac8f2a39823562ed2e55.1497365288.git.mirq-linux@rere.qmqm.pl> (raw)
In-Reply-To: <ddb025e50e9f63aa7714cb9423eba90f535fc4d6.1497361548.git.mirq-linux@rere.qmqm.pl>
Extend regulator's info line with enabled/disabled status.
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
---
v2:
- include commit message
drivers/regulator/core.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index c0d9ae8d0860e..ba4d121ae07fc 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -4379,13 +4379,18 @@ static void regulator_summary_show_subtree(struct seq_file *s,
struct regulation_constraints *c;
struct regulator *consumer;
struct summary_data summary_data;
+ int is_enabled;
if (!rdev)
return;
- seq_printf(s, "%*s%-*s %3d %4d %6d ",
+ mutex_lock(&rdev->mutex);
+ is_enabled = _regulator_is_enabled(rdev);
+ mutex_unlock(&rdev->mutex);
+
+ seq_printf(s, "%*s%-*s %3d %3d %4d %6d ",
level * 3 + 1, "",
- 30 - level * 3, rdev_get_name(rdev),
+ 30 - level * 3, rdev_get_name(rdev), is_enabled,
rdev->use_count, rdev->open_count, rdev->bypass_count);
seq_printf(s, "%5dmV ", _regulator_get_voltage(rdev) / 1000);
@@ -4450,8 +4455,8 @@ static int regulator_summary_show_roots(struct device *dev, void *data)
static int regulator_summary_show(struct seq_file *s, void *data)
{
- seq_puts(s, " regulator use open bypass voltage current min max\n");
- seq_puts(s, "-------------------------------------------------------------------------------\n");
+ seq_puts(s, " regulator ena use open bypass voltage current min max\n");
+ seq_puts(s, "-----------------------------------------------------------------------------------\n");
class_for_each_device(®ulator_class, NULL, s,
regulator_summary_show_roots);
--
2.11.0
next prev parent reply other threads:[~2017-06-13 14:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-13 13:58 [PATCH 1/2] regulator: include 'enabled' status in debugfs/regulator_summary Michał Mirosław
2017-06-13 13:58 ` [PATCH 2/2] regulator: use consumer->supply_name " Michał Mirosław
2017-06-13 14:50 ` Michał Mirosław [this message]
2017-06-13 14:50 ` Michał Mirosław
2017-06-13 17:47 ` [PATCH v2 1/2] regulator: include 'enabled' status " Mark Brown
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=2714dc5997438adb20f5ac8f2a39823562ed2e55.1497365288.git.mirq-linux@rere.qmqm.pl \
--to=mirq-linux@rere.qmqm.pl \
--cc=broonie@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.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).