]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - include/linux/reset.h
Merge branch 'reset/ath79' into reset/next
[mirror_ubuntu-bionic-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
b424080a
PZ
41#else
42
43static inline int reset_control_reset(struct reset_control *rstc)
44{
45 WARN_ON(1);
46 return 0;
47}
48
49static inline int reset_control_assert(struct reset_control *rstc)
50{
51 WARN_ON(1);
52 return 0;
53}
54
55static inline int reset_control_deassert(struct reset_control *rstc)
56{
57 WARN_ON(1);
58 return 0;
59}
60
729de41b
DN
61static inline int reset_control_status(struct reset_control *rstc)
62{
63 WARN_ON(1);
64 return 0;
65}
66
b424080a
PZ
67static inline void reset_control_put(struct reset_control *rstc)
68{
69 WARN_ON(1);
70}
71
72static inline int device_reset_optional(struct device *dev)
73{
74 return -ENOSYS;
75}
76
77static inline struct reset_control *reset_control_get_optional(
78 struct device *dev, const char *id)
79{
80 return ERR_PTR(-ENOSYS);
81}
82
83static inline struct reset_control *devm_reset_control_get_optional(
84 struct device *dev, const char *id)
85{
86 return ERR_PTR(-ENOSYS);
87}
88
e3ec0a8c
HG
89static inline struct reset_control *of_reset_control_get(
90 struct device_node *node, const char *id)
91{
92 return ERR_PTR(-ENOSYS);
93}
94
b424080a 95#endif /* CONFIG_RESET_CONTROLLER */
61fc4131
PZ
96
97#endif