From: clicedvly768 <harepro29@gmail.com>
To: ojeda@kernel.org, dmitry.torokhov@gmail.com
Cc: rust-for-linux@vger.kernel.org, linux-input@vger.kernel.org,
clicedvly768 <harepro29@gmail.com>
Subject: [PATCH v3 0/2] rust: input: add input/serio abstractions and port Gravis Stinger driver
Date: Sat, 7 Nov 2026 02:10:32 +0500 [thread overview]
Message-ID: <20261106211034.401918-1-harepro29@gmail.com> (raw)
This patch series introduces safe Rust abstractions for Linux input
devices (struct input_dev) and the serio (Serial I/O) bus subsystem,
along with a port of the legacy Gravis Stinger serial gamepad driver
to safe Rust.
Changes in v3:
- input: added AllocatedDevice::set_phys_from_parent() to dynamically
format the physical device path ("%s/input0") in an owned kernel
heap buffer.
- input: managed parent device reference counts in set_parent(), drop(),
and register() using get_device()/put_device() to avoid dangling
pointers and reference leaks.
- input: eliminated manual cleanup duplication in register() by checking
to_result() before mem::forget(self).
- input: implemented Send and Sync for AllocatedDevice, added #[inline]
on small methods, and formatted imports vertically.
- serio: eliminated race condition in connect_callback(): initialized
driver state in T::init(), set drvdata prior to serio_open(), and
published input devices in T::start().
- serio: integrated serio::Device with kernel device abstractions via
AsBusDevice, impl_device_context_deref!, and as_device().
- serio: mapped IrqReturn variants to C irqreturn_t constants.
- stinger: restored userspace-visible device name ("Gravis Stinger")
and dynamic phys path, preserving udev and EVIOCGNAME compatibility.
- stinger: maintained module name "stinger.ko" using Kbuild object
aliasing under CONFIG_JOYSTICK_STINGER_RUST.
- stinger: formatted imports vertically and fixed line-length warnings.
Changes in v2:
- Combined serio subsystem abstractions and Gravis Stinger driver
port into a single patch (2/2).
- Retained original C driver (stinger.c) under CONFIG_JOYSTICK_STINGER
and introduced CONFIG_JOYSTICK_STINGER_RUST to avoid regressions on
architectures and configurations without Rust support.
- Ensured IS_REACHABLE() guards for C helpers and #[cfg(CONFIG_* = "y")]
for rust/kernel modules to prevent unresolved symbols.
clicedvly768 (2):
rust: input: add input device abstractions
rust: serio: add serio bus abstractions and port Gravis Stinger driver
drivers/input/joystick/Kconfig | 14 ++
drivers/input/joystick/Makefile | 5 +-
drivers/input/joystick/stinger_rust.rs | 179 +++++++++++++++
rust/bindings/bindings_helper.h | 2 +
rust/helpers/helpers.c | 2 +
rust/helpers/input.c | 22 ++
rust/helpers/serio.c | 17 ++
rust/kernel/input.rs | 248 ++++++++++++++++++++
rust/kernel/lib.rs | 4 +
rust/kernel/serio.rs | 301 +++++++++++++++++++++++++
10 files changed, 792 insertions(+), 2 deletions(-)
create mode 100644 drivers/input/joystick/stinger_rust.rs
create mode 100644 rust/helpers/input.c
create mode 100644 rust/helpers/serio.c
create mode 100644 rust/kernel/input.rs
create mode 100644 rust/kernel/serio.rs
--
2.56.0
next reply other threads:[~2026-11-06 21:10 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-06 21:10 clicedvly768 [this message]
2026-11-06 21:10 ` [PATCH v3 1/2] rust: input: add input device abstractions clicedvly768
2026-11-06 21:20 ` sashiko-bot
2026-11-06 21:10 ` [PATCH v3 2/2] rust: serio: add serio bus abstractions and port Gravis Stinger driver clicedvly768
2026-11-06 21:28 ` sashiko-bot
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=20261106211034.401918-1-harepro29@gmail.com \
--to=harepro29@gmail.com \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=ojeda@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.