]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blame - drivers/pinctrl/pinmux.h
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
[mirror_ubuntu-artful-kernel.git] / drivers / pinctrl / pinmux.h
CommitLineData
2744e8af
LW
1/*
2 * Internal interface between the core pin control system and the
3 * pinmux 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#ifdef CONFIG_PINMUX
14
b9130b77 15int pinmux_check_ops(struct pinctrl_dev *pctldev);
7ecdb16f 16
1e2082b5
SW
17int pinmux_validate_map(struct pinctrl_map const *map, int i);
18
befe5bdf
LW
19int pinmux_request_gpio(struct pinctrl_dev *pctldev,
20 struct pinctrl_gpio_range *range,
21 unsigned pin, unsigned gpio);
22void pinmux_free_gpio(struct pinctrl_dev *pctldev, unsigned pin,
23 struct pinctrl_gpio_range *range);
24int pinmux_gpio_direction(struct pinctrl_dev *pctldev,
25 struct pinctrl_gpio_range *range,
26 unsigned pin, bool input);
7ecdb16f
SW
27
28int pinmux_map_to_setting(struct pinctrl_map const *map,
29 struct pinctrl_setting *setting);
30void pinmux_free_setting(struct pinctrl_setting const *setting);
31int pinmux_enable_setting(struct pinctrl_setting const *setting);
32void pinmux_disable_setting(struct pinctrl_setting const *setting);
33
2744e8af
LW
34#else
35
b9130b77 36static inline int pinmux_check_ops(struct pinctrl_dev *pctldev)
2744e8af
LW
37{
38 return 0;
39}
40
1e2082b5
SW
41static inline int pinmux_validate_map(struct pinctrl_map const *map, int i)
42{
43 return 0;
44}
45
befe5bdf
LW
46static inline int pinmux_request_gpio(struct pinctrl_dev *pctldev,
47 struct pinctrl_gpio_range *range,
48 unsigned pin, unsigned gpio)
49{
50 return 0;
51}
52
53static inline void pinmux_free_gpio(struct pinctrl_dev *pctldev,
54 unsigned pin,
55 struct pinctrl_gpio_range *range)
56{
57}
58
59static inline int pinmux_gpio_direction(struct pinctrl_dev *pctldev,
60 struct pinctrl_gpio_range *range,
61 unsigned pin, bool input)
62{
63 return 0;
64}
65
7ecdb16f
SW
66static inline int pinmux_map_to_setting(struct pinctrl_map const *map,
67 struct pinctrl_setting *setting)
2744e8af
LW
68{
69 return 0;
70}
71
7ecdb16f 72static inline void pinmux_free_setting(struct pinctrl_setting const *setting)
befe5bdf
LW
73{
74}
75
7ecdb16f 76static inline int pinmux_enable_setting(struct pinctrl_setting const *setting)
befe5bdf 77{
7ecdb16f 78 return 0;
befe5bdf
LW
79}
80
7ecdb16f
SW
81static inline void pinmux_disable_setting(
82 struct pinctrl_setting const *setting)
befe5bdf
LW
83{
84}
85
c736d73c
SW
86#endif
87
88#if defined(CONFIG_PINMUX) && defined(CONFIG_DEBUG_FS)
89
90void pinmux_show_map(struct seq_file *s, struct pinctrl_map const *map);
91void pinmux_show_setting(struct seq_file *s,
92 struct pinctrl_setting const *setting);
93void pinmux_init_device_debugfs(struct dentry *devroot,
94 struct pinctrl_dev *pctldev);
95
96#else
97
1e2082b5
SW
98static inline void pinmux_show_map(struct seq_file *s,
99 struct pinctrl_map const *map)
100{
101}
102
103static inline void pinmux_show_setting(struct seq_file *s,
104 struct pinctrl_setting const *setting)
03665e0f
SW
105{
106}
107
1e2082b5
SW
108static inline void pinmux_init_device_debugfs(struct dentry *devroot,
109 struct pinctrl_dev *pctldev)
2744e8af
LW
110{
111}
112
113#endif