Stephen Warren | 57291ce | 2012-03-23 10:29:46 -0600 | [diff] [blame] | 1 | /* |
| 2 | * Internal interface to pinctrl device tree integration |
| 3 | * |
| 4 | * Copyright (C) 2012 NVIDIA CORPORATION. All rights reserved. |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify it |
| 7 | * under the terms and conditions of the GNU General Public License, |
| 8 | * version 2, as published by the Free Software Foundation. |
| 9 | * |
| 10 | * This program is distributed in the hope it will be useful, but WITHOUT |
| 11 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 12 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
| 13 | * more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 17 | */ |
| 18 | |
Tony Lindgren | 42124bc | 2016-11-03 09:35:47 -0700 | [diff] [blame] | 19 | struct of_phandle_args; |
| 20 | |
Stephen Warren | 57291ce | 2012-03-23 10:29:46 -0600 | [diff] [blame] | 21 | #ifdef CONFIG_OF |
| 22 | |
Tony Lindgren | 99e4f67 | 2016-12-27 09:19:59 -0800 | [diff] [blame] | 23 | bool pinctrl_dt_has_hogs(struct pinctrl_dev *pctldev); |
| 24 | |
Stephen Warren | 57291ce | 2012-03-23 10:29:46 -0600 | [diff] [blame] | 25 | void pinctrl_dt_free_maps(struct pinctrl *p); |
Tony Lindgren | 99e4f67 | 2016-12-27 09:19:59 -0800 | [diff] [blame] | 26 | int pinctrl_dt_to_map(struct pinctrl *p, struct pinctrl_dev *pctldev); |
Stephen Warren | 57291ce | 2012-03-23 10:29:46 -0600 | [diff] [blame] | 27 | |
Tony Lindgren | 42124bc | 2016-11-03 09:35:47 -0700 | [diff] [blame] | 28 | int pinctrl_count_index_with_args(const struct device_node *np, |
| 29 | const char *list_name); |
| 30 | |
| 31 | int pinctrl_parse_index_with_args(const struct device_node *np, |
| 32 | const char *list_name, int index, |
| 33 | struct of_phandle_args *out_args); |
| 34 | |
Stephen Warren | 57291ce | 2012-03-23 10:29:46 -0600 | [diff] [blame] | 35 | #else |
| 36 | |
Tony Lindgren | 99e4f67 | 2016-12-27 09:19:59 -0800 | [diff] [blame] | 37 | static inline bool pinctrl_dt_has_hogs(struct pinctrl_dev *pctldev) |
| 38 | { |
| 39 | return false; |
| 40 | } |
| 41 | |
| 42 | static inline int pinctrl_dt_to_map(struct pinctrl *p, |
| 43 | struct pinctrl_dev *pctldev) |
Stephen Warren | 57291ce | 2012-03-23 10:29:46 -0600 | [diff] [blame] | 44 | { |
| 45 | return 0; |
| 46 | } |
| 47 | |
| 48 | static inline void pinctrl_dt_free_maps(struct pinctrl *p) |
| 49 | { |
| 50 | } |
| 51 | |
Tony Lindgren | 42124bc | 2016-11-03 09:35:47 -0700 | [diff] [blame] | 52 | static inline int pinctrl_count_index_with_args(const struct device_node *np, |
| 53 | const char *list_name) |
| 54 | { |
| 55 | return -ENODEV; |
| 56 | } |
| 57 | |
| 58 | static inline int |
| 59 | pinctrl_parse_index_with_args(const struct device_node *np, |
| 60 | const char *list_name, int index, |
| 61 | struct of_phandle_args *out_args) |
| 62 | { |
| 63 | return -ENODEV; |
| 64 | } |
| 65 | |
Stephen Warren | 57291ce | 2012-03-23 10:29:46 -0600 | [diff] [blame] | 66 | #endif |