Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

gpu: nova-core: register auxiliary device for nova-drm

Register an auxiliary device for nova-drm.

For now always use zero for the auxiliary device's ID; we don't use it
yet anyways. However, once it lands, we should switch to XArray.

Acked-by: Dave Airlie <airlied@redhat.com>
Link: https://lore.kernel.org/r/20250424160452.8070-2-dakr@kernel.org
Signed-off-by: Danilo Krummrich <dakr@kernel.org>

+11 -1
+1
drivers/gpu/nova-core/Kconfig
··· 1 1 config NOVA_CORE 2 2 tristate "Nova Core GPU driver" 3 + depends on AUXILIARY_BUS 3 4 depends on PCI 4 5 depends on RUST 5 6 depends on RUST_FW_LOADER_ABSTRACTIONS
+8 -1
drivers/gpu/nova-core/driver.rs
··· 1 1 // SPDX-License-Identifier: GPL-2.0 2 2 3 - use kernel::{bindings, c_str, device::Core, pci, prelude::*}; 3 + use kernel::{auxiliary, bindings, c_str, device::Core, pci, prelude::*}; 4 4 5 5 use crate::gpu::Gpu; 6 6 ··· 8 8 pub(crate) struct NovaCore { 9 9 #[pin] 10 10 pub(crate) gpu: Gpu, 11 + _reg: auxiliary::Registration, 11 12 } 12 13 13 14 const BAR0_SIZE: usize = 8; ··· 39 38 let this = KBox::pin_init( 40 39 try_pin_init!(Self { 41 40 gpu <- Gpu::new(pdev, bar)?, 41 + _reg: auxiliary::Registration::new( 42 + pdev.as_ref(), 43 + c_str!("nova-drm"), 44 + 0, // TODO: Once it lands, use XArray; for now we don't use the ID. 45 + crate::MODULE_NAME 46 + )?, 42 47 }), 43 48 GFP_KERNEL, 44 49 )?;
+2
drivers/gpu/nova-core/nova_core.rs
··· 8 8 mod regs; 9 9 mod util; 10 10 11 + pub(crate) const MODULE_NAME: &kernel::str::CStr = <LocalModule as kernel::ModuleMetadata>::NAME; 12 + 11 13 kernel::module_pci_driver! { 12 14 type: driver::NovaCore, 13 15 name: "NovaCore",