blob: def76aba99d17c8fde08afdcfab5e9fc342dfd46 [file] [log] [blame]
Thomas Gleixner9952f692019-05-28 10:10:04 -07001/* SPDX-License-Identifier: GPL-2.0-only */
Stephen Warren57291ce2012-03-23 10:29:46 -06002/*
3 * Internal interface to pinctrl device tree integration
4 *
5 * Copyright (C) 2012 NVIDIA CORPORATION. All rights reserved.
Stephen Warren57291ce2012-03-23 10:29:46 -06006 */
7
Andy Shevchenkoe5530ad2022-10-07 12:53:44 +03008#include <linux/errno.h>
9
10struct device_node;
Tony Lindgren42124bc2016-11-03 09:35:47 -070011struct of_phandle_args;
12
Andy Shevchenkoe5530ad2022-10-07 12:53:44 +030013struct pinctrl;
14struct pinctrl_dev;
15
Stephen Warren57291ce2012-03-23 10:29:46 -060016#ifdef CONFIG_OF
17
18void pinctrl_dt_free_maps(struct pinctrl *p);
Tony Lindgren99e4f672016-12-27 09:19:59 -080019int pinctrl_dt_to_map(struct pinctrl *p, struct pinctrl_dev *pctldev);
Stephen Warren57291ce2012-03-23 10:29:46 -060020
Tony Lindgren42124bc2016-11-03 09:35:47 -070021int pinctrl_count_index_with_args(const struct device_node *np,
22 const char *list_name);
23
24int 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 Warren57291ce2012-03-23 10:29:46 -060028#else
29
Tony Lindgren99e4f672016-12-27 09:19:59 -080030static inline int pinctrl_dt_to_map(struct pinctrl *p,
31 struct pinctrl_dev *pctldev)
Stephen Warren57291ce2012-03-23 10:29:46 -060032{
33 return 0;
34}
35
36static inline void pinctrl_dt_free_maps(struct pinctrl *p)
37{
38}
39
Tony Lindgren42124bc2016-11-03 09:35:47 -070040static inline int pinctrl_count_index_with_args(const struct device_node *np,
41 const char *list_name)
42{
43 return -ENODEV;
44}
45
46static inline int
47pinctrl_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 Warren57291ce2012-03-23 10:29:46 -060054#endif