From: Maxime Coquelin <maxime.coquelin@st.com>
To: Lee Jones <lee.jones@linaro.org>,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, linus.walleij@linaro.org,
linux-gpio@vger.kernel.org
Cc: kernel@stlinux.com
Subject: Re: [STLinux Kernel] [PATCH 6/6] pinctrl: st: Display pin's function when printing pinctrl debug information
Date: Wed, 18 Mar 2015 17:35:06 +0100 [thread overview]
Message-ID: <5509A93A.5080202@st.com> (raw)
In-Reply-To: <1426675899-19882-7-git-send-email-lee.jones@linaro.org>
Hi Lee,
On 03/18/2015 11:51 AM, Lee Jones wrote:
> Great for easily determining which mode a pin is operating in.
> This patch was particularly helpful when debugging a recent GPIO/
> Pinctrl disparity issue.
>
> Before:
> $ cat /sys/kernel/debug/pinctrl/<pin-controller>/pinconf-pins
> pin 33 (PIO4[1]):[OE:0,PU:0,OD:0]
> [retime:0,invclk:0,clknotdat:0,de:0,rt-clk:0,rt-delay:0]
>
> After [GPIO]:
> $ cat /sys/kernel/debug/pinctrl/<pin-controller>/pinconf-pins
> pin 33 (PIO4[1]):[OE:0,PU:0,OD:0] GPIO
> [retime:0,invclk:0,clknotdat:0,de:0,rt-clk:0,rt-delay:0]
>
> After [Alt]:
> $ cat /sys/kernel/debug/pinctrl/<pin-controller>/pinconf-pins
> pin 33 (PIO4[1]):[OE:0,PU:0,OD:0] Alt Fn 2
> [retime:0,invclk:0,clknotdat:0,de:0,rt-clk:0,rt-delay:0]
>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
> ---
> drivers/pinctrl/pinctrl-st.c | 12 +++++++++++-
> 1 file changed, 11 insertions(+), 1 deletion(-)
A couple of comments below.
Once fixed, you can add my:
Acked-by: Maxime Coquelin <maxime.coquelin@st.com>
>
> diff --git a/drivers/pinctrl/pinctrl-st.c b/drivers/pinctrl/pinctrl-st.c
> index 1cda40e..d5b2ffa 100644
> --- a/drivers/pinctrl/pinctrl-st.c
> +++ b/drivers/pinctrl/pinctrl-st.c
> @@ -1058,18 +1058,28 @@ static void st_pinconf_dbg_show(struct pinctrl_dev *pctldev,
> {
> struct st_pio_control *pc;
> unsigned long config;
> + unsigned int function;
> int offset = st_gpio_pin(pin_id);
> + char f[64];
64 bytes is way too big here
>
> mutex_unlock(&pctldev->mutex);
> pc = st_get_pio_control(pctldev, pin_id);
> st_pinconf_get(pctldev, pin_id, &config);
> mutex_lock(&pctldev->mutex);
> - seq_printf(s, "[OE:%ld,PU:%ld,OD:%ld]\n"
> +
> + function = st_pctl_get_pin_function(pc, offset);
> + if (function)
> + sprintf(f, "Alt Fn %d", function);
Please use snprintf.
> + else
> + sprintf(f, "GPIO");
> +
> + seq_printf(s, "[OE:%d,PU:%ld,OD:%ld]\t%s\n"
> "\t\t[retime:%ld,invclk:%ld,clknotdat:%ld,"
> "de:%ld,rt-clk:%ld,rt-delay:%ld]",
> !st_gpio_get_direction(&pc_to_bank(pc)->gpio_chip, offset),
> ST_PINCONF_UNPACK_PU(config),
> ST_PINCONF_UNPACK_OD(config),
> + f,
> ST_PINCONF_UNPACK_RT(config),
> ST_PINCONF_UNPACK_RT_INVERTCLK(config),
> ST_PINCONF_UNPACK_RT_CLKNOTDATA(config),
Thanks,
Maxime
WARNING: multiple messages have this Message-ID (diff)
From: maxime.coquelin@st.com (Maxime Coquelin)
To: linux-arm-kernel@lists.infradead.org
Subject: [STLinux Kernel] [PATCH 6/6] pinctrl: st: Display pin's function when printing pinctrl debug information
Date: Wed, 18 Mar 2015 17:35:06 +0100 [thread overview]
Message-ID: <5509A93A.5080202@st.com> (raw)
In-Reply-To: <1426675899-19882-7-git-send-email-lee.jones@linaro.org>
Hi Lee,
On 03/18/2015 11:51 AM, Lee Jones wrote:
> Great for easily determining which mode a pin is operating in.
> This patch was particularly helpful when debugging a recent GPIO/
> Pinctrl disparity issue.
>
> Before:
> $ cat /sys/kernel/debug/pinctrl/<pin-controller>/pinconf-pins
> pin 33 (PIO4[1]):[OE:0,PU:0,OD:0]
> [retime:0,invclk:0,clknotdat:0,de:0,rt-clk:0,rt-delay:0]
>
> After [GPIO]:
> $ cat /sys/kernel/debug/pinctrl/<pin-controller>/pinconf-pins
> pin 33 (PIO4[1]):[OE:0,PU:0,OD:0] GPIO
> [retime:0,invclk:0,clknotdat:0,de:0,rt-clk:0,rt-delay:0]
>
> After [Alt]:
> $ cat /sys/kernel/debug/pinctrl/<pin-controller>/pinconf-pins
> pin 33 (PIO4[1]):[OE:0,PU:0,OD:0] Alt Fn 2
> [retime:0,invclk:0,clknotdat:0,de:0,rt-clk:0,rt-delay:0]
>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
> ---
> drivers/pinctrl/pinctrl-st.c | 12 +++++++++++-
> 1 file changed, 11 insertions(+), 1 deletion(-)
A couple of comments below.
Once fixed, you can add my:
Acked-by: Maxime Coquelin <maxime.coquelin@st.com>
>
> diff --git a/drivers/pinctrl/pinctrl-st.c b/drivers/pinctrl/pinctrl-st.c
> index 1cda40e..d5b2ffa 100644
> --- a/drivers/pinctrl/pinctrl-st.c
> +++ b/drivers/pinctrl/pinctrl-st.c
> @@ -1058,18 +1058,28 @@ static void st_pinconf_dbg_show(struct pinctrl_dev *pctldev,
> {
> struct st_pio_control *pc;
> unsigned long config;
> + unsigned int function;
> int offset = st_gpio_pin(pin_id);
> + char f[64];
64 bytes is way too big here
>
> mutex_unlock(&pctldev->mutex);
> pc = st_get_pio_control(pctldev, pin_id);
> st_pinconf_get(pctldev, pin_id, &config);
> mutex_lock(&pctldev->mutex);
> - seq_printf(s, "[OE:%ld,PU:%ld,OD:%ld]\n"
> +
> + function = st_pctl_get_pin_function(pc, offset);
> + if (function)
> + sprintf(f, "Alt Fn %d", function);
Please use snprintf.
> + else
> + sprintf(f, "GPIO");
> +
> + seq_printf(s, "[OE:%d,PU:%ld,OD:%ld]\t%s\n"
> "\t\t[retime:%ld,invclk:%ld,clknotdat:%ld,"
> "de:%ld,rt-clk:%ld,rt-delay:%ld]",
> !st_gpio_get_direction(&pc_to_bank(pc)->gpio_chip, offset),
> ST_PINCONF_UNPACK_PU(config),
> ST_PINCONF_UNPACK_OD(config),
> + f,
> ST_PINCONF_UNPACK_RT(config),
> ST_PINCONF_UNPACK_RT_INVERTCLK(config),
> ST_PINCONF_UNPACK_RT_CLKNOTDATA(config),
Thanks,
Maxime
WARNING: multiple messages have this Message-ID (diff)
From: Maxime Coquelin <maxime.coquelin@st.com>
To: Lee Jones <lee.jones@linaro.org>,
<linux-arm-kernel@lists.infradead.org>,
<linux-kernel@vger.kernel.org>, <linus.walleij@linaro.org>,
<linux-gpio@vger.kernel.org>
Cc: <kernel@stlinux.com>
Subject: Re: [STLinux Kernel] [PATCH 6/6] pinctrl: st: Display pin's function when printing pinctrl debug information
Date: Wed, 18 Mar 2015 17:35:06 +0100 [thread overview]
Message-ID: <5509A93A.5080202@st.com> (raw)
In-Reply-To: <1426675899-19882-7-git-send-email-lee.jones@linaro.org>
Hi Lee,
On 03/18/2015 11:51 AM, Lee Jones wrote:
> Great for easily determining which mode a pin is operating in.
> This patch was particularly helpful when debugging a recent GPIO/
> Pinctrl disparity issue.
>
> Before:
> $ cat /sys/kernel/debug/pinctrl/<pin-controller>/pinconf-pins
> pin 33 (PIO4[1]):[OE:0,PU:0,OD:0]
> [retime:0,invclk:0,clknotdat:0,de:0,rt-clk:0,rt-delay:0]
>
> After [GPIO]:
> $ cat /sys/kernel/debug/pinctrl/<pin-controller>/pinconf-pins
> pin 33 (PIO4[1]):[OE:0,PU:0,OD:0] GPIO
> [retime:0,invclk:0,clknotdat:0,de:0,rt-clk:0,rt-delay:0]
>
> After [Alt]:
> $ cat /sys/kernel/debug/pinctrl/<pin-controller>/pinconf-pins
> pin 33 (PIO4[1]):[OE:0,PU:0,OD:0] Alt Fn 2
> [retime:0,invclk:0,clknotdat:0,de:0,rt-clk:0,rt-delay:0]
>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
> ---
> drivers/pinctrl/pinctrl-st.c | 12 +++++++++++-
> 1 file changed, 11 insertions(+), 1 deletion(-)
A couple of comments below.
Once fixed, you can add my:
Acked-by: Maxime Coquelin <maxime.coquelin@st.com>
>
> diff --git a/drivers/pinctrl/pinctrl-st.c b/drivers/pinctrl/pinctrl-st.c
> index 1cda40e..d5b2ffa 100644
> --- a/drivers/pinctrl/pinctrl-st.c
> +++ b/drivers/pinctrl/pinctrl-st.c
> @@ -1058,18 +1058,28 @@ static void st_pinconf_dbg_show(struct pinctrl_dev *pctldev,
> {
> struct st_pio_control *pc;
> unsigned long config;
> + unsigned int function;
> int offset = st_gpio_pin(pin_id);
> + char f[64];
64 bytes is way too big here
>
> mutex_unlock(&pctldev->mutex);
> pc = st_get_pio_control(pctldev, pin_id);
> st_pinconf_get(pctldev, pin_id, &config);
> mutex_lock(&pctldev->mutex);
> - seq_printf(s, "[OE:%ld,PU:%ld,OD:%ld]\n"
> +
> + function = st_pctl_get_pin_function(pc, offset);
> + if (function)
> + sprintf(f, "Alt Fn %d", function);
Please use snprintf.
> + else
> + sprintf(f, "GPIO");
> +
> + seq_printf(s, "[OE:%d,PU:%ld,OD:%ld]\t%s\n"
> "\t\t[retime:%ld,invclk:%ld,clknotdat:%ld,"
> "de:%ld,rt-clk:%ld,rt-delay:%ld]",
> !st_gpio_get_direction(&pc_to_bank(pc)->gpio_chip, offset),
> ST_PINCONF_UNPACK_PU(config),
> ST_PINCONF_UNPACK_OD(config),
> + f,
> ST_PINCONF_UNPACK_RT(config),
> ST_PINCONF_UNPACK_RT_INVERTCLK(config),
> ST_PINCONF_UNPACK_RT_CLKNOTDATA(config),
Thanks,
Maxime
next prev parent reply other threads:[~2015-03-18 16:35 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-18 10:51 [PATCH 0/6] pinctrl: st: Fix disparity between Pinctrl & GPIO in /sysfs Lee Jones
2015-03-18 10:51 ` Lee Jones
2015-03-18 10:51 ` [PATCH 1/6] ARM: STi: DT: STiH407: Fix retime pin mask for PIO5 and PIO35 Lee Jones
2015-03-18 10:51 ` Lee Jones
2015-03-18 16:36 ` [STLinux Kernel] " Maxime Coquelin
2015-03-18 16:36 ` Maxime Coquelin
2015-03-18 16:36 ` Maxime Coquelin
2015-03-18 10:51 ` [PATCH 2/6] pinctrl: st: Introduce a 'get pin function' call Lee Jones
2015-03-18 10:51 ` Lee Jones
2015-03-18 16:41 ` [STLinux Kernel] " Maxime Coquelin
2015-03-18 16:41 ` Maxime Coquelin
2015-03-18 16:41 ` Maxime Coquelin
2015-03-18 16:51 ` Lee Jones
2015-03-18 16:51 ` Lee Jones
2015-03-18 17:00 ` Maxime Coquelin
2015-03-18 17:00 ` Maxime Coquelin
2015-03-18 17:00 ` Maxime Coquelin
2015-03-18 10:51 ` [PATCH 3/6] pinctrl: st: Move st_get_pio_control() further up the source file Lee Jones
2015-03-18 10:51 ` Lee Jones
2015-03-18 16:41 ` [STLinux Kernel] " Maxime Coquelin
2015-03-18 16:41 ` Maxime Coquelin
2015-03-18 16:41 ` Maxime Coquelin
2015-03-18 10:51 ` [PATCH 4/6] pinctrl: st: Supply a GPIO get_direction() call-back Lee Jones
2015-03-18 10:51 ` Lee Jones
2015-03-18 16:43 ` [STLinux Kernel] " Maxime Coquelin
2015-03-18 16:43 ` Maxime Coquelin
2015-03-18 16:43 ` Maxime Coquelin
2015-03-18 10:51 ` [PATCH 5/6] pinctrl: st: Show correct pin direction -- even when in GPIO mode Lee Jones
2015-03-18 10:51 ` Lee Jones
2015-03-18 16:45 ` [STLinux Kernel] " Maxime Coquelin
2015-03-18 16:45 ` Maxime Coquelin
2015-03-18 16:45 ` Maxime Coquelin
2015-03-18 10:51 ` [PATCH 6/6] pinctrl: st: Display pin's function when printing pinctrl debug information Lee Jones
2015-03-18 10:51 ` Lee Jones
2015-03-18 16:35 ` Maxime Coquelin [this message]
2015-03-18 16:35 ` [STLinux Kernel] " Maxime Coquelin
2015-03-18 16:35 ` Maxime Coquelin
2015-03-18 16:54 ` Lee Jones
2015-03-18 16:54 ` Lee Jones
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=5509A93A.5080202@st.com \
--to=maxime.coquelin@st.com \
--cc=kernel@stlinux.com \
--cc=lee.jones@linaro.org \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.