diff options
author | Heiko Stübner <heiko@sntech.de> | 2016-04-14 22:17:44 +0300 |
---|---|---|
committer | Thierry Reding <thierry.reding@gmail.com> | 2016-05-17 15:48:05 +0300 |
commit | 23e3523f5d3a980edf7f189743cf4bb9490400a9 (patch) | |
tree | 598002d441de9e8d044d971af0b96a6eefc166b5 /drivers/pwm | |
parent | 39100ceea79ff2efeb2fb094baf120c73d5ccf47 (diff) | |
download | linux-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')
-rw-r--r-- | drivers/pwm/core.c | 5 |
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"); } } |