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 *reserved_maps, 19 unsigned *num_maps, unsigned reserve); 20 int pinctrl_utils_add_map_mux(struct pinctrl_dev *pctldev, 21 struct pinctrl_map **map, unsigned *reserved_maps, 22 unsigned *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 *reserved_maps, 26 unsigned *num_maps, const char *group, 27 unsigned long *configs, unsigned num_configs, 28 enum pinctrl_map_type type); 29 int pinctrl_utils_add_config(struct pinctrl_dev *pctldev, 30 unsigned long **configs, unsigned *num_configs, 31 unsigned long config); 32 void pinctrl_utils_free_map(struct pinctrl_dev *pctldev, 33 struct pinctrl_map *map, unsigned num_maps); 34 35 #endif /* __PINCTRL_UTILS_H__ */ 36