From: Stephen Warren <swarren@nvidia.com>
To: Linus Walleij <linus.walleij@stericsson.com>,
Linus Walleij <linus.walleij@linaro.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Barry Song <21cnbao@gmail.com>,
Shawn Guo <shawn.guo@freescale.com>,
Sascha Hauer <s.hauer@pengutronix.de>,
David Brown <davidb@codeaurora.org>,
Grant Likely <grant.likely@secretlab.ca>,
Rongjun Ying <Rongjun.Ying@csr.com>,
Linaro Dev <linaro-dev@lists.linaro.org>
Subject: RE: [PATCH] pinctrl: Add explicit gpio_disable_free pinmux_op
Date: Wed, 9 Nov 2011 08:28:14 -0800 [thread overview]
Message-ID: <74CDBE0F657A3D45AFBB94109FB122FF17408050C7@HQMAIL01.nvidia.com> (raw)
In-Reply-To: <1319221553-15128-1-git-send-email-swarren@nvidia.com>
Stephen Warren wrote at Friday, October 21, 2011 12:26 PM:
> Some pinctrl drivers (Tegra at least) program a pin to be a GPIO in a
> completely different manner than they select which function to mux out of
> that pin. In order to support a single "free" pinmux_op, the driver would
> need to maintain a per-pin state of requested-for-gpio vs. requested-for-
> function. However, that's a lot of work when the core already has explicit
> separate paths for gpio request/free and function request/free.
>
> So, add a gpio_disable_free op to struct pinmux_ops, and make pin_free()
> call it when appropriate.
LinusW,
Does this patch look good?
> When doing this, I noticed that when calling pin_request():
>
> !!gpio == (gpio_range != NULL)
>
> ... and so I collapsed those two parameters in both pin_request(), and
> when adding writing the new code in pin_free().
>
> Also, for pin_free():
>
> !!free_func == (gpio_range != NULL)
>
> However, I didn't want pin_free() to know about the GPIO function naming
> special case, so instead, I reworked pin_free() to always return the pin's
> previously requested function, and now pinmux_free_gpio() calls
> kfree(function). This is much more balanced with the allocation having
> been performed in pinmux_request_gpio().
>
> Signed-off-by: Stephen Warren <swarren@nvidia.com>
--
nvpublic
next prev parent reply other threads:[~2011-11-09 16:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-21 18:25 Stephen Warren
2011-11-09 16:28 ` Stephen Warren [this message]
2011-11-11 16:07 ` 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=74CDBE0F657A3D45AFBB94109FB122FF17408050C7@HQMAIL01.nvidia.com \
--to=swarren@nvidia.com \
--cc=21cnbao@gmail.com \
--cc=Rongjun.Ying@csr.com \
--cc=davidb@codeaurora.org \
--cc=grant.likely@secretlab.ca \
--cc=linaro-dev@lists.linaro.org \
--cc=linus.walleij@linaro.org \
--cc=linus.walleij@stericsson.com \
--cc=linux-kernel@vger.kernel.org \
--cc=s.hauer@pengutronix.de \
--cc=shawn.guo@freescale.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®