Philipp Zabel | 61fc413 | 2012-11-19 17:23:13 +0100 | [diff] [blame] | 1 | #ifndef _LINUX_RESET_H_ |
| 2 | #define _LINUX_RESET_H_ |
| 3 | |
Hans de Goede | 6c96f05 | 2016-02-23 18:46:24 +0100 | [diff] [blame] | 4 | #include <linux/device.h> |
| 5 | |
Philipp Zabel | 61fc413 | 2012-11-19 17:23:13 +0100 | [diff] [blame] | 6 | struct reset_control; |
| 7 | |
Philipp Zabel | b424080 | 2014-03-07 15:18:47 +0100 | [diff] [blame] | 8 | #ifdef CONFIG_RESET_CONTROLLER |
| 9 | |
Philipp Zabel | 61fc413 | 2012-11-19 17:23:13 +0100 | [diff] [blame] | 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); |
Dinh Nguyen | 729de41 | 2014-10-10 10:21:14 -0500 | [diff] [blame] | 13 | int reset_control_status(struct reset_control *rstc); |
Philipp Zabel | 61fc413 | 2012-11-19 17:23:13 +0100 | [diff] [blame] | 14 | |
Hans de Goede | 6c96f05 | 2016-02-23 18:46:24 +0100 | [diff] [blame] | 15 | struct reset_control *__of_reset_control_get(struct device_node *node, |
Ramiro Oliveira | bb47523 | 2017-01-13 17:57:41 +0000 | [diff] [blame] | 16 | const char *id, int index, bool shared, |
| 17 | bool optional); |
Philipp Zabel | 61fc413 | 2012-11-19 17:23:13 +0100 | [diff] [blame] | 18 | void reset_control_put(struct reset_control *rstc); |
Hans de Goede | 6c96f05 | 2016-02-23 18:46:24 +0100 | [diff] [blame] | 19 | struct reset_control *__devm_reset_control_get(struct device *dev, |
Ramiro Oliveira | bb47523 | 2017-01-13 17:57:41 +0000 | [diff] [blame] | 20 | const char *id, int index, bool shared, |
| 21 | bool optional); |
Philipp Zabel | 61fc413 | 2012-11-19 17:23:13 +0100 | [diff] [blame] | 22 | |
Philipp Zabel | b424080 | 2014-03-07 15:18:47 +0100 | [diff] [blame] | 23 | int __must_check device_reset(struct device *dev); |
| 24 | |
| 25 | static inline int device_reset_optional(struct device *dev) |
| 26 | { |
| 27 | return device_reset(dev); |
| 28 | } |
| 29 | |
Philipp Zabel | b424080 | 2014-03-07 15:18:47 +0100 | [diff] [blame] | 30 | #else |
| 31 | |
| 32 | static inline int reset_control_reset(struct reset_control *rstc) |
| 33 | { |
| 34 | WARN_ON(1); |
| 35 | return 0; |
| 36 | } |
| 37 | |
| 38 | static inline int reset_control_assert(struct reset_control *rstc) |
| 39 | { |
| 40 | WARN_ON(1); |
| 41 | return 0; |
| 42 | } |
| 43 | |
| 44 | static inline int reset_control_deassert(struct reset_control *rstc) |
| 45 | { |
| 46 | WARN_ON(1); |
| 47 | return 0; |
| 48 | } |
| 49 | |
Dinh Nguyen | 729de41 | 2014-10-10 10:21:14 -0500 | [diff] [blame] | 50 | static inline int reset_control_status(struct reset_control *rstc) |
| 51 | { |
| 52 | WARN_ON(1); |
| 53 | return 0; |
| 54 | } |
| 55 | |
Philipp Zabel | b424080 | 2014-03-07 15:18:47 +0100 | [diff] [blame] | 56 | static inline void reset_control_put(struct reset_control *rstc) |
| 57 | { |
| 58 | WARN_ON(1); |
| 59 | } |
| 60 | |
Daniel Lezcano | 4113652 | 2016-04-01 21:38:16 +0200 | [diff] [blame] | 61 | static inline int __must_check device_reset(struct device *dev) |
| 62 | { |
| 63 | WARN_ON(1); |
| 64 | return -ENOTSUPP; |
| 65 | } |
| 66 | |
Philipp Zabel | b424080 | 2014-03-07 15:18:47 +0100 | [diff] [blame] | 67 | static inline int device_reset_optional(struct device *dev) |
| 68 | { |
Philipp Zabel | 39b4da7 | 2015-10-29 09:55:00 +0100 | [diff] [blame] | 69 | return -ENOTSUPP; |
Philipp Zabel | b424080 | 2014-03-07 15:18:47 +0100 | [diff] [blame] | 70 | } |
| 71 | |
Hans de Goede | 6c96f05 | 2016-02-23 18:46:24 +0100 | [diff] [blame] | 72 | static inline struct reset_control *__of_reset_control_get( |
| 73 | struct device_node *node, |
Ramiro Oliveira | bb47523 | 2017-01-13 17:57:41 +0000 | [diff] [blame] | 74 | const char *id, int index, bool shared, |
| 75 | bool optional) |
Axel Lin | 5bcd0b7 | 2015-09-01 07:56:38 +0800 | [diff] [blame] | 76 | { |
John Youn | 168d7c4 | 2016-05-31 16:55:01 -0700 | [diff] [blame] | 77 | return ERR_PTR(-ENOTSUPP); |
Axel Lin | 5bcd0b7 | 2015-09-01 07:56:38 +0800 | [diff] [blame] | 78 | } |
| 79 | |
Hans de Goede | 6c96f05 | 2016-02-23 18:46:24 +0100 | [diff] [blame] | 80 | static inline struct reset_control *__devm_reset_control_get( |
Ramiro Oliveira | bb47523 | 2017-01-13 17:57:41 +0000 | [diff] [blame] | 81 | struct device *dev, const char *id, |
| 82 | int index, bool shared, bool optional) |
Hans de Goede | 6c96f05 | 2016-02-23 18:46:24 +0100 | [diff] [blame] | 83 | { |
John Youn | 168d7c4 | 2016-05-31 16:55:01 -0700 | [diff] [blame] | 84 | return ERR_PTR(-ENOTSUPP); |
Hans de Goede | 6c96f05 | 2016-02-23 18:46:24 +0100 | [diff] [blame] | 85 | } |
| 86 | |
| 87 | #endif /* CONFIG_RESET_CONTROLLER */ |
| 88 | |
| 89 | /** |
Lee Jones | a53e35d | 2016-06-06 16:56:50 +0100 | [diff] [blame] | 90 | * reset_control_get_exclusive - Lookup and obtain an exclusive reference |
| 91 | * to a reset controller. |
Hans de Goede | 6c96f05 | 2016-02-23 18:46:24 +0100 | [diff] [blame] | 92 | * @dev: device to be reset by the controller |
| 93 | * @id: reset line name |
| 94 | * |
| 95 | * Returns a struct reset_control or IS_ERR() condition containing errno. |
Hans de Goede | 0b52297 | 2016-02-23 18:46:26 +0100 | [diff] [blame] | 96 | * If this function is called more then once for the same reset_control it will |
| 97 | * return -EBUSY. |
| 98 | * |
| 99 | * See reset_control_get_shared for details on shared references to |
| 100 | * reset-controls. |
Hans de Goede | 6c96f05 | 2016-02-23 18:46:24 +0100 | [diff] [blame] | 101 | * |
| 102 | * Use of id names is optional. |
| 103 | */ |
Lee Jones | a53e35d | 2016-06-06 16:56:50 +0100 | [diff] [blame] | 104 | static inline struct reset_control * |
| 105 | __must_check reset_control_get_exclusive(struct device *dev, const char *id) |
Axel Lin | 5bcd0b7 | 2015-09-01 07:56:38 +0800 | [diff] [blame] | 106 | { |
Hans de Goede | 6c96f05 | 2016-02-23 18:46:24 +0100 | [diff] [blame] | 107 | #ifndef CONFIG_RESET_CONTROLLER |
Axel Lin | 5bcd0b7 | 2015-09-01 07:56:38 +0800 | [diff] [blame] | 108 | WARN_ON(1); |
Hans de Goede | 6c96f05 | 2016-02-23 18:46:24 +0100 | [diff] [blame] | 109 | #endif |
Ramiro Oliveira | bb47523 | 2017-01-13 17:57:41 +0000 | [diff] [blame] | 110 | return __of_reset_control_get(dev ? dev->of_node : NULL, id, 0, false, |
| 111 | false); |
Axel Lin | 5bcd0b7 | 2015-09-01 07:56:38 +0800 | [diff] [blame] | 112 | } |
| 113 | |
Hans de Goede | 6c96f05 | 2016-02-23 18:46:24 +0100 | [diff] [blame] | 114 | /** |
Hans de Goede | 0b52297 | 2016-02-23 18:46:26 +0100 | [diff] [blame] | 115 | * reset_control_get_shared - Lookup and obtain a shared reference to a |
| 116 | * reset controller. |
| 117 | * @dev: device to be reset by the controller |
| 118 | * @id: reset line name |
| 119 | * |
| 120 | * Returns a struct reset_control or IS_ERR() condition containing errno. |
| 121 | * This function is intended for use with reset-controls which are shared |
| 122 | * between hardware-blocks. |
| 123 | * |
| 124 | * When a reset-control is shared, the behavior of reset_control_assert / |
| 125 | * deassert is changed, the reset-core will keep track of a deassert_count |
| 126 | * and only (re-)assert the reset after reset_control_assert has been called |
| 127 | * as many times as reset_control_deassert was called. Also see the remark |
| 128 | * about shared reset-controls in the reset_control_assert docs. |
| 129 | * |
| 130 | * Calling reset_control_assert without first calling reset_control_deassert |
| 131 | * is not allowed on a shared reset control. Calling reset_control_reset is |
| 132 | * also not allowed on a shared reset control. |
| 133 | * |
| 134 | * Use of id names is optional. |
| 135 | */ |
| 136 | static inline struct reset_control *reset_control_get_shared( |
| 137 | struct device *dev, const char *id) |
| 138 | { |
Ramiro Oliveira | bb47523 | 2017-01-13 17:57:41 +0000 | [diff] [blame] | 139 | return __of_reset_control_get(dev ? dev->of_node : NULL, id, 0, true, |
| 140 | false); |
Hans de Goede | 0b52297 | 2016-02-23 18:46:26 +0100 | [diff] [blame] | 141 | } |
| 142 | |
Lee Jones | a53e35d | 2016-06-06 16:56:50 +0100 | [diff] [blame] | 143 | static inline struct reset_control *reset_control_get_optional_exclusive( |
Lee Jones | 3c35f6e | 2016-06-06 16:56:49 +0100 | [diff] [blame] | 144 | struct device *dev, const char *id) |
| 145 | { |
Ramiro Oliveira | bb47523 | 2017-01-13 17:57:41 +0000 | [diff] [blame] | 146 | return __of_reset_control_get(dev ? dev->of_node : NULL, id, 0, false, |
| 147 | true); |
Lee Jones | 3c35f6e | 2016-06-06 16:56:49 +0100 | [diff] [blame] | 148 | } |
| 149 | |
Lee Jones | c33d61a | 2016-06-06 16:56:52 +0100 | [diff] [blame] | 150 | static inline struct reset_control *reset_control_get_optional_shared( |
| 151 | struct device *dev, const char *id) |
| 152 | { |
Ramiro Oliveira | bb47523 | 2017-01-13 17:57:41 +0000 | [diff] [blame] | 153 | return __of_reset_control_get(dev ? dev->of_node : NULL, id, 0, true, |
| 154 | true); |
Lee Jones | c33d61a | 2016-06-06 16:56:52 +0100 | [diff] [blame] | 155 | } |
| 156 | |
Hans de Goede | 0b52297 | 2016-02-23 18:46:26 +0100 | [diff] [blame] | 157 | /** |
Lee Jones | a53e35d | 2016-06-06 16:56:50 +0100 | [diff] [blame] | 158 | * of_reset_control_get_exclusive - Lookup and obtain an exclusive reference |
| 159 | * to a reset controller. |
Hans de Goede | 6c96f05 | 2016-02-23 18:46:24 +0100 | [diff] [blame] | 160 | * @node: device to be reset by the controller |
| 161 | * @id: reset line name |
| 162 | * |
| 163 | * Returns a struct reset_control or IS_ERR() condition containing errno. |
| 164 | * |
| 165 | * Use of id names is optional. |
| 166 | */ |
Lee Jones | a53e35d | 2016-06-06 16:56:50 +0100 | [diff] [blame] | 167 | static inline struct reset_control *of_reset_control_get_exclusive( |
Hans de Goede | 6c96f05 | 2016-02-23 18:46:24 +0100 | [diff] [blame] | 168 | struct device_node *node, const char *id) |
| 169 | { |
Ramiro Oliveira | bb47523 | 2017-01-13 17:57:41 +0000 | [diff] [blame] | 170 | return __of_reset_control_get(node, id, 0, false, false); |
Hans de Goede | 6c96f05 | 2016-02-23 18:46:24 +0100 | [diff] [blame] | 171 | } |
| 172 | |
| 173 | /** |
Lee Jones | 40faee8e | 2016-06-06 16:56:51 +0100 | [diff] [blame] | 174 | * of_reset_control_get_shared - Lookup and obtain an shared reference |
| 175 | * to a reset controller. |
| 176 | * @node: device to be reset by the controller |
| 177 | * @id: reset line name |
| 178 | * |
| 179 | * When a reset-control is shared, the behavior of reset_control_assert / |
| 180 | * deassert is changed, the reset-core will keep track of a deassert_count |
| 181 | * and only (re-)assert the reset after reset_control_assert has been called |
| 182 | * as many times as reset_control_deassert was called. Also see the remark |
| 183 | * about shared reset-controls in the reset_control_assert docs. |
| 184 | * |
| 185 | * Calling reset_control_assert without first calling reset_control_deassert |
| 186 | * is not allowed on a shared reset control. Calling reset_control_reset is |
| 187 | * also not allowed on a shared reset control. |
| 188 | * Returns a struct reset_control or IS_ERR() condition containing errno. |
| 189 | * |
| 190 | * Use of id names is optional. |
| 191 | */ |
| 192 | static inline struct reset_control *of_reset_control_get_shared( |
| 193 | struct device_node *node, const char *id) |
| 194 | { |
Ramiro Oliveira | bb47523 | 2017-01-13 17:57:41 +0000 | [diff] [blame] | 195 | return __of_reset_control_get(node, id, 0, true, false); |
Lee Jones | 40faee8e | 2016-06-06 16:56:51 +0100 | [diff] [blame] | 196 | } |
| 197 | |
| 198 | /** |
Lee Jones | a53e35d | 2016-06-06 16:56:50 +0100 | [diff] [blame] | 199 | * of_reset_control_get_exclusive_by_index - Lookup and obtain an exclusive |
| 200 | * reference to a reset controller |
| 201 | * by index. |
Hans de Goede | 6c96f05 | 2016-02-23 18:46:24 +0100 | [diff] [blame] | 202 | * @node: device to be reset by the controller |
| 203 | * @index: index of the reset controller |
| 204 | * |
| 205 | * This is to be used to perform a list of resets for a device or power domain |
| 206 | * in whatever order. Returns a struct reset_control or IS_ERR() condition |
| 207 | * containing errno. |
| 208 | */ |
Lee Jones | a53e35d | 2016-06-06 16:56:50 +0100 | [diff] [blame] | 209 | static inline struct reset_control *of_reset_control_get_exclusive_by_index( |
Hans de Goede | 6c96f05 | 2016-02-23 18:46:24 +0100 | [diff] [blame] | 210 | struct device_node *node, int index) |
| 211 | { |
Ramiro Oliveira | bb47523 | 2017-01-13 17:57:41 +0000 | [diff] [blame] | 212 | return __of_reset_control_get(node, NULL, index, false, false); |
Hans de Goede | 6c96f05 | 2016-02-23 18:46:24 +0100 | [diff] [blame] | 213 | } |
| 214 | |
| 215 | /** |
Lee Jones | 40faee8e | 2016-06-06 16:56:51 +0100 | [diff] [blame] | 216 | * of_reset_control_get_shared_by_index - Lookup and obtain an shared |
| 217 | * reference to a reset controller |
| 218 | * by index. |
| 219 | * @node: device to be reset by the controller |
| 220 | * @index: index of the reset controller |
| 221 | * |
| 222 | * When a reset-control is shared, the behavior of reset_control_assert / |
| 223 | * deassert is changed, the reset-core will keep track of a deassert_count |
| 224 | * and only (re-)assert the reset after reset_control_assert has been called |
| 225 | * as many times as reset_control_deassert was called. Also see the remark |
| 226 | * about shared reset-controls in the reset_control_assert docs. |
| 227 | * |
| 228 | * Calling reset_control_assert without first calling reset_control_deassert |
| 229 | * is not allowed on a shared reset control. Calling reset_control_reset is |
| 230 | * also not allowed on a shared reset control. |
| 231 | * Returns a struct reset_control or IS_ERR() condition containing errno. |
| 232 | * |
| 233 | * This is to be used to perform a list of resets for a device or power domain |
| 234 | * in whatever order. Returns a struct reset_control or IS_ERR() condition |
| 235 | * containing errno. |
| 236 | */ |
| 237 | static inline struct reset_control *of_reset_control_get_shared_by_index( |
| 238 | struct device_node *node, int index) |
| 239 | { |
Ramiro Oliveira | bb47523 | 2017-01-13 17:57:41 +0000 | [diff] [blame] | 240 | return __of_reset_control_get(node, NULL, index, true, false); |
Lee Jones | 40faee8e | 2016-06-06 16:56:51 +0100 | [diff] [blame] | 241 | } |
| 242 | |
| 243 | /** |
Lee Jones | a53e35d | 2016-06-06 16:56:50 +0100 | [diff] [blame] | 244 | * devm_reset_control_get_exclusive - resource managed |
| 245 | * reset_control_get_exclusive() |
Hans de Goede | 6c96f05 | 2016-02-23 18:46:24 +0100 | [diff] [blame] | 246 | * @dev: device to be reset by the controller |
| 247 | * @id: reset line name |
| 248 | * |
Lee Jones | a53e35d | 2016-06-06 16:56:50 +0100 | [diff] [blame] | 249 | * Managed reset_control_get_exclusive(). For reset controllers returned |
| 250 | * from this function, reset_control_put() is called automatically on driver |
| 251 | * detach. |
| 252 | * |
| 253 | * See reset_control_get_exclusive() for more information. |
Hans de Goede | 6c96f05 | 2016-02-23 18:46:24 +0100 | [diff] [blame] | 254 | */ |
Lee Jones | a53e35d | 2016-06-06 16:56:50 +0100 | [diff] [blame] | 255 | static inline struct reset_control * |
| 256 | __must_check devm_reset_control_get_exclusive(struct device *dev, |
| 257 | const char *id) |
Hans de Goede | 6c96f05 | 2016-02-23 18:46:24 +0100 | [diff] [blame] | 258 | { |
| 259 | #ifndef CONFIG_RESET_CONTROLLER |
| 260 | WARN_ON(1); |
| 261 | #endif |
Ramiro Oliveira | bb47523 | 2017-01-13 17:57:41 +0000 | [diff] [blame] | 262 | return __devm_reset_control_get(dev, id, 0, false, false); |
Philipp Zabel | b424080 | 2014-03-07 15:18:47 +0100 | [diff] [blame] | 263 | } |
| 264 | |
Hans de Goede | 0b52297 | 2016-02-23 18:46:26 +0100 | [diff] [blame] | 265 | /** |
| 266 | * devm_reset_control_get_shared - resource managed reset_control_get_shared() |
| 267 | * @dev: device to be reset by the controller |
| 268 | * @id: reset line name |
| 269 | * |
| 270 | * Managed reset_control_get_shared(). For reset controllers returned from |
| 271 | * this function, reset_control_put() is called automatically on driver detach. |
| 272 | * See reset_control_get_shared() for more information. |
| 273 | */ |
| 274 | static inline struct reset_control *devm_reset_control_get_shared( |
| 275 | struct device *dev, const char *id) |
| 276 | { |
Ramiro Oliveira | bb47523 | 2017-01-13 17:57:41 +0000 | [diff] [blame] | 277 | return __devm_reset_control_get(dev, id, 0, true, false); |
Hans de Goede | 0b52297 | 2016-02-23 18:46:26 +0100 | [diff] [blame] | 278 | } |
| 279 | |
Lee Jones | a53e35d | 2016-06-06 16:56:50 +0100 | [diff] [blame] | 280 | static inline struct reset_control *devm_reset_control_get_optional_exclusive( |
Philipp Zabel | b424080 | 2014-03-07 15:18:47 +0100 | [diff] [blame] | 281 | struct device *dev, const char *id) |
| 282 | { |
Ramiro Oliveira | bb47523 | 2017-01-13 17:57:41 +0000 | [diff] [blame] | 283 | return __devm_reset_control_get(dev, id, 0, false, true); |
Philipp Zabel | b424080 | 2014-03-07 15:18:47 +0100 | [diff] [blame] | 284 | } |
| 285 | |
Lee Jones | c33d61a | 2016-06-06 16:56:52 +0100 | [diff] [blame] | 286 | static inline struct reset_control *devm_reset_control_get_optional_shared( |
| 287 | struct device *dev, const char *id) |
| 288 | { |
Ramiro Oliveira | bb47523 | 2017-01-13 17:57:41 +0000 | [diff] [blame] | 289 | return __devm_reset_control_get(dev, id, 0, true, true); |
Lee Jones | c33d61a | 2016-06-06 16:56:52 +0100 | [diff] [blame] | 290 | } |
| 291 | |
Hans de Goede | 6c96f05 | 2016-02-23 18:46:24 +0100 | [diff] [blame] | 292 | /** |
Lee Jones | a53e35d | 2016-06-06 16:56:50 +0100 | [diff] [blame] | 293 | * devm_reset_control_get_exclusive_by_index - resource managed |
| 294 | * reset_control_get_exclusive() |
Hans de Goede | 6c96f05 | 2016-02-23 18:46:24 +0100 | [diff] [blame] | 295 | * @dev: device to be reset by the controller |
| 296 | * @index: index of the reset controller |
| 297 | * |
Lee Jones | a53e35d | 2016-06-06 16:56:50 +0100 | [diff] [blame] | 298 | * Managed reset_control_get_exclusive(). For reset controllers returned from |
| 299 | * this function, reset_control_put() is called automatically on driver |
| 300 | * detach. |
| 301 | * |
| 302 | * See reset_control_get_exclusive() for more information. |
Hans de Goede | 6c96f05 | 2016-02-23 18:46:24 +0100 | [diff] [blame] | 303 | */ |
Lee Jones | a53e35d | 2016-06-06 16:56:50 +0100 | [diff] [blame] | 304 | static inline struct reset_control * |
| 305 | devm_reset_control_get_exclusive_by_index(struct device *dev, int index) |
Hans de Goede | e3ec0a8 | 2014-04-13 14:09:15 +0200 | [diff] [blame] | 306 | { |
Ramiro Oliveira | bb47523 | 2017-01-13 17:57:41 +0000 | [diff] [blame] | 307 | return __devm_reset_control_get(dev, NULL, index, false, false); |
Hans de Goede | 0b52297 | 2016-02-23 18:46:26 +0100 | [diff] [blame] | 308 | } |
| 309 | |
Hans de Goede | 0b52297 | 2016-02-23 18:46:26 +0100 | [diff] [blame] | 310 | /** |
| 311 | * devm_reset_control_get_shared_by_index - resource managed |
| 312 | * reset_control_get_shared |
| 313 | * @dev: device to be reset by the controller |
| 314 | * @index: index of the reset controller |
| 315 | * |
| 316 | * Managed reset_control_get_shared(). For reset controllers returned from |
| 317 | * this function, reset_control_put() is called automatically on driver detach. |
| 318 | * See reset_control_get_shared() for more information. |
| 319 | */ |
Lee Jones | 0bcc0ea | 2016-06-06 16:56:53 +0100 | [diff] [blame] | 320 | static inline struct reset_control * |
| 321 | devm_reset_control_get_shared_by_index(struct device *dev, int index) |
Hans de Goede | 0b52297 | 2016-02-23 18:46:26 +0100 | [diff] [blame] | 322 | { |
Ramiro Oliveira | bb47523 | 2017-01-13 17:57:41 +0000 | [diff] [blame] | 323 | return __devm_reset_control_get(dev, NULL, index, true, false); |
Hans de Goede | e3ec0a8 | 2014-04-13 14:09:15 +0200 | [diff] [blame] | 324 | } |
| 325 | |
Lee Jones | a53e35d | 2016-06-06 16:56:50 +0100 | [diff] [blame] | 326 | /* |
| 327 | * TEMPORARY calls to use during transition: |
| 328 | * |
| 329 | * of_reset_control_get() => of_reset_control_get_exclusive() |
| 330 | * |
| 331 | * These inline function calls will be removed once all consumers |
| 332 | * have been moved over to the new explicit API. |
| 333 | */ |
| 334 | static inline struct reset_control *reset_control_get( |
| 335 | struct device *dev, const char *id) |
| 336 | { |
| 337 | return reset_control_get_exclusive(dev, id); |
| 338 | } |
| 339 | |
| 340 | static inline struct reset_control *reset_control_get_optional( |
| 341 | struct device *dev, const char *id) |
| 342 | { |
| 343 | return reset_control_get_optional_exclusive(dev, id); |
| 344 | } |
| 345 | |
| 346 | static inline struct reset_control *of_reset_control_get( |
| 347 | struct device_node *node, const char *id) |
| 348 | { |
| 349 | return of_reset_control_get_exclusive(node, id); |
| 350 | } |
| 351 | |
| 352 | static inline struct reset_control *of_reset_control_get_by_index( |
| 353 | struct device_node *node, int index) |
| 354 | { |
| 355 | return of_reset_control_get_exclusive_by_index(node, index); |
| 356 | } |
| 357 | |
| 358 | static inline struct reset_control *devm_reset_control_get( |
| 359 | struct device *dev, const char *id) |
| 360 | { |
| 361 | return devm_reset_control_get_exclusive(dev, id); |
| 362 | } |
| 363 | |
| 364 | static inline struct reset_control *devm_reset_control_get_optional( |
| 365 | struct device *dev, const char *id) |
| 366 | { |
| 367 | return devm_reset_control_get_optional_exclusive(dev, id); |
| 368 | |
| 369 | } |
| 370 | |
| 371 | static inline struct reset_control *devm_reset_control_get_by_index( |
| 372 | struct device *dev, int index) |
| 373 | { |
| 374 | return devm_reset_control_get_exclusive_by_index(dev, index); |
| 375 | } |
Philipp Zabel | 61fc413 | 2012-11-19 17:23:13 +0100 | [diff] [blame] | 376 | #endif |