This source file includes following definitions.
- mctrl_gpio_set
- mctrl_gpio_get
- mctrl_gpio_get_outputs
- mctrl_gpio_to_gpiod
- mctrl_gpio_init
- mctrl_gpio_init_noauto
- mctrl_gpio_free
- mctrl_gpio_enable_ms
- mctrl_gpio_disable_ms
1
2
3
4
5
6
7
8 #ifndef __SERIAL_MCTRL_GPIO__
9 #define __SERIAL_MCTRL_GPIO__
10
11 #include <linux/err.h>
12 #include <linux/device.h>
13 #include <linux/gpio/consumer.h>
14
15 struct uart_port;
16
17 enum mctrl_gpio_idx {
18 UART_GPIO_CTS,
19 UART_GPIO_DSR,
20 UART_GPIO_DCD,
21 UART_GPIO_RNG,
22 UART_GPIO_RI = UART_GPIO_RNG,
23 UART_GPIO_RTS,
24 UART_GPIO_DTR,
25 UART_GPIO_MAX,
26 };
27
28
29
30
31 struct mctrl_gpios;
32
33 #ifdef CONFIG_GPIOLIB
34
35
36
37
38 void mctrl_gpio_set(struct mctrl_gpios *gpios, unsigned int mctrl);
39
40
41
42
43
44 unsigned int mctrl_gpio_get(struct mctrl_gpios *gpios, unsigned int *mctrl);
45
46
47
48
49
50 unsigned int
51 mctrl_gpio_get_outputs(struct mctrl_gpios *gpios, unsigned int *mctrl);
52
53
54
55
56 struct gpio_desc *mctrl_gpio_to_gpiod(struct mctrl_gpios *gpios,
57 enum mctrl_gpio_idx gidx);
58
59
60
61
62
63
64
65
66 struct mctrl_gpios *mctrl_gpio_init(struct uart_port *port, unsigned int idx);
67
68
69
70
71
72
73
74 struct mctrl_gpios *mctrl_gpio_init_noauto(struct device *dev,
75 unsigned int idx);
76
77
78
79
80
81
82 void mctrl_gpio_free(struct device *dev, struct mctrl_gpios *gpios);
83
84
85
86
87 void mctrl_gpio_enable_ms(struct mctrl_gpios *gpios);
88
89
90
91
92 void mctrl_gpio_disable_ms(struct mctrl_gpios *gpios);
93
94 #else
95
96 static inline
97 void mctrl_gpio_set(struct mctrl_gpios *gpios, unsigned int mctrl)
98 {
99 }
100
101 static inline
102 unsigned int mctrl_gpio_get(struct mctrl_gpios *gpios, unsigned int *mctrl)
103 {
104 return *mctrl;
105 }
106
107 static inline unsigned int
108 mctrl_gpio_get_outputs(struct mctrl_gpios *gpios, unsigned int *mctrl)
109 {
110 return *mctrl;
111 }
112
113 static inline
114 struct gpio_desc *mctrl_gpio_to_gpiod(struct mctrl_gpios *gpios,
115 enum mctrl_gpio_idx gidx)
116 {
117 return NULL;
118 }
119
120 static inline
121 struct mctrl_gpios *mctrl_gpio_init(struct uart_port *port, unsigned int idx)
122 {
123 return NULL;
124 }
125
126 static inline
127 struct mctrl_gpios *mctrl_gpio_init_noauto(struct device *dev, unsigned int idx)
128 {
129 return NULL;
130 }
131
132 static inline
133 void mctrl_gpio_free(struct device *dev, struct mctrl_gpios *gpios)
134 {
135 }
136
137 static inline void mctrl_gpio_enable_ms(struct mctrl_gpios *gpios)
138 {
139 }
140
141 static inline void mctrl_gpio_disable_ms(struct mctrl_gpios *gpios)
142 {
143 }
144
145 #endif
146
147 #endif