From: Stephen Warren <swarren@nvidia.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Linus Walleij <linus.walleij@stericsson.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Grant Likely <grant.likely@secretlab.ca>,
Barry Song <21cnbao@gmail.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>
Subject: RE: [PATCH 2/2 v4] pinctrl: introduce generic pin config
Date: Thu, 1 Dec 2011 09:16:21 -0800 [thread overview]
Message-ID: <74CDBE0F657A3D45AFBB94109FB122FF174FDB01F2@HQMAIL01.nvidia.com> (raw)
In-Reply-To: <CACRpkdZueyZkOq20qq_jDn27cfkChM58cR+TvPKfifSwFwiQ5w@mail.gmail.com>
Linus Walleij wrote at Thursday, December 01, 2011 3:12 AM:
> On Wed, Nov 30, 2011 at 8:45 PM, Stephen Warren <swarren@nvidia.com> wrote:
> > Linus Walleij wrote at Thursday, November 24, 2011 11:46 AM:
>
> >> diff --git a/include/linux/pinctrl/pinconf-generic.h b/include/linux/pinctrl/pinconf-generic.h
> >
> >> +/*
> >> + * You shouldn't even be able to compile with these enums etc unless you're
> >> + * using generic pin config. That is why this is defined out.
> >> + */
> >> +#ifdef CONFIG_GENERIC_PINCONF
> >
> > Hmm. I'd prefer to have drivers able to use both generic values and
> > extend them with custom values. Can't we just use the top bit of the
> > param value to indicate 0:standard (from the enum below) 1:custom
> > (something meaningful to only the individual pinctrl driver). This
> > could then trigger calling pinconf_generic_dump_pin() or not for
> > example.
>
> Hm...
>
> That will get messy when if I refactor this stuff, add new enums
> and whatever.
I don't understand what'd be difficult about that.
New standardized enums could be added with values without the top bit
set. No existing driver would need modification, since their switch(param)
would not have a case for that new value, and would just return an error.
> >> +#ifdef CONFIG_GENERIC_PINCONF
> >> + bool is_generic;
> >> +#endif
> >
> > ... and get rid of that flag.
>
> This is for the case wher you have both generic and non-generic
> config controllers onboard a system.
>
> Like in the generic debugfs dump function:
>
> if (!ops->is_generic)
> return;
>
> If I take this out, the generic debugfs code will be used for
> everything.
I think that'd be fine; the generic code would do all the debug prints
for the standardized enums, then the core would call into the pinctrl
driver to perform any additional debug prints for any driver-defined
custom parameters.
> And then the generic sematics which you didn't like in the
> previous patch:
>
> if (ret == -EINVAL || ret == -ENOTSUPP)
>
> Need to go back in, else the generic debugfs stuff won't
> work.
That'd be fine, provided the loop only checked the standardized parameters,
or only enabled that special error-checking case for standardized parameters.
--
nvpublic
next prev parent reply other threads:[~2011-12-01 17:16 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-24 18:46 Linus Walleij
2011-11-30 19:45 ` Stephen Warren
2011-12-01 10:11 ` Linus Walleij
2011-12-01 17:16 ` Stephen Warren [this message]
2011-12-05 13:35 ` Linus Walleij
2011-12-05 15:37 ` Mark Brown
2011-12-05 17:51 ` Stephen Warren
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=74CDBE0F657A3D45AFBB94109FB122FF174FDB01F2@HQMAIL01.nvidia.com \
--to=swarren@nvidia.com \
--cc=21cnbao@gmail.com \
--cc=dong.aisheng@linaro.org \
--cc=grant.likely@secretlab.ca \
--cc=linus.walleij@linaro.org \
--cc=linus.walleij@stericsson.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rajendra.nayak@linaro.org \
--cc=shawn.guo@freescale.com \
--cc=thomas.abraham@linaro.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
all inboxes | Powered by JetHome®