From patchwork Wed Feb 29 17:58:52 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 7012 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 C289E23E4A for ; Wed, 29 Feb 2012 17:59:23 +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 7E6D3A1801F for ; Wed, 29 Feb 2012 17:59:23 +0000 (UTC) Received: by iage36 with SMTP id e36so3675532iag.11 for ; Wed, 29 Feb 2012 09:59:23 -0800 (PST) Received: from mr.google.com ([10.50.170.41]) by 10.50.170.41 with SMTP id aj9mr1659386igc.0.1330538362999 (num_hops = 1); Wed, 29 Feb 2012 09:59:22 -0800 (PST) Received: by 10.50.170.41 with SMTP id aj9mr1353828igc.0.1330538362955; Wed, 29 Feb 2012 09:59:22 -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.53.18 with SMTP id k18csp9117ibg; Wed, 29 Feb 2012 09:59:22 -0800 (PST) Received: by 10.14.38.193 with SMTP id a41mr565513eeb.125.1330538361479; Wed, 29 Feb 2012 09:59:21 -0800 (PST) Received: from eu1sys200aog114.obsmtp.com (eu1sys200aog114.obsmtp.com. [207.126.144.137]) by mx.google.com with SMTP id r8si14042758eem.39.2012.02.29.09.59.06 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 29 Feb 2012 09:59:21 -0800 (PST) Received-SPF: neutral (google.com: 207.126.144.137 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) client-ip=207.126.144.137; Authentication-Results: mx.google.com; spf=neutral (google.com: 207.126.144.137 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 eu1sys200aob114.postini.com ([207.126.147.11]) with SMTP ID DSNKT05nZ+/TxyuTPl5W16bRTT++6BRgBUls@postini.com; Wed, 29 Feb 2012 17:59:20 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 5D8BFC8; Wed, 29 Feb 2012 17:50:34 +0000 (GMT) Received: from relay2.stm.gmessaging.net (unknown [10.230.100.18]) by zeta.dmz-ap.st.com (STMicroelectronics) with ESMTP id B39CB122F; Wed, 29 Feb 2012 17:58:58 +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 41220A807B; Wed, 29 Feb 2012 18:58:51 +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; Wed, 29 Feb 2012 18:58:57 +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 v2] pinctrl: make the pinmux-pins more helpful Date: Wed, 29 Feb 2012 18:58:52 +0100 Message-ID: <1330538332-16088-1-git-send-email-linus.walleij@stericsson.com> X-Mailer: git-send-email 1.7.8 MIME-Version: 1.0 X-Gm-Message-State: ALoCoQmmiPYmMQ6ufN3nx58JPzZgR9H5dsQ7UZrUTGtSMXso24r4LU+CsOO8cAd95Ed8OBFWxo1Y 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. ChangeLog v1->v2: - Preserve the self-referential owner field, just clarify that when the pin controller states itself as owner this means that it's hogged. Acked-by: Dong Aisheng Signed-off-by: Linus Walleij --- drivers/pinctrl/pinmux.c | 11 ++++++++--- 1 files changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/pinctrl/pinmux.c b/drivers/pinctrl/pinmux.c index 98b89d6..2a40561 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; + bool is_hog = false; pin = pctldev->desc->pins[i].number; desc = pin_desc_get(pctldev, pin); @@ -635,9 +635,14 @@ static int pinmux_pins_show(struct seq_file *s, void *what) if (desc == NULL) continue; - seq_printf(s, "pin %d (%s): %s\n", pin, + if (desc->owner && + !strcmp(desc->owner, pinctrl_dev_get_name(pctldev))) + is_hog = true; + + seq_printf(s, "pin %d (%s): %s%s\n", pin, desc->name ? desc->name : "unnamed", - desc->owner ? desc->owner : "UNCLAIMED"); + desc->owner ? desc->owner : "UNCLAIMED", + is_hog ? " (HOG)" : ""); } return 0;