Trait kernel::power::Operations
source · [−]pub trait Operations {
type Data: ForeignOwnable + Sync + Send;
fn suspend(_data: <Self::Data as ForeignOwnable>::Borrowed<'_>) -> Result { ... }
fn resume(_data: <Self::Data as ForeignOwnable>::Borrowed<'_>) -> Result { ... }
fn freeze(_data: <Self::Data as ForeignOwnable>::Borrowed<'_>) -> Result { ... }
fn restore(_data: <Self::Data as ForeignOwnable>::Borrowed<'_>) -> Result { ... }
}
Expand description
Corresponds to the kernel’s struct dev_pm_ops
.
It is meant to be implemented by drivers that support power-management operations.
Required Associated Types
sourcetype Data: ForeignOwnable + Sync + Send
type Data: ForeignOwnable + Sync + Send
The type of the context data stored by the driver on each device.
Provided Methods
sourcefn suspend(_data: <Self::Data as ForeignOwnable>::Borrowed<'_>) -> Result
fn suspend(_data: <Self::Data as ForeignOwnable>::Borrowed<'_>) -> Result
Called before the system goes into a sleep state.
sourcefn resume(_data: <Self::Data as ForeignOwnable>::Borrowed<'_>) -> Result
fn resume(_data: <Self::Data as ForeignOwnable>::Borrowed<'_>) -> Result
Called after the system comes back from a sleep state.