Zephyr API Documentation 4.3.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
power.h File Reference

SCMI power domain protocol helpers. More...

Go to the source code of this file.

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

Enumerations

enum  scmi_power_domain_message {
  SCMI_POWER_DOMAIN_MSG_PROTOCOL_VERSION = 0x0 , SCMI_POWER_DOMAIN_MSG_PROTOCOL_ATTRIBUTES = 0x1 , SCMI_POWER_DOMAIN_MSG_PROTOCOL_MESSAGE_ATTRIBUTES = 0x2 , SCMI_POWER_DOMAIN_MSG_POWER_DOMAIN_ATTRIBUTES = 0x3 ,
  SCMI_POWER_DOMAIN_MSG_POWER_STATE_SET = 0x4 , SCMI_POWER_DOMAIN_MSG_POWER_STATE_GET = 0x5 , SCMI_POWER_DOMAIN_MSG_POWER_STATE_NOTIFY = 0x6 , SCMI_POWER_DOMAIN_MSG_POWER_STATE_CHANGE_REQEUSTED_NOTIFY = 0x7 ,
  SCMI_POWER_DOMAIN_MSG_POWER_DOMAIN_NAME_GET = 0x8 , SCMI_POWER_DOMAIN_MSG_NEGOTIATE_PROTOCOL_VERSION = 0x10
}
 Power domain protocol command message IDs. More...

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.

Detailed Description

SCMI power domain protocol helpers.

Macro Definition Documentation

◆ SCMI_POWER_STATE_GENERIC_OFF

#define SCMI_POWER_STATE_GENERIC_OFF   SCMI_POWER_STATE_PARAM(1, 0)

Power domain is in OFF state.

◆ SCMI_POWER_STATE_GENERIC_ON

#define SCMI_POWER_STATE_GENERIC_ON   SCMI_POWER_STATE_PARAM(0, 0)

Power domain is in ON state.

◆ SCMI_POWER_STATE_ID_MASK

#define SCMI_POWER_STATE_ID_MASK   (BIT(28) - 1)

Power state ID field mask.

◆ SCMI_POWER_STATE_PARAM

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

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)

◆ SCMI_POWER_STATE_TYPE_SHIFT

#define SCMI_POWER_STATE_TYPE_SHIFT   30U

Power state type field bit shift.

Enumeration Type Documentation

◆ scmi_power_domain_message

Power domain protocol command message IDs.

Enumerator
SCMI_POWER_DOMAIN_MSG_PROTOCOL_VERSION 
SCMI_POWER_DOMAIN_MSG_PROTOCOL_ATTRIBUTES 
SCMI_POWER_DOMAIN_MSG_PROTOCOL_MESSAGE_ATTRIBUTES 
SCMI_POWER_DOMAIN_MSG_POWER_DOMAIN_ATTRIBUTES 
SCMI_POWER_DOMAIN_MSG_POWER_STATE_SET 
SCMI_POWER_DOMAIN_MSG_POWER_STATE_GET 
SCMI_POWER_DOMAIN_MSG_POWER_STATE_NOTIFY 
SCMI_POWER_DOMAIN_MSG_POWER_STATE_CHANGE_REQEUSTED_NOTIFY 
SCMI_POWER_DOMAIN_MSG_POWER_DOMAIN_NAME_GET 
SCMI_POWER_DOMAIN_MSG_NEGOTIATE_PROTOCOL_VERSION 

Function Documentation

◆ scmi_power_state_get()

int scmi_power_state_get ( uint32_t domain_id,
uint32_t * power_state )

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
Return values
0if successful
negativeerrno if failure

◆ scmi_power_state_set()

int scmi_power_state_set ( struct scmi_power_state_config * cfg)

Send the POWER_STATE_SET command and get its reply.

Parameters
cfgpointer to structure containing configuration to be set
Return values
0if successful
negativeerrno if failure