From: linus.walleij@linaro.org (Linus Walleij)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] drivers: create a pin control subsystem v7
Date: Tue, 27 Sep 2011 09:51:17 +0200 [thread overview]
Message-ID: <CACRpkdZiQX0whbC85dN0JmNB=sgWiZ=WiUwkBdrHzFC4awH8YA@mail.gmail.com> (raw)
In-Reply-To: <74CDBE0F657A3D45AFBB94109FB122FF1738180167@HQMAIL01.nvidia.com>
On Wed, Sep 21, 2011 at 9:45 PM, Stephen Warren <swarren@nvidia.com> wrote:
> Linus Walleij wrote at Wednesday, September 21, 2011 3:17 AM:
>> To abstract things the stuff we can do with the group should be
>> something enumerated too. So:
>>
>> pinctrl_config_group(const char *pinctrl_device, const char *group,
>> const char *mode);
>> pinctrl_config_pin(const char *pinctrl_device, int pin, const char *mode);
>>
>> So the driver need an API to enumerate pin and group modes.
>>
>> I might want to save this thing for post-merge of the basic API and
>> pinmux stuff though so we don't try to push too much upfront
>> design at once.
>
> Yes, adding in a replacement _config API can certainly be a later patch.
If I'm efficient enough we might get that add-on before the v3.2
merge window, I'll iterate that patch separately though.
> One comment on the API above: I think you want "mode" (or "setting"?)
> /and/ a value parameter; Tegra's pull strength definition for example
> is:
>
> enum tegra_pull_strength {
> ? ? ? ?TEGRA_PULL_0 = 0,
> ? ? ? ?TEGRA_PULL_1,
> // ... (every value in between)
> ? ? ? ?TEGRA_PULL_30,
> ? ? ? ?TEGRA_PULL_31,
> ? ? ? ?TEGRA_MAX_PULL,
> };
>
> And it seems better to represent that as ("pull", 0) ... ("pull", 31) than
> "pull0" .. "pull31" such that the value needs to be parsed out of the "mode"
> string somehow by the driver.
OK so we might want some public defintion of "things you can do"
with pins, then an opaque parameter.
like:
#define PINCTRL_PULL "pull"
#define PINCTRL_BIAS "bias"
#define PINCTRL_LOADCAP "load-capacitance"
#define PINCTRL_DRIVE "drive"
...but then it's just simple enumerators, and we might be better off
with a simple enum after all:
enum pinctrl_pin_ops {
PINCTRL_PULL,
PINCTRL_BIAS,
PINCTRL_LOADCAP,
PINCTRL_DRIVE,
}
Surely the device tree will have to translate that enum into strings
(I guess? Sorry for my low DT competence) but that is more of a
DT pecularity and can be kept in the DT pin control parser?
Yours,
Linus Walleij
next prev parent reply other threads:[~2011-09-27 7:51 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1316175203-10736-1-git-send-email-linus.walleij@stericsson.com>
2011-09-20 21:58 ` [PATCH 1/2] drivers: create a pin control subsystem v7 Stephen Warren
2011-09-21 9:17 ` Linus Walleij
2011-09-21 19:45 ` Stephen Warren
2011-09-27 7:44 ` Linus Walleij
2011-09-27 7:51 ` Linus Walleij [this message]
2011-09-28 0:08 ` Stephen Warren
2011-09-27 9:30 ` Stijn Devriendt
2011-09-28 9:18 ` 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='CACRpkdZiQX0whbC85dN0JmNB=sgWiZ=WiUwkBdrHzFC4awH8YA@mail.gmail.com' \
--to=linus.walleij@linaro.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 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).