diff options
author | Stephen Warren <swarren@nvidia.com> | 2012-03-01 20:48:32 -0500 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2012-03-02 10:18:24 -0500 |
commit | 46919ae63d4820e76724beb655274ce143f0da0b (patch) | |
tree | a16dfab490eb0d68db9d633f172bab98b1035485 /Documentation/pinctrl.txt | |
parent | d4e3198736d9d64e4ba4d2b46ab75cbcf5d0a4e0 (diff) |
pinctrl: introduce PINCTRL_STATE_DEFAULT, define hogs as that state
This provides a single centralized name for the default state.
Update PIN_MAP_* macros to use this state name, instead of requiring the
user to pass a state name in.
With this change, hog entries in the mapping table are defined as those
with state name PINCTRL_STATE_DEFAULT, i.e. all entries have the same
name. This interacts badly with the nested iteration over mapping table
entries in pinctrl_hog_maps() and pinctrl_hog_map() which would now
attempt to claim each hog mapping table entry multiple times. Replacing
the custom hog code with a simple pinctrl_get()/pinctrl_enable().
Update documentation and mapping tables to use this.
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 'Documentation/pinctrl.txt')
-rw-r--r-- | Documentation/pinctrl.txt | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Documentation/pinctrl.txt b/Documentation/pinctrl.txt index 5e314cecab77..6fe3232e798e 100644 --- a/Documentation/pinctrl.txt +++ b/Documentation/pinctrl.txt | |||
@@ -814,7 +814,7 @@ it even more compact which assumes you want to use pinctrl-foo and position | |||
814 | 0 for mapping, for example: | 814 | 0 for mapping, for example: |
815 | 815 | ||
816 | static struct pinctrl_map __initdata mapping[] = { | 816 | static struct pinctrl_map __initdata mapping[] = { |
817 | PIN_MAP("I2CMAP", "pinctrl-foo", "i2c0", "foo-i2c.0"), | 817 | PIN_MAP(PINCTRL_STATE_DEFAULT, "pinctrl-foo", "i2c0", "foo-i2c.0"), |
818 | }; | 818 | }; |
819 | 819 | ||
820 | 820 | ||
@@ -930,7 +930,7 @@ foo_probe() | |||
930 | /* Allocate a state holder named "state" etc */ | 930 | /* Allocate a state holder named "state" etc */ |
931 | struct pinctrl p; | 931 | struct pinctrl p; |
932 | 932 | ||
933 | p = pinctrl_get(&device, NULL); | 933 | p = pinctrl_get(&device, PINCTRL_STATE_DEFAULT); |
934 | if IS_ERR(p) | 934 | if IS_ERR(p) |
935 | return PTR_ERR(p); | 935 | return PTR_ERR(p); |
936 | pinctrl_enable(p); | 936 | pinctrl_enable(p); |
@@ -989,7 +989,7 @@ of the pin controller itself, like this: | |||
989 | 989 | ||
990 | { | 990 | { |
991 | .dev_name = "pinctrl-foo", | 991 | .dev_name = "pinctrl-foo", |
992 | .name = "POWERMAP" | 992 | .name = PINCTRL_STATE_DEFAULT, |
993 | .ctrl_dev_name = "pinctrl-foo", | 993 | .ctrl_dev_name = "pinctrl-foo", |
994 | .function = "power_func", | 994 | .function = "power_func", |
995 | }, | 995 | }, |
@@ -998,7 +998,7 @@ Since it may be common to request the core to hog a few always-applicable | |||
998 | mux settings on the primary pin controller, there is a convenience macro for | 998 | mux settings on the primary pin controller, there is a convenience macro for |
999 | this: | 999 | this: |
1000 | 1000 | ||
1001 | PIN_MAP_PRIMARY_SYS_HOG("POWERMAP", "pinctrl-foo", "power_func") | 1001 | PIN_MAP_SYS_HOG("pinctrl-foo", "power_func") |
1002 | 1002 | ||
1003 | This gives the exact same result as the above construction. | 1003 | This gives the exact same result as the above construction. |
1004 | 1004 | ||