From patchwork Sat Feb 2 17:25:49 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haojian Zhuang X-Patchwork-Id: 14427 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 9B62623F96 for ; Sat, 2 Feb 2013 17:26:59 +0000 (UTC) Received: from mail-vb0-f49.google.com (mail-vb0-f49.google.com [209.85.212.49]) by fiordland.canonical.com (Postfix) with ESMTP id 4B76DA18DE8 for ; Sat, 2 Feb 2013 17:26:59 +0000 (UTC) Received: by mail-vb0-f49.google.com with SMTP id s24so3046235vbi.22 for ; Sat, 02 Feb 2013 09:26:58 -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=AYGISmZNoU9Gkhe+zTLy+B9VD09oZ78V1Rbxjx6lM7U=; b=gDYP8UI0Icu7adezShF/apZF7FB0tt4KCEL8HsQlbbBq/GJzjtfrQ4tgxl1p94wv0Y WdoIy4UZeHzIgINu0j0oFBUpeSlzdJGXhBbiWpPGyaUo5fUJee4LM+ByhwUd7ddMfc3H IJP8DKlSUQRJi/gmMZ24HWMqfatK+Wlhjb9KYUAcnM15JZNb56rHVKK73y5oFfihE5WI lnyWRkcUIZWuE2bFVdbvEo2h367hdZrWNFsr/mzjntLPfQS8L/Mm5VK1E6j291Sx7Blw MCwLHUwlRGwLrMPmSI/aAS7PtWXL4sQ+fYCM1hPa0Red1SUZLDSdDLiG3Lp2iciI+vLj i60Q== X-Received: by 10.220.219.204 with SMTP id hv12mr14720414vcb.71.1359826018754; Sat, 02 Feb 2013 09:26:58 -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 zo8csp16831vec; Sat, 2 Feb 2013 09:26:58 -0800 (PST) X-Received: by 10.68.135.133 with SMTP id ps5mr41512822pbb.132.1359826018012; Sat, 02 Feb 2013 09:26:58 -0800 (PST) Received: from mail-pb0-f45.google.com (mail-pb0-f45.google.com [209.85.160.45]) by mx.google.com with ESMTPS id vy7si11283590pbc.96.2013.02.02.09.26.57 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 02 Feb 2013 09:26:58 -0800 (PST) Received-SPF: neutral (google.com: 209.85.160.45 is neither permitted nor denied by best guess record for domain of haojian.zhuang@linaro.org) client-ip=209.85.160.45; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.160.45 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-pb0-f45.google.com with SMTP id rq13so2590686pbb.32 for ; Sat, 02 Feb 2013 09:26:57 -0800 (PST) X-Received: by 10.68.130.226 with SMTP id oh2mr41886663pbb.157.1359826017646; Sat, 02 Feb 2013 09:26:57 -0800 (PST) Received: from localhost.localdomain ([27.115.121.35]) by mx.google.com with ESMTPS id b3sm10434040pax.14.2013.02.02.09.26.51 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 02 Feb 2013 09:26:56 -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 Cc: patches@linaro.org, Haojian Zhuang Subject: [PATCH v8 08/12] pinctrl: generic: dump pin configuration Date: Sun, 3 Feb 2013 01:25:49 +0800 Message-Id: <1359825953-15663-9-git-send-email-haojian.zhuang@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1359825953-15663-1-git-send-email-haojian.zhuang@linaro.org> References: <1359825953-15663-1-git-send-email-haojian.zhuang@linaro.org> X-Gm-Message-State: ALoCoQmFvc/RmilsGxyBkcY8hDqE2JctdpTiPwdHrtn24ySveP/cLCvjFBOqFcvmxM4yuaOyNvzL 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 e5948f8..66e4ae5 100644 --- a/drivers/pinctrl/pinconf-generic.c +++ b/drivers/pinctrl/pinconf-generic.c @@ -120,4 +120,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