aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHeiko Stübner <heiko@sntech.de>2016-04-14 21:17:44 +0200
committerThierry Reding <thierry.reding@gmail.com>2016-05-02 12:04:24 +0200
commit08619abd4f4339143f1ea8ec45df26f7fb0d0190 (patch)
tree110a3892c16cc19122481c32229e57c31a23ba3b
parent3f1c2b67adb56bf79d4ab7eadb16eac17560ab0e (diff)
downloadlinux-pwm-pwm-atomic.tar.gz
pwm: Add information about polarity, duty cycle and period to debugfspwm-atomic
The PWM states make it possible to also output the polarity, duty cycle and period information in the debugfs summary output. This simplifies gathering information about PWMs without needing to walk through the sysfs attributes of every PWM. Signed-off-by: Heiko Stuebner <heiko@sntech.de> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com> [thierry.reding@gmail.com: use more spaces in debugfs output] Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
-rw-r--r--drivers/pwm/core.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/pwm/core.c b/drivers/pwm/core.c
index 8ebeda79d98512..241763c2ead98d 100644
--- a/drivers/pwm/core.c
+++ b/drivers/pwm/core.c
@@ -960,6 +960,11 @@ static void pwm_dbg_show(struct pwm_chip *chip, struct seq_file *s)
if (state.enabled)
seq_puts(s, " enabled");
+ seq_printf(s, " period: %u ns", state.period);
+ seq_printf(s, " duty: %u ns", state.duty_cycle);
+ seq_printf(s, " polarity: %s",
+ state.polarity ? "inverse" : "normal");
+
seq_puts(s, "\n");
}
}