lkml.org 
[lkml]   [2012]   [Nov]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v4 05/11] pwm: pwm-tiecap: pinctrl support
On Fri, Nov 23, 2012 at 01:48:51PM +0100, Peter Korsgaard wrote:
> >>>>> "Thierry" == Thierry Reding <thierry.reding@avionic-design.de> writes:
>
> Hi,
>
> Thierry> Everybody seems to be doing it with a warning, so I guess
> Thierry> that's fine for now. I just find it strange that if you
> Thierry> request the default pin group to be selected when in fact the
> Thierry> hardware doesn't support pinctrl at all you shouldn't be
> Thierry> getting an error either.
>
> There's several different situations:
>
> - Platform without pinctrl support
> - Platform with pinctrl support but no pinmux specified in dt for device
> (E.G. pinmux setup in bootloader)
> - Pinmux specified in dt
> - Some kind of misconfiguration in dt
>
> You could argue that devm_pinctrl_get_select_default() shouldn't return
> an error for the first situation, but how should it be able to know the
> difference between 2 and 4?

In case where the platform supports pinctrl but no pinmux is specified
for the device it should just assume that no pinmuxing is needed. That
sounds like the most logical behaviour to me. In those cases pinctrl
could just assume that the default has already been selected and not
return an error.

But you can't reasonably expect to cope with misconfigured DT content.
Heck, there's no way for you to even know if it is misconfigured.

That said, I'm not sure how much of an issue this really is. Pinmuxing
is only used for functions local to a given chip, right? So if an SoC
supports pinctrl and a given peripheral needs pinmuxing then we can
reasonably assume that your second case can't happen, can't we?

Thierry
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2012-11-24 22:01    [W:0.834 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site