Initial work for Rust abstraction for HID device driver development
v2 cover Initial work for Rust abstraction for HID device driver development
Hello again,
I incorporated Danilo's and Peter's feedback from my v1. Additionally, I implemented the AlwaysRefCounted trait for kernel::hid::Device and needed some bindings from kref.
Rahul Rameshbabu (4):
HID: core: Change hid_driver to use a const char* for name
rust: add kref bindings
rust: core abstractions for HID drivers
rust: hid: Glorious Gaming PC Race Model O and O- mice reference
driver
MAINTAINERS | 15 + drivers/hid/Kconfig | 16 ++ drivers/hid/Makefile | 1 + drivers/hid/hid-glorious.c | 2 + drivers/hid/hid_glorious_rust.rs | 59 ++++ include/linux/hid.h | 2 +- rust/bindings/bindings_helper.h | 3 + rust/helpers/helpers.c | 1 + rust/helpers/kref.c | 13 + rust/kernel/hid.rs | 458 +++++++++++++++++++++++++++++++ rust/kernel/lib.rs | 2 + 11 files changed, 571 insertions(+), 1 deletion(-) create mode 100644 drivers/hid/hid_glorious_rust.rs create mode 100644 rust/helpers/kref.c create mode 100644 rust/kernel/hid.rs
base-commit: 2009a2d5696944d85c34d75e691a6f3884e787c0
Signature · 1 line
2.47.2
PATCH v2 1/4 HID: core: Change hid_driver to use a const char* for name
name is never mutated by the core HID stack. Making name a const char* simplifies passing the string from Rust to C. Otherwise, it becomes difficult to pass a 'static lifetime CStr from Rust to a char*, rather than a const char*, due to lack of guarantee that the underlying data of the CStr will not be mutated by the C code.
--- include/linux/hid.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/hid.h +1 -1
@@ -816,7 +816,7 @@ struct hid_usage_id {* zero from them. */ struct hid_driver { -char *name; +const char *name;const struct hid_device_id *id_table;struct list_head dyn_list;
Signature · 1 line
2.47.2
PATCH v2 2/4 rust: add kref bindings
In reply to Rahul RameshbabuIntroduce kref bindings for use in the Rust HID abstractions. Needed for implementing the AlwaysRefCounted trait for kernel::hid::Device. Add rust helpers for binding the kref_get and kref_put static inline C functions.
--- rust/bindings/bindings_helper.h | 1 + rust/helpers/helpers.c | 1 + rust/helpers/kref.c | 13 +++++++++++++ 3 files changed, 15 insertions(+) create mode 100644 rust/helpers/kref.c
rust/bindings/bindings_helper.h +1 -0
@@ -54,6 +54,7 @@#include <linux/fs.h> #include <linux/jiffies.h> #include <linux/jump_label.h> +#include <linux/kref.h> #include <linux/mdio.h> #include <linux/miscdevice.h> #include <linux/of_device.h>
rust/helpers/helpers.c +1 -0
@@ -25,6 +25,7 @@#include "fs.c" #include "io.c" #include "jump_label.c" +#include "kref.c" #include "kunit.c" #include "mm.c" #include "mutex.c"
rust/helpers/kref.c new file +13 -0
@@ -0,0 +1,13 @@ +// SPDX-License-Identifier: GPL-2.0 + +#include <linux/kref.h> + +void rust_helper_kref_get (struct kref *kref) +{ +kref_get (kref); +} + +void rust_helper_kref_put (struct kref *kref,void (*release)(struct kref *kref)) +{ +kref_put (kref, release); +}
Signature · 1 line
2.47.2
Re: [PATCH v2 2/4] rust: add kref bindings
Quoted 45 lines · On Sun, 13 Jul, 2025 21:12:06 +0000 "Rahul Rameshbabu"…
Introduce kref bindings for use in the Rust HID abstractions. Needed for implementing the AlwaysRefCounted trait for
kernel::hid::Device. Add rust helpers for binding thekref_getandkref_putstatic inline C functions.Signed-off-by Rahul Rameshbabu <[email protected]>--- rust/bindings/bindings_helper.h | 1 + rust/helpers/helpers.c | 1 + rust/helpers/kref.c | 13 +++++++++++++ 3 files changed, 15 insertions(+) create mode 100644 rust/helpers/kref.crust/bindings/bindings_helper.h +1
-0@@ -54,6 +54,7 @@#include <linux/fs.h> #include <linux/jiffies.h> #include <linux/jump_label.h> +#include <linux/kref.h> #include <linux/mdio.h> #include <linux/miscdevice.h> #include <linux/of_device.h> rust/helpers/helpers.c +1
-0@@ -25,6 +25,7 @@#include "fs.c" #include "io.c" #include "jump_label.c" +#include "kref.c" #include "kunit.c" #include "mm.c" #include "mutex.c" rust/helpers/kref.c new file +3
-0@@ -0,0 +1,13 @@ +// SPDX-License-Identifier: GPL-2.0 + +#include <linux/kref.h>
rust/helpers/kref.c line 13
Quoted 10 lines
rust/helpers/kref.c new file +10
-0+ +void rust_helper_kref_get (struct kref *kref) +{ +kref_get (kref); +} + +void rust_helper_kref_put (struct kref *kref,void (*release)(struct kref *kref)) +{ +kref_put (kref, release); +}
I am about to send out my v3, and this patch will no longer be needed. Would it make sense to send this out separately? I can also just keep it stashed away till someone needs it.
Thanks,
Rahul Rameshbabu
Re: [PATCH v2 2/4] rust: add kref bindings
On Sun, Jul 20, 2025 at 04:02:09PM +0000, Rahul Rameshbabu wrote:
[...]
Quoted 27 lines
Quoted 27 lines
rust/helpers/helpers.c +1
-0@@ -25,6 +25,7 @@#include "fs.c" #include "io.c" #include "jump_label.c" +#include "kref.c" #include "kunit.c" #include "mm.c" #include "mutex.c" rust/helpers/kref.c new file +9
-0@@ -0,0 +1,13 @@ +// SPDX-License-Identifier: GPL-2.0 + +#include <linux/kref.h> + +void rust_helper_kref_get (struct kref *kref) +{ +kref_get (kref); +} +
Quoted 9 lines
rust/helpers/kref.c line 13
Quoted 4 lines
rust/helpers/kref.c new file +4
-0+void rust_helper_kref_put (struct kref *kref,void (*release)(struct kref *kref)) +{ +kref_put (kref, release); +}I am about to send out my v3, and this patch will no longer be needed. Would it make sense to send this out separately? I can also just keep it stashed away till someone needs it.
I think you just drop this, we will have the Refcount abstraction:
https://lore.kernel.org/rust-for-linux/[email protected]/
, and we can build an kref API on top of that.
Thanks!
Regards,
Boqun
Quoted 3 lines
Thanks,
Rahul Rameshbabu
PATCH v2 3/4 rust: core abstractions for HID drivers
In reply to Rahul RameshbabuThese abstractions enable the development of HID drivers in Rust by binding with the HID core C API. They provide Rust types that map to the equivalents in C. In this initial draft, only hid_device and hid_device_id are provided direct Rust type equivalents. hid_driver is specially wrapped with a custom Driver type. The module_hid_driver! macro provides analogous functionality to its C equivalent. Only the .report_fixup callback is binded to Rust so far.
Future work for these abstractions would include more bindings for common HID-related types, such as hid_field, hid_report_enum, and hid_report as well as more bus callbacks. Providing Rust equivalents to useful core HID functions will also be necessary for HID driver development in Rust.
---
Notes:
Notes:
Some points I did not address from the last review cycle:
* Enabling CONFIG_HID=m with the Rust bindings
- This is a limitation due to the Makefile rules that currently exist, compiling all the Rust bindings into kernel.o, which gets linked into the core kernel image.
From rust/Makefile
$(obj)/kernel.o: private rustc_target_flags = --extern ffi --extern pin_init \
--extern build_error --extern macros --extern bindings --extern uapi
$(obj)/kernel.o: $(src)/kernel/lib.rs $(obj)/build_error.o $(obj)/pin_init.o \
$(obj)/$(libmacros_name) $(obj)/bindings.o $(obj)/uapi.o FORCE
+$(call if_changed_rule,rustc_library)
ifdef CONFIG_JUMP_LABEL
$(obj)/kernel.o: $(obj)/kernel/generated_arch_static_branch_asm.rs endif
- I would be happy to work on support for module-level bindings, but this is not a problem unique only to the Rust HID binding work.
* I did not look into autogenerating all the getter functions for various fields exported from the binded C structures.
- I would be interested in hearing opinions from folks actively involved with Rust for Linux on this topic.
Changelog:
RFC->v1:
* Use Danilo's core infrastructure
* Account for HID device groups
* Remove probe and remove callbacks
* Implement report_fixup support
* Properly comment code including SAFETY comments
v1->v2:
* Binded drivers/hid/hid-ids.h for use in Rust drivers
* Remove pre-emptive referencing of a C HID driver instance before it is fully initialized in the driver registration path
* Moved static getters to generic Device trait implementation, so they can be used by all device::DeviceContext
* Use core macros for supporting DeviceContext transitions
* Implemented the AlwaysRefCounted and AsRef traits
* Make use for dev_err! as appropriate
MAINTAINERS | 8 + drivers/hid/Kconfig | 8 + rust/bindings/bindings_helper.h | 2 + rust/kernel/hid.rs | 458 ++++++++++++++++++++++++++++++++ rust/kernel/lib.rs | 2 + 5 files changed, 478 insertions(+) create mode 100644 rust/kernel/hid.rs
MAINTAINERS +8 -0
@@ -10686,6 +10686,14 @@ F: include/uapi/linux/hid* F: samples/hid/ F: tools/testing/selftests/hid/ +HID CORE LAYER [RUST] +M: Rahul Rameshbabu <[email protected]> +R: Benjamin Tissoires <[email protected]> +L: [email protected] +S: Maintained +T: git https://github.com/Rust-for-Linux/linux.git hid-next +F: rust/kernel/hid.rs + HID LOGITECH DRIVERS R: Filipe Laíns <[email protected]> L: [email protected]
drivers/hid/Kconfig +8 -0
@@ -744,6 +744,14 @@ config HID_MEGAWORLD_FF Say Y here if you have a Mega World based game controller and want to have force feedback support for it. +config RUST_HID_ABSTRACTIONS + bool "Rust HID abstractions support" + depends on RUST + depends on HID=y + help + Adds support needed for HID drivers written in Rust. It provides a + wrapper around the C hid core. + config HID_REDRAGON tristate "Redragon keyboards" default !EXPERT
rust/bindings/bindings_helper.h +2 -0
@@ -52,6 +52,8 @@#include <linux/file.h> #include <linux/firmware.h> #include <linux/fs.h> +#include <linux/hid.h> +#include "../../drivers/hid/hid-ids.h" #include <linux/jiffies.h> #include <linux/jump_label.h> #include <linux/kref.h>
rust/kernel/hid.rs new file +458 -0
458 lines not on this page · raw message
rust/kernel/lib.rs +2 -0
@@ -78,6 +78,8 @@#[cfg( CONFIG_RUST_FW_LOADER_ABSTRACTIONS )] pub mod firmware;pub mod fs; +#[cfg( CONFIG_RUST_HID_ABSTRACTIONS )] +pub mod hid;pub mod init;pub mod io;pub mod ioctl;
Signature · 1 line
2.47.2
Re: [PATCH v2 3/4] rust: core abstractions for HID drivers
Hi Rahul,
Some mostly doc-related comments below...
Quoted 9 lines · Rahul Rameshbabu
Some points I did not address from the last review cycle:
* Enabling
CONFIG_HID=mwith the Rust bindings
- This is a limitation due to theMakefilerules that currently exist, compiling all the Rust bindings into kernel.o, which gets linked into the core kernel image.
- I would be happy to work on support for module-level bindings, but this is not a problem unique only to the Rust HID binding work.
I am working on supporting that, so for the moment your approach is fine.
MAINTAINERS F: include/uapi/linux/hid* · line 10694
Quoted 2 lines
MAINTAINERS +2
-0+L: [email protected] +T: git https://github.com/Rust-for-Linux/linux.git hid-next
Hmm... I think we discussed going through HID, no? Or did something change?
rust/kernel/hid.rs line 22
Quoted 3 lines
rust/kernel/hid.rs new file +3
-0+/// [Device Class Definition for HID 1.11]: https://www.usb.org/sites/default/files/hid1_11.pdf +pub const MAIN_ITEM_CONSTANT :u8 = bindings::HID_MAIN_ITEM_CONSTANT as u8 ; +/// Indicates the item represents data from a physical control.
Please add new-lines between items.
rust/kernel/hid.rs line 90
Quoted 2 lines
rust/kernel/hid.rs new file +2
-0+ Generic = bindings::HID_GROUP_GENERIC as isize, +/// Maps multitouch devices to hid-multitouch instead of hid-generic.
Same between enum variants.
Quoted 1 line
+ /// Internal function used to convert Group variants into u16
[Group]
[u16]
Quoted 1 line
+ const fn into(self) -> u16 {
Could the enum be repr(u16) directly?
Are those as isize for a reason?
Quoted 1 line
+ // variants assigned constants that can be represented as u16
Please format consistently comments as well.
rust/kernel/hid.rs line 159
Quoted 5 lines
rust/kernel/hid.rs new file +5
-0+/// Returns the HID report group. +pub fn group (&self) ->u16 { +// SAFETY: `self.as_raw` is a valid pointer to a `struct hid_device` +unsafe { *self.as_raw () }.group + }
Do you need to expose the group as a raw integer?
Also, are these used currently?
Quoted 1 line
+/// Abstraction for the HID device ID structure ([
struct hid_device_id]).
This intra-doc pointing is probably broken -- we don't have yet automatic support to link to C ones yet (please check make ..... rustdoc).
Quoted 1 line
+ bus:
0x3, /*BUS_USB*/
Please use // for comments unless there is a reason that wouldn't work (e.g. to comment out within code).
Quoted 1 line
+/// IdTable type for HID
[IdTable]
Period at the end.
(I see others elsewhere are like this, so that is probably you had it like this -- they should be fixed too)
Quoted 1 line
+/// # Example
Please use the plural even if there is one example.
Quoted 1 line
+/// // Perform some report descriptor fixup
Period at the end.
Quoted 1 line
+///```
Missing space (several).
Quoted 1 line
+ "Cannot fix report description due to length conversion failure: {}!\n",
This could probably be a bit shorter using {e}
Quoted 1 line
+ // Build a mutable Rust slice from buf and size
Markdown.
Quoted 1 line
+ // SAFETY: The HID subsystem only ever calls the
report_fixupcallback
Markdown (several).
Quoted 1 line
+/// fn report_fixup<'a, 'b: 'a>(_hdev: &hid::Device<device::Core>, rdesc: &'b mut [u8]) -> &'a [u8] {
The example does not build -- please see how to test them here:
https://docs.kernel.org/rust/testing.html#kunit-tests-are-documentation-tests
Thanks!
Cheers,
Miguel
Re: [PATCH v2 3/4] rust: core abstractions for HID drivers
Quoted 9 lines · On Sun, 13 Jul, 2025 23:57:38 +0200 "Miguel Ojeda"…
rust/kernel/hid.rs line 159
Quoted 5 lines
rust/kernel/hid.rs new file +5
-0+/// Returns the HID report group. +pub fn group (&self) ->u16 { +// SAFETY: `self.as_raw` is a valid pointer to a `struct hid_device` +unsafe { *self.as_raw () }.group + }Do you need to expose the group as a raw integer?
Also, are these used currently?
Hi Miguel,
I originally did not expose the report group in the Rust bindings since I did not make use of them. Benjamin has a preference access to them be exposed in the initial bindings. I exposed this before implementing the enum in a later revision. I agree that we should wrap this using the enum now.
Thanks,
Rahul Rameshbabu
Danilo Krummrich
reviewerRe: [PATCH v2 3/4] rust: core abstractions for HID drivers
In reply to Rahul Rameshbaburust/kernel/hid.rs line 183
Quoted 5 lines · Rahul Rameshbabu
rust/kernel/hid.rs new file +5
-0+// SAFETY: Instances of `Device` are always reference-counted. +unsafe impl crate ::types::AlwaysRefCounted for Device { +fn inc_ref (&self) { +// SAFETY: The existence of a shared reference guarantees that the refcount is non-zero. +unsafe { bindings::kref_get (&mut ((*self.as_raw ()).ref_)) }
I'm confused, what's the lifecycle of a struct hid_device? It embedds a struct device, so it also inherits its reference count. Additionally it also has a struct kref. Can you elaborate please?
I don't know what the struct kref is for, but I'm pretty sure you want to manage the reference count of the embedded struct device here.
rust/kernel/hid.rs line 190
Quoted 7 lines
rust/kernel/hid.rs new file +7
-0+ } + +unsafe fn dec_ref (obj:NonNull <Self >) { +// SAFETY: The safety requirements guarantee that the refcount is non-zero. +unsafe { + bindings::kref_put ( + &mut ((*obj.cast::<bindings::hid_device>().as_ptr()).ref_),
I think you want &raw mut instead.
rust/kernel/hid.rs line 201
Quoted 11 lines
rust/kernel/hid.rs new file +11
-0+ Some(bindings::hiddev_free), + ) + } + } +} + +impl <Ctx : device::DeviceContext >AsRef <device::Device <Ctx >>for Device <Ctx > { +fn as_ref (&self) -> &device::Device <Ctx > { +// SAFETY: By the type invariant of `Self`, `self.as_raw()` is a pointer to a valid +// `struct hid_device`. +let dev =unsafe {addr_of_mut! ((*self.as_raw ()).dev) };
You also use &raw mut meanwhile.
Quoted 5 lines
rust/kernel/hid.rs new file +5
-0+ +// SAFETY: `dev` points to a valid `struct device`. +unsafe { device::Device ::as_ref (dev) } + } +}
Re: [PATCH v2 3/4] rust: core abstractions for HID drivers
Quoted 11 lines · On Tue, 15 Jul, 2025 17:04:07 +0200 "Danilo Krummrich" <[email protected]> wrote:
rust/kernel/hid.rs line 183
Quoted 5 lines · Rahul Rameshbabu
rust/kernel/hid.rs new file +5
-0+// SAFETY: Instances of `Device` are always reference-counted. +unsafe impl crate ::types::AlwaysRefCounted for Device { +fn inc_ref (&self) { +// SAFETY: The existence of a shared reference guarantees that the refcount is non-zero. +unsafe { bindings::kref_get (&mut ((*self.as_raw ()).ref_)) }I'm confused, what's the lifecycle of a struct
hid_device? It embedds a struct device, so it also inherits its reference count. Additionally it also has a struct kref. Can you elaborate please?
Quoted 3 lines
I don't know what the struct kref is for, but I'm pretty sure you want to manage the reference count of the embedded struct device here.
Hi Danilo,
The hid subsystem uses a separate ref counter from the one maintained by the embedded struct device. hid_device_release is assigned to the embedded struct device's release method and makes use of this separate reference (in drivers/hid/hid-core.c).
drivers/hid/hid-debug.c makes use of the same reference in a similar manner to what I do here in hid_debug_events_release and hid_debug_events_open.
Basically, the hid subsystem has a separate reference counter on top of the one embedded in the kobject of struct device;
I decided to follow the same pattern used in the core C HID subsystem. This pattern is found in hid-core + hid_debug.
However, thank you for bringing this up since I think that you are right that it would be better to increment the reference count for the underlying device rather than use this separate external reference count.
It might even make sense to refactor core C HID to remove this separate kref and have hid_debug increase the reference count of the underlying struct device's kobject.
Right now, we can have the following situation in the hid subsystem.
1. struct device's kobject decrements to 0
2. struct device's release callback is called
3. This invokes hid_device_ref and decrements struct hid_device's ref
4. hid_debug is in use, so the ref has not gone to 0 yet
5. When hid_debug is ready to tear down the instance, hiddev_free will get called
The above creates a weird situation where the HID device can still be in-use even though the underlying device instance has reached a reference count of 0.
I will first start with fixing this in my Rust code, but I will take a look at cleaning this up in the core HID subsystem as well.
Quoted 24 lines
rust/kernel/hid.rs line 190
Quoted 7 lines
rust/kernel/hid.rs new file +7
-0+ } + +unsafe fn dec_ref (obj:NonNull <Self >) { +// SAFETY: The safety requirements guarantee that the refcount is non-zero. +unsafe { + bindings::kref_put ( + &mut ((*obj.cast::<bindings::hid_device>().as_ptr()).ref_),I think you want &raw mut instead.
rust/kernel/hid.rs line 201
Quoted 11 lines
rust/kernel/hid.rs new file +11
-0+ Some(bindings::hiddev_free), + ) + } + } +} + +impl <Ctx : device::DeviceContext >AsRef <device::Device <Ctx >>for Device <Ctx > { +fn as_ref (&self) -> &device::Device <Ctx > { +// SAFETY: By the type invariant of `Self`, `self.as_raw()` is a pointer to a valid +// `struct hid_device`. +let dev =unsafe {addr_of_mut! ((*self.as_raw ()).dev) };You also use &raw mut meanwhile.
Quoted 5 lines
rust/kernel/hid.rs line 206
Quoted 5 lines
rust/kernel/hid.rs new file +5
-0+ +// SAFETY: `dev` points to a valid `struct device`. +unsafe { device::Device ::as_ref (dev) } + } +}
https://doc.rust-lang.org/std/primitive.pointer.html#3-create-it-using-raw
Yes, I want &raw mut in the places you mentioned. Thanks :)
Thanks,
Rahul Rameshbabu
PATCH v2 4/4 rust: hid: Glorious Gaming PC Race Model O and O- mice reference driver
In reply to Rahul RameshbabuDemonstrate how to perform a report fixup from a Rust HID driver. The mice specify the const flag incorrectly in the consumer input report descriptor, which leads to inputs being ignored. Correctly patch the report descriptor for the Model O and O- mice.
Portions of the HID report post-fixup:
device 0:0
...0x81, 0x06, // Input (Data,Var,Rel) 84
...0x81, 0x06, // Input (Data,Var,Rel) 112
...0x81, 0x06, // Input (Data,Var,Rel) 140
---
Notes:
Changelog:
v1->v2:
* Use vendor id and device id from drivers/hid/hid-ids.h bindings
* Make use for dev_err! as appropriate
MAINTAINERS | 7 ++++ drivers/hid/Kconfig | 8 +++++ drivers/hid/Makefile | 1 + drivers/hid/hid-glorious.c | 2 ++ drivers/hid/hid_glorious_rust.rs | 59 ++++++++++++++++++++++++++++++++ 5 files changed, 77 insertions(+) create mode 100644 drivers/hid/hid_glorious_rust.rs
MAINTAINERS +7 -0
@@ -10200,6 +10200,13 @@ L: [email protected] S: Maintained F: drivers/platform/x86/gigabyte-wmi.c +GLORIOUS RUST DRIVER [RUST] +M: Rahul Rameshbabu <[email protected]> +L: [email protected] +S: Maintained +T: git https://github.com/Rust-for-Linux/linux.git hid-next +F: drivers/hid/hid_glorious_rust.rs + GNSS SUBSYSTEM M: Johan Hovold <[email protected]> S: Maintained
drivers/hid/Kconfig +8 -0
@@ -406,6 +406,14 @@ config HID_GLORIOUS Support for Glorious PC Gaming Race mice such as the Glorious Model O, O- and D. +config HID_GLORIOUS_RUST + tristate "Glorious O and O- mice Rust reference driver" + depends on USB_HID + depends on RUST_HID_ABSTRACTIONS + help + Support for Glorious PC Gaming Race O and O- mice + in Rust + config HID_HOLTEK tristate "Holtek HID devices" depends on USB_HID
drivers/hid/Makefile +1 -0
@@ -55,6 +55,7 @@ obj-$(CONFIG_HID_FT260) += hid-ft260.o obj-$(CONFIG_HID_GEMBIRD) += hid-gembird.o obj-$(CONFIG_HID_GFRM) += hid-gfrm.o obj-$(CONFIG_HID_GLORIOUS) += hid-glorious.o +obj-$(CONFIG_HID_GLORIOUS_RUST) += hid_glorious_rust.o obj-$(CONFIG_HID_VIVALDI_COMMON) += hid-vivaldi-common.o obj-$(CONFIG_HID_GOODIX_SPI) += hid-goodix-spi.o obj-$(CONFIG_HID_GOOGLE_HAMMER) += hid-google-hammer.o
drivers/hid/hid-glorious.c +2 -0
@@ -76,8 +76,10 @@ static int glorious_probe(struct hid_device *hdev, }static const struct hid_device_id glorious_devices[] = { +#if !IS_ENABLED(CONFIG_HID_GLORIOUS_RUST) {HID_USB_DEVICE (USB_VENDOR_ID_SINOWEALTH ,USB_DEVICE_ID_GLORIOUS_MODEL_O ) }, +#endif {HID_USB_DEVICE (USB_VENDOR_ID_SINOWEALTH ,USB_DEVICE_ID_GLORIOUS_MODEL_D ) }, { HID_USB_DEVICE(USB_VENDOR_ID_LAVIEW,
drivers/hid/hid_glorious_rust.rs new file +59 -0
59 lines not on this page · raw message
Signature · 1 line
2.47.2
Re: [PATCH v2 4/4] rust: hid: Glorious Gaming PC Race Model O and O- mice reference driver
MAINTAINERS L: [email protected] · line 10207
Quoted 3 lines · Rahul Rameshbabu
MAINTAINERS +2
-0+L: [email protected] +T: git https://github.com/Rust-for-Linux/linux.git hid-next
Hmm... I think we discussed going through HID, no? Or did something change?
drivers/hid/Kconfig config HID_GLORIOUS · line 415
Quoted 2 lines
drivers/hid/Kconfig +2
-0+ Support for Glorious PC Gaming Race O and O- mice + in Rust
Period at the end.
Quoted 1 line
+//! Rust reference HID driver for Glorious Model O and O- mice
Period at the end.
drivers/hid/hid_glorious_rust.rs line 32
Quoted 3 lines
drivers/hid/hid_glorious_rust.rs new file +3
-0+/// Glorious Model O and O- specify the const flag in the consumer input +/// report descriptor, which leads to inputs being ignored. Fix this by +/// patching the descriptor.
If these are the function docs (i.e. ///), then please write them as usually we would do, e.g. "Fix ... (new paragraph) ...".
Thanks!
Cheers,
Miguel