Lines Matching defs:i2c_client
133 // SAFETY: It's safe to set the fields of `struct i2c_client` on initialization.
155 extern "C" fn probe_callback(idev: *mut bindings::i2c_client) -> kernel::ffi::c_int {
157 // `struct i2c_client`.
173 extern "C" fn remove_callback(idev: *mut bindings::i2c_client) {
174 // SAFETY: `idev` is a valid pointer to a `struct i2c_client`.
185 extern "C" fn shutdown_callback(idev: *mut bindings::i2c_client) {
462 /// This structure represents the Rust abstraction for a C `struct i2c_client`. The
463 /// implementation abstracts the usage of an existing C `struct i2c_client` that
468 /// A [`I2cClient`] instance represents a valid `struct i2c_client` created by the C portion of
472 Opaque<bindings::i2c_client>,
477 fn as_raw(&self) -> *mut bindings::i2c_client {
482 // SAFETY: `I2cClient` is a transparent wrapper of `struct i2c_client`.
485 const OFFSET: usize = offset_of!(bindings::i2c_client, dev);
510 // `struct i2c_client`.
530 // `struct i2c_client` as guaranteed by the corresponding C code.
531 let idev = unsafe { container_of!(dev.as_raw(), bindings::i2c_client, dev) };
533 // SAFETY: `idev` is a valid pointer to a `struct i2c_client`.
547 /// This type represents the registration of a [`struct i2c_client`]. When an instance of this
553 /// [`struct i2c_client`].
555 pub struct Registration(NonNull<bindings::i2c_client>);
584 // always contains a non-null pointer to an `i2c_client`.
589 // SAFETY: A `Registration` of a `struct i2c_client` can be released from any thread.