From: 21cnbao@gmail.com (Barry Song)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] GPIOLIB: add generic gpio_set_pull API
Date: Tue, 9 Aug 2011 10:51:18 +0800 [thread overview]
Message-ID: <CAGsJ_4xq2kpVu2BXPkeeWaZYYN=r73_2V2eOnT5FA8dv43at5w@mail.gmail.com> (raw)
In-Reply-To: <4E40912C.5040801@codeaurora.org>
2011/8/9 Rohit Vaswani <rvaswani@codeaurora.org>:
> On 8/8/2011 3:57 PM, Kyungmin Park wrote:
>>
>> On Tue, Aug 9, 2011 at 3:24 AM, Grant Likely<grant.likely@secretlab.ca>
>> ?wrote:
>>>
>>> On Mon, Aug 8, 2011 at 2:15 AM, Paul Mundt<lethal@linux-sh.org> ?wrote:
>>>>
>>>> On Sun, Aug 07, 2011 at 10:19:33PM -0700, Barry Song wrote:
>>>>>
>>>>> Now there are many different implementations for GPIO pull
>>>>> configuration, for
>>>>> example:
>>>>> s3c_gpio_setpull()
>>>>> tegra_pinmux_set_pullupdown()
>>>>> chipcHw_setPinPullup()
>>>>> gpio_pullup()
>>>>> s3c2410_gpio_pullup()
>>>>>
>>>>> This patch adds a new generic gpio_set_pull API so that all SoCs can
>>>>> have unified
>>>>> codes.
>>>>>
>>>>> Signed-off-by: Barry Song<Baohua.Song@csr.com>
>>>>
>>>> For arch/arm/mach-shmobile we also have gpio_pull_up() for board-g4evm.c
>>>> and gpio_pull_down() for board-mackerel.c. Both of these would benefit
>>>> from this sort of an API addition.
>>>
>>> I think I'm okay with this API change. ?Linus, what say you? ?How does
>>> this interact with your plans for pinctrl?
>>
>> If gpiolib accept the pullup control. gpiolib is better place to
>> control gpio config.
>> then remains are the gpio driver strength, and power down mode
>> control. powerdown pull-up/down, powerdown in/out at samsung gpios.
>
> If we add this API - the remaining gpio controls like drive strength and
> function select could also be added, which eats into the pinmux domain.
> Linus W. had a patch earlier which added an API for a gpio config to be
> specified through gpiolib. " gpio: add a custom configuration mechanism to
> gpiolib" which is sort of an extensible model of this API.
gpio_config() from Linus W. is an interface with multiple functions or
a function for multiple purpose. Its actions seem to be ambiguous,
then mean diffiicult to use or diffirent subsystems still result in
many differences after using it.
pullup/down/none is something very common and much frequently used to
all SoCs, i guess it can have individual, simple and direct API.
I don't oppose gpiolib cover more GPIO configurations, for example OC,
OD and powerdown. but we might keep APIs as simple and clear as
possible.
>
> Thanks,
> Rohit
next prev parent reply other threads:[~2011-08-09 2:51 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-08 5:19 [PATCH] GPIOLIB: add generic gpio_set_pull API Barry Song
2011-08-08 8:15 ` Paul Mundt
2011-08-08 18:24 ` Grant Likely
2011-08-08 22:57 ` Kyungmin Park
2011-08-09 1:45 ` Rohit Vaswani
2011-08-09 2:51 ` Barry Song [this message]
2011-08-09 10:11 ` Linus Walleij
2012-06-19 3:25 ` Barry Song
2012-06-20 8:15 ` Linus Walleij
2012-06-20 10:07 ` Barry Song
2012-06-20 14:31 ` Paul Mundt
2012-06-21 7:48 ` Linus Walleij
2011-08-09 10:07 ` Linus Walleij
2011-08-09 10:04 ` 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='CAGsJ_4xq2kpVu2BXPkeeWaZYYN=r73_2V2eOnT5FA8dv43at5w@mail.gmail.com' \
--to=21cnbao@gmail.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).