PowerElementConfiguration
and types contained in that struct define
the configuration that drivers can expect from board drivers. This
configuration information is intended to be reflected into the
power management system by the receivers of that configuration.
PowerTokenService
is what drivers should implement to provide their
children with access to the driver's power elements.
PROTOCOLS
Device
Defined in fuchsia.hardware.power/power.fidl
GetCurrentVoltage
Get current voltage in uV.
Request
Name | Type |
---|---|
index |
uint32
|
Response
Name | Type |
---|---|
payload |
Device_GetCurrentVoltage_Result
|
GetPowerDomainStatus
Get power domain status
Request
<EMPTY>
Response
Name | Type |
---|---|
payload |
Device_GetPowerDomainStatus_Result
|
GetSupportedVoltageRange
Get Supported Voltage Range. min and max are in micorVolts(uV)
Request
<EMPTY>
Response
Name | Type |
---|---|
payload |
Device_GetSupportedVoltageRange_Result
|
ReadPmicCtrlReg
Read ctrl register of PMIC
Request
Name | Type |
---|---|
reg_addr |
uint32
|
Response
Name | Type |
---|---|
payload |
Device_ReadPmicCtrlReg_Result
|
RegisterPowerDomain
Register the callee for this power domain. The callee will be registered until UnregisterPowerDomain is called. Any voltage changes to the power domain will be made considering the min_needed_voltage(in uV) and max_supported_voltage(in uV) published here. If voltages mentioned are out of supported voltage range of domain(obtained by calling GetSupportedVoltageRange), the callee will be registered with the supported voltage range.
Request
Name | Type |
---|---|
min_needed_voltage |
uint32
|
max_supported_voltage |
uint32
|
Response
Name | Type |
---|---|
payload |
Device_RegisterPowerDomain_Result
|
RequestVoltage
Request a particular voltage. The actual_voltage is the voltage that the power domain is transitioned to after considering supported voltage ranges of all the registered dependents. "voltage" should be in uV.
Request
Name | Type |
---|---|
voltage |
uint32
|
Response
Name | Type |
---|---|
payload |
Device_RequestVoltage_Result
|
UnregisterPowerDomain
Unregister the callee for this power domain. The callee will no longer be considered as a dependent of this power domain.
Request
<EMPTY>
Response
Name | Type |
---|---|
payload |
Device_UnregisterPowerDomain_Result
|
WritePmicCtrlReg
Write to ctrl register of PMIC
Request
Name | Type |
---|---|
reg_addr |
uint32
|
value |
uint32
|
Response
Name | Type |
---|---|
payload |
Device_WritePmicCtrlReg_Result
|
PowerTokenProvider
Defined in fuchsia.hardware.power/config.fidl
GetToken
Returns a token which can be used with fuchsia.power.broker
APIs to
create a relationship between this driver's power element(s) and the
power element this token is associated with.
Request
<EMPTY>
Response
Name | Type |
---|---|
payload |
PowerTokenProvider_GetToken_Result
|
STRUCTS
ComponentPowerConfiguration
Defined in fuchsia.hardware.power/config.fidl
The configuration for a component's power elements.
Field | Type | Description | Default |
---|---|---|---|
power_elements |
vector<PowerElementConfiguration>[32]
|
No default |
Device_GetCurrentVoltage_Response
Defined in fuchsia.hardware.power/power.fidl
Field | Type | Description | Default |
---|---|---|---|
current_voltage |
uint32
|
No default |
Device_GetPowerDomainStatus_Response
Defined in fuchsia.hardware.power/power.fidl
Field | Type | Description | Default |
---|---|---|---|
status |
PowerDomainStatus
|
No default |
Device_GetSupportedVoltageRange_Response
Defined in fuchsia.hardware.power/power.fidl
Field | Type | Description | Default |
---|---|---|---|
min |
uint32
|
No default | |
max |
uint32
|
No default |
Device_ReadPmicCtrlReg_Response
Defined in fuchsia.hardware.power/power.fidl
Field | Type | Description | Default |
---|---|---|---|
value |
uint32
|
No default |
Device_RegisterPowerDomain_Response
Defined in fuchsia.hardware.power/power.fidl
<EMPTY>
Device_RequestVoltage_Response
Defined in fuchsia.hardware.power/power.fidl
Field | Type | Description | Default |
---|---|---|---|
actual_voltage |
uint32
|
No default |
Device_UnregisterPowerDomain_Response
Defined in fuchsia.hardware.power/power.fidl
<EMPTY>
Device_WritePmicCtrlReg_Response
Defined in fuchsia.hardware.power/power.fidl
<EMPTY>
PowerTokenProvider_GetToken_Response resource
Defined in fuchsia.hardware.power/config.fidl
Field | Type | Description | Default |
---|---|---|---|
handle |
handle<event>
|
No default |
ENUMS
CpuPowerElement strict
Type: uint32
Defined in fuchsia.hardware.power/config.fidl
Represents the power elements related to controlling the CPU. This is an enum with a single variant to add flexibility for future addition of more elements related to CPU power state.
Name | Value | Description |
---|---|---|
CPU |
1 |
PowerDomainStatus strict
Type: uint8
Defined in fuchsia.hardware.power/power.fidl
Name | Value | Description |
---|---|---|
DISABLED |
1 |
|
ENABLED |
2 |
RequirementType strict
Type: uint32
Defined in fuchsia.hardware.power/config.fidl
Name | Value | Description |
---|---|---|
ASSERTIVE |
1 |
|
OPPORTUNISTIC |
2 |
SagElement strict
Type: uint32
Defined in fuchsia.hardware.power/config.fidl
Name | Value | Description |
---|---|---|
EXECUTION_STATE |
1 |
|
EXECUTION_RESUME_LATENCY |
2 |
|
WAKE_HANDLING |
3 |
|
APPLICATION_ACTIVITY |
4 |
TABLES
Domain
Defined in fuchsia.hardware.power/metadata.fidl
Information related to a power domain.
Ordinal | Field | Type | Description |
---|---|---|---|
1 |
id |
uint32
|
Domain ID should be unique across all power domains in the same level. Used to associate power consumers that belong to the same power domain. |
DomainMetadata
Defined in fuchsia.hardware.power/metadata.fidl
Passed to the power core driver in metadata as DEVICE_METADATA_POWER_DOMAINS.
Ordinal | Field | Type | Description |
---|---|---|---|
1 |
domains |
vector<Domain>
|
List of power domains to be managed by this power driver. |
LevelTuple
Defined in fuchsia.hardware.power/config.fidl
Represents a dependency between two power levels of two different
PowerElement
s.
Ordinal | Field | Type | Description |
---|---|---|---|
1 |
child_level |
uint8
|
|
2 |
parent_level |
uint8
|
PowerDependency
Defined in fuchsia.hardware.power/config.fidl
Describes the relationship between the PowerLevel
s of two
PowerElement
s. child
is the name of the PowerElement
which has
PowerLevel
s that depend on parent
.
child
is the name for aPowerElement
which a driver owns.parent
is the name for aPowerElement
which a driver has access tolevel_deps
is the map of level dependencies fromchild
toparent
.
Ordinal | Field | Type | Description |
---|---|---|---|
1 |
child |
string[63]
|
|
2 |
parent |
ParentElement
|
|
3 |
level_deps |
vector<LevelTuple>[128]
|
|
4 |
strength |
RequirementType
|
PowerElement
Defined in fuchsia.hardware.power/config.fidl
Set of PowerLevel
s and a human-readable identifier. A PowerLevel
itself
contains information about valid transitions out of that level.
Ordinal | Field | Type | Description |
---|---|---|---|
1 |
name |
string[63]
|
|
2 |
levels |
vector<PowerLevel>[128]
|
PowerElementConfiguration
Defined in fuchsia.hardware.power/config.fidl
Contains the PowerElement
description and any dependencies it has on
other PowerElement
s.
Ordinal | Field | Type | Description |
---|---|---|---|
1 |
element |
PowerElement
|
|
2 |
dependencies |
vector<PowerDependency>[128]
|
PowerLevel
Defined in fuchsia.hardware.power/config.fidl
A zero-indexed set of levels that a device can assume.
level
is the zero-indexed level of thisPowerLevel
.name
is a human-readable label for thisPowerLevel
, used only for debugging.transitions
describes the levels that are valid transitions from thisPowerLevel
.
Ordinal | Field | Type | Description |
---|---|---|---|
1 |
level |
uint8
|
|
2 |
name |
string[63]
|
|
3 |
transitions |
vector<Transition>[127]
|
Transition
Defined in fuchsia.hardware.power/config.fidl
The length of time it takes to move to a power level.
target_level
is the power level we're moving to.latency_us
is the time it takes to move to the level in microseconds.
Ordinal | Field | Type | Description |
---|---|---|---|
1 |
target_level |
uint8
|
|
2 |
latency_us |
uint32
|
UNIONS
Device_GetCurrentVoltage_Result strict
Defined in fuchsia.hardware.power/power.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
response |
Device_GetCurrentVoltage_Response
|
|
2 |
err |
zx/Status
|
Device_GetPowerDomainStatus_Result strict
Defined in fuchsia.hardware.power/power.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
response |
Device_GetPowerDomainStatus_Response
|
|
2 |
err |
zx/Status
|
Device_GetSupportedVoltageRange_Result strict
Defined in fuchsia.hardware.power/power.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
response |
Device_GetSupportedVoltageRange_Response
|
|
2 |
err |
zx/Status
|
Device_ReadPmicCtrlReg_Result strict
Defined in fuchsia.hardware.power/power.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
response |
Device_ReadPmicCtrlReg_Response
|
|
2 |
err |
zx/Status
|
Device_RegisterPowerDomain_Result strict
Defined in fuchsia.hardware.power/power.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
response |
Device_RegisterPowerDomain_Response
|
|
2 |
err |
zx/Status
|
Device_RequestVoltage_Result strict
Defined in fuchsia.hardware.power/power.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
response |
Device_RequestVoltage_Response
|
|
2 |
err |
zx/Status
|
Device_UnregisterPowerDomain_Result strict
Defined in fuchsia.hardware.power/power.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
response |
Device_UnregisterPowerDomain_Response
|
|
2 |
err |
zx/Status
|
Device_WritePmicCtrlReg_Result strict
Defined in fuchsia.hardware.power/power.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
response |
Device_WritePmicCtrlReg_Response
|
|
2 |
err |
zx/Status
|
ParentElement strict
Defined in fuchsia.hardware.power/config.fidl
Identifier for an element that is another element's parent, in other words an element that the other element depends upon.
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
sag |
SagElement
|
The parent element is one of SAG's elements and the access token should be obtained from the appropriate SAG-related protocol. |
2 |
instance_name |
string[63]
|
The parent element's access token should be available from
|
3 |
cpu_control |
CpuPowerElement
|
The parent element comes from the fuchsia.power.system/CpuElementManager protocol. |
PowerTokenProvider_GetToken_Result strict resource
Defined in fuchsia.hardware.power/config.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
response |
PowerTokenProvider_GetToken_Response
|
|
2 |
err |
zx/Status
|
|
3 |
framework_err |
internal
|
CONSTANTS
Name | Value | Type | Description |
---|---|---|---|
MAX_DEPENDENCIES |
128
|
uint16 |
|
MAX_LEVELS |
128
|
uint16 |
Should be MAX_TRANSITIONS + 1 |
MAX_NAME_LENGTH |
63
|
uint16 |
|
MAX_POWER_ELEMENTS |
32
|
uint16 |
|
MAX_TRANSITIONS |
127
|
uint16 |
This means we could have up to 128 power levels, which seems like more than enough. |
SERVICES
PowerTokenService
Defined in fuchsia.hardware.power/config.fidl
Name | Type | Transport |
---|---|---|
token_provider |
fuchsia.hardware.power/PowerTokenProvider
|
Channel |
Service
Defined in fuchsia.hardware.power/power.fidl
Name | Type | Transport |
---|---|---|
device |
fuchsia.hardware.power/Device
|
Channel |