History

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.

Laxman Dewangan committed 13 years ago

Commit 3287c241 parent 529301c4 files · +35 −10Browse files

Showing the changes to include/linux/pinctrl (1 of 4 files). Show all

Unified · Split

include/linux/pinctrl/pinconf-generic.h+20−2
@@ -140,15 +140,33 @@ static inline unsigned long pinconf_to_config_packed(enum pin_config_param param · 139 unmodified lines
140140 #ifdef CONFIG_OF
141141
142142 #include <linux/device.h>
143+#include <linux/pinctrl/machine.h>
143144 struct pinctrl_dev;
144145 struct pinctrl_map;
145146
146147 int pinconf_generic_dt_subnode_to_map(struct pinctrl_dev *pctldev,
147148 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);
149151 int pinconf_generic_dt_node_to_map(struct pinctrl_dev *pctldev,
150152 struct device_node *np_config, struct pinctrl_map **map,
151− unsigned *num_maps);
153+ unsigned *num_maps, enum pinctrl_map_type type);
154+
155+static 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+
163+static 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+}
152170
153171 #endif
154172

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t