pinctrl: break out a pinctrl consumer header

This breaks out a <linux/pinctrl/consumer.h> header to be used by
all pinmux and pinconfig alike, so drivers needing services from
pinctrl does not need to include different headers. This is similar
to the approach taken by the regulator API.

Acked-by: Stephen Warren <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
This commit is contained in:
Linus Walleij 2012-02-09 01:52:22 +01:00
commit 28a8d14cc7
6 changed files with 125 additions and 94 deletions

View file

@ -208,6 +208,8 @@ unconnected.
For example, a platform may do this:
#include <linux/pinctrl/consumer.h>
ret = pin_config_set("foo-dev", "FOO_GPIO_PIN", PLATFORM_X_PULL_UP);
To pull up a pin to VDD. The pin configuration driver implements callbacks for
@ -920,7 +922,7 @@ this is not possible.
A driver may request a certain mux to be activated, usually just the default
mux like this:
#include <linux/pinctrl/pinmux.h>
#include <linux/pinctrl/consumer.h>
struct foo_state {
struct pinmux *pmx;
@ -1019,6 +1021,8 @@ function, but with different named in the mapping as described under
This snippet first muxes the function in the pins defined by group A, enables
it, disables and releases it, and muxes it in on the pins defined by group B:
#include <linux/pinctrl/consumer.h>
foo_switch()
{
struct pinmux *pmx;