From patchwork Thu May 28 08:14:02 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 49048 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f197.google.com (mail-lb0-f197.google.com [209.85.217.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 95676202A3 for ; Thu, 28 May 2015 08:14:18 +0000 (UTC) Received: by lbbti3 with SMTP id ti3sf8451667lbb.1 for ; Thu, 28 May 2015 01:14:17 -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:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=7INneYBvRczZv/+TvbuegEzjoCCrM+b26jHU1ed4neE=; b=EPB3V8I4udMkBkZ1pBjnpPB8KwTC9UusqeOT/oacbPWngx5noe/1JaIhOfZYMvjqOT AjzITnTay4Fs/q9jadWaN+pg0/u9LvpjvqN/vvhJBrXlr6HPHA62kJW7iUhW9qCZUxCN XsZO5UW3dMZbPUbRLM/3MPXe4q/+TSyBikbgZp5Z33HOr+VJPaq0MTxmXPyPg9Na8xcN R0L/cCa6cx6HiqlSughe3CCxFlEmYzcvODzRRMpOshXYF4Ov8vRDNDR2LRKUmCCMFtm4 BnXNV4ZyqZpmHTpH0QERTVEl8KcxctqrPDtx5PFIG0+OjDNtPDGEVBjYqzoqHw+yLta3 phHQ== X-Gm-Message-State: ALoCoQm6wDcS1vVhHiOsC+QQL11P3V6RyHy/IcPPHYa1nsryxD4QVZB0mrV2/fxD2SQppoTdi8/L X-Received: by 10.152.206.36 with SMTP id ll4mr1625722lac.6.1432800856598; Thu, 28 May 2015 01:14:16 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.37.166 with SMTP id z6ls141492laj.64.gmail; Thu, 28 May 2015 01:14:16 -0700 (PDT) X-Received: by 10.112.136.166 with SMTP id qb6mr1564916lbb.54.1432800856423; Thu, 28 May 2015 01:14:16 -0700 (PDT) Received: from mail-lb0-f180.google.com (mail-lb0-f180.google.com. [209.85.217.180]) by mx.google.com with ESMTPS id pw2si1335216lbb.33.2015.05.28.01.14.16 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 May 2015 01:14:16 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.180 as permitted sender) client-ip=209.85.217.180; Received: by lbbqq2 with SMTP id qq2so23009936lbb.3 for ; Thu, 28 May 2015 01:14:16 -0700 (PDT) X-Received: by 10.152.4.137 with SMTP id k9mr1491147lak.29.1432800855987; Thu, 28 May 2015 01:14:15 -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.108.230 with SMTP id hn6csp962341lbb; Thu, 28 May 2015 01:14:14 -0700 (PDT) X-Received: by 10.66.233.232 with SMTP id tz8mr1601780pac.77.1432800854131; Thu, 28 May 2015 01:14:14 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h13si2546881pdf.62.2015.05.28.01.14.13; Thu, 28 May 2015 01:14:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751673AbbE1IOM (ORCPT + 1 other); Thu, 28 May 2015 04:14:12 -0400 Received: from mail-lb0-f178.google.com ([209.85.217.178]:33438 "EHLO mail-lb0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751372AbbE1IOK (ORCPT ); Thu, 28 May 2015 04:14:10 -0400 Received: by lbcue7 with SMTP id ue7so23088678lbc.0 for ; Thu, 28 May 2015 01:14:09 -0700 (PDT) X-Received: by 10.152.44.166 with SMTP id f6mr1537877lam.86.1432800848966; Thu, 28 May 2015 01:14:08 -0700 (PDT) Received: from localhost.localdomain ([85.235.11.236]) by mx.google.com with ESMTPSA id ky7sm332895lab.37.2015.05.28.01.14.06 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 May 2015 01:14:07 -0700 (PDT) From: Linus Walleij To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: linux-gpio@vger.kernel.org, Linus Walleij , Sonic Zhang Subject: [PATCH] pinctrl: improve debugfs for strict controllers Date: Thu, 28 May 2015 10:14:02 +0200 Message-Id: <1432800842-19318-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 1.9.3 Sender: linux-gpio-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-gpio@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: linus.walleij@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.180 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: , If we know we are using a strict pin controller (one that cannot mix device functions+group use and GPIO) we can be a bit more specific in debugfs, just print either device-function-group or GPIO consumer for the pin. Let's do that to be helpful. Cc: Sonic Zhang Signed-off-by: Linus Walleij --- drivers/pinctrl/pinmux.c | 41 +++++++++++++++++++++++++++++++++-------- 1 file changed, 33 insertions(+), 8 deletions(-) diff --git a/drivers/pinctrl/pinmux.c b/drivers/pinctrl/pinmux.c index c58c168b06c2..77f82b23f7be 100644 --- a/drivers/pinctrl/pinmux.c +++ b/drivers/pinctrl/pinmux.c @@ -585,7 +585,12 @@ static int pinmux_pins_show(struct seq_file *s, void *what) return 0; seq_puts(s, "Pinmux settings per pin\n"); - seq_puts(s, "Format: pin (name): mux_owner gpio_owner hog?\n"); + if (pmxops->strict) + seq_puts(s, + "Format: pin (name): mux_owner|gpio_owner (strict) hog?\n"); + else + seq_puts(s, + "Format: pin (name): mux_owner gpio_owner hog?\n"); mutex_lock(&pctldev->mutex); @@ -604,14 +609,34 @@ static int pinmux_pins_show(struct seq_file *s, void *what) !strcmp(desc->mux_owner, pinctrl_dev_get_name(pctldev))) is_hog = true; - seq_printf(s, "pin %d (%s): %s %s%s", pin, - desc->name ? desc->name : "unnamed", - desc->mux_owner ? desc->mux_owner - : "(MUX UNCLAIMED)", - desc->gpio_owner ? desc->gpio_owner - : "(GPIO UNCLAIMED)", - is_hog ? " (HOG)" : ""); + if (pmxops->strict) { + if (desc->mux_owner) + seq_printf(s, "pin %d (%s): device %s%s", + pin, + desc->name ? desc->name : "unnamed", + desc->mux_owner, + is_hog ? " (HOG)" : ""); + else if (desc->gpio_owner) + seq_printf(s, "pin %d (%s): GPIO %s", + pin, + desc->name ? desc->name : "unnamed", + desc->gpio_owner); + else + seq_printf(s, "pin %d (%s): UNCLAIMED", + pin, + desc->name ? desc->name : "unnamed"); + } else { + /* For non-strict controllers */ + seq_printf(s, "pin %d (%s): %s %s%s", pin, + desc->name ? desc->name : "unnamed", + desc->mux_owner ? desc->mux_owner + : "(MUX UNCLAIMED)", + desc->gpio_owner ? desc->gpio_owner + : "(GPIO UNCLAIMED)", + is_hog ? " (HOG)" : ""); + } + /* If mux: print function+group claiming the pin */ if (desc->mux_setting) seq_printf(s, " function %s group %s\n", pmxops->get_function_name(pctldev,