mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: John Crispin <blogic@openwrt.org>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: linux-kernel@vger.kernel.org, John Crispin <blogic@openwrt.org>,
	Thomas Langer <thomas.langer@lantiq.com>
Subject: [PATCH 09/11] PINCTRL: lantiq: add functionality to falcon_pinconf_dbg_show
Date: Fri,  1 Feb 2013 13:05:03 +0100	[thread overview]
Message-ID: <1359720305-31933-9-git-send-email-blogic@openwrt.org> (raw)
In-Reply-To: <1359720305-31933-1-git-send-email-blogic@openwrt.org>

The current code only has a stub for falcon_pinconf_dbg_show. This patch adds
proper functionality.

Signed-off-by: Thomas Langer <thomas.langer@lantiq.com>
Signed-off-by: John Crispin <blogic@openwrt.org>
---
 drivers/pinctrl/pinctrl-falcon.c |   31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/drivers/pinctrl/pinctrl-falcon.c b/drivers/pinctrl/pinctrl-falcon.c
index c5a9868..4a0d54a 100644
--- a/drivers/pinctrl/pinctrl-falcon.c
+++ b/drivers/pinctrl/pinctrl-falcon.c
@@ -315,6 +315,37 @@ static int falcon_pinconf_set(struct pinctrl_dev *pctrldev,
 static void falcon_pinconf_dbg_show(struct pinctrl_dev *pctrldev,
 			struct seq_file *s, unsigned offset)
 {
+	unsigned long config;
+	struct pin_desc *desc;
+
+	struct ltq_pinmux_info *info = pinctrl_dev_get_drvdata(pctrldev);
+	int port = PORT(offset);
+
+	seq_printf(s, " (port %d) mux %d -- ", port,
+		pad_r32(info->membase[port], LTQ_PADC_MUX(PORT_PIN(offset))));
+
+	config = LTQ_PINCONF_PACK(LTQ_PINCONF_PARAM_PULL, 0);
+	if (!falcon_pinconf_get(pctrldev, offset, &config))
+		seq_printf(s, "pull %d ",
+			(int)LTQ_PINCONF_UNPACK_ARG(config));
+
+	config = LTQ_PINCONF_PACK(LTQ_PINCONF_PARAM_DRIVE_CURRENT, 0);
+	if (!falcon_pinconf_get(pctrldev, offset, &config))
+		seq_printf(s, "drive-current %d ",
+			(int)LTQ_PINCONF_UNPACK_ARG(config));
+
+	config = LTQ_PINCONF_PACK(LTQ_PINCONF_PARAM_SLEW_RATE, 0);
+	if (!falcon_pinconf_get(pctrldev, offset, &config))
+		seq_printf(s, "slew-rate %d ",
+			(int)LTQ_PINCONF_UNPACK_ARG(config));
+
+	desc = pin_desc_get(pctrldev, offset);
+	if (desc) {
+		if (desc->gpio_owner)
+			seq_printf(s, " owner: %s", desc->gpio_owner);
+	} else {
+		seq_printf(s, " not registered");
+	}
 }
 
 static void falcon_pinconf_group_dbg_show(struct pinctrl_dev *pctrldev,
-- 
1.7.10.4


  parent reply	other threads:[~2013-02-01 12:08 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-01 12:04 [PATCH 01/11] PINCTRL: lantiq: pinconf uses port instead of pin John Crispin
2013-02-01 12:04 ` [PATCH 02/11] PINCTRL: lantiq: faulty bit inversion John Crispin
2013-02-05 14:39   ` Linus Walleij
2013-02-01 12:04 ` [PATCH 03/11] PINCTRL: lantiq: add pin_config_group_set support John Crispin
2013-02-05 14:42   ` Linus Walleij
2013-02-01 12:04 ` [PATCH 04/11] PINCTRL: lantiq: add output pinconf parameter John Crispin
2013-02-05 14:46   ` Linus Walleij
2013-02-05 14:46     ` John Crispin
2013-02-01 12:04 ` [PATCH 05/11] PINCTRL: lantiq: the pinconf OD parameter argument was ignored John Crispin
2013-02-05 14:50   ` Linus Walleij
2013-02-01 12:05 ` [PATCH 06/11] PINCTRL: lantiq: only probe available pad controllers John Crispin
2013-02-05 14:58   ` Linus Walleij
2013-02-01 12:05 ` [PATCH 07/11] PINCTRL: lantiq: one of the boot leds was defined incorrectly John Crispin
2013-02-05 14:53   ` Linus Walleij
2013-02-01 12:05 ` [PATCH 08/11] PINCTRL: lantiq: fix pinconfig parameters John Crispin
2013-02-05 14:57   ` Linus Walleij
2013-02-01 12:05 ` John Crispin [this message]
2013-02-05 14:55   ` [PATCH 09/11] PINCTRL: lantiq: add functionality to falcon_pinconf_dbg_show Linus Walleij
2013-02-01 12:05 ` [PATCH 10/11] PINCTRL: lantiq: fix pin availability check John Crispin
2013-02-01 12:05 ` [PATCH 11/11] PINCTRL: lantiq: fix pin number in ltq_pmx_gpio_request_enable John Crispin
2013-02-05 15:13   ` Linus Walleij
2013-02-05 14:39 ` [PATCH 01/11] PINCTRL: lantiq: pinconf uses port instead of pin Linus Walleij
2013-02-05 14:59   ` Linus Walleij
2013-02-05 15:00     ` John Crispin
2013-02-05 15:14       ` 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=1359720305-31933-9-git-send-email-blogic@openwrt.org \
    --to=blogic@openwrt.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=thomas.langer@lantiq.com \
    /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

all inboxes | Powered by JetHome®