From patchwork Wed Mar 18 17:21:19 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 45982 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f70.google.com (mail-wg0-f70.google.com [74.125.82.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9BD672153C for ; Wed, 18 Mar 2015 17:21:53 +0000 (UTC) Received: by wggy19 with SMTP id y19sf8472632wgg.2 for ; Wed, 18 Mar 2015 10:21:52 -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=/tXdZrzOpndcnnF3VFjxZu2ERqjDperL3tdx8mXdJ90=; b=eiiFhgUYuxavzbJRzIvKGx8FyeLploYq1jQ4mFtRSpA7z/e7LSUZgxiuLvWnHszBef 4bsb0qSrPi1UBwm5YEUCl19VxO51eBwfXna7/Xz3r3ZmhIocpO2O/gDaJJgUEit9onQG v4dZ8zK9LgOj2tJj2QBJl0zSv4mh411HHXju/DrgnvJZxpStVdJqvL6XknPcFuunnGwl V4DckmtQbj5M523V+sacL6MNkJrf4thqWFt7RhxweabeOIVz+CgnSrzHmhDH7HO8JjRN CAVEuQ6Dtvtv6TgJkykNDKcVGiwc9cedawO3RdBYRZ5zvWvM2lrQhdicXvaq2HIK7tS8 DBTg== X-Gm-Message-State: ALoCoQn69DoxhIxnuczQNCL+QX0jzrS9KWvenG+D8mfOo8u0IFvkyogz8Lx/eseBi9lnLk4R9PQy X-Received: by 10.194.236.196 with SMTP id uw4mr8194780wjc.5.1426699312980; Wed, 18 Mar 2015 10:21:52 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.19.234 with SMTP id i10ls179071lae.103.gmail; Wed, 18 Mar 2015 10:21:52 -0700 (PDT) X-Received: by 10.112.162.167 with SMTP id yb7mr63732562lbb.76.1426699312653; Wed, 18 Mar 2015 10:21:52 -0700 (PDT) Received: from mail-la0-f49.google.com (mail-la0-f49.google.com. [209.85.215.49]) by mx.google.com with ESMTPS id ds4si13373793lac.34.2015.03.18.10.21.52 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Mar 2015 10:21:52 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) client-ip=209.85.215.49; Received: by labjg1 with SMTP id jg1so41847807lab.2 for ; Wed, 18 Mar 2015 10:21:52 -0700 (PDT) X-Received: by 10.152.22.67 with SMTP id b3mr64088058laf.117.1426699312067; Wed, 18 Mar 2015 10:21:52 -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 h5csp1294521lbj; Wed, 18 Mar 2015 10:21:50 -0700 (PDT) X-Received: by 10.182.251.138 with SMTP id zk10mr58931671obc.72.1426699309321; Wed, 18 Mar 2015 10:21:49 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id rh12si37261231pdb.159.2015.03.18.10.21.48; Wed, 18 Mar 2015 10:21:49 -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 S1756624AbbCRRVk (ORCPT + 27 others); Wed, 18 Mar 2015 13:21:40 -0400 Received: from mail-we0-f171.google.com ([74.125.82.171]:34848 "EHLO mail-we0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756594AbbCRRVe (ORCPT ); Wed, 18 Mar 2015 13:21:34 -0400 Received: by webcq43 with SMTP id cq43so37794869web.2 for ; Wed, 18 Mar 2015 10:21:33 -0700 (PDT) X-Received: by 10.194.2.145 with SMTP id 17mr73182148wju.79.1426699293538; Wed, 18 Mar 2015 10:21:33 -0700 (PDT) Received: from localhost.localdomain ([81.134.86.251]) by mx.google.com with ESMTPSA id v13sm4021936wij.10.2015.03.18.10.21.32 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 18 Mar 2015 10:21:32 -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 v2 6/6] pinctrl: st: Display pin's function when printing pinctrl debug information Date: Wed, 18 Mar 2015 17:21:19 +0000 Message-Id: <1426699279-9258-7-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1426699279-9258-1-git-send-email-lee.jones@linaro.org> References: <1426699279-9258-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.215.49 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] Acked-by: Maxime Coquelin 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..b80ccc7 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[16]; 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) + snprintf(f, 10, "Alt Fn %d", function); + else + snprintf(f, 5, "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),