[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250825-b4-usb-v1-0-7aa024de7ae8@collabora.com>
Date: Mon, 25 Aug 2025 15:18:04 -0300
From: Daniel Almeida <daniel.almeida@...labora.com>
To: Miguel Ojeda <ojeda@...nel.org>, Alex Gaynor <alex.gaynor@...il.com>,
Boqun Feng <boqun.feng@...il.com>, Gary Guo <gary@...yguo.net>,
Björn Roy Baron <bjorn3_gh@...tonmail.com>,
Benno Lossin <lossin@...nel.org>, Andreas Hindborg <a.hindborg@...nel.org>,
Alice Ryhl <aliceryhl@...gle.com>, Trevor Gross <tmgross@...ch.edu>,
Danilo Krummrich <dakr@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: linux-kernel@...r.kernel.org, rust-for-linux@...r.kernel.org,
linux-usb@...r.kernel.org, Daniel Almeida <daniel.almeida@...labora.com>
Subject: [PATCH 0/2] rust: usb: add initial USB abstractions
This adds initial support for USB Rust drivers, not only because I see a
widespread use of module_usb_driver() in media (which is a subsystem I
aim to support) but also because I want to learn about USB in general
and this is a nice opportunity to start doing so.
I tried to keep things as consistent with pci.rs and platform.rs as
possible and tested it by manually binding a device (i.e.: my Logitech
mouse) to the sample driver via:
/sys/bus/usb/drivers/rust_driver_usb/new_id
This initial patch is therefore comprised of the same patterns that are
known to work for pci and platform already.
Physically disconnecting the device also worked, i.e.: nothing bad
showed up in dmesg.
Note that I did not touch MAINTAINERS at all. The objective is to
kickstart the discussion of what to do there here in v1.
---
Daniel Almeida (2):
rust: usb: add basic USB abstractions
samples: rust: add a USB driver sample
rust/bindings/bindings_helper.h | 1 +
rust/helpers/helpers.c | 1 +
rust/helpers/usb.c | 8 +
rust/kernel/lib.rs | 2 +
rust/kernel/usb.rs | 457 ++++++++++++++++++++++++++++++++++++++++
samples/rust/Kconfig | 11 +
samples/rust/Makefile | 1 +
samples/rust/rust_driver_usb.rs | 47 +++++
8 files changed, 528 insertions(+)
---
base-commit: 44d454fcffa8b08d6d66df132121c1d387fa85db
change-id: 20250825-b4-usb-dd0fe44fd78b
Best regards,
--
Daniel Almeida <daniel.almeida@...labora.com>
Powered by blists - more mailing lists