aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/pinctrl/machine.h
diff options
context:
space:
mode:
authorStephen Warren <swarren@nvidia.com>2012-03-02 15:05:47 -0500
committerLinus Walleij <linus.walleij@linaro.org>2012-03-05 05:22:59 -0500
commit6e5e959dde0d92d177f035652aeaa77f9330c9c6 (patch)
treec2d874df6a1c591b558a17591a1c8fbc2ba7a1e1 /include/linux/pinctrl/machine.h
parent0e3db173e2b9fd3b82246516e72c17763eb5f98d (diff)
pinctrl: API changes to support multiple states per device
The API model is changed from: p = pinctrl_get(dev, "state1"); pinctrl_enable(p); ... pinctrl_disable(p); pinctrl_put(p); p = pinctrl_get(dev, "state2"); pinctrl_enable(p); ... pinctrl_disable(p); pinctrl_put(p); to this: p = pinctrl_get(dev); s1 = pinctrl_lookup_state(p, "state1"); s2 = pinctrl_lookup_state(p, "state2"); pinctrl_select_state(p, s1); ... pinctrl_select_state(p, s2); ... pinctrl_put(p); This allows devices to directly transition between states without disabling the pin controller programming and put()/get()ing the configuration data each time. This model will also better suit pinconf programming, which doesn't have a concept of "disable". The special-case hogging feature of pin controllers is re-written to use the regular APIs instead of special-case code. Hence, the pinmux-hogs debugfs file is removed; see the top-level pinctrl-handles files for equivalent data. Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Dong Aisheng <dong.aisheng@linaro.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'include/linux/pinctrl/machine.h')
-rw-r--r--include/linux/pinctrl/machine.h11
1 files changed, 5 insertions, 6 deletions
diff --git a/include/linux/pinctrl/machine.h b/include/linux/pinctrl/machine.h
index 20e97353d5f9..05d25c8adbaf 100644
--- a/include/linux/pinctrl/machine.h
+++ b/include/linux/pinctrl/machine.h
@@ -21,23 +21,22 @@
21 * same name as the pin controllers own dev_name(), the map entry will be 21 * same name as the pin controllers own dev_name(), the map entry will be
22 * hogged by the driver itself upon registration 22 * hogged by the driver itself upon registration
23 * @name: the name of this specific map entry for the particular machine. 23 * @name: the name of this specific map entry for the particular machine.
24 * This is the second parameter passed to pinmux_get() when you want 24 * This is the parameter passed to pinmux_lookup_state()
25 * to have several mappings to the same device
26 * @ctrl_dev_name: the name of the device controlling this specific mapping, 25 * @ctrl_dev_name: the name of the device controlling this specific mapping,
27 * the name must be the same as in your struct device* 26 * the name must be the same as in your struct device*
28 * @function: a function in the driver to use for this mapping, the driver
29 * will lookup the function referenced by this ID on the specified
30 * pin control device
31 * @group: sometimes a function can map to different pin groups, so this 27 * @group: sometimes a function can map to different pin groups, so this
32 * selects a certain specific pin group to activate for the function, if 28 * selects a certain specific pin group to activate for the function, if
33 * left as NULL, the first applicable group will be used 29 * left as NULL, the first applicable group will be used
30 * @function: a function in the driver to use for this mapping, the driver
31 * will lookup the function referenced by this ID on the specified
32 * pin control device
34 */ 33 */
35struct pinctrl_map { 34struct pinctrl_map {
36 const char *dev_name; 35 const char *dev_name;
37 const char *name; 36 const char *name;
38 const char *ctrl_dev_name; 37 const char *ctrl_dev_name;
39 const char *function;
40 const char *group; 38 const char *group;
39 const char *function;
41}; 40};
42 41
43/* 42/*