From patchwork Mon Jul 20 15:32:05 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Boris BREZILLON X-Patchwork-Id: 6828951 Return-Path: X-Original-To: patchwork-linux-rockchip@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 354649F7B4 for ; Mon, 20 Jul 2015 15:34:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4FFBA20603 for ; Mon, 20 Jul 2015 15:34:36 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 27EA4205F9 for ; Mon, 20 Jul 2015 15:34:35 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZHD5N-0005r2-VO; Mon, 20 Jul 2015 15:34:33 +0000 Received: from down.free-electrons.com ([37.187.137.238] helo=mail.free-electrons.com) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZHD3n-0004aV-9W; Mon, 20 Jul 2015 15:32:59 +0000 Received: by mail.free-electrons.com (Postfix, from userid 106) id 1037DA3A; Mon, 20 Jul 2015 17:32:22 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from localhost.localdomain (AToulouse-657-1-56-159.w82-125.abo.wanadoo.fr [82.125.234.159]) by mail.free-electrons.com (Postfix) with ESMTPSA id 536801F41; Mon, 20 Jul 2015 17:32:21 +0200 (CEST) From: Boris Brezillon To: Thierry Reding , linux-pwm@vger.kernel.org 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> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1437406327-6207-1-git-send-email-boris.brezillon@free-electrons.com> References: <1437406327-6207-1-git-send-email-boris.brezillon@free-electrons.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150720_083255_522757_2F369345 X-CRM114-Status: GOOD ( 11.28 ) X-Spam-Score: -3.8 (---) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-fbdev@vger.kernel.org, Heiko Stuebner , Jingoo Han , Tomi Valkeinen , Bryan Wu , linux-kernel@vger.kernel.org, Liam Girdwood , linux-rockchip@lists.infradead.org, Mark Brown , Richard Purdie , linux-arm-kernel@lists.infradead.org, =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= , Jean-Christophe Plagniol-Villard , Maxime Ripard , Doug Anderson , Lee Jones , Jacek Anaszewski , linux-leds@vger.kernel.org Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Heiko Stübner 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, struct seq_file *s) 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"); } }