From patchwork Mon Feb 11 17:10:54 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haojian Zhuang X-Patchwork-Id: 14749 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 97BF723DEA for ; Mon, 11 Feb 2013 17:12:00 +0000 (UTC) Received: from mail-ve0-f176.google.com (mail-ve0-f176.google.com [209.85.128.176]) by fiordland.canonical.com (Postfix) with ESMTP id 43385A19245 for ; Mon, 11 Feb 2013 17:12:00 +0000 (UTC) Received: by mail-ve0-f176.google.com with SMTP id cz10so5197436veb.7 for ; Mon, 11 Feb 2013 09:11:59 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-received:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state; bh=i/GpoCIs+ItSKGfq4bUIYivhYW65MqizNG+lu6eMzpE=; b=eKbv4ScWj+VhhjZKQwjWmBe89Vjj3AyXkbmtmhZvvLLXbygfUe82CybhNT7Zv+XG3E z39FbUl+Ha/lhKr8IkbqXNLojQHM7fxx1wtpawqtgJfAT7rrlBAevGxi8Gir7VU7/TLt 7lgH8nPCV6HBJ01ewqePWOSDv5/BLpqcGsCpyPHanwNirKtTaIX9eJVKxDZtYTID6Umt Gzn+uwu9kZYaVSoeAgxr7yMv0hCJYd+I+758seYZBYefZaP9AmEr5/pEAaYQtBOR1D4c u/7+WncFFD0OsYUDZ0HPbJTHx0tLVGAPnVHafKjI2HdkHLp5PU28XVLRUaOrcbr506iG /LrA== X-Received: by 10.58.232.226 with SMTP id tr2mr19569193vec.48.1360602712994; Mon, 11 Feb 2013 09:11:52 -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.58.252.8 with SMTP id zo8csp108015vec; Mon, 11 Feb 2013 09:11:52 -0800 (PST) X-Received: by 10.66.74.2 with SMTP id p2mr42845057pav.55.1360602711824; Mon, 11 Feb 2013 09:11:51 -0800 (PST) Received: from mail-pa0-f50.google.com (mail-pa0-f50.google.com [209.85.220.50]) by mx.google.com with ESMTPS id z9si38282940pav.92.2013.02.11.09.11.51 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 11 Feb 2013 09:11:51 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.50 is neither permitted nor denied by best guess record for domain of haojian.zhuang@linaro.org) client-ip=209.85.220.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.50 is neither permitted nor denied by best guess record for domain of haojian.zhuang@linaro.org) smtp.mail=haojian.zhuang@linaro.org Received: by mail-pa0-f50.google.com with SMTP id fa11so3118730pad.37 for ; Mon, 11 Feb 2013 09:11:51 -0800 (PST) X-Received: by 10.66.85.101 with SMTP id g5mr42845328paz.17.1360602711316; Mon, 11 Feb 2013 09:11:51 -0800 (PST) Received: from localhost.localdomain ([27.115.121.35]) by mx.google.com with ESMTPS id m3sm67935973pav.4.2013.02.11.09.11.46 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 11 Feb 2013 09:11:50 -0800 (PST) From: Haojian Zhuang To: shiraz.hashim@st.com, shiraz.linux.kernel@gmail.com, linux@arm.linux.org.uk, tony@atomide.com, linux-arm-kernel@lists.infradead.org, swarren@nvidia.com, grant.likely@secretlab.ca, linus.walleij@linaro.org Cc: patches@linaro.org, Haojian Zhuang Subject: [PATCH v8 07/12] pinctrl: generic: dump pin configuration Date: Tue, 12 Feb 2013 01:10:54 +0800 Message-Id: <1360602659-4774-8-git-send-email-haojian.zhuang@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1360602659-4774-1-git-send-email-haojian.zhuang@linaro.org> References: <1360602659-4774-1-git-send-email-haojian.zhuang@linaro.org> X-Gm-Message-State: ALoCoQknx+3g1Q1jPpoyjlHgOP567NUzz7BEcQvty876EkaLISaYnuSFyuTd9oIsE7MsOa0RRqIk Add the support of dumping pin configuration. Signed-off-by: Haojian Zhuang --- drivers/pinctrl/pinconf-generic.c | 14 ++++++++++++++ drivers/pinctrl/pinconf.h | 8 ++++++++ 2 files changed, 22 insertions(+) diff --git a/drivers/pinctrl/pinconf-generic.c b/drivers/pinctrl/pinconf-generic.c index e5948f8..ef24230 100644 --- a/drivers/pinctrl/pinconf-generic.c +++ b/drivers/pinctrl/pinconf-generic.c @@ -12,6 +12,7 @@ #define pr_fmt(fmt) "generic pinconfig core: " fmt #include +#include #include #include #include @@ -120,4 +121,17 @@ 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)); + } +} +EXPORT_SYMBOL_GPL(pinconf_generic_dump_config); #endif diff --git a/drivers/pinctrl/pinconf.h b/drivers/pinctrl/pinconf.h index e3ed8cb..1f7113e 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 inline void pinconf_generic_dump_config(struct pinctrl_dev *pctldev, + struct seq_file *s, + unsigned long config) +{ + return; +} #endif