linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: haojian.zhuang@linaro.org (Haojian Zhuang)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v9 07/10] pinctrl: generic: dump pin configuration
Date: Sun, 17 Feb 2013 19:42:53 +0800	[thread overview]
Message-ID: <1361101376-3783-8-git-send-email-haojian.zhuang@linaro.org> (raw)
In-Reply-To: <1361101376-3783-1-git-send-email-haojian.zhuang@linaro.org>

Add the support of dumping pin configuration.

Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
---
 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 <linux/kernel.h>
+#include <linux/module.h>
 #include <linux/init.h>
 #include <linux/device.h>
 #include <linux/slab.h>
@@ -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
-- 
1.7.10.4

  parent reply	other threads:[~2013-02-17 11:42 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-17 11:42 [PATCH v9 00/10] bind pinconf to pinctrl single Haojian Zhuang
2013-02-17 11:42 ` [PATCH v9 01/10] gpio: add gpio offset in gpio range cells property Haojian Zhuang
2013-03-01 12:43   ` Linus Walleij
2013-02-17 11:42 ` [PATCH v9 02/10] gpio: fix wrong checking condition for gpio range Haojian Zhuang
2013-03-01 12:45   ` Linus Walleij
2013-02-17 11:42 ` [PATCH v9 03/10] gpio: pl061: support irqdomain Haojian Zhuang
2013-03-01 12:48   ` Linus Walleij
2013-02-17 11:42 ` [PATCH v9 04/10] pinctrl: check pinctrl ready for gpio range Haojian Zhuang
2013-03-01 12:53   ` Linus Walleij
2013-02-17 11:42 ` [PATCH v9 05/10] gpio: pl061: bind pinctrl by gpio request Haojian Zhuang
2013-03-01 12:54   ` Linus Walleij
2013-02-17 11:42 ` [PATCH v9 06/10] pinctrl: single: create new gpio function range Haojian Zhuang
2013-03-01 12:57   ` Linus Walleij
2013-02-17 11:42 ` Haojian Zhuang [this message]
2013-03-01 12:59   ` [PATCH v9 07/10] pinctrl: generic: dump pin configuration Linus Walleij
2013-02-17 11:42 ` [PATCH v9 08/10] pinctrl: single: set function mask as optional Haojian Zhuang
2013-03-01 13:00   ` Linus Walleij
2013-02-17 11:42 ` [PATCH v9 09/10] pinctrl: single: support generic pinconf Haojian Zhuang
2013-03-01 13:03   ` Linus Walleij
2013-02-17 11:42 ` [PATCH v9 10/10] document: devicetree: bind pinconf with pin single Haojian Zhuang
2013-03-01 13:04   ` Linus Walleij

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1361101376-3783-8-git-send-email-haojian.zhuang@linaro.org \
    --to=haojian.zhuang@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).