From patchwork Wed Jul 1 21:50:46 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Heiko_St=C3=BCbner?= X-Patchwork-Id: 6706881 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id DB1D79F38C for ; Wed, 1 Jul 2015 21:51:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 10C772079F for ; Wed, 1 Jul 2015 21:51:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 228D02078C for ; Wed, 1 Jul 2015 21:51:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753562AbbGAVvG (ORCPT ); Wed, 1 Jul 2015 17:51:06 -0400 Received: from gloria.sntech.de ([95.129.55.99]:43120 "EHLO gloria.sntech.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753487AbbGAVvE (ORCPT ); Wed, 1 Jul 2015 17:51:04 -0400 Received: from [95.91.187.196] (helo=diego.localnet) by gloria.sntech.de with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1ZAPu3-0001rM-57; Wed, 01 Jul 2015 23:50:47 +0200 From: Heiko =?ISO-8859-1?Q?St=FCbner?= To: linux-arm-kernel@lists.infradead.org Cc: Boris Brezillon , Thierry Reding , linux-pwm@vger.kernel.org, Alexandre Courbot , linux-fbdev@vger.kernel.org, Lee Jones , Stephen Warren , Tomi Valkeinen , Bryan Wu , Liam Girdwood , Doug Anderson , Mark Brown , Richard Purdie , Jingoo Han , linux-tegra@vger.kernel.org, Maxime Ripard , Jean-Christophe Plagniol-Villard , Jacek Anaszewski , linux-leds@vger.kernel.org Subject: [RFC PATCH 16/15] pwm: add informations about polarity, duty cycle and period to debugfs Date: Wed, 01 Jul 2015 23:50:46 +0200 Message-ID: <3365087.n2eEES60JK@diego> User-Agent: KMail/4.14.1 (Linux/3.16.0-4-amd64; KDE/4.14.2; x86_64; ; ) In-Reply-To: <1435738921-25027-1-git-send-email-boris.brezillon@free-electrons.com> References: <1435738921-25027-1-git-send-email-boris.brezillon@free-electrons.com> MIME-Version: 1.0 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- might be nice to have too ;-) drivers/pwm/core.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/pwm/core.c b/drivers/pwm/core.c index 6dafd8e..79037a2 100644 --- a/drivers/pwm/core.c +++ b/drivers/pwm/core.c @@ -951,9 +951,18 @@ static void pwm_dbg_show(struct pwm_chip *chip, struct seq_file *s) if (test_bit(PWMF_REQUESTED, &pwm->flags)) seq_puts(s, " requested"); - if (pwm_is_enabled(pwm)) + if (pwm_is_enabled(pwm)) { seq_puts(s, " enabled"); + 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"); } }