From mboxrd@z Thu Jan 1 00:00:00 1970 From: Boris Brezillon Subject: [PATCH v2 08/10] pwm: add information about polarity, duty cycle and period to debugfs Date: Mon, 20 Jul 2015 17:32:05 +0200 Message-ID: <1437406327-6207-9-git-send-email-boris.brezillon@free-electrons.com> References: <1437406327-6207-1-git-send-email-boris.brezillon@free-electrons.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: In-Reply-To: <1437406327-6207-1-git-send-email-boris.brezillon@free-electrons.com> Sender: linux-kernel-owner@vger.kernel.org To: Thierry Reding , linux-pwm@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Bryan Wu , Richard Purdie , Jacek Anaszewski , linux-leds@vger.kernel.org, Heiko Stuebner , linux-rockchip@lists.infradead.org, Jingoo Han , Lee Jones , linux-fbdev@vger.kernel.org, Mark Brown , Liam Girdwood , Jean-Christophe Plagniol-Villard , Tomi Valkeinen , Doug Anderson , =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= , Maxime Ripard List-Id: linux-leds@vger.kernel.org =46rom: Heiko St=C3=BCbner The pwm-states make it possible to also output the polarity, duty cycle and period information in the debugfs pwm summary-outout. This makes it easier to gather overview information about pwms without needing to walk through the sysfs attributes of every pwm. Signed-off-by: Heiko Stuebner --- drivers/pwm/core.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/pwm/core.c b/drivers/pwm/core.c index 4fe4703..9fc8338 100644 --- a/drivers/pwm/core.c +++ b/drivers/pwm/core.c @@ -986,6 +986,11 @@ static void pwm_dbg_show(struct pwm_chip *chip, st= ruct seq_file *s) if (pwm_is_enabled(pwm)) seq_puts(s, " enabled"); =20 + seq_printf(s, " period:%uns", pwm_get_period(pwm)); + seq_printf(s, " duty:%uns", pwm_get_duty_cycle(pwm)); + seq_printf(s, " polarity:%s", pwm_get_polarity(pwm) ? "inverse" + : "normal"); + seq_puts(s, "\n"); } } --=20 1.9.1