summaryrefslogtreecommitdiff
path: root/include/reset-uclass.h
diff options
context:
space:
mode:
authorMichal Simek <[email protected]>2026-05-25 13:45:42 +0200
committerMichal Simek <[email protected]>2026-06-08 10:50:06 +0200
commit19f7def2646f2ec2926e8a0fcff50d4b754eec92 (patch)
tree4c2f6d7b1a04203930f44a71f3a5fdc2006f706d /include/reset-uclass.h
parent4706bd020886bc8fd583efb91aa227ed99c95c45 (diff)
reset: Add reset_reset() and reset_reset_bulk() API
Add reset_reset() and reset_reset_bulk() functions to the reset controller API. These functions assert and then deassert reset signals in a single call, providing a convenient way to pulse/toggle a reset line. This mimics the Linux kernel's reset_control_reset() and reset_control_bulk_reset() APIs. The new functions are useful for drivers that need to cycle a reset line during initialization or error recovery but with also passing delay parameter. If a driver implements the rst_reset op, it will be called directly with the delay parameter. Otherwise, the reset core performs reset_assert(), optional udelay(), and reset_deassert() as fallback. Reviewed-by: Simon Glass <[email protected]> Signed-off-by: Michal Simek <[email protected]> Link: https://lore.kernel.org/r/55ddd313c9e7b2d4dc79ab36bdd0040f871610f6.1779709539.git.michal.simek@amd.com
Diffstat (limited to 'include/reset-uclass.h')
-rw-r--r--include/reset-uclass.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/include/reset-uclass.h b/include/reset-uclass.h
index 9a0696dd1e3..7af090b60b5 100644
--- a/include/reset-uclass.h
+++ b/include/reset-uclass.h
@@ -77,6 +77,25 @@ struct reset_ops {
*/
int (*rst_deassert)(struct reset_ctl *reset_ctl);
/**
+ * rst_reset - Reset a HW module.
+ *
+ * This optional function triggers a reset pulse on the reset line.
+ * If not implemented, reset_reset() falls back to rst_assert(),
+ * udelay(@delay_us), then rst_deassert(); that delay is therefore
+ * observed only on the fallback path.
+ *
+ * When rst_reset is provided, @delay_us is controller-specific: the
+ * implementation should honour it if the hardware needs a minimum
+ * assertion time before release. It may ignore @delay_us when the
+ * pulse shape is fixed elsewhere (for example a firmware pulse).
+ *
+ * @reset_ctl: The reset signal to pulse.
+ * @delay_us: Minimum delay in microseconds between assert and
+ * deassert where applicable; see above.
+ * @return 0 if OK, or a negative error code.
+ */
+ int (*rst_reset)(struct reset_ctl *reset_ctl, ulong delay_us);
+ /**
* rst_status - Check reset signal status.
*
* @reset_ctl: The reset signal to check.