Lines Matching +full:bus +full:- +full:specific

1 // SPDX-License-Identifier: GPL-2.0
5 //! This documentation describes how to implement a bus specific driver API and how to align it with
6 //! the design of (bus specific) devices.
13 //! The main driver interface is defined by a bus specific driver trait. For instance:
27 //! fn probe(dev: &Device<device::Core>, id_info: &Self::IdInfo) -> Result<Pin<KBox<Self>>>;
36 //! For specific examples see [`auxiliary::Driver`], [`pci::Driver`] and [`platform::Driver`].
39 //! data. The bus abstraction should store the pointer in the corresponding bus device. The generic
44 //! is unbound from the device, the bus abstraction should take back the ownership of the driver's
51 //! The adapter implementation of a bus represents the abstraction layer between the C bus
52 //! callbacks and the Rust bus callbacks. It therefore has to be generic over an implementation of
53 //! the [driver trait](#driver-trait).
70 //! Typically, bus abstractions want to provide a bus specific `module_bus_driver!` macro, which
71 //! creates a kernel module with exactly one [`Registration`] for the bus specific adapter.
99 /// Amba, etc.) to provide the corresponding subsystem specific implementation to register /
125 ) -> Result; in register()
139 /// `T::unregister` calls result in the subsystem specific registration calls.
158 pub fn new(name: &'static CStr, module: &'static ThisModule) -> impl PinInit<Self, Error> { in new()
160 reg <- Opaque::try_ffi_init(|ptr: *mut T::RegType| { in new()
202 ) -> impl ::pin_init::PinInit<Self, $crate::error::Error> {
204 _driver <- $crate::driver::Registration::new(
219 /// The bus independent adapter to match a drivers and a devices.
221 /// This trait should be implemented by the bus specific adapter, which represents the connection
224 /// It provides bus independent functions for device / driver interactions.
230 fn acpi_id_table() -> Option<acpi::IdTable<Self::IdInfo>>; in acpi_id_table()
235 fn acpi_id_info(dev: &device::Device) -> Option<&'static Self::IdInfo> { in acpi_id_info()
247 // - `table` has static lifetime, hence it's valid for read, in acpi_id_info()
248 // - `dev` is guaranteed to be valid while it's alive, and so is `dev.as_raw()`. in acpi_id_info()
264 fn of_id_table() -> Option<of::IdTable<Self::IdInfo>>; in of_id_table()
269 fn of_id_info(dev: &device::Device) -> Option<&'static Self::IdInfo> { in of_id_info()
281 // - `table` has static lifetime, hence it's valid for read, in of_id_info()
282 // - `dev` is guaranteed to be valid while it's alive, and so is `dev.as_raw()`. in of_id_info()
305 fn id_info(dev: &device::Device) -> Option<&'static Self::IdInfo> { in id_info()