[PATCH v4 21/24] pwm: add information about polarity, duty cycle and period to debugfs

From: Boris Brezillon
Date: Mon Nov 16 2015 - 03:57:42 EST


From: Heiko StÃbner <heiko@xxxxxxxxx>

The pwm-states make it possible to also output the polarity, duty cycle
and period information in the debugfs pwm summary-outout.
This makes it easier to gather overview information about pwms without
needing to walk through the sysfs attributes of every pwm.

Signed-off-by: Heiko Stuebner <heiko@xxxxxxxxx>
Signed-off-by: Boris Brezillon <boris.brezillon@xxxxxxxxxxxxxxxxxx>
---
drivers/pwm/core.c | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/drivers/pwm/core.c b/drivers/pwm/core.c
index fbc71d3..1619101 100644
--- a/drivers/pwm/core.c
+++ b/drivers/pwm/core.c
@@ -1035,6 +1035,11 @@ static void pwm_dbg_show(struct pwm_chip *chip, struct seq_file *s)
if (pwm_is_enabled(pwm))
seq_puts(s, " enabled");

+ seq_printf(s, " period:%uns", pwm_get_period(pwm));
+ seq_printf(s, " duty:%uns", pwm_get_duty_cycle(pwm));
+ seq_printf(s, " polarity:%s", pwm_get_polarity(pwm) ? "inverse"
+ : "normal");
+
seq_puts(s, "\n");
}
}
--
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/