This source file includes following definitions.
- reset_control_reset
- reset_control_assert
- reset_control_deassert
- reset_control_status
- reset_control_acquire
- reset_control_release
- reset_control_put
- __device_reset
- __of_reset_control_get
- __reset_control_get
- __devm_reset_control_get
- devm_reset_control_array_get
- of_reset_control_array_get
- reset_control_get_count
- device_reset
- device_reset_optional
- reset_control_get_exclusive
- reset_control_get_exclusive_released
- reset_control_get_shared
- reset_control_get_optional_exclusive
- reset_control_get_optional_shared
- of_reset_control_get_exclusive
- of_reset_control_get_shared
- of_reset_control_get_exclusive_by_index
- of_reset_control_get_shared_by_index
- devm_reset_control_get_exclusive
- devm_reset_control_get_exclusive_released
- devm_reset_control_get_shared
- devm_reset_control_get_optional_exclusive
- devm_reset_control_get_optional_shared
- devm_reset_control_get_exclusive_by_index
- devm_reset_control_get_shared_by_index
- of_reset_control_get
- of_reset_control_get_by_index
- devm_reset_control_get
- devm_reset_control_get_optional
- devm_reset_control_get_by_index
- devm_reset_control_array_get_exclusive
- devm_reset_control_array_get_shared
- devm_reset_control_array_get_optional_exclusive
- devm_reset_control_array_get_optional_shared
- of_reset_control_array_get_exclusive
- of_reset_control_array_get_exclusive_released
- of_reset_control_array_get_shared
- of_reset_control_array_get_optional_exclusive
- of_reset_control_array_get_optional_shared
1
2 #ifndef _LINUX_RESET_H_
3 #define _LINUX_RESET_H_
4
5 #include <linux/err.h>
6 #include <linux/errno.h>
7 #include <linux/types.h>
8
9 struct device;
10 struct device_node;
11 struct reset_control;
12
13 #ifdef CONFIG_RESET_CONTROLLER
14
15 int reset_control_reset(struct reset_control *rstc);
16 int reset_control_assert(struct reset_control *rstc);
17 int reset_control_deassert(struct reset_control *rstc);
18 int reset_control_status(struct reset_control *rstc);
19 int reset_control_acquire(struct reset_control *rstc);
20 void reset_control_release(struct reset_control *rstc);
21
22 struct reset_control *__of_reset_control_get(struct device_node *node,
23 const char *id, int index, bool shared,
24 bool optional, bool acquired);
25 struct reset_control *__reset_control_get(struct device *dev, const char *id,
26 int index, bool shared,
27 bool optional, bool acquired);
28 void reset_control_put(struct reset_control *rstc);
29 int __device_reset(struct device *dev, bool optional);
30 struct reset_control *__devm_reset_control_get(struct device *dev,
31 const char *id, int index, bool shared,
32 bool optional, bool acquired);
33
34 struct reset_control *devm_reset_control_array_get(struct device *dev,
35 bool shared, bool optional);
36 struct reset_control *of_reset_control_array_get(struct device_node *np,
37 bool shared, bool optional,
38 bool acquired);
39
40 int reset_control_get_count(struct device *dev);
41
42 #else
43
44 static inline int reset_control_reset(struct reset_control *rstc)
45 {
46 return 0;
47 }
48
49 static inline int reset_control_assert(struct reset_control *rstc)
50 {
51 return 0;
52 }
53
54 static inline int reset_control_deassert(struct reset_control *rstc)
55 {
56 return 0;
57 }
58
59 static inline int reset_control_status(struct reset_control *rstc)
60 {
61 return 0;
62 }
63
64 static inline int reset_control_acquire(struct reset_control *rstc)
65 {
66 return 0;
67 }
68
69 static inline void reset_control_release(struct reset_control *rstc)
70 {
71 }
72
73 static inline void reset_control_put(struct reset_control *rstc)
74 {
75 }
76
77 static inline int __device_reset(struct device *dev, bool optional)
78 {
79 return optional ? 0 : -ENOTSUPP;
80 }
81
82 static inline struct reset_control *__of_reset_control_get(
83 struct device_node *node,
84 const char *id, int index, bool shared,
85 bool optional, bool acquired)
86 {
87 return optional ? NULL : ERR_PTR(-ENOTSUPP);
88 }
89
90 static inline struct reset_control *__reset_control_get(
91 struct device *dev, const char *id,
92 int index, bool shared, bool optional,
93 bool acquired)
94 {
95 return optional ? NULL : ERR_PTR(-ENOTSUPP);
96 }
97
98 static inline struct reset_control *__devm_reset_control_get(
99 struct device *dev, const char *id,
100 int index, bool shared, bool optional,
101 bool acquired)
102 {
103 return optional ? NULL : ERR_PTR(-ENOTSUPP);
104 }
105
106 static inline struct reset_control *
107 devm_reset_control_array_get(struct device *dev, bool shared, bool optional)
108 {
109 return optional ? NULL : ERR_PTR(-ENOTSUPP);
110 }
111
112 static inline struct reset_control *
113 of_reset_control_array_get(struct device_node *np, bool shared, bool optional,
114 bool acquired)
115 {
116 return optional ? NULL : ERR_PTR(-ENOTSUPP);
117 }
118
119 static inline int reset_control_get_count(struct device *dev)
120 {
121 return -ENOENT;
122 }
123
124 #endif
125
126 static inline int __must_check device_reset(struct device *dev)
127 {
128 return __device_reset(dev, false);
129 }
130
131 static inline int device_reset_optional(struct device *dev)
132 {
133 return __device_reset(dev, true);
134 }
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151 static inline struct reset_control *
152 __must_check reset_control_get_exclusive(struct device *dev, const char *id)
153 {
154 return __reset_control_get(dev, id, 0, false, false, true);
155 }
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171 static inline struct reset_control *
172 __must_check reset_control_get_exclusive_released(struct device *dev,
173 const char *id)
174 {
175 return __reset_control_get(dev, id, 0, false, false, false);
176 }
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200 static inline struct reset_control *reset_control_get_shared(
201 struct device *dev, const char *id)
202 {
203 return __reset_control_get(dev, id, 0, true, false, false);
204 }
205
206 static inline struct reset_control *reset_control_get_optional_exclusive(
207 struct device *dev, const char *id)
208 {
209 return __reset_control_get(dev, id, 0, false, true, true);
210 }
211
212 static inline struct reset_control *reset_control_get_optional_shared(
213 struct device *dev, const char *id)
214 {
215 return __reset_control_get(dev, id, 0, true, true, false);
216 }
217
218
219
220
221
222
223
224
225
226
227
228 static inline struct reset_control *of_reset_control_get_exclusive(
229 struct device_node *node, const char *id)
230 {
231 return __of_reset_control_get(node, id, 0, false, false, true);
232 }
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253 static inline struct reset_control *of_reset_control_get_shared(
254 struct device_node *node, const char *id)
255 {
256 return __of_reset_control_get(node, id, 0, true, false, false);
257 }
258
259
260
261
262
263
264
265
266
267
268
269
270 static inline struct reset_control *of_reset_control_get_exclusive_by_index(
271 struct device_node *node, int index)
272 {
273 return __of_reset_control_get(node, NULL, index, false, false, true);
274 }
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298 static inline struct reset_control *of_reset_control_get_shared_by_index(
299 struct device_node *node, int index)
300 {
301 return __of_reset_control_get(node, NULL, index, true, false, false);
302 }
303
304
305
306
307
308
309
310
311
312
313
314
315
316 static inline struct reset_control *
317 __must_check devm_reset_control_get_exclusive(struct device *dev,
318 const char *id)
319 {
320 return __devm_reset_control_get(dev, id, 0, false, false, true);
321 }
322
323
324
325
326
327
328
329
330
331
332
333
334
335 static inline struct reset_control *
336 __must_check devm_reset_control_get_exclusive_released(struct device *dev,
337 const char *id)
338 {
339 return __devm_reset_control_get(dev, id, 0, false, false, false);
340 }
341
342
343
344
345
346
347
348
349
350
351 static inline struct reset_control *devm_reset_control_get_shared(
352 struct device *dev, const char *id)
353 {
354 return __devm_reset_control_get(dev, id, 0, true, false, false);
355 }
356
357 static inline struct reset_control *devm_reset_control_get_optional_exclusive(
358 struct device *dev, const char *id)
359 {
360 return __devm_reset_control_get(dev, id, 0, false, true, true);
361 }
362
363 static inline struct reset_control *devm_reset_control_get_optional_shared(
364 struct device *dev, const char *id)
365 {
366 return __devm_reset_control_get(dev, id, 0, true, true, false);
367 }
368
369
370
371
372
373
374
375
376
377
378
379
380
381 static inline struct reset_control *
382 devm_reset_control_get_exclusive_by_index(struct device *dev, int index)
383 {
384 return __devm_reset_control_get(dev, NULL, index, false, false, true);
385 }
386
387
388
389
390
391
392
393
394
395
396
397 static inline struct reset_control *
398 devm_reset_control_get_shared_by_index(struct device *dev, int index)
399 {
400 return __devm_reset_control_get(dev, NULL, index, true, false, false);
401 }
402
403
404
405
406
407
408
409
410
411 static inline struct reset_control *of_reset_control_get(
412 struct device_node *node, const char *id)
413 {
414 return of_reset_control_get_exclusive(node, id);
415 }
416
417 static inline struct reset_control *of_reset_control_get_by_index(
418 struct device_node *node, int index)
419 {
420 return of_reset_control_get_exclusive_by_index(node, index);
421 }
422
423 static inline struct reset_control *devm_reset_control_get(
424 struct device *dev, const char *id)
425 {
426 return devm_reset_control_get_exclusive(dev, id);
427 }
428
429 static inline struct reset_control *devm_reset_control_get_optional(
430 struct device *dev, const char *id)
431 {
432 return devm_reset_control_get_optional_exclusive(dev, id);
433
434 }
435
436 static inline struct reset_control *devm_reset_control_get_by_index(
437 struct device *dev, int index)
438 {
439 return devm_reset_control_get_exclusive_by_index(dev, index);
440 }
441
442
443
444
445 static inline struct reset_control *
446 devm_reset_control_array_get_exclusive(struct device *dev)
447 {
448 return devm_reset_control_array_get(dev, false, false);
449 }
450
451 static inline struct reset_control *
452 devm_reset_control_array_get_shared(struct device *dev)
453 {
454 return devm_reset_control_array_get(dev, true, false);
455 }
456
457 static inline struct reset_control *
458 devm_reset_control_array_get_optional_exclusive(struct device *dev)
459 {
460 return devm_reset_control_array_get(dev, false, true);
461 }
462
463 static inline struct reset_control *
464 devm_reset_control_array_get_optional_shared(struct device *dev)
465 {
466 return devm_reset_control_array_get(dev, true, true);
467 }
468
469 static inline struct reset_control *
470 of_reset_control_array_get_exclusive(struct device_node *node)
471 {
472 return of_reset_control_array_get(node, false, false, true);
473 }
474
475 static inline struct reset_control *
476 of_reset_control_array_get_exclusive_released(struct device_node *node)
477 {
478 return of_reset_control_array_get(node, false, false, false);
479 }
480
481 static inline struct reset_control *
482 of_reset_control_array_get_shared(struct device_node *node)
483 {
484 return of_reset_control_array_get(node, true, false, true);
485 }
486
487 static inline struct reset_control *
488 of_reset_control_array_get_optional_exclusive(struct device_node *node)
489 {
490 return of_reset_control_array_get(node, false, true, true);
491 }
492
493 static inline struct reset_control *
494 of_reset_control_array_get_optional_shared(struct device_node *node)
495 {
496 return of_reset_control_array_get(node, true, true, true);
497 }
498 #endif