aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pinctrl/pinctrl-utils.h
diff options
context:
space:
mode:
authorLaxman Dewangan <ldewangan@nvidia.com>2013-08-06 09:12:33 -0400
committerLinus Walleij <linus.walleij@linaro.org>2013-08-14 15:00:41 -0400
commit1eb207a9ecaafb980704d8bc055a9a0269f62f8e (patch)
treebd4264b775dc59bd08279ee265eed0fd0d1e7732 /drivers/pinctrl/pinctrl-utils.h
parent744f0a9adb6a3478c9753eef56b0614ee69f969e (diff)
pinctrl: add utility functions for add map/configs
Some of pincontrol driver needs the utility function to create map list. The utility function needed for adding mux, configs etc. In place of duplicating this in each driver, add the common utility function in common file and use from device specific driver. This will reduce the duplicating of code across drivers. Changes from V1: - Add this files in this patch and add common utility APIs to here. Changes from V2: - Nothing in code. - Added Reviewed by Stephen. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/pinctrl-utils.h')
-rw-r--r--drivers/pinctrl/pinctrl-utils.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/drivers/pinctrl/pinctrl-utils.h b/drivers/pinctrl/pinctrl-utils.h
new file mode 100644
index 000000000000..d0ffe1ce200f
--- /dev/null
+++ b/drivers/pinctrl/pinctrl-utils.h
@@ -0,0 +1,43 @@
1/*
2 * Utils functions to implement the pincontrol driver.
3 *
4 * Copyright (c) 2013, NVIDIA Corporation.
5 *
6 * Author: Laxman Dewangan <ldewangan@nvidia.com>
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation version 2.
11 *
12 * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
13 * whether express or implied; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
20 * 02111-1307, USA
21 */
22#ifndef __PINCTRL_UTILS_H__
23#define __PINCTRL_UTILS_H__
24
25int pinctrl_utils_reserve_map(struct pinctrl_dev *pctldev,
26 struct pinctrl_map **map, unsigned *reserved_maps,
27 unsigned *num_maps, unsigned reserve);
28int pinctrl_utils_add_map_mux(struct pinctrl_dev *pctldev,
29 struct pinctrl_map **map, unsigned *reserved_maps,
30 unsigned *num_maps, const char *group,
31 const char *function);
32int pinctrl_utils_add_map_configs(struct pinctrl_dev *pctldev,
33 struct pinctrl_map **map, unsigned *reserved_maps,
34 unsigned *num_maps, const char *group,
35 unsigned long *configs, unsigned num_configs,
36 enum pinctrl_map_type type);
37int pinctrl_utils_add_config(struct pinctrl_dev *pctldev,
38 unsigned long **configs, unsigned *num_configs,
39 unsigned long config);
40void pinctrl_utils_dt_free_map(struct pinctrl_dev *pctldev,
41 struct pinctrl_map *map, unsigned num_maps);
42
43#endif /* __PINCTRL_UTILS_H__ */