diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2022-02-20 13:47:32 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2022-03-08 09:59:59 +0100 |
commit | b63e5ff58fc4a8ff029592ac12d6e0c8d54ef658 (patch) | |
tree | 58fdf3d24ec70222d7a6a53faa194270ced0a2ba /include | |
parent | 054ccac22bd136b6cfd152024389bc8e4e604921 (diff) | |
download | barebox-b63e5ff58fc4a8ff029592ac12d6e0c8d54ef658.tar.gz barebox-b63e5ff58fc4a8ff029592ac12d6e0c8d54ef658.tar.xz |
reset: add support for reset_control_status
Driver code may want to query status of a reset line. Add an optional
callback for drivers to provide this.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20220220124736.3052502-21-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/reset-controller.h | 2 | ||||
-rw-r--r-- | include/linux/reset.h | 6 |
2 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/reset-controller.h b/include/linux/reset-controller.h index 8ace8cd417..a9047e947e 100644 --- a/include/linux/reset-controller.h +++ b/include/linux/reset-controller.h @@ -14,11 +14,13 @@ struct reset_controller_dev; * things to reset the device * @assert: manually assert the reset line, if supported * @deassert: manually deassert the reset line, if supported + * @status: return the status of the reset line, if supported */ struct reset_control_ops { int (*reset)(struct reset_controller_dev *rcdev, unsigned long id); int (*assert)(struct reset_controller_dev *rcdev, unsigned long id); int (*deassert)(struct reset_controller_dev *rcdev, unsigned long id); + int (*status)(struct reset_controller_dev *rcdev, unsigned long id); }; struct device_node; diff --git a/include/linux/reset.h b/include/linux/reset.h index d25464d4bd..d0677b1d9f 100644 --- a/include/linux/reset.h +++ b/include/linux/reset.h @@ -8,6 +8,7 @@ struct reset_control; #ifdef CONFIG_RESET_CONTROLLER +int reset_control_status(struct reset_control *rstc); int reset_control_reset(struct reset_control *rstc); int reset_control_assert(struct reset_control *rstc); int reset_control_deassert(struct reset_control *rstc); @@ -25,6 +26,11 @@ int __must_check device_reset_all(struct device_d *dev); #else +static inline int reset_control_status(struct reset_control *rstc) +{ + return 0; +} + static inline int reset_control_reset(struct reset_control *rstc) { return 0; |