From: Stephen Warren <swarren@wwwdotorg.org>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Peter Ujfalusi <peter.ujfalusi@ti.com>,
alsa-devel@alsa-project.org, Liam Girdwood <lrg@ti.com>,
Linus Walleij <linus.walleij@linaro.org>
Subject: Re: [PATCH] ASoC: core: Configure pin muxing via pinctrl when registering a DAI
Date: Sat, 22 Sep 2012 21:23:25 -0600 [thread overview]
Message-ID: <505E80AD.9050000@wwwdotorg.org> (raw)
In-Reply-To: <20120922152840.GM4495@opensource.wolfsonmicro.com>
On 09/22/2012 09:28 AM, Mark Brown wrote:
> On Fri, Sep 21, 2012 at 10:23:50AM -0600, Stephen Warren wrote:
>> On 09/21/2012 07:16 AM, Peter Ujfalusi wrote:
>
>>> pinctrl_get_select() returns with a pointer to struct pinctrl. If the platform
>>> does not have CONFIG_PINCTRL enabled it will return with NULL.
>>> If no pinctrl has been specified for the device it will return with error
>>> (-ENODEV).
>>> Neither of these cases should be considered as error. We do print out with
>>> dev_info() to notify the developer, but having pinctrl mux should not be
>>> mandatory.
>
>> Indeed - what about a platform like Tegra which has pinctrl enabled, yet
>> doesn't specify any pinctrl configuration for any device other than the
>> pin controller itself? Do we want to force every device into having to
>> specify an empty pin control configuration? If we take this route, we
>> should really have the driver core or platform bus set up the initial
>> pinctrl state, and I believe that approach was explicitly decided against.
>
> Well, the other options are for pinctrl to either not return an error in
> the no configuration case or change to a void return type. The current
> behaviour seems a bit pointless since we can't usefully do anything with
> the errors, we can just factor the error logs into the core and have
> done with it since it's not possible to treat errors as such.
(I'm not 100% sure if everyone agrees on this and I'm not sure if it's
been explicitly stated, so perhaps this is my personal opinion. However,
the more I think about this, the more it makes sense).
I think the errors shouldn't be ignored at all; it's an error for a
driver to explicitly go out and request a pinctrl state if that state is
not defined. In turn, this means that no generic code should be going
out and requesting a pinctrl state on behalf of the driver; it has no
idea if the driver has defined that it needs pinctrl set up for it.
I'll explain this in a slightly different way that will probably make
more sense.
For any pinctrl configuration that is static, that configuration should
be applied one time as the system boots using the "hog" feature of the
pin controller itself, i.e. the pin controller driver should apply that
state during its own probe(). Individual drivers should only ever
request a pinctrl state if they need to dynamically switch between
different states at run-time. This is (a) likely to be fairly rare, and
(b) the need is likely to be defined directly by the kind of protocol
that the driver/HW is implementing.
So in other words, I'd expect to see an almost complete system-wide
"default" pinctrl state defined for the pin controller, and quite
possibly no other drivers with pinctrl states defined at all.
Drivers that might switch between pinctrl states are say
I2C/SPI/MDIO/... bus muxes that use an SoC's pinctrl module to perform
the muxing, or perhaps some kind of high-speed data bus that might need
different pin configuration (say biasing/equalization/... stuff rather
than muxing) based on the runtime-selected bus clock.
Given all this, that probably means that none of your (Peter's) DAI
drivers need to touch pinctrl at all, so this patch isn't needed in any
form?
next prev parent reply other threads:[~2012-09-23 3:23 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-21 7:54 [PATCH] ASoC: core: Configure pin muxing via pinctrl when registering a DAI Peter Ujfalusi
2012-09-21 11:13 ` Mark Brown
2012-09-21 13:16 ` Peter Ujfalusi
2012-09-21 14:55 ` Peter Ujfalusi
2012-09-22 15:23 ` Mark Brown
2012-09-21 16:23 ` Stephen Warren
2012-09-22 15:28 ` Mark Brown
2012-09-23 3:23 ` Stephen Warren [this message]
2012-09-24 9:20 ` Linus Walleij
2012-09-24 10:17 ` Mark Brown
2012-09-24 14:37 ` Linus Walleij
2012-09-25 11:11 ` Mark Brown
2012-09-25 11:24 ` Peter Ujfalusi
2012-09-25 11:43 ` Linus Walleij
2012-09-25 11:43 ` Mark Brown
2012-09-25 11:56 ` Linus Walleij
2012-09-25 12:24 ` Mark Brown
2012-09-25 17:00 ` Stephen Warren
2012-09-24 15:41 ` Stephen Warren
2012-09-25 11:22 ` Mark Brown
2012-09-24 8:34 ` Linus Walleij
2012-09-24 10:23 ` Mark Brown
2012-09-24 15:38 ` Stephen Warren
2012-09-22 15:18 ` Mark Brown
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=505E80AD.9050000@wwwdotorg.org \
--to=swarren@wwwdotorg.org \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=linus.walleij@linaro.org \
--cc=lrg@ti.com \
--cc=peter.ujfalusi@ti.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;
as well as URLs for NNTP newsgroup(s).