19952f691SThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-only */ 257291ce2SStephen Warren /* 357291ce2SStephen Warren * Internal interface to pinctrl device tree integration 457291ce2SStephen Warren * 557291ce2SStephen Warren * Copyright (C) 2012 NVIDIA CORPORATION. All rights reserved. 657291ce2SStephen Warren */ 757291ce2SStephen Warren 8*e5530adcSAndy Shevchenko #include <linux/errno.h> 9*e5530adcSAndy Shevchenko 10*e5530adcSAndy Shevchenko struct device_node; 1142124bc5STony Lindgren struct of_phandle_args; 1242124bc5STony Lindgren 13*e5530adcSAndy Shevchenko struct pinctrl; 14*e5530adcSAndy Shevchenko struct pinctrl_dev; 15*e5530adcSAndy Shevchenko 1657291ce2SStephen Warren #ifdef CONFIG_OF 1757291ce2SStephen Warren 1857291ce2SStephen Warren void pinctrl_dt_free_maps(struct pinctrl *p); 1999e4f675STony Lindgren int pinctrl_dt_to_map(struct pinctrl *p, struct pinctrl_dev *pctldev); 2057291ce2SStephen Warren 2142124bc5STony Lindgren int pinctrl_count_index_with_args(const struct device_node *np, 2242124bc5STony Lindgren const char *list_name); 2342124bc5STony Lindgren 2442124bc5STony Lindgren int pinctrl_parse_index_with_args(const struct device_node *np, 2542124bc5STony Lindgren const char *list_name, int index, 2642124bc5STony Lindgren struct of_phandle_args *out_args); 2742124bc5STony Lindgren 2857291ce2SStephen Warren #else 2957291ce2SStephen Warren 3099e4f675STony Lindgren static inline int pinctrl_dt_to_map(struct pinctrl *p, 3199e4f675STony Lindgren struct pinctrl_dev *pctldev) 3257291ce2SStephen Warren { 3357291ce2SStephen Warren return 0; 3457291ce2SStephen Warren } 3557291ce2SStephen Warren 3657291ce2SStephen Warren static inline void pinctrl_dt_free_maps(struct pinctrl *p) 3757291ce2SStephen Warren { 3857291ce2SStephen Warren } 3957291ce2SStephen Warren 4042124bc5STony Lindgren static inline int pinctrl_count_index_with_args(const struct device_node *np, 4142124bc5STony Lindgren const char *list_name) 4242124bc5STony Lindgren { 4342124bc5STony Lindgren return -ENODEV; 4442124bc5STony Lindgren } 4542124bc5STony Lindgren 4642124bc5STony Lindgren static inline int 4742124bc5STony Lindgren pinctrl_parse_index_with_args(const struct device_node *np, 4842124bc5STony Lindgren const char *list_name, int index, 4942124bc5STony Lindgren struct of_phandle_args *out_args) 5042124bc5STony Lindgren { 5142124bc5STony Lindgren return -ENODEV; 5242124bc5STony Lindgren } 5342124bc5STony Lindgren 5457291ce2SStephen Warren #endif 55