[PATCH v2] pinctrl: pin configuration states

Tony Lindgren tony at atomide.com
Fri Feb 3 17:37:41 EST 2012


* Linus Walleij <linus.walleij at linaro.org> [120203 13:46]:
> On Fri, Feb 3, 2012 at 12:03 AM, Tony Lindgren <tony at atomide.com> wrote:
> > [Me]
> >> +For simple systems that just configure the pins on boot and then forget about
> >> +them, the first configuration table may be sufficient. However some systems
> >> +may need to switch configuration states at runtime, and in that case the
> >> +system may want to ground both pins by simply calling:
> >> +
> >> +ret = pinconf_activate_state("pinctrl-foo", "idle");
> >
> > For dynamic changing of pin states during runtime we should not change
> > the states based on string parsing. This is because some of these pins
> > may need to be changed every time when entering and exiting idle.
> 
> So pinmuxes get a handle back using a get/put pair, and
> have enable/disable semantics as well.
> 
> I avoided this for pin config since it would mean that you have
> to keep some opaque cookie around, like we currently do with
> pinmux. And pin config states are simpler in that you simply
> move from one state to the other, no bookkeeping is involved.
> 
> I never took into consideration that it may be a performance
> issue to do that string parsing and you have a point there.
> 
> So would you prefer something like:
> 
> astat = pinconf_get_state("pinctrl-foo", "idle");
> istat = pinconf_get_state("pinctrl-foo", "idle");
> 
> pinconf_activate_state(astat);
> pinconf_activate_state(istat);
> ...
> 
> If this is what people want I can sure do it like that instead.

OK that sounds good to me.

Regards,

Tony



More information about the linux-arm-kernel mailing list