]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blame - include/linux/reset.h
Linux 4.6-rc1
[mirror_ubuntu-artful-kernel.git] / include / linux / reset.h
CommitLineData
61fc4131
PZ
1#ifndef _LINUX_RESET_H_
2#define _LINUX_RESET_H_
3
4struct device;
e3ec0a8c 5struct device_node;
61fc4131
PZ
6struct reset_control;
7
b424080a
PZ
8#ifdef CONFIG_RESET_CONTROLLER
9
61fc4131
PZ
10int reset_control_reset(struct reset_control *rstc);
11int reset_control_assert(struct reset_control *rstc);
12int reset_control_deassert(struct reset_control *rstc);
729de41b 13int reset_control_status(struct reset_control *rstc);
61fc4131
PZ
14
15struct reset_control *reset_control_get(struct device *dev, const char *id);
16void reset_control_put(struct reset_control *rstc);
17struct reset_control *devm_reset_control_get(struct device *dev, const char *id);
18
b424080a
PZ
19int __must_check device_reset(struct device *dev);
20
21static inline int device_reset_optional(struct device *dev)
22{
23 return device_reset(dev);
24}
25
26static inline struct reset_control *reset_control_get_optional(
27 struct device *dev, const char *id)
28{
29 return reset_control_get(dev, id);
30}
31
32static inline struct reset_control *devm_reset_control_get_optional(
33 struct device *dev, const char *id)
34{
35 return devm_reset_control_get(dev, id);
36}
37
e3ec0a8c
HG
38struct reset_control *of_reset_control_get(struct device_node *node,
39 const char *id);
40
c0a13aa6
VH
41struct reset_control *of_reset_control_get_by_index(
42 struct device_node *node, int index);
43
b424080a
PZ
44#else
45
46static inline int reset_control_reset(struct reset_control *rstc)
47{
48 WARN_ON(1);
49 return 0;
50}
51
52static inline int reset_control_assert(struct reset_control *rstc)
53{
54 WARN_ON(1);
55 return 0;
56}
57
58static inline int reset_control_deassert(struct reset_control *rstc)
59{
60 WARN_ON(1);
61 return 0;
62}
63
729de41b
DN
64static inline int reset_control_status(struct reset_control *rstc)
65{
66 WARN_ON(1);
67 return 0;
68}
69
b424080a
PZ
70static inline void reset_control_put(struct reset_control *rstc)
71{
72 WARN_ON(1);
73}
74
75static inline int device_reset_optional(struct device *dev)
76{
39b4da71 77 return -ENOTSUPP;
b424080a
PZ
78}
79
5bcd0b7f
AL
80static inline struct reset_control *__must_check reset_control_get(
81 struct device *dev, const char *id)
82{
83 WARN_ON(1);
84 return ERR_PTR(-EINVAL);
85}
86
87static inline struct reset_control *__must_check devm_reset_control_get(
88 struct device *dev, const char *id)
89{
90 WARN_ON(1);
91 return ERR_PTR(-EINVAL);
92}
93
b424080a
PZ
94static inline struct reset_control *reset_control_get_optional(
95 struct device *dev, const char *id)
96{
39b4da71 97 return ERR_PTR(-ENOTSUPP);
b424080a
PZ
98}
99
100static inline struct reset_control *devm_reset_control_get_optional(
101 struct device *dev, const char *id)
102{
39b4da71 103 return ERR_PTR(-ENOTSUPP);
b424080a
PZ
104}
105
e3ec0a8c
HG
106static inline struct reset_control *of_reset_control_get(
107 struct device_node *node, const char *id)
108{
39b4da71 109 return ERR_PTR(-ENOTSUPP);
e3ec0a8c
HG
110}
111
c0a13aa6
VH
112static inline struct reset_control *of_reset_control_get_by_index(
113 struct device_node *node, int index)
114{
115 return ERR_PTR(-ENOTSUPP);
116}
117
b424080a 118#endif /* CONFIG_RESET_CONTROLLER */
61fc4131
PZ
119
120#endif