]>
Commit | Line | Data |
---|---|---|
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 | 15 | int pinmux_check_ops(struct pinctrl_dev *pctldev); |
befe5bdf LW |
16 | int pinmux_request_gpio(struct pinctrl_dev *pctldev, |
17 | struct pinctrl_gpio_range *range, | |
18 | unsigned pin, unsigned gpio); | |
19 | void pinmux_free_gpio(struct pinctrl_dev *pctldev, unsigned pin, | |
20 | struct pinctrl_gpio_range *range); | |
21 | int pinmux_gpio_direction(struct pinctrl_dev *pctldev, | |
22 | struct pinctrl_gpio_range *range, | |
23 | unsigned pin, bool input); | |
24 | static inline void pinmux_init_pinctrl_handle(struct pinctrl *p) | |
25 | { | |
26 | p->func_selector = UINT_MAX; | |
27 | INIT_LIST_HEAD(&p->groups); | |
28 | } | |
29 | int pinmux_apply_muxmap(struct pinctrl_dev *pctldev, | |
30 | struct pinctrl *p, | |
31 | struct device *dev, | |
32 | const char *devname, | |
33 | struct pinctrl_map const *map); | |
34 | void pinmux_put(struct pinctrl *p); | |
35 | int pinmux_enable(struct pinctrl *p); | |
36 | void pinmux_disable(struct pinctrl *p); | |
03665e0f SW |
37 | void pinmux_init_device_debugfs(struct dentry *devroot, |
38 | struct pinctrl_dev *pctldev); | |
befe5bdf | 39 | void pinmux_dbg_show(struct seq_file *s, struct pinctrl *p); |
2744e8af LW |
40 | |
41 | #else | |
42 | ||
b9130b77 | 43 | static inline int pinmux_check_ops(struct pinctrl_dev *pctldev) |
2744e8af LW |
44 | { |
45 | return 0; | |
46 | } | |
47 | ||
befe5bdf LW |
48 | static inline int pinmux_request_gpio(struct pinctrl_dev *pctldev, |
49 | struct pinctrl_gpio_range *range, | |
50 | unsigned pin, unsigned gpio) | |
51 | { | |
52 | return 0; | |
53 | } | |
54 | ||
55 | static inline void pinmux_free_gpio(struct pinctrl_dev *pctldev, | |
56 | unsigned pin, | |
57 | struct pinctrl_gpio_range *range) | |
58 | { | |
59 | } | |
60 | ||
61 | static inline int pinmux_gpio_direction(struct pinctrl_dev *pctldev, | |
62 | struct pinctrl_gpio_range *range, | |
63 | unsigned pin, bool input) | |
64 | { | |
65 | return 0; | |
66 | } | |
67 | ||
68 | static inline void pinmux_init_pinctrl_handle(struct pinctrl *p) | |
2744e8af LW |
69 | { |
70 | } | |
71 | ||
befe5bdf LW |
72 | static inline int pinmux_apply_muxmap(struct pinctrl_dev *pctldev, |
73 | struct pinctrl *p, | |
74 | struct device *dev, | |
75 | const char *devname, | |
76 | struct pinctrl_map const *map) | |
2744e8af LW |
77 | { |
78 | return 0; | |
79 | } | |
80 | ||
befe5bdf LW |
81 | static inline void pinmux_put(struct pinctrl *p) |
82 | { | |
83 | } | |
84 | ||
85 | static inline int pinmux_enable(struct pinctrl *p) | |
86 | { | |
87 | } | |
88 | ||
89 | static inline void pinmux_disable(struct pinctrl *p) | |
90 | { | |
91 | } | |
92 | ||
03665e0f SW |
93 | static inline void pinmux_init_device_debugfs(struct dentry *devroot, |
94 | struct pinctrl_dev *pctldev) | |
95 | { | |
96 | } | |
97 | ||
98 | static inline void pinmux_dbg_show(struct seq_file *s, struct pinctrl *p) | |
2744e8af LW |
99 | { |
100 | } | |
101 | ||
102 | #endif |