diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2012-02-09 19:34:12 -0500 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2012-02-10 15:33:10 -0500 |
commit | 77a5988355f993840928d195f790a939200a4ff0 (patch) | |
tree | b2590450fb4c5e956ddfc119e6bb610ce53aa8a9 /include/linux/pinctrl | |
parent | befe5bdfbb698b3bc57c58d0bd7ca3391c9275ed (diff) |
pinctrl: changes hog mechanism to be self-referential
Instead of a specific boolean field to indicate if a map entry shall
be hogged, treat self-reference as an indication of desired hogging.
This drops one field off the map struct and has a nice Douglas R.
Hofstadter-feel to it.
Acked-by: Dong Aisheng <dong.aisheng@linaro.org>
Acked-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'include/linux/pinctrl')
-rw-r--r-- | include/linux/pinctrl/machine.h | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/include/linux/pinctrl/machine.h b/include/linux/pinctrl/machine.h index a2ab524a0106..af145d571970 100644 --- a/include/linux/pinctrl/machine.h +++ b/include/linux/pinctrl/machine.h | |||
@@ -26,13 +26,9 @@ | |||
26 | * selects a certain specific pin group to activate for the function, if | 26 | * selects a certain specific pin group to activate for the function, if |
27 | * left as NULL, the first applicable group will be used | 27 | * left as NULL, the first applicable group will be used |
28 | * @dev_name: the name of the device using this specific mapping, the name | 28 | * @dev_name: the name of the device using this specific mapping, the name |
29 | * must be the same as in your struct device* | 29 | * must be the same as in your struct device*. If this name is set to the |
30 | * @hog_on_boot: if this is set to true, the pin control subsystem will itself | 30 | * same name as the pin controllers own dev_name(), the map entry will be |
31 | * hog the mappings as the pinmux device drivers are attached, so this is | 31 | * hogged by the driver itself upon registration |
32 | * typically used with system maps (mux mappings without an assigned | ||
33 | * device) that you want to get hogged and enabled by default as soon as | ||
34 | * a pinmux device supporting it is registered. These maps will not be | ||
35 | * disabled and put until the system shuts down. | ||
36 | */ | 32 | */ |
37 | struct pinctrl_map { | 33 | struct pinctrl_map { |
38 | const char *name; | 34 | const char *name; |
@@ -40,7 +36,6 @@ struct pinctrl_map { | |||
40 | const char *function; | 36 | const char *function; |
41 | const char *group; | 37 | const char *group; |
42 | const char *dev_name; | 38 | const char *dev_name; |
43 | bool hog_on_boot; | ||
44 | }; | 39 | }; |
45 | 40 | ||
46 | /* | 41 | /* |
@@ -62,8 +57,7 @@ struct pinctrl_map { | |||
62 | * to be hogged by the pin control core until the system shuts down. | 57 | * to be hogged by the pin control core until the system shuts down. |
63 | */ | 58 | */ |
64 | #define PIN_MAP_SYS_HOG(a, b, c) \ | 59 | #define PIN_MAP_SYS_HOG(a, b, c) \ |
65 | { .name = a, .ctrl_dev_name = b, .function = c, \ | 60 | { .name = a, .ctrl_dev_name = b, .dev_name = b, .function = c, } |
66 | .hog_on_boot = true } | ||
67 | 61 | ||
68 | /* | 62 | /* |
69 | * Convenience macro to map a system function onto a certain pinctrl device | 63 | * Convenience macro to map a system function onto a certain pinctrl device |
@@ -71,8 +65,8 @@ struct pinctrl_map { | |||
71 | * system shuts down. | 65 | * system shuts down. |
72 | */ | 66 | */ |
73 | #define PIN_MAP_SYS_HOG_GROUP(a, b, c, d) \ | 67 | #define PIN_MAP_SYS_HOG_GROUP(a, b, c, d) \ |
74 | { .name = a, .ctrl_dev_name = b, .function = c, .group = d, \ | 68 | { .name = a, .ctrl_dev_name = b, .dev_name = b, .function = c, \ |
75 | .hog_on_boot = true } | 69 | .group = d, } |
76 | 70 | ||
77 | #ifdef CONFIG_PINMUX | 71 | #ifdef CONFIG_PINMUX |
78 | 72 | ||