net: smc91x: constify dev_pm_ops structures.
[linux-2.6-block.git] / drivers / pinctrl / pinconf.h
CommitLineData
ae6b4d85
LW
1/*
2 * Internal interface between the core pin control system and the
3 * pin config portions
4 *
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
8 *
9 * Author: Linus Walleij <linus.walleij@linaro.org>
10 *
11 * License terms: GNU General Public License (GPL) version 2
12 */
13
14#ifdef CONFIG_PINCONF
15
b9130b77 16int pinconf_check_ops(struct pinctrl_dev *pctldev);
1e2082b5 17int pinconf_validate_map(struct pinctrl_map const *map, int i);
1e2082b5
SW
18int pinconf_map_to_setting(struct pinctrl_map const *map,
19 struct pinctrl_setting *setting);
20void pinconf_free_setting(struct pinctrl_setting const *setting);
21int pinconf_apply_setting(struct pinctrl_setting const *setting);
ae6b4d85 22
15381bc7
MW
23int pinconf_set_config(struct pinctrl_dev *pctldev, unsigned pin,
24 unsigned long *configs, size_t nconfigs);
25
394349f7
LW
26/*
27 * You will only be interested in these if you're using PINCONF
28 * so don't supply any stubs for these.
29 */
30int pin_config_get_for_pin(struct pinctrl_dev *pctldev, unsigned pin,
31 unsigned long *config);
32int pin_config_group_get(const char *dev_name, const char *pin_group,
33 unsigned long *config);
34
ae6b4d85
LW
35#else
36
b9130b77 37static inline int pinconf_check_ops(struct pinctrl_dev *pctldev)
ae6b4d85
LW
38{
39 return 0;
40}
41
1e2082b5
SW
42static inline int pinconf_validate_map(struct pinctrl_map const *map, int i)
43{
44 return 0;
45}
46
47static inline int pinconf_map_to_setting(struct pinctrl_map const *map,
48 struct pinctrl_setting *setting)
49{
50 return 0;
51}
52
53static inline void pinconf_free_setting(struct pinctrl_setting const *setting)
54{
55}
56
57static inline int pinconf_apply_setting(struct pinctrl_setting const *setting)
58{
59 return 0;
60}
61
15381bc7
MW
62static inline int pinconf_set_config(struct pinctrl_dev *pctldev, unsigned pin,
63 unsigned long *configs, size_t nconfigs)
64{
65 return -ENOTSUPP;
66}
67
c736d73c
SW
68#endif
69
96593afe 70#if defined(CONFIG_PINCONF) && defined(CONFIG_DEBUG_FS)
c736d73c
SW
71
72void pinconf_show_map(struct seq_file *s, struct pinctrl_map const *map);
73void pinconf_show_setting(struct seq_file *s,
74 struct pinctrl_setting const *setting);
75void pinconf_init_device_debugfs(struct dentry *devroot,
76 struct pinctrl_dev *pctldev);
77
78#else
79
1e2082b5
SW
80static inline void pinconf_show_map(struct seq_file *s,
81 struct pinctrl_map const *map)
82{
83}
84
85static inline void pinconf_show_setting(struct seq_file *s,
86 struct pinctrl_setting const *setting)
87{
88}
89
ae6b4d85
LW
90static inline void pinconf_init_device_debugfs(struct dentry *devroot,
91 struct pinctrl_dev *pctldev)
92{
93}
94
95#endif
394349f7
LW
96
97/*
98 * The following functions are available if the driver uses the generic
99 * pin config.
100 */
101
bf4d7be5 102#if defined(CONFIG_GENERIC_PINCONF) && defined(CONFIG_DEBUG_FS)
394349f7 103
dd4d01f7
SB
104void pinconf_generic_dump_pins(struct pinctrl_dev *pctldev,
105 struct seq_file *s, const char *gname,
106 unsigned pin);
394349f7 107
9cfd1724
HZ
108void pinconf_generic_dump_config(struct pinctrl_dev *pctldev,
109 struct seq_file *s, unsigned long config);
394349f7
LW
110#else
111
dd4d01f7
SB
112static inline void pinconf_generic_dump_pins(struct pinctrl_dev *pctldev,
113 struct seq_file *s,
114 const char *gname, unsigned pin)
394349f7
LW
115{
116 return;
117}
118
9cfd1724
HZ
119static inline void pinconf_generic_dump_config(struct pinctrl_dev *pctldev,
120 struct seq_file *s,
121 unsigned long config)
122{
123 return;
124}
394349f7 125#endif
7db9af4b
HS
126
127#if defined(CONFIG_GENERIC_PINCONF) && defined(CONFIG_OF)
128int pinconf_generic_parse_dt_config(struct device_node *np,
dd4d01f7 129 struct pinctrl_dev *pctldev,
7db9af4b
HS
130 unsigned long **configs,
131 unsigned int *nconfigs);
132#endif