diff options
-rw-r--r-- | Documentation/pinctrl.txt | 8 | ||||
-rw-r--r-- | drivers/pinctrl/core.c | 6 | ||||
-rw-r--r-- | include/linux/pinctrl/machine.h | 18 |
3 files changed, 12 insertions, 20 deletions
diff --git a/Documentation/pinctrl.txt b/Documentation/pinctrl.txt index 2e7132355db8..ee3266b948e7 100644 --- a/Documentation/pinctrl.txt +++ b/Documentation/pinctrl.txt | |||
@@ -989,21 +989,21 @@ is registered. This means that the core will attempt to call pinctrl_get() and | |||
989 | pinctrl_enable() on it immediately after the pin control device has been | 989 | pinctrl_enable() on it immediately after the pin control device has been |
990 | registered. | 990 | registered. |
991 | 991 | ||
992 | This is enabled by simply setting the .hog_on_boot field in the map to true, | 992 | This is enabled by simply setting the .dev_name field in the map to the name |
993 | like this: | 993 | of the pin controller itself, like this: |
994 | 994 | ||
995 | { | 995 | { |
996 | .name = "POWERMAP" | 996 | .name = "POWERMAP" |
997 | .ctrl_dev_name = "pinctrl-foo", | 997 | .ctrl_dev_name = "pinctrl-foo", |
998 | .function = "power_func", | 998 | .function = "power_func", |
999 | .hog_on_boot = true, | 999 | .dev_name = "pinctrl-foo", |
1000 | }, | 1000 | }, |
1001 | 1001 | ||
1002 | Since it may be common to request the core to hog a few always-applicable | 1002 | Since it may be common to request the core to hog a few always-applicable |
1003 | mux settings on the primary pin controller, there is a convenience macro for | 1003 | mux settings on the primary pin controller, there is a convenience macro for |
1004 | this: | 1004 | this: |
1005 | 1005 | ||
1006 | PIN_MAP_PRIMARY_SYS_HOG("POWERMAP", "power_func") | 1006 | PIN_MAP_PRIMARY_SYS_HOG("POWERMAP", "pinctrl-foo", "power_func") |
1007 | 1007 | ||
1008 | This gives the exact same result as the above construction. | 1008 | This gives the exact same result as the above construction. |
1009 | 1009 | ||
diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c index ec32c545f07f..c5f76ad5a8c5 100644 --- a/drivers/pinctrl/core.c +++ b/drivers/pinctrl/core.c | |||
@@ -793,11 +793,9 @@ int pinctrl_hog_maps(struct pinctrl_dev *pctldev) | |||
793 | for (i = 0; i < pinctrl_maps_num; i++) { | 793 | for (i = 0; i < pinctrl_maps_num; i++) { |
794 | struct pinctrl_map const *map = &pinctrl_maps[i]; | 794 | struct pinctrl_map const *map = &pinctrl_maps[i]; |
795 | 795 | ||
796 | if (!map->hog_on_boot) | ||
797 | continue; | ||
798 | |||
799 | if (map->ctrl_dev_name && | 796 | if (map->ctrl_dev_name && |
800 | !strcmp(map->ctrl_dev_name, devname)) { | 797 | !strcmp(map->ctrl_dev_name, devname) && |
798 | !strcmp(map->dev_name, devname)) { | ||
801 | /* OK time to hog! */ | 799 | /* OK time to hog! */ |
802 | ret = pinctrl_hog_map(pctldev, map); | 800 | ret = pinctrl_hog_map(pctldev, map); |
803 | if (ret) | 801 | if (ret) |
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 | ||