pub enum OdpmDeviceRequest {
GetRailMetadata {
responder: OdpmDeviceGetRailMetadataResponder,
},
GetAvailableRails {
responder: OdpmDeviceGetAvailableRailsResponder,
},
SetChannelRail {
channel_id: u32,
rail_name: String,
responder: OdpmDeviceSetChannelRailResponder,
},
GetPowerWatts {
payload: Options,
responder: OdpmDeviceGetPowerWattsResponder,
},
GetCurrentAmperes {
payload: Options,
responder: OdpmDeviceGetCurrentAmperesResponder,
},
GetEnergyJoules {
payload: Options,
responder: OdpmDeviceGetEnergyJoulesResponder,
},
SetPollingConfig {
payload: PollingConfig,
responder: OdpmDeviceSetPollingConfigResponder,
},
GetPollingConfig {
responder: OdpmDeviceGetPollingConfigResponder,
},
ResetPollingConfig {
responder: OdpmDeviceResetPollingConfigResponder,
},
#[non_exhaustive] _UnknownMethod {
ordinal: u64,
control_handle: OdpmDeviceControlHandle,
method_type: MethodType,
},
}Expand description
Provides power and power-related measurements for all actively-monitored rails, dynamic rail multiplexing, and configuration for the ODPM driver’s hardware polling loop.
Variants§
GetRailMetadata
Returns metadata for all actively-monitored rails.
Fields
responder: OdpmDeviceGetRailMetadataResponderGetAvailableRails
Returns metadata for all available power rails supported by the hardware (both actively-monitored and unmonitored).
measurement_startis reported for rails that are actively monitored or were previously monitored.measurement_stopandenergy_ujare reported only for rails that have been swapped out, retaining only the most recent completed measurement window (rather than an entry per session or an aggregate across sessions). If a stopped rail is swapped back onto an active channel, its previous stopped reading (measurement_stopandenergy_uj) is cleared and a new measurement window begins.
Returns ZX_ERR_INTERNAL if internal rail state cannot be retrieved.
Fields
responder: OdpmDeviceGetAvailableRailsResponderSetChannelRail
Reconfigures an internal telemetry channel (channel_id) to monitor rail_name
(matched case-insensitively against name, regulator_name, or schematic_name).
The new assignment is visible to all clients: readings for channel_id from
GetPowerWatts, GetCurrentAmperes, and GetEnergyJoules then refer to rail_name
and restart from a new measurement window. Clients that cache GetRailMetadata can
detect the change by re-querying it and comparing name or measurement_start.
Returns:
ZX_OK(as a no-op) ifchannel_idis already actively monitoringrail_name.ZX_ERR_NOT_FOUNDifrail_namedoes not match any available rail.ZX_ERR_INVALID_ARGSifchannel_idis invalid, is an external shunt channel, or if the requested rail is an external shunt rail or belongs to a different PMIC thanchannel_id.ZX_ERR_ALREADY_BOUNDif the requested rail is already monitored on a different active channel.ZX_ERR_UNAVAILABLEif the hardware operation fails.ZX_ERR_INTERNALif an internal driver error occurs.
GetPowerWatts
Returns the power consumption for all actively-monitored rails.
Returns ZX_ERR_NOT_SUPPORTED if the requested measurement type is not supported.
Returns ZX_ERR_UNAVAILABLE if the hardware read fails.
Returns ZX_ERR_INTERNAL if internal rail state is inconsistent.
GetCurrentAmperes
Returns the current for all actively-monitored rails.
Returns ZX_ERR_NOT_SUPPORTED if the requested measurement type is not supported.
Returns ZX_ERR_UNAVAILABLE if the hardware read fails.
Returns ZX_ERR_INTERNAL if internal rail state is inconsistent.
GetEnergyJoules
Returns the energy consumption for all actively-monitored rails.
Returns ZX_ERR_NOT_SUPPORTED if the requested measurement type is not supported.
Returns ZX_ERR_UNAVAILABLE if the hardware read fails.
Returns ZX_ERR_INTERNAL if internal rail state is inconsistent.
SetPollingConfig
Overrides polling configuration parameters. Any omitted fields in PollingConfig
remain unchanged.
Returns ZX_ERR_INVALID_ARGS if poll_interval is less than MIN_POLL_INTERVAL or
polls_per_series_entry == 0.
GetPollingConfig
Retrieves the current polling configuration parameters.
Fields
responder: OdpmDeviceGetPollingConfigResponderResetPollingConfig
Resets polling configuration parameters to the driver’s default values.
Fields
responder: OdpmDeviceResetPollingConfigResponder#[non_exhaustive]_UnknownMethod
An interaction was received which does not match any known method.
Fields
This variant is marked as non-exhaustive
control_handle: OdpmDeviceControlHandlemethod_type: MethodTypeImplementations§
Source§impl OdpmDeviceRequest
impl OdpmDeviceRequest
pub fn into_get_rail_metadata( self, ) -> Option<OdpmDeviceGetRailMetadataResponder>
pub fn into_get_available_rails( self, ) -> Option<OdpmDeviceGetAvailableRailsResponder>
pub fn into_set_channel_rail( self, ) -> Option<(u32, String, OdpmDeviceSetChannelRailResponder)>
pub fn into_get_power_watts( self, ) -> Option<(Options, OdpmDeviceGetPowerWattsResponder)>
pub fn into_get_current_amperes( self, ) -> Option<(Options, OdpmDeviceGetCurrentAmperesResponder)>
pub fn into_get_energy_joules( self, ) -> Option<(Options, OdpmDeviceGetEnergyJoulesResponder)>
pub fn into_set_polling_config( self, ) -> Option<(PollingConfig, OdpmDeviceSetPollingConfigResponder)>
pub fn into_get_polling_config( self, ) -> Option<OdpmDeviceGetPollingConfigResponder>
pub fn into_reset_polling_config( self, ) -> Option<OdpmDeviceResetPollingConfigResponder>
Sourcepub fn method_name(&self) -> &'static str
pub fn method_name(&self) -> &'static str
Name of the method defined in FIDL