From patchwork Wed Mar 18 10:51:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 45930 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D99A62153B for ; Wed, 18 Mar 2015 10:52:45 +0000 (UTC) Received: by labgq15 with SMTP id gq15sf6629324lab.0 for ; Wed, 18 Mar 2015 03:52:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=28KVnGRaIFKnod+6JD3HXrVtwvr9i1ZIDnH38QD5HZk=; b=HH72d+r2HJRaRHv8f8GBxCrjFwv8N5N+tzPCA6n/uj8K4YuGel5Lf/oS80Vmj19rRn /1JbFr6Zt1Rm5AgDzJJKmsF0BRhECneVFrVL3Wg6GkeXPZIZ2er7gBL8wsCcHf5x/hFK 8vsxIGMApaLD/u7I9NWtANEXYerfN4Hs2lBt3HRss/5xHbUSLBXrfAS6ncBi+SoyFZuQ L59+A7TaSqgeaYPIJW51Z0sTVa/pY8inssT5sMjo6DQduRBo5jIh0yN6U0DWITNdLSoo zZh3+tEyFBVSvsXHPZUYNFkpFNzsye7dtUbRoDn+cTHXubzTXnQmHRM6LK1LqvIuLdfc ti3w== X-Gm-Message-State: ALoCoQlEs9R4D61RtUSua3tMoJCEYq0WktKn1pf/aiR1NAq4AJQwBRXf9vo/ZfgMlgGxaxH5SPxO X-Received: by 10.112.125.67 with SMTP id mo3mr9183791lbb.6.1426675964892; Wed, 18 Mar 2015 03:52:44 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.120.199 with SMTP id le7ls155644lab.89.gmail; Wed, 18 Mar 2015 03:52:44 -0700 (PDT) X-Received: by 10.152.43.51 with SMTP id t19mr62957634lal.73.1426675964715; Wed, 18 Mar 2015 03:52:44 -0700 (PDT) Received: from mail-lb0-f176.google.com (mail-lb0-f176.google.com. [209.85.217.176]) by mx.google.com with ESMTPS id f7si12620604lab.19.2015.03.18.03.52.44 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Mar 2015 03:52:44 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.176 as permitted sender) client-ip=209.85.217.176; Received: by lbbzq9 with SMTP id zq9so26586399lbb.0 for ; Wed, 18 Mar 2015 03:52:44 -0700 (PDT) X-Received: by 10.152.197.34 with SMTP id ir2mr63599509lac.36.1426675964586; Wed, 18 Mar 2015 03:52:44 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.35.133 with SMTP id h5csp1072438lbj; Wed, 18 Mar 2015 03:52:43 -0700 (PDT) X-Received: by 10.66.66.108 with SMTP id e12mr163003715pat.31.1426675962766; Wed, 18 Mar 2015 03:52:42 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id fl4si35226182pab.219.2015.03.18.03.52.41; Wed, 18 Mar 2015 03:52:42 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756063AbbCRKwh (ORCPT + 27 others); Wed, 18 Mar 2015 06:52:37 -0400 Received: from mail-wi0-f174.google.com ([209.85.212.174]:33258 "EHLO mail-wi0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756017AbbCRKwA (ORCPT ); Wed, 18 Mar 2015 06:52:00 -0400 Received: by wixw10 with SMTP id w10so61675732wix.0 for ; Wed, 18 Mar 2015 03:51:58 -0700 (PDT) X-Received: by 10.194.21.193 with SMTP id x1mr138809678wje.144.1426675918702; Wed, 18 Mar 2015 03:51:58 -0700 (PDT) Received: from localhost.localdomain ([81.134.86.251]) by mx.google.com with ESMTPSA id gz3sm2665532wib.1.2015.03.18.03.51.57 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 18 Mar 2015 03:51:57 -0700 (PDT) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linus.walleij@linaro.org, linux-gpio@vger.kernel.org Cc: lee.jones@linaro.org, kernel@stlinux.com Subject: [PATCH 6/6] pinctrl: st: Display pin's function when printing pinctrl debug information Date: Wed, 18 Mar 2015 10:51:39 +0000 Message-Id: <1426675899-19882-7-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1426675899-19882-1-git-send-email-lee.jones@linaro.org> References: <1426675899-19882-1-git-send-email-lee.jones@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: lee.jones@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.176 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Great for easily determining which mode a pin is operating in. This patch was particularly helpful when debugging a recent GPIO/ Pinctrl disparity issue. Before: $ cat /sys/kernel/debug/pinctrl//pinconf-pins pin 33 (PIO4[1]):[OE:0,PU:0,OD:0] [retime:0,invclk:0,clknotdat:0,de:0,rt-clk:0,rt-delay:0] After [GPIO]: $ cat /sys/kernel/debug/pinctrl//pinconf-pins pin 33 (PIO4[1]):[OE:0,PU:0,OD:0] GPIO [retime:0,invclk:0,clknotdat:0,de:0,rt-clk:0,rt-delay:0] After [Alt]: $ cat /sys/kernel/debug/pinctrl//pinconf-pins pin 33 (PIO4[1]):[OE:0,PU:0,OD:0] Alt Fn 2 [retime:0,invclk:0,clknotdat:0,de:0,rt-clk:0,rt-delay:0] Signed-off-by: Lee Jones --- drivers/pinctrl/pinctrl-st.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/pinctrl/pinctrl-st.c b/drivers/pinctrl/pinctrl-st.c index 1cda40e..d5b2ffa 100644 --- a/drivers/pinctrl/pinctrl-st.c +++ b/drivers/pinctrl/pinctrl-st.c @@ -1058,18 +1058,28 @@ static void st_pinconf_dbg_show(struct pinctrl_dev *pctldev, { struct st_pio_control *pc; unsigned long config; + unsigned int function; int offset = st_gpio_pin(pin_id); + char f[64]; mutex_unlock(&pctldev->mutex); pc = st_get_pio_control(pctldev, pin_id); st_pinconf_get(pctldev, pin_id, &config); mutex_lock(&pctldev->mutex); - seq_printf(s, "[OE:%ld,PU:%ld,OD:%ld]\n" + + function = st_pctl_get_pin_function(pc, offset); + if (function) + sprintf(f, "Alt Fn %d", function); + else + sprintf(f, "GPIO"); + + seq_printf(s, "[OE:%d,PU:%ld,OD:%ld]\t%s\n" "\t\t[retime:%ld,invclk:%ld,clknotdat:%ld," "de:%ld,rt-clk:%ld,rt-delay:%ld]", !st_gpio_get_direction(&pc_to_bank(pc)->gpio_chip, offset), ST_PINCONF_UNPACK_PU(config), ST_PINCONF_UNPACK_OD(config), + f, ST_PINCONF_UNPACK_RT(config), ST_PINCONF_UNPACK_RT_INVERTCLK(config), ST_PINCONF_UNPACK_RT_CLKNOTDATA(config),