diff options
Diffstat (limited to 'include/linux/pinctrl/pinconf-generic.h')
-rw-r--r-- | include/linux/pinctrl/pinconf-generic.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/include/linux/pinctrl/pinconf-generic.h b/include/linux/pinctrl/pinconf-generic.h index d578a60eff23..fe65962b264f 100644 --- a/include/linux/pinctrl/pinconf-generic.h +++ b/include/linux/pinctrl/pinconf-generic.h | |||
@@ -115,6 +115,18 @@ enum pin_config_param { | |||
115 | PIN_CONFIG_END = 0x7FFF, | 115 | PIN_CONFIG_END = 0x7FFF, |
116 | }; | 116 | }; |
117 | 117 | ||
118 | #ifdef CONFIG_DEBUG_FS | ||
119 | #define PCONFDUMP(a, b, c, d) { .param = a, .display = b, .format = c, \ | ||
120 | .has_arg = d } | ||
121 | |||
122 | struct pin_config_item { | ||
123 | const enum pin_config_param param; | ||
124 | const char * const display; | ||
125 | const char * const format; | ||
126 | bool has_arg; | ||
127 | }; | ||
128 | #endif /* CONFIG_DEBUG_FS */ | ||
129 | |||
118 | /* | 130 | /* |
119 | * Helpful configuration macro to be used in tables etc. | 131 | * Helpful configuration macro to be used in tables etc. |
120 | */ | 132 | */ |
@@ -150,6 +162,12 @@ static inline unsigned long pinconf_to_config_packed(enum pin_config_param param | |||
150 | struct pinctrl_dev; | 162 | struct pinctrl_dev; |
151 | struct pinctrl_map; | 163 | struct pinctrl_map; |
152 | 164 | ||
165 | struct pinconf_generic_params { | ||
166 | const char * const property; | ||
167 | enum pin_config_param param; | ||
168 | u32 default_value; | ||
169 | }; | ||
170 | |||
153 | int pinconf_generic_dt_subnode_to_map(struct pinctrl_dev *pctldev, | 171 | int pinconf_generic_dt_subnode_to_map(struct pinctrl_dev *pctldev, |
154 | struct device_node *np, struct pinctrl_map **map, | 172 | struct device_node *np, struct pinctrl_map **map, |
155 | unsigned *reserved_maps, unsigned *num_maps, | 173 | unsigned *reserved_maps, unsigned *num_maps, |
@@ -174,6 +192,17 @@ static inline int pinconf_generic_dt_node_to_map_pin( | |||
174 | PIN_MAP_TYPE_CONFIGS_PIN); | 192 | PIN_MAP_TYPE_CONFIGS_PIN); |
175 | } | 193 | } |
176 | 194 | ||
195 | static inline int pinconf_generic_dt_node_to_map_all( | ||
196 | struct pinctrl_dev *pctldev, struct device_node *np_config, | ||
197 | struct pinctrl_map **map, unsigned *num_maps) | ||
198 | { | ||
199 | /* | ||
200 | * passing the type as PIN_MAP_TYPE_INVALID causes the underlying parser | ||
201 | * to infer the map type from the DT properties used. | ||
202 | */ | ||
203 | return pinconf_generic_dt_node_to_map(pctldev, np_config, map, num_maps, | ||
204 | PIN_MAP_TYPE_INVALID); | ||
205 | } | ||
177 | #endif | 206 | #endif |
178 | 207 | ||
179 | #endif /* CONFIG_GENERIC_PINCONF */ | 208 | #endif /* CONFIG_GENERIC_PINCONF */ |