drm/exynos: fix types for compilation on 64bit architectures
[linux-2.6/btrfs-unstable.git] / include / linux / reset.h
blobc4c097de0ba9e042c3a357e06c6b3f6d5dc5e58e
1 #ifndef _LINUX_RESET_H_
2 #define _LINUX_RESET_H_
4 struct device;
5 struct device_node;
6 struct reset_control;
8 #ifdef CONFIG_RESET_CONTROLLER
10 int reset_control_reset(struct reset_control *rstc);
11 int reset_control_assert(struct reset_control *rstc);
12 int reset_control_deassert(struct reset_control *rstc);
13 int reset_control_status(struct reset_control *rstc);
15 struct reset_control *reset_control_get(struct device *dev, const char *id);
16 void reset_control_put(struct reset_control *rstc);
17 struct reset_control *devm_reset_control_get(struct device *dev, const char *id);
19 int __must_check device_reset(struct device *dev);
21 static inline int device_reset_optional(struct device *dev)
23 return device_reset(dev);
26 static inline struct reset_control *reset_control_get_optional(
27 struct device *dev, const char *id)
29 return reset_control_get(dev, id);
32 static inline struct reset_control *devm_reset_control_get_optional(
33 struct device *dev, const char *id)
35 return devm_reset_control_get(dev, id);
38 struct reset_control *of_reset_control_get(struct device_node *node,
39 const char *id);
41 struct reset_control *of_reset_control_get_by_index(
42 struct device_node *node, int index);
44 #else
46 static inline int reset_control_reset(struct reset_control *rstc)
48 WARN_ON(1);
49 return 0;
52 static inline int reset_control_assert(struct reset_control *rstc)
54 WARN_ON(1);
55 return 0;
58 static inline int reset_control_deassert(struct reset_control *rstc)
60 WARN_ON(1);
61 return 0;
64 static inline int reset_control_status(struct reset_control *rstc)
66 WARN_ON(1);
67 return 0;
70 static inline void reset_control_put(struct reset_control *rstc)
72 WARN_ON(1);
75 static inline int device_reset_optional(struct device *dev)
77 return -ENOTSUPP;
80 static inline struct reset_control *__must_check reset_control_get(
81 struct device *dev, const char *id)
83 WARN_ON(1);
84 return ERR_PTR(-EINVAL);
87 static inline struct reset_control *__must_check devm_reset_control_get(
88 struct device *dev, const char *id)
90 WARN_ON(1);
91 return ERR_PTR(-EINVAL);
94 static inline struct reset_control *reset_control_get_optional(
95 struct device *dev, const char *id)
97 return ERR_PTR(-ENOTSUPP);
100 static inline struct reset_control *devm_reset_control_get_optional(
101 struct device *dev, const char *id)
103 return ERR_PTR(-ENOTSUPP);
106 static inline struct reset_control *of_reset_control_get(
107 struct device_node *node, const char *id)
109 return ERR_PTR(-ENOTSUPP);
112 static inline struct reset_control *of_reset_control_get_by_index(
113 struct device_node *node, int index)
115 return ERR_PTR(-ENOTSUPP);
118 #endif /* CONFIG_RESET_CONTROLLER */
120 #endif