at v3.17-rc2 2.0 kB view raw
1#ifndef _LINUX_RESET_H_ 2#define _LINUX_RESET_H_ 3 4struct device; 5struct device_node; 6struct reset_control; 7 8#ifdef CONFIG_RESET_CONTROLLER 9 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 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 37struct reset_control *of_reset_control_get(struct device_node *node, 38 const char *id); 39 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 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 88#endif /* CONFIG_RESET_CONTROLLER */ 89 90#endif