From patchwork Fri Jan 18 07:31:16 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haojian Zhuang X-Patchwork-Id: 1999801 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 304C3DF280 for ; Fri, 18 Jan 2013 07:38:25 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Tw6Ua-00005n-QZ; Fri, 18 Jan 2013 07:36:00 +0000 Received: from mail-pa0-f41.google.com ([209.85.220.41]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1Tw6Qq-0005gC-1K for linux-arm-kernel@lists.infradead.org; Fri, 18 Jan 2013 07:32:09 +0000 Received: by mail-pa0-f41.google.com with SMTP id bj3so1978144pad.28 for ; Thu, 17 Jan 2013 23:32:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=PehC4dxmcMH6K2MOAgCoxD5Lmebs8o+GzydZWNXsmDs=; b=QZZworc4DLpnA0ujfAGam6GMtRRwXrkW+QytcRa9EB6oFBJLGmadvC8W9bpF7CmVYg bFnpu4LI1nGfM0RIrU9KqJ+vWJWaNj+FoZH1WScWOCYBIVaopSy4F0KqWQzmvenZ2PMq 5WO9gzjmgGdGDQTM6Z3BkOjgOrq25tsTrr9n21FBZAm25D7Pos1Luwm/FklSNxWcJrXT y3IH9twdNTXGQirlKJZwGBCrMA/jkoaxC11OL3O33CzsZICvQOG5OYp691eWFcDs331A EG0QSwaqffdecGz/CXM8Pk+mj3jrwYGcqPC2ZkJ/1aCJouhRBdhKNj7wJDSfM7Y56WCm sA9Q== X-Received: by 10.68.136.73 with SMTP id py9mr2453288pbb.43.1358494326565; Thu, 17 Jan 2013 23:32:06 -0800 (PST) Received: from localhost.localdomain ([98.126.173.75]) by mx.google.com with ESMTPS id i6sm2922899paw.19.2013.01.17.23.32.03 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 17 Jan 2013 23:32:05 -0800 (PST) From: Haojian Zhuang To: linus.walleij@linaro.org, linux@arm.linux.org.uk, tony@atomide.com, linux-arm-kernel@lists.infradead.org, swarren@nvidia.com Subject: [PATCH v7 12/15] pinctrl: generic: dump pin configuration Date: Fri, 18 Jan 2013 15:31:16 +0800 Message-Id: <1358494279-16503-13-git-send-email-haojian.zhuang@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1358494279-16503-1-git-send-email-haojian.zhuang@linaro.org> References: <1358494279-16503-1-git-send-email-haojian.zhuang@linaro.org> X-Gm-Message-State: ALoCoQm6yZXNF9Dy7s2dAgY4VhodmyqSAjz29jdmPWajg2AEMjTbfCgDLxj6fIfC5hYg8SdX+oXM X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130118_023208_185272_DE1CACAA X-CRM114-Status: GOOD ( 10.30 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.220.41 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Haojian Zhuang X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Add the support of dumping pin configuration. Signed-off-by: Haojian Zhuang --- drivers/pinctrl/pinconf-generic.c | 12 ++++++++++++ drivers/pinctrl/pinconf.h | 8 ++++++++ 2 files changed, 20 insertions(+) diff --git a/drivers/pinctrl/pinconf-generic.c b/drivers/pinctrl/pinconf-generic.c index 678db63..9bb6d47 100644 --- a/drivers/pinctrl/pinconf-generic.c +++ b/drivers/pinctrl/pinconf-generic.c @@ -119,4 +119,16 @@ void pinconf_generic_dump_group(struct pinctrl_dev *pctldev, } } +void pinconf_generic_dump_config(struct pinctrl_dev *pctldev, + struct seq_file *s, unsigned long config) +{ + int i; + + for(i = 0; i < ARRAY_SIZE(conf_items); i++) { + if (pinconf_to_config_param(config) != conf_items[i].param) + continue; + seq_printf(s, "%s: 0x%x", conf_items[i].display, + pinconf_to_config_argument(config)); + } +} #endif diff --git a/drivers/pinctrl/pinconf.h b/drivers/pinctrl/pinconf.h index e3ed8cb..8023421 100644 --- a/drivers/pinctrl/pinconf.h +++ b/drivers/pinctrl/pinconf.h @@ -98,6 +98,8 @@ void pinconf_generic_dump_pin(struct pinctrl_dev *pctldev, void pinconf_generic_dump_group(struct pinctrl_dev *pctldev, struct seq_file *s, const char *gname); +void pinconf_generic_dump_config(struct pinctrl_dev *pctldev, + struct seq_file *s, unsigned long config); #else static inline void pinconf_generic_dump_pin(struct pinctrl_dev *pctldev, @@ -114,4 +116,10 @@ static inline void pinconf_generic_dump_group(struct pinctrl_dev *pctldev, return; } +static void pinconf_generic_dump_config(struct pinctrl_dev *pctldev, + struct seq_file *s, + unsigned long config) +{ + return; +} #endif