2 * Internal interface between the core pin control system and the
5 * Copyright (C) 2011 ST-Ericsson SA
6 * Written on behalf of Linaro for ST-Ericsson
7 * Based on bits of regulator core, gpio core and clk core
9 * Author: Linus Walleij <linus.walleij@linaro.org>
11 * License terms: GNU General Public License (GPL) version 2
16 int pinconf_check_ops(struct pinctrl_dev
*pctldev
);
17 int pinconf_validate_map(const struct pinctrl_map
*map
, int i
);
18 int pinconf_map_to_setting(const struct pinctrl_map
*map
,
19 struct pinctrl_setting
*setting
);
20 void pinconf_free_setting(const struct pinctrl_setting
*setting
);
21 int pinconf_apply_setting(const struct pinctrl_setting
*setting
);
23 int pinconf_set_config(struct pinctrl_dev
*pctldev
, unsigned pin
,
24 unsigned long *configs
, size_t nconfigs
);
27 * You will only be interested in these if you're using PINCONF
28 * so don't supply any stubs for these.
30 int pin_config_get_for_pin(struct pinctrl_dev
*pctldev
, unsigned pin
,
31 unsigned long *config
);
32 int pin_config_group_get(const char *dev_name
, const char *pin_group
,
33 unsigned long *config
);
37 static inline int pinconf_check_ops(struct pinctrl_dev
*pctldev
)
42 static inline int pinconf_validate_map(const struct pinctrl_map
*map
, int i
)
47 static inline int pinconf_map_to_setting(const struct pinctrl_map
*map
,
48 struct pinctrl_setting
*setting
)
53 static inline void pinconf_free_setting(const struct pinctrl_setting
*setting
)
57 static inline int pinconf_apply_setting(const struct pinctrl_setting
*setting
)
62 static inline int pinconf_set_config(struct pinctrl_dev
*pctldev
, unsigned pin
,
63 unsigned long *configs
, size_t nconfigs
)
70 #if defined(CONFIG_PINCONF) && defined(CONFIG_DEBUG_FS)
72 void pinconf_show_map(struct seq_file
*s
, const struct pinctrl_map
*map
);
73 void pinconf_show_setting(struct seq_file
*s
,
74 const struct pinctrl_setting
*setting
);
75 void pinconf_init_device_debugfs(struct dentry
*devroot
,
76 struct pinctrl_dev
*pctldev
);
80 static inline void pinconf_show_map(struct seq_file
*s
,
81 const struct pinctrl_map
*map
)
85 static inline void pinconf_show_setting(struct seq_file
*s
,
86 const struct pinctrl_setting
*setting
)
90 static inline void pinconf_init_device_debugfs(struct dentry
*devroot
,
91 struct pinctrl_dev
*pctldev
)
98 * The following functions are available if the driver uses the generic
102 #if defined(CONFIG_GENERIC_PINCONF) && defined(CONFIG_DEBUG_FS)
104 void pinconf_generic_dump_pins(struct pinctrl_dev
*pctldev
,
105 struct seq_file
*s
, const char *gname
,
108 void pinconf_generic_dump_config(struct pinctrl_dev
*pctldev
,
109 struct seq_file
*s
, unsigned long config
);
112 static inline void pinconf_generic_dump_pins(struct pinctrl_dev
*pctldev
,
114 const char *gname
, unsigned pin
)
119 static inline void pinconf_generic_dump_config(struct pinctrl_dev
*pctldev
,
121 unsigned long config
)
127 #if defined(CONFIG_GENERIC_PINCONF) && defined(CONFIG_OF)
128 int pinconf_generic_parse_dt_config(struct device_node
*np
,
129 struct pinctrl_dev
*pctldev
,
130 unsigned long **configs
,
131 unsigned int *nconfigs
);