aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/pinctrl
diff options
context:
space:
mode:
authorLaxman Dewangan <ldewangan@nvidia.com>2013-08-21 07:23:37 -0400
committerLinus Walleij <linus.walleij@linaro.org>2013-08-23 02:56:32 -0400
commit3287c24088abded9f111ca797fdd36f86912d199 (patch)
tree537d6a48cb062129171a9c491bc7add698aeb842 /include/linux/pinctrl
parent529301c19cbc315929e1b39ee71859061910b652 (diff)
pinctrl: utils : add support to pass config type in generic util APIs
Add support to pass the config type like GROUP or PIN when using the utils or generic pin configuration APIs. This will make the APIs more generic. Added additional inline APIs such that it can be use directly as callback for the pinctrl_ops. Changes from V1: - Remove separate implementation for pins and group for pinctrl_utils_dt_free_map and improve this function to support both i.e. PINS and GROUPs. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-by: Stephen Warren <swarren@nvidia.com> Tested-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/pinconf-generic.h22
1 files changed, 20 insertions, 2 deletions
diff --git a/include/linux/pinctrl/pinconf-generic.h b/include/linux/pinctrl/pinconf-generic.h
index 83f5179ea0c5..fb90ef5eb038 100644
--- a/include/linux/pinctrl/pinconf-generic.h
+++ b/include/linux/pinctrl/pinconf-generic.h
@@ -140,15 +140,33 @@ static inline unsigned long pinconf_to_config_packed(enum pin_config_param param
140#ifdef CONFIG_OF 140#ifdef CONFIG_OF
141 141
142#include <linux/device.h> 142#include <linux/device.h>
143#include <linux/pinctrl/machine.h>
143struct pinctrl_dev; 144struct pinctrl_dev;
144struct pinctrl_map; 145struct pinctrl_map;
145 146
146int pinconf_generic_dt_subnode_to_map(struct pinctrl_dev *pctldev, 147int pinconf_generic_dt_subnode_to_map(struct pinctrl_dev *pctldev,
147 struct device_node *np, struct pinctrl_map **map, 148 struct device_node *np, struct pinctrl_map **map,
148 unsigned *reserved_maps, unsigned *num_maps); 149 unsigned *reserved_maps, unsigned *num_maps,
150 enum pinctrl_map_type type);
149int pinconf_generic_dt_node_to_map(struct pinctrl_dev *pctldev, 151int pinconf_generic_dt_node_to_map(struct pinctrl_dev *pctldev,
150 struct device_node *np_config, struct pinctrl_map **map, 152 struct device_node *np_config, struct pinctrl_map **map,
151 unsigned *num_maps); 153 unsigned *num_maps, enum pinctrl_map_type type);
154
155static inline int pinconf_generic_dt_node_to_map_group(
156 struct pinctrl_dev *pctldev, struct device_node *np_config,
157 struct pinctrl_map **map, unsigned *num_maps)
158{
159 return pinconf_generic_dt_node_to_map(pctldev, np_config, map, num_maps,
160 PIN_MAP_TYPE_CONFIGS_GROUP);
161}
162
163static inline int pinconf_generic_dt_node_to_map_pin(
164 struct pinctrl_dev *pctldev, struct device_node *np_config,
165 struct pinctrl_map **map, unsigned *num_maps)
166{
167 return pinconf_generic_dt_node_to_map(pctldev, np_config, map, num_maps,
168 PIN_MAP_TYPE_CONFIGS_PIN);
169}
152 170
153#endif 171#endif
154 172