aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pwm/core.c
diff options
context:
space:
mode:
authorHeiko Stübner <heiko@sntech.de>2016-04-14 15:17:44 -0400
committerThierry Reding <thierry.reding@gmail.com>2016-05-17 08:48:05 -0400
commit23e3523f5d3a980edf7f189743cf4bb9490400a9 (patch)
tree598002d441de9e8d044d971af0b96a6eefc166b5 /drivers/pwm/core.c
parent39100ceea79ff2efeb2fb094baf120c73d5ccf47 (diff)
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 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)
960 if (state.enabled) 960 if (state.enabled)
961 seq_puts(s, " enabled"); 961 seq_puts(s, " enabled");
962 962
963 seq_printf(s, " period: %u ns", state.period);
964 seq_printf(s, " duty: %u ns", state.duty_cycle);
965 seq_printf(s, " polarity: %s",
966 state.polarity ? "inverse" : "normal");
967
963 seq_puts(s, "\n"); 968 seq_puts(s, "\n");
964 } 969 }
965} 970}