Messages in this thread | | | Date | Thu, 16 Feb 2012 20:16:36 +0100 | Subject | Re: [PATCH V2 2/2] gpio: add STA2X11 GPIO block | From | Linus Walleij <> |
| |
On Thu, Feb 16, 2012 at 2:00 PM, Alessandro Rubini <rubini@gnudd.com> wrote:
> +/* > + * Special method: alternate functions and pullup/pulldown. This will > + * need to be exported to other drivers, adding a way to retrieve > + * the gsta_gpio structure from their own pci device > + */ > +void gsta_set_config(struct gsta_gpio *chip, int nr, unsigned cfg) > +{ (...) > + if (cfg == PINMUX_TYPE_NONE) (...) > + if (cfg == PINMUX_TYPE_FUNCTION) (...) > + if (cfg == PINMUX_TYPE_FUNCTION) { (...) > + case PINMUX_TYPE_OUTPUT_LOW: (...) > + case PINMUX_TYPE_OUTPUT_HIGH: (...) > + case PINMUX_TYPE_INPUT: (...) > + case PINMUX_TYPE_INPUT_PULLUP: (...) > + case PINMUX_TYPE_INPUT_PULLDOWN:
We have created the pin control subsystem to handle things like this. (Muxing and complex control.)
Please create a driver in drivers/pinctrl/pinctrl-sta2x11.c that expose both a pinctrl and a GPIOlib interface. The GPIOlib interface can call into the pin control portions just fine.
We've had some refactoring in the pin control subsystem recently so check linux-next for the latest API. The documentation in Documentation/pinctrl.txt should be pretty uptodate, else tell me!
I'm giving a talk about pin control at ELC tomorrow, mail me if you want a copy of the slides!
Yours, Linus Walleij -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |