blob: 54510de5e8c6d31d9f8f57a3abce02c0401c61eb [file] [log] [blame]
Linus Walleijae6b4d82011-10-19 18:14:33 +02001/*
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
Tony Lindgrenb9130b72012-01-24 16:28:08 -080016int pinconf_check_ops(struct pinctrl_dev *pctldev);
Stephen Warren1e2082b2012-03-02 13:05:48 -070017int pinconf_validate_map(struct pinctrl_map const *map, int i);
Stephen Warren1e2082b2012-03-02 13:05:48 -070018int 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);
Stephen Warren1e2082b2012-03-02 13:05:48 -070022void pinconf_show_map(struct seq_file *s, struct pinctrl_map const *map);
23void pinconf_show_setting(struct seq_file *s,
24 struct pinctrl_setting const *setting);
Linus Walleijae6b4d82011-10-19 18:14:33 +020025void pinconf_init_device_debugfs(struct dentry *devroot,
26 struct pinctrl_dev *pctldev);
Linus Walleijae6b4d82011-10-19 18:14:33 +020027
Linus Walleij394349f2011-11-24 18:27:15 +010028/*
29 * You will only be interested in these if you're using PINCONF
30 * so don't supply any stubs for these.
31 */
32int pin_config_get_for_pin(struct pinctrl_dev *pctldev, unsigned pin,
33 unsigned long *config);
34int pin_config_group_get(const char *dev_name, const char *pin_group,
35 unsigned long *config);
36
Linus Walleijae6b4d82011-10-19 18:14:33 +020037#else
38
Tony Lindgrenb9130b72012-01-24 16:28:08 -080039static inline int pinconf_check_ops(struct pinctrl_dev *pctldev)
Linus Walleijae6b4d82011-10-19 18:14:33 +020040{
41 return 0;
42}
43
Stephen Warren1e2082b2012-03-02 13:05:48 -070044static inline int pinconf_validate_map(struct pinctrl_map const *map, int i)
45{
46 return 0;
47}
48
49static inline int pinconf_map_to_setting(struct pinctrl_map const *map,
50 struct pinctrl_setting *setting)
51{
52 return 0;
53}
54
55static inline void pinconf_free_setting(struct pinctrl_setting const *setting)
56{
57}
58
59static inline int pinconf_apply_setting(struct pinctrl_setting const *setting)
60{
61 return 0;
62}
63
64static inline void pinconf_show_map(struct seq_file *s,
65 struct pinctrl_map const *map)
66{
67}
68
69static inline void pinconf_show_setting(struct seq_file *s,
70 struct pinctrl_setting const *setting)
71{
72}
73
Linus Walleijae6b4d82011-10-19 18:14:33 +020074static inline void pinconf_init_device_debugfs(struct dentry *devroot,
75 struct pinctrl_dev *pctldev)
76{
77}
78
79#endif
Linus Walleij394349f2011-11-24 18:27:15 +010080
81/*
82 * The following functions are available if the driver uses the generic
83 * pin config.
84 */
85
86#ifdef CONFIG_GENERIC_PINCONF
87
88void pinconf_generic_dump_pin(struct pinctrl_dev *pctldev,
89 struct seq_file *s, unsigned pin);
90
91void pinconf_generic_dump_group(struct pinctrl_dev *pctldev,
92 struct seq_file *s, const char *gname);
93
94#else
95
96static inline void pinconf_generic_dump_pin(struct pinctrl_dev *pctldev,
97 struct seq_file *s,
98 unsigned pin)
99{
100 return;
101}
102
103static inline void pinconf_generic_dump_group(struct pinctrl_dev *pctldev,
104 struct seq_file *s,
105 const char *gname)
106{
107 return;
108}
109
110#endif