From: Heiko Stübner Date: Thu, 14 Apr 2016 19:17:44 +0000 (+0200) Subject: UPSTREAM: pwm: Add information about polarity, duty cycle and period to debugfs X-Git-Tag: firefly_0821_release~437 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=0cb6a1b23bd55212d64d8f89cd016f1801e8b124;p=firefly-linux-kernel-4.4.55.git UPSTREAM: 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 Signed-off-by: Boris Brezillon [thierry.reding@gmail.com: use more spaces in debugfs output] Signed-off-by: Thierry Reding (cherry picked from commit 23e3523f5d3a980edf7f189743cf4bb9490400a9) Change-Id: Ia5d4d9ab898510d07364ad455ccf93e1c1d95d2b Signed-off-by: David Wu --- diff --git a/drivers/pwm/core.c b/drivers/pwm/core.c index 52ecfab9f765..6ec9a0ce9c44 100644 --- a/drivers/pwm/core.c +++ b/drivers/pwm/core.c @@ -963,6 +963,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"); } }