1
2#ifndef _LINUX_RESET_CONTROLLER_H_
3#define _LINUX_RESET_CONTROLLER_H_
4
5#include <linux/list.h>
6
7struct reset_controller_dev;
8
9
10
11
12
13
14
15
16
17
18struct reset_control_ops {
19 int (*reset)(struct reset_controller_dev *rcdev, unsigned long id);
20 int (*assert)(struct reset_controller_dev *rcdev, unsigned long id);
21 int (*deassert)(struct reset_controller_dev *rcdev, unsigned long id);
22 int (*status)(struct reset_controller_dev *rcdev, unsigned long id);
23};
24
25struct module;
26struct device_node;
27struct of_phandle_args;
28
29
30
31
32
33
34
35
36
37
38struct reset_control_lookup {
39 struct list_head list;
40 const char *provider;
41 unsigned int index;
42 const char *dev_id;
43 const char *con_id;
44};
45
46#define RESET_LOOKUP(_provider, _index, _dev_id, _con_id) \
47 { \
48 .provider = _provider, \
49 .index = _index, \
50 .dev_id = _dev_id, \
51 .con_id = _con_id, \
52 }
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69struct reset_controller_dev {
70 const struct reset_control_ops *ops;
71 struct module *owner;
72 struct list_head list;
73 struct list_head reset_control_head;
74 struct device *dev;
75 struct device_node *of_node;
76 int of_reset_n_cells;
77 int (*of_xlate)(struct reset_controller_dev *rcdev,
78 const struct of_phandle_args *reset_spec);
79 unsigned int nr_resets;
80};
81
82int reset_controller_register(struct reset_controller_dev *rcdev);
83void reset_controller_unregister(struct reset_controller_dev *rcdev);
84
85struct device;
86int devm_reset_controller_register(struct device *dev,
87 struct reset_controller_dev *rcdev);
88
89void reset_controller_add_lookup(struct reset_control_lookup *lookup,
90 unsigned int num_entries);
91
92#endif
93