xref: /linux/drivers/pinctrl/pinctrl-utils.h (revision 4359a011e259a4608afc7fb3635370c9d4ba5943)
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 int pinctrl_utils_reserve_map(struct pinctrl_dev *pctldev,
13 		struct pinctrl_map **map, unsigned *reserved_maps,
14 		unsigned *num_maps, unsigned reserve);
15 int pinctrl_utils_add_map_mux(struct pinctrl_dev *pctldev,
16 		struct pinctrl_map **map, unsigned *reserved_maps,
17 		unsigned *num_maps, const char *group,
18 		const char *function);
19 int pinctrl_utils_add_map_configs(struct pinctrl_dev *pctldev,
20 		struct pinctrl_map **map, unsigned *reserved_maps,
21 		unsigned *num_maps, const char *group,
22 		unsigned long *configs, unsigned num_configs,
23 		enum pinctrl_map_type type);
24 int pinctrl_utils_add_config(struct pinctrl_dev *pctldev,
25 		unsigned long **configs, unsigned *num_configs,
26 		unsigned long config);
27 void pinctrl_utils_free_map(struct pinctrl_dev *pctldev,
28 		struct pinctrl_map *map, unsigned num_maps);
29 
30 #endif /* __PINCTRL_UTILS_H__ */
31