summaryrefslogtreecommitdiffstats
path: root/drivers/pwm
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-17 14:48:05 +0200
commit23e3523f5d3a980edf7f189743cf4bb9490400a9 (patch)
tree598002d441de9e8d044d971af0b96a6eefc166b5 /drivers/pwm
parentpwm: Switch to the atomic API (diff)
downloadlinux-23e3523f5d3a980edf7f189743cf4bb9490400a9.tar.xz
linux-23e3523f5d3a980edf7f189743cf4bb9490400a9.zip
pwm: Add information about polarity, duty cycle and period to debugfs
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>
Diffstat (limited to 'drivers/pwm')
-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 b0b87b3b52a6..c2e1a4bb23ac 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");
}
}