linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] regulator: include 'enabled' status in debugfs/regulator_summary
@ 2017-06-13 13:58 Michał Mirosław
  2017-06-13 13:58 ` [PATCH 2/2] regulator: use consumer->supply_name " Michał Mirosław
  2017-06-13 14:50 ` [PATCH v2 1/2] regulator: include 'enabled' status " Michał Mirosław
  0 siblings, 2 replies; 5+ messages in thread
From: Michał Mirosław @ 2017-06-13 13:58 UTC (permalink / raw)
  To: linux-kernel; +Cc: Liam Girdwood, Mark Brown

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
---
 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(&regulator_class, NULL, s,
 			      regulator_summary_show_roots);
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] regulator: use consumer->supply_name in debugfs/regulator_summary
  2017-06-13 13:58 [PATCH 1/2] regulator: include 'enabled' status in debugfs/regulator_summary Michał Mirosław
@ 2017-06-13 13:58 ` Michał Mirosław
  2017-06-13 14:50 ` [PATCH v2 1/2] regulator: include 'enabled' status " Michał Mirosław
  1 sibling, 0 replies; 5+ messages in thread
From: Michał Mirosław @ 2017-06-13 13:58 UTC (permalink / raw)
  To: linux-kernel; +Cc: Liam Girdwood, Mark Brown

Before:

 regulator                      ena use open bypass voltage current min     max
-----------------------------------------------------------------------------------
 regulator-dummy                  1   0    2      0     0mV     0mA 0mV     0mV
    1-0010                                                          0mV     0mV
    1-0010                                                          0mV     0mV

After:

 regulator                      ena use open bypass voltage current min     max
-----------------------------------------------------------------------------------
 regulator-dummy                  1   0    2      0     0mV     0mA 0mV     0mV
    1-0010-vccio                                                    0mV     0mV
    1-0010-vcc33                                                    0mV     0mV

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
---
 drivers/regulator/core.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index ba4d121ae07fc..a9bfabd132cff 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -4419,6 +4419,7 @@ static void regulator_summary_show_subtree(struct seq_file *s,
 		seq_printf(s, "%*s%-*s ",
 			   (level + 1) * 3 + 1, "",
 			   30 - (level + 1) * 3,
+			   consumer->supply_name ? consumer->supply_name :
 			   consumer->dev ? dev_name(consumer->dev) : "deviceless");
 
 		switch (rdev->desc->type) {
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v2 1/2] regulator: include 'enabled' status in debugfs/regulator_summary
  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
  2017-06-13 14:50   ` [PATCH 2/2] regulator: use consumer->supply_name " Michał Mirosław
  2017-06-13 17:47   ` [PATCH v2 1/2] regulator: include 'enabled' status " Mark Brown
  1 sibling, 2 replies; 5+ messages in thread
From: Michał Mirosław @ 2017-06-13 14:50 UTC (permalink / raw)
  To: linux-kernel; +Cc: Liam Girdwood, Mark Brown

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(&regulator_class, NULL, s,
 			      regulator_summary_show_roots);
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] regulator: use consumer->supply_name in debugfs/regulator_summary
  2017-06-13 14:50 ` [PATCH v2 1/2] regulator: include 'enabled' status " Michał Mirosław
@ 2017-06-13 14:50   ` Michał Mirosław
  2017-06-13 17:47   ` [PATCH v2 1/2] regulator: include 'enabled' status " Mark Brown
  1 sibling, 0 replies; 5+ messages in thread
From: Michał Mirosław @ 2017-06-13 14:50 UTC (permalink / raw)
  To: linux-kernel; +Cc: Liam Girdwood, Mark Brown

Make it easier to identify regulator consumers when consumer device
uses more than one supply.

Before:

  regulator                      ena use open bypass voltage current min     max
 -----------------------------------------------------------------------------------
  regulator-dummy                  1   0    2      0     0mV     0mA 0mV     0mV
     1-0010                                                          0mV     0mV
     1-0010                                                          0mV     0mV

After:

  regulator                      ena use open bypass voltage current min     max
 -----------------------------------------------------------------------------------
  regulator-dummy                  1   0    2      0     0mV     0mA 0mV     0mV
     1-0010-vccio                                                    0mV     0mV
     1-0010-vcc33                                                    0mV     0mV

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
---
v2:
  - extend commit message

 drivers/regulator/core.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index ba4d121ae07fc..a9bfabd132cff 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -4419,6 +4419,7 @@ static void regulator_summary_show_subtree(struct seq_file *s,
 		seq_printf(s, "%*s%-*s ",
 			   (level + 1) * 3 + 1, "",
 			   30 - (level + 1) * 3,
+			   consumer->supply_name ? consumer->supply_name :
 			   consumer->dev ? dev_name(consumer->dev) : "deviceless");
 
 		switch (rdev->desc->type) {
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2 1/2] regulator: include 'enabled' status in debugfs/regulator_summary
  2017-06-13 14:50 ` [PATCH v2 1/2] regulator: include 'enabled' status " Michał Mirosław
  2017-06-13 14:50   ` [PATCH 2/2] regulator: use consumer->supply_name " Michał Mirosław
@ 2017-06-13 17:47   ` Mark Brown
  1 sibling, 0 replies; 5+ messages in thread
From: Mark Brown @ 2017-06-13 17:47 UTC (permalink / raw)
  To: Michał Mirosław; +Cc: linux-kernel, Liam Girdwood

[-- Attachment #1: Type: text/plain, Size: 277 bytes --]

On Tue, Jun 13, 2017 at 04:50:35PM +0200, Michał Mirosław wrote:
> Extend regulator's info line with enabled/disabled status.

Like I say please don't send new patches in reply to old ones - I can't
tell what's going on here, I've got this mail but no v2 to go with it?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-06-13 17:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [PATCH v2 1/2] regulator: include 'enabled' status " Michał Mirosław
2017-06-13 14:50   ` [PATCH 2/2] regulator: use consumer->supply_name " Michał Mirosław
2017-06-13 17:47   ` [PATCH v2 1/2] regulator: include 'enabled' status " Mark Brown

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).