From: Nicolas Ferre <nicolas.ferre@atmel.com>
To: Alexandre Belloni <alexandre.belloni@free-electrons.com>,
"Jean-Christophe Plagniol-Villard" <plagnioj@jcrosoft.com>,
Linus Walleij <linus.walleij@linaro.org>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: <linux-kernel@vger.kernel.org>, <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH 3/3] pinctrl: at91: implement at91_pinconf_dbg_show
Date: Fri, 13 Dec 2013 09:50:59 +0100 [thread overview]
Message-ID: <52AACA73.9060409@atmel.com> (raw)
In-Reply-To: <1386421734-10240-3-git-send-email-alexandre.belloni@free-electrons.com>
On 07/12/2013 14:08, Alexandre Belloni :
> This allows to get the pin configuration by using debugfs. On my system:
> # cat /sys/kernel/debug/pinctrl/pinctrl.3/pinconf-pins
>
> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
I am fine with these helpers:
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
But still a little disappointed that Laurent announced that he wouldn't
review the whole kernel ;-)
Bye guys and thanks a lot!
> ---
> drivers/pinctrl/pinctrl-at91.c | 25 +++++++++++++++++++++++++
> 1 file changed, 25 insertions(+)
>
> diff --git a/drivers/pinctrl/pinctrl-at91.c b/drivers/pinctrl/pinctrl-at91.c
> index b0b78f3468ae..bcfc8a2eebca 100644
> --- a/drivers/pinctrl/pinctrl-at91.c
> +++ b/drivers/pinctrl/pinctrl-at91.c
> @@ -784,10 +784,35 @@ static int at91_pinconf_set(struct pinctrl_dev *pctldev,
> return 0;
> }
>
> +#define DBG_SHOW_FLAG(flag) do { \
> + if (config & flag) { \
> + if (num_conf) \
> + seq_puts(s, "|"); \
> + seq_puts(s, #flag); \
> + num_conf++; \
> + } \
> +} while (0)
> +
> static void at91_pinconf_dbg_show(struct pinctrl_dev *pctldev,
> struct seq_file *s, unsigned pin_id)
> {
> + unsigned long config;
> + int ret, val, num_conf = 0;
> +
> + ret = at91_pinconf_get(pctldev, pin_id, &config);
> +
> + DBG_SHOW_FLAG(MULTI_DRIVE);
> + DBG_SHOW_FLAG(PULL_UP);
> + DBG_SHOW_FLAG(PULL_DOWN);
> + DBG_SHOW_FLAG(DIS_SCHMIT);
> + DBG_SHOW_FLAG(DEGLITCH);
> + DBG_SHOW_FLAG(DEBOUNCE);
> + if (config & DEBOUNCE) {
> + val = config >> DEBOUNCE_VAL_SHIFT;
> + seq_printf(s, "(%d)", val);
> + }
>
> + return;
> }
>
> static void at91_pinconf_group_dbg_show(struct pinctrl_dev *pctldev,
>
--
Nicolas Ferre
next prev parent reply other threads:[~2013-12-13 8:51 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-07 13:08 [PATCH 1/3] pinctrl: at91: correct a few typos Alexandre Belloni
2013-12-07 13:08 ` [PATCH 2/3] pinctrl: at91: initialize config parameter to 0 Alexandre Belloni
2013-12-09 8:24 ` Nicolas Ferre
2013-12-09 9:55 ` Alexandre Belloni
2013-12-12 14:40 ` Linus Walleij
2013-12-12 15:33 ` Alexandre Belloni
2013-12-12 14:38 ` Linus Walleij
2013-12-12 14:44 ` Linus Walleij
2013-12-07 13:08 ` [PATCH 3/3] pinctrl: at91: implement at91_pinconf_dbg_show Alexandre Belloni
2013-12-12 14:45 ` Linus Walleij
2013-12-12 15:50 ` Alexandre Belloni
2013-12-12 16:04 ` Laurent Pinchart
2013-12-12 21:14 ` Linus Walleij
2013-12-13 8:50 ` Nicolas Ferre [this message]
2013-12-13 9:34 ` Linus Walleij
2013-12-12 14:42 ` [PATCH 1/3] pinctrl: at91: correct a few typos Linus Walleij
2013-12-12 14:47 ` Laurent Pinchart
2013-12-12 21:13 ` 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=52AACA73.9060409@atmel.com \
--to=nicolas.ferre@atmel.com \
--cc=alexandre.belloni@free-electrons.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=plagnioj@jcrosoft.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