This source file includes following definitions.
- of_pinctrl_get
1
2
3
4
5
6
7
8
9
10
11 #ifndef __LINUX_PINCTRL_PINCTRL_H
12 #define __LINUX_PINCTRL_PINCTRL_H
13
14 #include <linux/radix-tree.h>
15 #include <linux/list.h>
16 #include <linux/seq_file.h>
17 #include <linux/pinctrl/pinctrl-state.h>
18 #include <linux/pinctrl/devinfo.h>
19
20 struct device;
21 struct pinctrl_dev;
22 struct pinctrl_map;
23 struct pinmux_ops;
24 struct pinconf_ops;
25 struct pin_config_item;
26 struct gpio_chip;
27 struct device_node;
28
29
30
31
32
33
34
35
36 struct pinctrl_pin_desc {
37 unsigned number;
38 const char *name;
39 void *drv_data;
40 };
41
42
43 #define PINCTRL_PIN(a, b) { .number = a, .name = b }
44 #define PINCTRL_PIN_ANON(a) { .number = a }
45
46
47
48
49
50
51
52
53
54
55
56
57
58 struct pinctrl_gpio_range {
59 struct list_head node;
60 const char *name;
61 unsigned int id;
62 unsigned int base;
63 unsigned int pin_base;
64 unsigned const *pins;
65 unsigned int npins;
66 struct gpio_chip *gc;
67 };
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88 struct pinctrl_ops {
89 int (*get_groups_count) (struct pinctrl_dev *pctldev);
90 const char *(*get_group_name) (struct pinctrl_dev *pctldev,
91 unsigned selector);
92 int (*get_group_pins) (struct pinctrl_dev *pctldev,
93 unsigned selector,
94 const unsigned **pins,
95 unsigned *num_pins);
96 void (*pin_dbg_show) (struct pinctrl_dev *pctldev, struct seq_file *s,
97 unsigned offset);
98 int (*dt_node_to_map) (struct pinctrl_dev *pctldev,
99 struct device_node *np_config,
100 struct pinctrl_map **map, unsigned *num_maps);
101 void (*dt_free_map) (struct pinctrl_dev *pctldev,
102 struct pinctrl_map *map, unsigned num_maps);
103 };
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130 struct pinctrl_desc {
131 const char *name;
132 const struct pinctrl_pin_desc *pins;
133 unsigned int npins;
134 const struct pinctrl_ops *pctlops;
135 const struct pinmux_ops *pmxops;
136 const struct pinconf_ops *confops;
137 struct module *owner;
138 #ifdef CONFIG_GENERIC_PINCONF
139 unsigned int num_custom_params;
140 const struct pinconf_generic_params *custom_params;
141 const struct pin_config_item *custom_conf_items;
142 #endif
143 bool link_consumers;
144 };
145
146
147
148 extern int pinctrl_register_and_init(struct pinctrl_desc *pctldesc,
149 struct device *dev, void *driver_data,
150 struct pinctrl_dev **pctldev);
151 extern int pinctrl_enable(struct pinctrl_dev *pctldev);
152
153
154 extern struct pinctrl_dev *pinctrl_register(struct pinctrl_desc *pctldesc,
155 struct device *dev, void *driver_data);
156
157 extern void pinctrl_unregister(struct pinctrl_dev *pctldev);
158
159 extern int devm_pinctrl_register_and_init(struct device *dev,
160 struct pinctrl_desc *pctldesc,
161 void *driver_data,
162 struct pinctrl_dev **pctldev);
163
164
165 extern struct pinctrl_dev *devm_pinctrl_register(struct device *dev,
166 struct pinctrl_desc *pctldesc,
167 void *driver_data);
168
169 extern void devm_pinctrl_unregister(struct device *dev,
170 struct pinctrl_dev *pctldev);
171
172 extern void pinctrl_add_gpio_range(struct pinctrl_dev *pctldev,
173 struct pinctrl_gpio_range *range);
174 extern void pinctrl_add_gpio_ranges(struct pinctrl_dev *pctldev,
175 struct pinctrl_gpio_range *ranges,
176 unsigned nranges);
177 extern void pinctrl_remove_gpio_range(struct pinctrl_dev *pctldev,
178 struct pinctrl_gpio_range *range);
179
180 extern struct pinctrl_dev *pinctrl_find_and_add_gpio_range(const char *devname,
181 struct pinctrl_gpio_range *range);
182 extern struct pinctrl_gpio_range *
183 pinctrl_find_gpio_range_from_pin(struct pinctrl_dev *pctldev,
184 unsigned int pin);
185 extern int pinctrl_get_group_pins(struct pinctrl_dev *pctldev,
186 const char *pin_group, const unsigned **pins,
187 unsigned *num_pins);
188
189 #ifdef CONFIG_OF
190 extern struct pinctrl_dev *of_pinctrl_get(struct device_node *np);
191 #else
192 static inline
193 struct pinctrl_dev *of_pinctrl_get(struct device_node *np)
194 {
195 return NULL;
196 }
197 #endif
198
199 extern const char *pinctrl_dev_get_name(struct pinctrl_dev *pctldev);
200 extern const char *pinctrl_dev_get_devname(struct pinctrl_dev *pctldev);
201 extern void *pinctrl_dev_get_drvdata(struct pinctrl_dev *pctldev);
202
203 #endif