Zephyr API 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
Power Domain Protocol

Power domain state management via SCMI . More...

Files

file  power.h
 Header file for the SCMI Power Domain Protocol.
 

Data Structures

struct  scmi_power_state_config
 Describes the parameters for the POWER_STATE_SET command. More...
 

Macros

#define SCMI_POWER_STATE_SET_FLAGS_ASYNC   BIT(0)
 POWER_STATE_SET flag: perform the power state change asynchronously.
 
#define SCMI_POWER_DOMAIN_PROTOCOL_SUPPORTED_VERSION   0x30001
 Version of the SCMI power domain protocol supported by this driver.
 

Functions

int scmi_power_state_set (struct scmi_power_state_config *cfg)
 Send the POWER_STATE_SET command and get its reply.
 
int scmi_power_state_get (uint32_t domain_id, uint32_t *power_state)
 Query the power domain state.
 

SCMI power domain state parameters

#define SCMI_POWER_STATE_TYPE_SHIFT   30U
 Power state type field bit shift.
 
#define SCMI_POWER_STATE_ID_MASK   (BIT(28) - 1)
 Power state ID field mask.
 
#define SCMI_POWER_STATE_PARAM(type, id)
 Construct SCMI power state parameter.
 

SCMI power domain generic states

#define SCMI_POWER_STATE_GENERIC_ON   SCMI_POWER_STATE_PARAM(0, 0)
 Power domain is in ON state.
 
#define SCMI_POWER_STATE_GENERIC_OFF   SCMI_POWER_STATE_PARAM(1, 0)
 Power domain is in OFF state.
 

Detailed Description

Power domain state management via SCMI .

Macro Definition Documentation

◆ SCMI_POWER_DOMAIN_PROTOCOL_SUPPORTED_VERSION

#define SCMI_POWER_DOMAIN_PROTOCOL_SUPPORTED_VERSION   0x30001

#include <zephyr/drivers/firmware/scmi/power.h>

Version of the SCMI power domain protocol supported by this driver.

◆ SCMI_POWER_STATE_GENERIC_OFF

#define SCMI_POWER_STATE_GENERIC_OFF   SCMI_POWER_STATE_PARAM(1, 0)

#include <zephyr/drivers/firmware/scmi/power.h>

Power domain is in OFF state.

◆ SCMI_POWER_STATE_GENERIC_ON

#define SCMI_POWER_STATE_GENERIC_ON   SCMI_POWER_STATE_PARAM(0, 0)

#include <zephyr/drivers/firmware/scmi/power.h>

Power domain is in ON state.

◆ SCMI_POWER_STATE_ID_MASK

#define SCMI_POWER_STATE_ID_MASK   (BIT(28) - 1)

#include <zephyr/drivers/firmware/scmi/power.h>

Power state ID field mask.

◆ SCMI_POWER_STATE_PARAM

#define SCMI_POWER_STATE_PARAM ( type,
id )

#include <zephyr/drivers/firmware/scmi/power.h>

Value:
((((type) & BIT(0)) << SCMI_POWER_STATE_TYPE_SHIFT) | \
#define SCMI_POWER_STATE_TYPE_SHIFT
Power state type field bit shift.
Definition power.h:37
#define SCMI_POWER_STATE_ID_MASK
Power state ID field mask.
Definition power.h:40
#define BIT(n)
Unsigned integer with bit position n set (signed in assembly language).
Definition util_macro.h:44

Construct SCMI power state parameter.

Parameters
typePower state type
idPower state ID

◆ SCMI_POWER_STATE_SET_FLAGS_ASYNC

#define SCMI_POWER_STATE_SET_FLAGS_ASYNC   BIT(0)

#include <zephyr/drivers/firmware/scmi/power.h>

POWER_STATE_SET flag: perform the power state change asynchronously.

◆ SCMI_POWER_STATE_TYPE_SHIFT

#define SCMI_POWER_STATE_TYPE_SHIFT   30U

#include <zephyr/drivers/firmware/scmi/power.h>

Power state type field bit shift.

Function Documentation

◆ scmi_power_state_get()

int scmi_power_state_get ( uint32_t domain_id,
uint32_t * power_state )

#include <zephyr/drivers/firmware/scmi/power.h>

Query the power domain state.

Parameters
domain_idID of the power domain for which the query is done
power_statePointer to be set via this command
Returns
0 on success, negative errno value on failure.

◆ scmi_power_state_set()

int scmi_power_state_set ( struct scmi_power_state_config * cfg)

#include <zephyr/drivers/firmware/scmi/power.h>

Send the POWER_STATE_SET command and get its reply.

Parameters
cfgPointer to structure containing configuration to be set
Returns
0 on success, negative errno value on failure.