]> Git Repo - linux.git/commitdiff
pwm: Add information about polarity, duty cycle and period to debugfs
authorHeiko Stübner <[email protected]>
Thu, 14 Apr 2016 19:17:44 +0000 (21:17 +0200)
committerThierry Reding <[email protected]>
Tue, 17 May 2016 12:48:05 +0000 (14:48 +0200)
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 <[email protected]>
Signed-off-by: Boris Brezillon <[email protected]>
[[email protected]: use more spaces in debugfs output]
Signed-off-by: Thierry Reding <[email protected]>
drivers/pwm/core.c

index b0b87b3b52a6516f6fd1ab7a28cb7449589f4370..c2e1a4bb23ac7f4d9b881a1a57d710bf69b52ce5 100644 (file)
@@ -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");
        }
 }
This page took 0.054392 seconds and 4 git commands to generate.