From: swarren@wwwdotorg.org (Stephen Warren)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 06/12] pinctrl/nomadik: implement pin configuration
Date: Wed, 09 May 2012 14:44:17 -0600 [thread overview]
Message-ID: <4FAAD721.3070101@wwwdotorg.org> (raw)
In-Reply-To: <1336470302-23670-1-git-send-email-linus.walleij@stericsson.com>
On 05/08/2012 03:45 AM, Linus Walleij wrote:
> From: Linus Walleij <linus.walleij@linaro.org>
>
> This implements the pin configuration interface for the
> Nomadik pin controller.
>
> As part of the exercise we add a bit in the pin_cfg_t for
> the Nomadik pinctrl driver that indicates if the pin should
> be forced into GPIO mode. This is not done to go behind the
> back of the GPIO subsystem, but to ensure that default modes
> can be set by hogs on boot and system suspend/resume states.
> It was used implicitly by the old code defining all config
> settings and modes in a single config word but we now have
> a split between pinmux and pinconf leading to the need to
> have this.
Yes, I have wondered if we should have always represented the
GPIO/pinctrl interaction as a pinctrl "function" of "GPIO. There are a
few gotchas that prevented me moving forward with this though:
1) On Tegra at least, GPIO-vs-pinmux is actually a bit in the GPIO
controller, so that mux is after the pinmux's output mux
2) I'm not sure how it'd work when you could mux "GPIO controller A GPIO
x" or "GPIO controller B pin y" onto the same pinctrl pin
3) On Tegra at least, special-function muxing is at a per-pingroup
level, but GPIO muxing is at a per-pin level. So much for regular HW:-(
> @@ -1561,7 +1562,8 @@ int nmk_gpio_request_enable(struct pinctrl_dev *pctldev,
>
> clk_enable(nmk_chip->clk);
> bit = offset % NMK_GPIO_PER_CHIP;
> - __nmk_gpio_set_mode_safe(nmk_chip, bit, NMK_GPIO_ALT_GPIO, false);
> + /* There is no glitch when converting any pin to GPIO */
> + __nmk_gpio_set_mode(nmk_chip, bit, NMK_GPIO_ALT_GPIO);
Was that meant to be squashed into some other earlier change?
WARNING: multiple messages have this Message-ID (diff)
From: Stephen Warren <swarren@wwwdotorg.org>
To: Linus Walleij <linus.walleij@stericsson.com>
Cc: linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
Stephen Warren <swarren@nvidia.com>,
Shawn Guo <shawn.guo@freescale.com>,
Thomas Abraham <thomas.abraham@linaro.org>,
Dong Aisheng <dong.aisheng@linaro.org>,
Rajendra Nayak <rajendra.nayak@linaro.org>,
Haojian Zhuang <haojian.zhuang@marvell.com>,
Linus Walleij <linus.walleij@linaro.org>
Subject: Re: [PATCH 06/12] pinctrl/nomadik: implement pin configuration
Date: Wed, 09 May 2012 14:44:17 -0600 [thread overview]
Message-ID: <4FAAD721.3070101@wwwdotorg.org> (raw)
In-Reply-To: <1336470302-23670-1-git-send-email-linus.walleij@stericsson.com>
On 05/08/2012 03:45 AM, Linus Walleij wrote:
> From: Linus Walleij <linus.walleij@linaro.org>
>
> This implements the pin configuration interface for the
> Nomadik pin controller.
>
> As part of the exercise we add a bit in the pin_cfg_t for
> the Nomadik pinctrl driver that indicates if the pin should
> be forced into GPIO mode. This is not done to go behind the
> back of the GPIO subsystem, but to ensure that default modes
> can be set by hogs on boot and system suspend/resume states.
> It was used implicitly by the old code defining all config
> settings and modes in a single config word but we now have
> a split between pinmux and pinconf leading to the need to
> have this.
Yes, I have wondered if we should have always represented the
GPIO/pinctrl interaction as a pinctrl "function" of "GPIO. There are a
few gotchas that prevented me moving forward with this though:
1) On Tegra at least, GPIO-vs-pinmux is actually a bit in the GPIO
controller, so that mux is after the pinmux's output mux
2) I'm not sure how it'd work when you could mux "GPIO controller A GPIO
x" or "GPIO controller B pin y" onto the same pinctrl pin
3) On Tegra at least, special-function muxing is at a per-pingroup
level, but GPIO muxing is at a per-pin level. So much for regular HW:-(
> @@ -1561,7 +1562,8 @@ int nmk_gpio_request_enable(struct pinctrl_dev *pctldev,
>
> clk_enable(nmk_chip->clk);
> bit = offset % NMK_GPIO_PER_CHIP;
> - __nmk_gpio_set_mode_safe(nmk_chip, bit, NMK_GPIO_ALT_GPIO, false);
> + /* There is no glitch when converting any pin to GPIO */
> + __nmk_gpio_set_mode(nmk_chip, bit, NMK_GPIO_ALT_GPIO);
Was that meant to be squashed into some other earlier change?
next prev parent reply other threads:[~2012-05-09 20:44 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-08 9:45 [PATCH 06/12] pinctrl/nomadik: implement pin configuration Linus Walleij
2012-05-08 9:45 ` Linus Walleij
2012-05-09 20:44 ` Stephen Warren [this message]
2012-05-09 20:44 ` Stephen Warren
2012-05-11 8:21 ` Linus Walleij
2012-05-11 8:21 ` 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=4FAAD721.3070101@wwwdotorg.org \
--to=swarren@wwwdotorg.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 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.