summaryrefslogtreecommitdiff
path: root/drivers/pwm/core.c
diff options
context:
space:
mode:
authorHeiko Stübner <heiko@sntech.de>2016-04-14 19:17:44 (GMT)
committerThierry Reding <thierry.reding@gmail.com>2016-05-17 12:48:05 (GMT)
commit23e3523f5d3a980edf7f189743cf4bb9490400a9 (patch)
tree598002d441de9e8d044d971af0b96a6eefc166b5 /drivers/pwm/core.c
parent39100ceea79ff2efeb2fb094baf120c73d5ccf47 (diff)
downloadlinux-23e3523f5d3a980edf7f189743cf4bb9490400a9.tar.xz
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/core.c')
-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 b0b87b3..c2e1a4b 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");
}
}