1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Internal interface between the core pin control system and the
6 * Copyright (C) 2011 ST-Ericsson SA
7 * Written on behalf of Linaro for ST-Ericsson
8 * Based on bits of regulator core, gpio core and clk core
10 * Author: Linus Walleij <linus.walleij@linaro.org>
15 int pinconf_check_ops(struct pinctrl_dev
*pctldev
);
16 int pinconf_validate_map(const struct pinctrl_map
*map
, int i
);
17 int pinconf_map_to_setting(const struct pinctrl_map
*map
,
18 struct pinctrl_setting
*setting
);
19 void pinconf_free_setting(const struct pinctrl_setting
*setting
);
20 int pinconf_apply_setting(const struct pinctrl_setting
*setting
);
22 int pinconf_set_config(struct pinctrl_dev
*pctldev
, unsigned pin
,
23 unsigned long *configs
, size_t nconfigs
);
26 * You will only be interested in these if you're using PINCONF
27 * so don't supply any stubs for these.
29 int pin_config_get_for_pin(struct pinctrl_dev
*pctldev
, unsigned pin
,
30 unsigned long *config
);
31 int pin_config_group_get(const char *dev_name
, const char *pin_group
,
32 unsigned long *config
);
36 static inline int pinconf_check_ops(struct pinctrl_dev
*pctldev
)
41 static inline int pinconf_validate_map(const struct pinctrl_map
*map
, int i
)
46 static inline int pinconf_map_to_setting(const struct pinctrl_map
*map
,
47 struct pinctrl_setting
*setting
)
52 static inline void pinconf_free_setting(const struct pinctrl_setting
*setting
)
56 static inline int pinconf_apply_setting(const struct pinctrl_setting
*setting
)
61 static inline int pinconf_set_config(struct pinctrl_dev
*pctldev
, unsigned pin
,
62 unsigned long *configs
, size_t nconfigs
)
69 #if defined(CONFIG_PINCONF) && defined(CONFIG_DEBUG_FS)
71 void pinconf_show_map(struct seq_file
*s
, const struct pinctrl_map
*map
);
72 void pinconf_show_setting(struct seq_file
*s
,
73 const struct pinctrl_setting
*setting
);
74 void pinconf_init_device_debugfs(struct dentry
*devroot
,
75 struct pinctrl_dev
*pctldev
);
79 static inline void pinconf_show_map(struct seq_file
*s
,
80 const struct pinctrl_map
*map
)
84 static inline void pinconf_show_setting(struct seq_file
*s
,
85 const struct pinctrl_setting
*setting
)
89 static inline void pinconf_init_device_debugfs(struct dentry
*devroot
,
90 struct pinctrl_dev
*pctldev
)
97 * The following functions are available if the driver uses the generic
101 #if defined(CONFIG_GENERIC_PINCONF) && defined(CONFIG_DEBUG_FS)
103 void pinconf_generic_dump_pins(struct pinctrl_dev
*pctldev
,
104 struct seq_file
*s
, const char *gname
,
107 void pinconf_generic_dump_config(struct pinctrl_dev
*pctldev
,
108 struct seq_file
*s
, unsigned long config
);
111 static inline void pinconf_generic_dump_pins(struct pinctrl_dev
*pctldev
,
113 const char *gname
, unsigned pin
)
118 static inline void pinconf_generic_dump_config(struct pinctrl_dev
*pctldev
,
120 unsigned long config
)
126 #if defined(CONFIG_GENERIC_PINCONF) && defined(CONFIG_OF)
127 int pinconf_generic_parse_dt_config(struct device_node
*np
,
128 struct pinctrl_dev
*pctldev
,
129 unsigned long **configs
,
130 unsigned int *nconfigs
);