diff options
author | Geert Uytterhoeven <geert+renesas@glider.be> | 2018-11-13 07:47:44 -0500 |
---|---|---|
committer | Philipp Zabel <p.zabel@pengutronix.de> | 2019-01-07 10:38:26 -0500 |
commit | eaf91db0ab22dc2c664a9782f2f31dcbc410f3b5 (patch) | |
tree | 73558bd411854718af939759af7fb5a561abaf57 /include/linux/reset.h | |
parent | 12c62b9d6ce57d37f3c03cc902c30498909fbc42 (diff) |
reset: Add reset_control_get_count()
Currently the reset core has internal support for counting the number of
resets for a device described in DT. Generalize this to devices using
lookup resets, and export it for public use.
This will be used by generic drivers that need to be sure a device is
controlled by a single, dedicated reset line (e.g. vfio-platform).
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
[p.zabel@pengutronix.de: fixed a typo in reset_control_get_count comment]
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Diffstat (limited to 'include/linux/reset.h')
-rw-r--r-- | include/linux/reset.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/reset.h b/include/linux/reset.h index 76690cf2e3e0..c1901b61ca30 100644 --- a/include/linux/reset.h +++ b/include/linux/reset.h | |||
@@ -32,6 +32,8 @@ struct reset_control *devm_reset_control_array_get(struct device *dev, | |||
32 | struct reset_control *of_reset_control_array_get(struct device_node *np, | 32 | struct reset_control *of_reset_control_array_get(struct device_node *np, |
33 | bool shared, bool optional); | 33 | bool shared, bool optional); |
34 | 34 | ||
35 | int reset_control_get_count(struct device *dev); | ||
36 | |||
35 | #else | 37 | #else |
36 | 38 | ||
37 | static inline int reset_control_reset(struct reset_control *rstc) | 39 | static inline int reset_control_reset(struct reset_control *rstc) |
@@ -97,6 +99,11 @@ of_reset_control_array_get(struct device_node *np, bool shared, bool optional) | |||
97 | return optional ? NULL : ERR_PTR(-ENOTSUPP); | 99 | return optional ? NULL : ERR_PTR(-ENOTSUPP); |
98 | } | 100 | } |
99 | 101 | ||
102 | static inline int reset_control_get_count(struct device *dev) | ||
103 | { | ||
104 | return -ENOENT; | ||
105 | } | ||
106 | |||
100 | #endif /* CONFIG_RESET_CONTROLLER */ | 107 | #endif /* CONFIG_RESET_CONTROLLER */ |
101 | 108 | ||
102 | static inline int __must_check device_reset(struct device *dev) | 109 | static inline int __must_check device_reset(struct device *dev) |