diff options
| author | Arnd Bergmann <arnd@arndb.de> | 2014-03-26 20:28:19 -0400 |
|---|---|---|
| committer | Arnd Bergmann <arnd@arndb.de> | 2014-03-26 20:28:19 -0400 |
| commit | 463e8474af8317c3bfc0dc95b0d003e11e847b40 (patch) | |
| tree | e83b8de6826d81e5f01f26cb486fbc82bb5e8169 /include/linux | |
| parent | b80a6373d6cf7cbd22498409cef7883d7f8209c4 (diff) | |
| parent | b424080a9e086e683ad5fdc624a7cf3c024e0c0f (diff) | |
Merge branch 'reset/for_v3.15' of git://git.pengutronix.de/git/pza/linux into next/drivers
Merge "reset controller fixes and updates" from Philipp Zabel:
* 'reset/for_v3.15' of git://git.pengutronix.de/git/pza/linux:
reset: Add optional resets and stubs
reset: Add of_reset_control_get
reset: Mark function as static and remove unused function in core.c
reset: allow drivers to request probe deferral
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/reset.h | 65 |
1 files changed, 64 insertions, 1 deletions
diff --git a/include/linux/reset.h b/include/linux/reset.h index 6082247feab1..c0eda5023d74 100644 --- a/include/linux/reset.h +++ b/include/linux/reset.h | |||
| @@ -4,6 +4,8 @@ | |||
| 4 | struct device; | 4 | struct device; |
| 5 | struct reset_control; | 5 | struct reset_control; |
| 6 | 6 | ||
| 7 | #ifdef CONFIG_RESET_CONTROLLER | ||
| 8 | |||
| 7 | int reset_control_reset(struct reset_control *rstc); | 9 | int reset_control_reset(struct reset_control *rstc); |
| 8 | int reset_control_assert(struct reset_control *rstc); | 10 | int reset_control_assert(struct reset_control *rstc); |
| 9 | int reset_control_deassert(struct reset_control *rstc); | 11 | int reset_control_deassert(struct reset_control *rstc); |
| @@ -12,6 +14,67 @@ struct reset_control *reset_control_get(struct device *dev, const char *id); | |||
| 12 | void reset_control_put(struct reset_control *rstc); | 14 | void reset_control_put(struct reset_control *rstc); |
| 13 | struct reset_control *devm_reset_control_get(struct device *dev, const char *id); | 15 | struct reset_control *devm_reset_control_get(struct device *dev, const char *id); |
| 14 | 16 | ||
| 15 | int device_reset(struct device *dev); | 17 | int __must_check device_reset(struct device *dev); |
| 18 | |||
| 19 | static inline int device_reset_optional(struct device *dev) | ||
| 20 | { | ||
| 21 | return device_reset(dev); | ||
| 22 | } | ||
| 23 | |||
| 24 | static inline struct reset_control *reset_control_get_optional( | ||
| 25 | struct device *dev, const char *id) | ||
| 26 | { | ||
| 27 | return reset_control_get(dev, id); | ||
| 28 | } | ||
| 29 | |||
| 30 | static inline struct reset_control *devm_reset_control_get_optional( | ||
| 31 | struct device *dev, const char *id) | ||
| 32 | { | ||
| 33 | return devm_reset_control_get(dev, id); | ||
| 34 | } | ||
| 35 | |||
| 36 | #else | ||
| 37 | |||
| 38 | static inline int reset_control_reset(struct reset_control *rstc) | ||
| 39 | { | ||
| 40 | WARN_ON(1); | ||
| 41 | return 0; | ||
| 42 | } | ||
| 43 | |||
| 44 | static inline int reset_control_assert(struct reset_control *rstc) | ||
| 45 | { | ||
| 46 | WARN_ON(1); | ||
| 47 | return 0; | ||
| 48 | } | ||
| 49 | |||
| 50 | static inline int reset_control_deassert(struct reset_control *rstc) | ||
| 51 | { | ||
| 52 | WARN_ON(1); | ||
| 53 | return 0; | ||
| 54 | } | ||
| 55 | |||
| 56 | static inline void reset_control_put(struct reset_control *rstc) | ||
| 57 | { | ||
| 58 | WARN_ON(1); | ||
| 59 | } | ||
| 60 | |||
| 61 | static inline int device_reset_optional(struct device *dev) | ||
| 62 | { | ||
| 63 | return -ENOSYS; | ||
| 64 | } | ||
| 65 | |||
| 66 | static inline struct reset_control *reset_control_get_optional( | ||
| 67 | struct device *dev, const char *id) | ||
| 68 | { | ||
| 69 | return ERR_PTR(-ENOSYS); | ||
| 70 | } | ||
| 71 | |||
| 72 | static inline struct reset_control *devm_reset_control_get_optional( | ||
| 73 | struct device *dev, const char *id) | ||
| 74 | { | ||
| 75 | return ERR_PTR(-ENOSYS); | ||
| 76 | } | ||
| 77 | |||
| 78 | #endif /* CONFIG_RESET_CONTROLLER */ | ||
| 16 | 79 | ||
| 17 | #endif | 80 | #endif |
