xref: /linux/drivers/pinctrl/pinctrl-utils.h (revision 4b132aacb0768ac1e652cf517097ea6f237214b9)
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3  * Utils functions to implement the pincontrol driver.
4  *
5  * Copyright (c) 2013, NVIDIA Corporation.
6  *
7  * Author: Laxman Dewangan <ldewangan@nvidia.com>
8  */
9 #ifndef __PINCTRL_UTILS_H__
10 #define __PINCTRL_UTILS_H__
11 
12 #include <linux/pinctrl/machine.h>
13 
14 struct pinctrl_dev;
15 struct pinctrl_map;
16 
17 int pinctrl_utils_reserve_map(struct pinctrl_dev *pctldev,
18 		struct pinctrl_map **map, unsigned int *reserved_maps,
19 		unsigned int *num_maps, unsigned int reserve);
20 int pinctrl_utils_add_map_mux(struct pinctrl_dev *pctldev,
21 		struct pinctrl_map **map, unsigned int *reserved_maps,
22 		unsigned int *num_maps, const char *group,
23 		const char *function);
24 int pinctrl_utils_add_map_configs(struct pinctrl_dev *pctldev,
25 		struct pinctrl_map **map, unsigned int *reserved_maps,
26 		unsigned int *num_maps, const char *group,
27 		unsigned long *configs, unsigned int num_configs,
28 		enum pinctrl_map_type type);
29 int pinctrl_utils_add_config(struct pinctrl_dev *pctldev,
30 		unsigned long **configs, unsigned int *num_configs,
31 		unsigned long config);
32 void pinctrl_utils_free_map(struct pinctrl_dev *pctldev,
33 		struct pinctrl_map *map, unsigned int num_maps);
34 
35 #endif /* __PINCTRL_UTILS_H__ */
36