fuchsia.hardware.power

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.

Added: HEAD

PROTOCOLS

Device

Defined in fuchsia.hardware.power/power.fidl

GetCurrentVoltage

Get current voltage in uV.

Request

NameType
index uint32

Response

NameType
payload Device_GetCurrentVoltage_Result

GetPowerDomainStatus

Get power domain status

Request

<EMPTY>

Response

NameType
payload Device_GetPowerDomainStatus_Result

GetSupportedVoltageRange

Get Supported Voltage Range. min and max are in micorVolts(uV)

Request

<EMPTY>

Response

NameType
payload Device_GetSupportedVoltageRange_Result

ReadPmicCtrlReg

Read ctrl register of PMIC

Request

NameType
reg_addr uint32

Response

NameType
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

NameType
min_needed_voltage uint32
max_supported_voltage uint32

Response

NameType
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

NameType
voltage uint32

Response

NameType
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

NameType
payload Device_UnregisterPowerDomain_Result

WritePmicCtrlReg

Write to ctrl register of PMIC

Request

NameType
reg_addr uint32
value uint32

Response

NameType
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

NameType
payload PowerTokenProvider_GetToken_Result

STRUCTS

ComponentPowerConfiguration

Defined in fuchsia.hardware.power/config.fidl

The configuration for a component's power elements.

FieldTypeDescriptionDefault
power_elements vector<PowerElementConfiguration>[32] No default

Device_GetCurrentVoltage_Response

Defined in fuchsia.hardware.power/power.fidl

FieldTypeDescriptionDefault
current_voltage uint32 No default

Device_GetPowerDomainStatus_Response

Defined in fuchsia.hardware.power/power.fidl

FieldTypeDescriptionDefault
status PowerDomainStatus No default

Device_GetSupportedVoltageRange_Response

Defined in fuchsia.hardware.power/power.fidl

FieldTypeDescriptionDefault
min uint32 No default
max uint32 No default

Device_ReadPmicCtrlReg_Response

Defined in fuchsia.hardware.power/power.fidl

FieldTypeDescriptionDefault
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

FieldTypeDescriptionDefault
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

FieldTypeDescriptionDefault
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.

NameValueDescription
1

PowerDomainStatus strict

Type: uint8

Defined in fuchsia.hardware.power/power.fidl

NameValueDescription
1
2

RequirementType strict

Type: uint32

Defined in fuchsia.hardware.power/config.fidl

NameValueDescription
1
2

SagElement strict

Type: uint32

Defined in fuchsia.hardware.power/config.fidl

NameValueDescription
1
2
3
4

TABLES

Domain

Defined in fuchsia.hardware.power/metadata.fidl

Information related to a power domain.

OrdinalFieldTypeDescription
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.

OrdinalFieldTypeDescription
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 PowerElements.

OrdinalFieldTypeDescription
child_level uint8
parent_level uint8

PowerDependency

Defined in fuchsia.hardware.power/config.fidl

Describes the relationship between the PowerLevels of two PowerElements. child is the name of the PowerElement which has PowerLevels that depend on parent.

  • child is the name for a PowerElement which a driver owns.
  • parent is the name for a PowerElement which a driver has access to
  • level_deps is the map of level dependencies from child to parent.

OrdinalFieldTypeDescription
child string[63]
parent ParentElement
level_deps vector<LevelTuple>[128]
strength RequirementType

PowerElement

Defined in fuchsia.hardware.power/config.fidl

Set of PowerLevels and a human-readable identifier. A PowerLevel itself contains information about valid transitions out of that level.

OrdinalFieldTypeDescription
name string[63]
levels vector<PowerLevel>[128]

PowerElementConfiguration

Defined in fuchsia.hardware.power/config.fidl

Contains the PowerElement description and any dependencies it has on other PowerElements.

OrdinalFieldTypeDescription
element PowerElement
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 this PowerLevel.
  • name is a human-readable label for this PowerLevel, used only for debugging.
  • transitions describes the levels that are valid transitions from this PowerLevel.

OrdinalFieldTypeDescription
level uint8
name string[63]
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.

OrdinalFieldTypeDescription
target_level uint8
latency_us uint32

UNIONS

Device_GetCurrentVoltage_Result strict

Defined in fuchsia.hardware.power/power.fidl

OrdinalVariantTypeDescription
response Device_GetCurrentVoltage_Response
err zx/Status

Device_GetPowerDomainStatus_Result strict

Defined in fuchsia.hardware.power/power.fidl

OrdinalVariantTypeDescription
response Device_GetPowerDomainStatus_Response
err zx/Status

Device_GetSupportedVoltageRange_Result strict

Defined in fuchsia.hardware.power/power.fidl

OrdinalVariantTypeDescription
response Device_GetSupportedVoltageRange_Response
err zx/Status

Device_ReadPmicCtrlReg_Result strict

Defined in fuchsia.hardware.power/power.fidl

OrdinalVariantTypeDescription
response Device_ReadPmicCtrlReg_Response
err zx/Status

Device_RegisterPowerDomain_Result strict

Defined in fuchsia.hardware.power/power.fidl

OrdinalVariantTypeDescription
response Device_RegisterPowerDomain_Response
err zx/Status

Device_RequestVoltage_Result strict

Defined in fuchsia.hardware.power/power.fidl

OrdinalVariantTypeDescription
response Device_RequestVoltage_Response
err zx/Status

Device_UnregisterPowerDomain_Result strict

Defined in fuchsia.hardware.power/power.fidl

OrdinalVariantTypeDescription
response Device_UnregisterPowerDomain_Response
err zx/Status

Device_WritePmicCtrlReg_Result strict

Defined in fuchsia.hardware.power/power.fidl

OrdinalVariantTypeDescription
response Device_WritePmicCtrlReg_Response
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.

OrdinalVariantTypeDescription
sag SagElement

The parent element is one of SAG's elements and the access token should be obtained from the appropriate SAG-related protocol.

instance_name string[63]

The parent element's access token should be available from /svc/fuchsia.hardware.power.PowerTokenProvider/{instance_name}.

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

OrdinalVariantTypeDescription
response PowerTokenProvider_GetToken_Response
err zx/Status
framework_err internal

CONSTANTS

NameValueTypeDescription
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

NameTypeTransport
token_provider fuchsia.hardware.power/PowerTokenProvider Channel

Service

Defined in fuchsia.hardware.power/power.fidl

NameTypeTransport
device fuchsia.hardware.power/Device Channel