[PATCH] reset: core: Add reset_control_pulse() helper

From: Philipp Zabel

Date: Thu Nov 12 2026 - 07:21:00 EST


Add a helper function reset_control_pulse() that first calls
reset_control_assert(), then fsleep()s for a number of microseconds,
and then calls reset_control_deassert().

This allows to simplify a common pattern in consumer drivers that
need to pulse an exclusively controlled reset line for a certain
duration.

Signed-off-by: Philipp Zabel <p.zabel@xxxxxxxxxxxxxx>
---
drivers/reset/core.c | 37 +++++++++++++++++++++++++++++++++++++
include/linux/reset.h | 6 ++++++
2 files changed, 43 insertions(+)

diff --git a/drivers/reset/core.c b/drivers/reset/core.c
index bd82a0cf56c3..5d7f92667186 100644
--- a/drivers/reset/core.c
+++ b/drivers/reset/core.c
@@ -9,6 +9,7 @@
#include <linux/atomic.h>
#include <linux/auxiliary_bus.h>
#include <linux/cleanup.h>
+#include <linux/delay.h>
#include <linux/device.h>
#include <linux/err.h>
#include <linux/export.h>
@@ -722,6 +723,42 @@ int reset_control_bulk_deassert(int num_rstcs,
}
EXPORT_SYMBOL_GPL(reset_control_bulk_deassert);

+/**
+ * reset_control_pulse - asserts the reset line, sleeps, then deasserts
+ * @rstc: exclusive reset control to pulse
+ * @usecs: requested sleep duration between assert and deassert in microseconds
+ *
+ * Calls reset_control_assert(), fsleep(), and then reset_control_deassert() on
+ * an exclusive reset control. The caller must make sure that the reset line is
+ * previously deasserted, otherwise this is equivalent to a delayed deassert.
+ *
+ * If rstc is NULL it is an optional reset and the function will just
+ * return 0.
+ */
+int reset_control_pulse(struct reset_control *rstc, unsigned long usecs)
+{
+ int ret;
+
+ if (!rstc)
+ return 0;
+
+ if (WARN_ON(IS_ERR(rstc)))
+ return -EINVAL;
+
+ if (rstc->shared)
+ return -EINVAL;
+
+ ret = reset_control_assert(rstc);
+ if (ret < 0)
+ return ret;
+
+ if (usecs)
+ fsleep(usecs);
+
+ return reset_control_deassert(rstc);
+}
+EXPORT_SYMBOL_GPL(reset_control_pulse);
+
/**
* reset_control_status - returns a negative errno if not supported, a
* positive value if the reset line is asserted, or zero if the reset
diff --git a/include/linux/reset.h b/include/linux/reset.h
index 9c391cf0c822..8c61ca993919 100644
--- a/include/linux/reset.h
+++ b/include/linux/reset.h
@@ -76,6 +76,7 @@ int reset_control_reset(struct reset_control *rstc);
int reset_control_rearm(struct reset_control *rstc);
int reset_control_assert(struct reset_control *rstc);
int reset_control_deassert(struct reset_control *rstc);
+int reset_control_pulse(struct reset_control *rstc, unsigned long usecs);
int reset_control_status(struct reset_control *rstc);
int reset_control_acquire(struct reset_control *rstc);
void reset_control_release(struct reset_control *rstc);
@@ -132,6 +133,11 @@ static inline int reset_control_deassert(struct reset_control *rstc)
return 0;
}

+static inline int reset_control_pulse(struct reset_control *rstc, unsigned long usecs)
+{
+ return 0;
+}
+
static inline int reset_control_status(struct reset_control *rstc)
{
return 0;

---
base-commit: fbcd5a23e1472fd774c1b6f5a393cfb9371a751f
change-id: 20261112-reset-control-pulse-c00ead64cde2

Best regards,
--
Philipp Zabel <p.zabel@xxxxxxxxxxxxxx>