summaryrefslogtreecommitdiff
path: root/drivers/power
diff options
context:
space:
mode:
authorNicholas Troast <ntroast@codeaurora.org>2017-08-03 13:52:33 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2017-08-17 16:54:19 -0700
commit0092e08d5ce8dfe77b6ac1ecd48cb4a6229496df (patch)
treefbda370ae22a396fa63c5a8dfcab08594c29f484 /drivers/power
parenta49bb61510b938152025049730fa922c5da950a1 (diff)
power: pmic-voter: make debug status more parsable
The status debug property lists all of the voters, their enable and value status, and the effective result. Currently the status is presented on multiple lines which is difficult to parse. Change the format to be more parsable. Print each voter in the following format: VOTABLE: CLIENT: en=1 v=1000 Print a single summary line at the end in the following format: VOTABLE: effective=EFFECTIVE_CLIENT type=VOTABLE_TYPE v=1000 Change-Id: I0671cdd8e0911450bafe4869cb49cc48bd622a81 Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
Diffstat (limited to 'drivers/power')
-rw-r--r--drivers/power/supply/qcom/pmic-voter.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/power/supply/qcom/pmic-voter.c b/drivers/power/supply/qcom/pmic-voter.c
index b99558ed2100..0deacdeb0171 100644
--- a/drivers/power/supply/qcom/pmic-voter.c
+++ b/drivers/power/supply/qcom/pmic-voter.c
@@ -519,11 +519,10 @@ static int show_votable_clients(struct seq_file *m, void *data)
lock_votable(votable);
- seq_printf(m, "Votable %s:\n", votable->name);
- seq_puts(m, "clients:\n");
for (i = 0; i < votable->num_clients; i++) {
if (votable->client_strs[i]) {
- seq_printf(m, "%-15s:\t\ten=%d\t\tv=%d\n",
+ seq_printf(m, "%s: %s:\t\t\ten=%d v=%d\n",
+ votable->name,
votable->client_strs[i],
votable->votes[i].enabled,
votable->votes[i].value);
@@ -542,11 +541,11 @@ static int show_votable_clients(struct seq_file *m, void *data)
break;
}
- seq_printf(m, "type: %s\n", type_str);
- seq_puts(m, "Effective:\n");
effective_client_str = get_effective_client_locked(votable);
- seq_printf(m, "%-15s:\t\tv=%d\n",
+ seq_printf(m, "%s: effective=%s type=%s v=%d\n",
+ votable->name,
effective_client_str ? effective_client_str : "none",
+ type_str,
get_effective_result_locked(votable));
unlock_votable(votable);