Thomas Gleixner | 9952f69 | 2019-05-28 10:10:04 -0700 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Stephen Warren | 57291ce | 2012-03-23 10:29:46 -0600 | [diff] [blame] | 2 | /* |
| 3 | * Internal interface to pinctrl device tree integration |
| 4 | * |
| 5 | * Copyright (C) 2012 NVIDIA CORPORATION. All rights reserved. |
Stephen Warren | 57291ce | 2012-03-23 10:29:46 -0600 | [diff] [blame] | 6 | */ |
| 7 | |
Andy Shevchenko | e5530ad | 2022-10-07 12:53:44 +0300 | [diff] [blame] | 8 | #include <linux/errno.h> |
| 9 | |
| 10 | struct device_node; |
Tony Lindgren | 42124bc | 2016-11-03 09:35:47 -0700 | [diff] [blame] | 11 | struct of_phandle_args; |
| 12 | |
Andy Shevchenko | e5530ad | 2022-10-07 12:53:44 +0300 | [diff] [blame] | 13 | struct pinctrl; |
| 14 | struct pinctrl_dev; |
| 15 | |
Stephen Warren | 57291ce | 2012-03-23 10:29:46 -0600 | [diff] [blame] | 16 | #ifdef CONFIG_OF |
| 17 | |
| 18 | void pinctrl_dt_free_maps(struct pinctrl *p); |
Tony Lindgren | 99e4f67 | 2016-12-27 09:19:59 -0800 | [diff] [blame] | 19 | int pinctrl_dt_to_map(struct pinctrl *p, struct pinctrl_dev *pctldev); |
Stephen Warren | 57291ce | 2012-03-23 10:29:46 -0600 | [diff] [blame] | 20 | |
Tony Lindgren | 42124bc | 2016-11-03 09:35:47 -0700 | [diff] [blame] | 21 | int pinctrl_count_index_with_args(const struct device_node *np, |
| 22 | const char *list_name); |
| 23 | |
| 24 | int pinctrl_parse_index_with_args(const struct device_node *np, |
| 25 | const char *list_name, int index, |
| 26 | struct of_phandle_args *out_args); |
| 27 | |
Stephen Warren | 57291ce | 2012-03-23 10:29:46 -0600 | [diff] [blame] | 28 | #else |
| 29 | |
Tony Lindgren | 99e4f67 | 2016-12-27 09:19:59 -0800 | [diff] [blame] | 30 | static inline int pinctrl_dt_to_map(struct pinctrl *p, |
| 31 | struct pinctrl_dev *pctldev) |
Stephen Warren | 57291ce | 2012-03-23 10:29:46 -0600 | [diff] [blame] | 32 | { |
| 33 | return 0; |
| 34 | } |
| 35 | |
| 36 | static inline void pinctrl_dt_free_maps(struct pinctrl *p) |
| 37 | { |
| 38 | } |
| 39 | |
Tony Lindgren | 42124bc | 2016-11-03 09:35:47 -0700 | [diff] [blame] | 40 | static inline int pinctrl_count_index_with_args(const struct device_node *np, |
| 41 | const char *list_name) |
| 42 | { |
| 43 | return -ENODEV; |
| 44 | } |
| 45 | |
| 46 | static inline int |
| 47 | pinctrl_parse_index_with_args(const struct device_node *np, |
| 48 | const char *list_name, int index, |
| 49 | struct of_phandle_args *out_args) |
| 50 | { |
| 51 | return -ENODEV; |
| 52 | } |
| 53 | |
Stephen Warren | 57291ce | 2012-03-23 10:29:46 -0600 | [diff] [blame] | 54 | #endif |