]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blame - include/linux/reset.h
Merge branch 'for-linus' of git://git.open-osd.org/linux-open-osd
[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);
13
14struct reset_control *reset_control_get(struct device *dev, const char *id);
15void reset_control_put(struct reset_control *rstc);
16struct reset_control *devm_reset_control_get(struct device *dev, const char *id);
17
b424080a
PZ
18int __must_check device_reset(struct device *dev);
19
20static inline int device_reset_optional(struct device *dev)
21{
22 return device_reset(dev);
23}
24
25static inline struct reset_control *reset_control_get_optional(
26 struct device *dev, const char *id)
27{
28 return reset_control_get(dev, id);
29}
30
31static inline struct reset_control *devm_reset_control_get_optional(
32 struct device *dev, const char *id)
33{
34 return devm_reset_control_get(dev, id);
35}
36
e3ec0a8c
HG
37struct reset_control *of_reset_control_get(struct device_node *node,
38 const char *id);
39
b424080a
PZ
40#else
41
42static inline int reset_control_reset(struct reset_control *rstc)
43{
44 WARN_ON(1);
45 return 0;
46}
47
48static inline int reset_control_assert(struct reset_control *rstc)
49{
50 WARN_ON(1);
51 return 0;
52}
53
54static inline int reset_control_deassert(struct reset_control *rstc)
55{
56 WARN_ON(1);
57 return 0;
58}
59
60static inline void reset_control_put(struct reset_control *rstc)
61{
62 WARN_ON(1);
63}
64
65static inline int device_reset_optional(struct device *dev)
66{
67 return -ENOSYS;
68}
69
70static inline struct reset_control *reset_control_get_optional(
71 struct device *dev, const char *id)
72{
73 return ERR_PTR(-ENOSYS);
74}
75
76static inline struct reset_control *devm_reset_control_get_optional(
77 struct device *dev, const char *id)
78{
79 return ERR_PTR(-ENOSYS);
80}
81
e3ec0a8c
HG
82static inline struct reset_control *of_reset_control_get(
83 struct device_node *node, const char *id)
84{
85 return ERR_PTR(-ENOSYS);
86}
87
b424080a 88#endif /* CONFIG_RESET_CONTROLLER */
61fc4131
PZ
89
90#endif