Re: [PATCH v2] pinctrl: pin configuration states

From: Linus Walleij
Date: Fri Feb 03 2012 - 17:17:47 EST

On Fri, Feb 3, 2012 at 12:03 AM, Tony Lindgren <tony@xxxxxxxxxxx> 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");


If this is what people want I can sure do it like that instead.

linus Walleij
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at