Lines Matching defs:I2cClient

160         let idev = unsafe { &*idev.cast::<I2cClient<device::CoreInternal>>() };
175 let idev = unsafe { &*idev.cast::<I2cClient<device::CoreInternal>>() };
178 // `probe_callback`, hence it's guaranteed that `I2cClient::set_drvdata()` has been called
187 let idev = unsafe { &*idev.cast::<I2cClient<device::CoreInternal>>() };
205 fn i2c_id_info(dev: &I2cClient) -> Option<&'static <Self as driver::Adapter>::IdInfo> {
302 /// _idev: &i2c::I2cClient<Core>,
308 /// fn shutdown(_idev: &i2c::I2cClient<Core>, this: Pin<&Self>) {
335 dev: &I2cClient<device::Core>,
342 /// [`I2cClient`] into a safe state. Implementing this callback is optional.
350 fn shutdown(dev: &I2cClient<device::Core>, this: Pin<&Self>) {
356 /// Called when the [`I2cClient`] is unbound from its bound [`Driver`]. Implementing this
364 fn unbind(dev: &I2cClient<device::Core>, this: Pin<&Self>) {
468 /// A [`I2cClient`] instance represents a valid `struct i2c_client` created by the C portion of
471 pub struct I2cClient<Ctx: device::DeviceContext = device::Normal>(
476 impl<Ctx: device::DeviceContext> I2cClient<Ctx> {
482 // SAFETY: `I2cClient` is a transparent wrapper of `struct i2c_client`.
483 // The offset is guaranteed to point to a valid device field inside `I2cClient`.
484 unsafe impl<Ctx: device::DeviceContext> device::AsBusDevice<Ctx> for I2cClient<Ctx> {
488 // SAFETY: `I2cClient` is a transparent wrapper of a type that doesn't depend on
489 // `I2cClient`'s generic argument.
490 kernel::impl_device_context_deref!(unsafe { I2cClient });
491 kernel::impl_device_context_into_aref!(I2cClient);
493 // SAFETY: Instances of `I2cClient` are always reference-counted.
494 unsafe impl AlwaysRefCounted for I2cClient {
506 impl<Ctx: device::DeviceContext> AsRef<device::Device<Ctx>> for I2cClient<Ctx> {
518 impl<Ctx: device::DeviceContext> TryFrom<&device::Device<Ctx>> for &I2cClient<Ctx> {
538 // SAFETY: A `I2cClient` is always reference-counted and can be released from any thread.
539 unsafe impl Send for I2cClient {}
541 // SAFETY: `I2cClient` can be shared among threads because all methods of `I2cClient`
542 // (i.e. `I2cClient<Normal>) are thread safe.
543 unsafe impl Sync for I2cClient {}