mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Daniel Almeida <daniel.almeida@collabora.com>
To: "Miguel Ojeda" <ojeda@kernel.org>,
	"Boqun Feng" <boqun@kernel.org>, "Gary Guo" <gary@garyguo.net>,
	"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
	"Benno Lossin" <lossin@kernel.org>,
	"Andreas Hindborg" <a.hindborg@kernel.org>,
	"Alice Ryhl" <aliceryhl@google.com>,
	"Trevor Gross" <tmgross@umich.edu>,
	"Danilo Krummrich" <dakr@kernel.org>,
	"Daniel Almeida" <daniel.almeida@collabora.com>,
	"Tamir Duberstein" <tamird@kernel.org>,
	"Alexandre Courbot" <acourbot@nvidia.com>,
	"Onur Özkan" <work@onurozkan.dev>,
	"Philipp Zabel" <p.zabel@pengutronix.de>
Cc: linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org,
	 dri-devel@lists.freedesktop.org,
	 Detlev Casanova <detlev.casanova@collabora.com>,
	 Nicolas Dufresne <nicolas.dufresne@collabora.com>
Subject: [PATCH 1/7] rust: reset: add reset control helpers
Date: Thu, 26 Nov 2026 13:04:28 -0300	[thread overview]
Message-ID: <20261126-b4-rust-reset-v1-1-9c4c3d029080@collabora.com> (raw)
In-Reply-To: <20261126-b4-rust-reset-v1-0-9c4c3d029080@collabora.com>

In preparation for the reset control abstraction added by the next
patch, make the static inline functions it uses available to bindgen.

Signed-off-by: Daniel Almeida <daniel.almeida@collabora.com>
---
 MAINTAINERS                     |  1 +
 rust/bindings/bindings_helper.h |  1 +
 rust/helpers/helpers.c          |  1 +
 rust/helpers/reset.c            | 33 +++++++++++++++++++++++++++++++++
 4 files changed, 36 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 222b7fc2c3aa..d8bcacb7d8ef 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -24063,6 +24063,7 @@ F:	include/dt-bindings/reset/
 F:	include/linux/reset-controller.h
 F:	include/linux/reset.h
 F:	include/linux/reset/
+F:	rust/helpers/reset.c
 K:	\b(?:devm_|of_)?reset_control(?:ler_[a-z]+|_[a-z_]+)?\b
 
 RESTARTABLE SEQUENCES SUPPORT
diff --git a/rust/bindings/bindings_helper.h b/rust/bindings/bindings_helper.h
index 3791af0aadc7..c96634bfaacb 100644
--- a/rust/bindings/bindings_helper.h
+++ b/rust/bindings/bindings_helper.h
@@ -85,6 +85,7 @@
 #include <linux/random.h>
 #include <linux/refcount.h>
 #include <linux/regulator/consumer.h>
+#include <linux/reset.h>
 #include <linux/sched.h>
 #include <linux/security.h>
 #include <linux/serdev.h>
diff --git a/rust/helpers/helpers.c b/rust/helpers/helpers.c
index d62c7be1ca7b..a5a127935961 100644
--- a/rust/helpers/helpers.c
+++ b/rust/helpers/helpers.c
@@ -92,6 +92,7 @@
 #include "rcu.c"
 #include "refcount.c"
 #include "regulator.c"
+#include "reset.c"
 #include "scatterlist.c"
 #include "security.c"
 #include "serdev.c"
diff --git a/rust/helpers/reset.c b/rust/helpers/reset.c
new file mode 100644
index 000000000000..ea2e6f09b7d5
--- /dev/null
+++ b/rust/helpers/reset.c
@@ -0,0 +1,33 @@
+// SPDX-License-Identifier: GPL-2.0
+
+#include <linux/reset.h>
+
+__rust_helper struct reset_control *
+rust_helper_reset_control_get_exclusive(struct device *dev, const char *id)
+{
+	return reset_control_get_exclusive(dev, id);
+}
+
+__rust_helper struct reset_control *
+rust_helper_reset_control_get_optional_exclusive(struct device *dev,
+						 const char *id)
+{
+	return reset_control_get_optional_exclusive(dev, id);
+}
+
+#ifndef CONFIG_RESET_CONTROLLER
+__rust_helper void rust_helper_reset_control_put(struct reset_control *rstc)
+{
+	reset_control_put(rstc);
+}
+
+__rust_helper int rust_helper_reset_control_assert(struct reset_control *rstc)
+{
+	return reset_control_assert(rstc);
+}
+
+__rust_helper int rust_helper_reset_control_deassert(struct reset_control *rstc)
+{
+	return reset_control_deassert(rstc);
+}
+#endif

-- 
2.56.0


  reply	other threads:[~2026-11-26 16:06 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-26 16:04 [PATCH 0/7] rust: reset: add reset control abstractions Daniel Almeida
2026-11-26 16:04 ` Daniel Almeida [this message]
2026-11-26 16:04 ` [PATCH 2/7] rust: reset: add ExclusiveResetControl Daniel Almeida
2026-11-26 16:04 ` [PATCH 3/7] rust: reset: add ExclusiveResetControl::get_array() and get_array_optional() Daniel Almeida
2026-11-26 16:04 ` [PATCH 4/7] rust: reset: add AssertedGuard Daniel Almeida
2026-11-26 16:04 ` [PATCH 5/7] rust: reset: add SharedResetControl Daniel Almeida
2026-11-26 19:14   ` Alice Ryhl
2026-11-26 16:04 ` [PATCH 6/7] rust: reset: add SharedResetControl::get_array() and get_array_optional() Daniel Almeida
2026-11-26 16:04 ` [PATCH 7/7] rust: reset: add devm_deassert() and devm_deassert_optional() Daniel Almeida
2026-11-26 16:33 ` [PATCH 0/7] rust: reset: add reset control abstractions Nicolas Dufresne
2026-11-26 18:02   ` Daniel Almeida
2026-11-26 18:11     ` Nicolas Dufresne
2026-11-26 18:36       ` Daniel Almeida
2026-11-26 18:46         ` Nicolas Dufresne

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261126-b4-rust-reset-v1-1-9c4c3d029080@collabora.com \
    --to=daniel.almeida@collabora.com \
    --cc=a.hindborg@kernel.org \
    --cc=acourbot@nvidia.com \
    --cc=aliceryhl@google.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun@kernel.org \
    --cc=dakr@kernel.org \
    --cc=detlev.casanova@collabora.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gary@garyguo.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lossin@kernel.org \
    --cc=nicolas.dufresne@collabora.com \
    --cc=ojeda@kernel.org \
    --cc=p.zabel@pengutronix.de \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=tamird@kernel.org \
    --cc=tmgross@umich.edu \
    --cc=work@onurozkan.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®