From patchwork Fri Feb 24 05:56:09 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 6910 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id EAC172447B for ; Fri, 24 Feb 2012 05:56:48 +0000 (UTC) Received: from mail-iy0-f180.google.com (mail-iy0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id 940F2A180F4 for ; Fri, 24 Feb 2012 05:56:48 +0000 (UTC) Received: by iabz7 with SMTP id z7so3566923iab.11 for ; Thu, 23 Feb 2012 21:56:48 -0800 (PST) Received: from mr.google.com ([10.42.131.129]) by 10.42.131.129 with SMTP id z1mr735456ics.53.1330063008127 (num_hops = 1); Thu, 23 Feb 2012 21:56:48 -0800 (PST) Received: by 10.42.131.129 with SMTP id z1mr598621ics.53.1330063004641; Thu, 23 Feb 2012 21:56:44 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.11.10 with SMTP id r10csp2785ibr; Thu, 23 Feb 2012 21:56:43 -0800 (PST) Received: by 10.213.27.5 with SMTP id g5mr218931ebc.49.1330063003032; Thu, 23 Feb 2012 21:56:43 -0800 (PST) Received: from eu1sys200aog112.obsmtp.com (eu1sys200aog112.obsmtp.com. [207.126.144.133]) by mx.google.com with SMTP id q54si2691388eef.65.2012.02.23.21.56.24 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 23 Feb 2012 21:56:42 -0800 (PST) Received-SPF: neutral (google.com: 207.126.144.133 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) client-ip=207.126.144.133; Authentication-Results: mx.google.com; spf=neutral (google.com: 207.126.144.133 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) smtp.mail=linus.walleij@stericsson.com Received: from beta.dmz-ap.st.com ([138.198.100.35]) (using TLSv1) by eu1sys200aob112.postini.com ([207.126.147.11]) with SMTP ID DSNKT0cmhZx7S/+Mo/3GpTSVn/bWug52Ettu@postini.com; Fri, 24 Feb 2012 05:56:42 UTC Received: from zeta.dmz-ap.st.com (ns6.st.com [138.198.234.13]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 06811CE; Fri, 24 Feb 2012 05:47:50 +0000 (GMT) Received: from relay2.stm.gmessaging.net (unknown [10.230.100.18]) by zeta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 0B84A90B; Fri, 24 Feb 2012 05:56:17 +0000 (GMT) Received: from exdcvycastm003.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm003", Issuer "exdcvycastm003" (not verified)) by relay2.stm.gmessaging.net (Postfix) with ESMTPS id D4885A8065; Fri, 24 Feb 2012 06:56:13 +0100 (CET) Received: from steludxu4075.lud.stericsson.com (10.230.100.153) by smtp.stericsson.com (10.230.100.1) with Microsoft SMTP Server (TLS) id 8.3.83.0; Fri, 24 Feb 2012 06:56:16 +0100 From: Linus Walleij To: , Cc: Stephen Warren , Grant Likely , Barry Song <21cnbao@gmail.com>, Shawn Guo , Thomas Abraham , Dong Aisheng , Rajendra Nayak , Haojian Zhuang , Linus Walleij Subject: [PATCH] pinctrl: make the pinmux-pins more helpful Date: Fri, 24 Feb 2012 06:56:09 +0100 Message-ID: <1330062969-25016-1-git-send-email-linus.walleij@stericsson.com> X-Mailer: git-send-email 1.7.8 MIME-Version: 1.0 X-Gm-Message-State: ALoCoQkJwIB5jIP0mnJJ4Ft0BvwSFcu6KPaAqIV7SEf+2z99VKFst8wTZ+wijMJiq5rFcZJ7YjTY From: Linus Walleij The debugfs file pinmux-pins used to tell which function was enabled but now states simply which device owns the pin. Being owned by the pinctrl driver itself means just that it's hogged so be a bit more helpful by printing that. Signed-off-by: Linus Walleij --- I somewhat mourn the loss of being able to tell from the debugfs which function is using a certain pin, does anyone have ideas on how to go about fixing this properly? The root file pinctrl-handles does tell it, but requires cross-referencing which isn't helpful. --- drivers/pinctrl/pinmux.c | 11 +++++++++-- 1 files changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/pinctrl/pinmux.c b/drivers/pinctrl/pinmux.c index 98b89d6..db5ed86 100644 --- a/drivers/pinctrl/pinmux.c +++ b/drivers/pinctrl/pinmux.c @@ -626,8 +626,8 @@ static int pinmux_pins_show(struct seq_file *s, void *what) /* The pin number can be retrived from the pin controller descriptor */ for (i = 0; i < pctldev->desc->npins; i++) { - struct pin_desc *desc; + const char *owner; pin = pctldev->desc->pins[i].number; desc = pin_desc_get(pctldev, pin); @@ -635,9 +635,16 @@ static int pinmux_pins_show(struct seq_file *s, void *what) if (desc == NULL) continue; + if (!desc->owner) + owner = "UNCLAIMED"; + else if (!strcmp(desc->owner, pinctrl_dev_get_name(pctldev))) + owner = "HOG"; + else + owner = desc->owner; + seq_printf(s, "pin %d (%s): %s\n", pin, desc->name ? desc->name : "unnamed", - desc->owner ? desc->owner : "UNCLAIMED"); + owner); } return 0;