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

SCMI pinctrl protocol helpers. More...

Go to the source code of this file.

Data Structures

struct  scmi_pinctrl_settings
 Describes the parameters for the PINCTRL_SETTINGS_CONFIGURE command. More...
 

Macros

#define ARM_SCMI_PINCTRL_MAX_CONFIG_SIZE   (10 * 2)
 
#define SCMI_PINCTRL_NO_FUNCTION   0xFFFFFFFF
 
#define SCMI_PINCTRL_CONFIG_ATTRIBUTES(fid_valid, cfg_num, selector)
 
#define SCMI_PINCTRL_SELECTOR_PIN   0x0
 
#define SCMI_PINCTRL_SELECTOR_GROUP   0x1
 
#define SCMI_PINCTRL_ATTRIBUTES_CONFIG_NUM(attributes)
 

Enumerations

enum  scmi_pinctrl_message {
  SCMI_PINCTRL_MSG_PROTOCOL_VERSION = 0x0 , SCMI_PINCTRL_MSG_PROTOCOL_ATTRIBUTES = 0x1 , SCMI_PINCTRL_MSG_PROTOCOL_MESSAGE_ATTRIBUTES = 0x2 , SCMI_PINCTRL_MSG_PINCTRL_ATTRIBUTES = 0x3 ,
  SCMI_PINCTRL_MSG_PINCTRL_LIST_ASSOCIATIONS = 0x4 , SCMI_PINCTRL_MSG_PINCTRL_SETTINGS_GET = 0x5 , SCMI_PINCTRL_MSG_PINCTRL_SETTINGS_CONFIGURE = 0x6 , SCMI_PINCTRL_MSG_PINCTRL_REQUEST = 0x7 ,
  SCMI_PINCTRL_MSG_PINCTRL_RELEASE = 0x8 , SCMI_PINCTRL_MSG_PINCTRL_NAME_GET = 0x9 , SCMI_PINCTRL_MSG_PINCTRL_SET_PERMISSIONS = 0xa , SCMI_PINCTRL_MSG_NEGOTIATE_PROTOCOL_VERSION = 0x10
}
 Pinctrl protocol command message IDs. More...
 
enum  scmi_pinctrl_config {
  SCMI_PINCTRL_DEFAULT = 0 , SCMI_PINCTRL_BIAS_BUS_HOLD = 1 , SCMI_PINCTRL_BIAS_DISABLE = 2 , SCMI_PINCTRL_BIAS_HIGH_Z = 3 ,
  SCMI_PINCTRL_BIAS_PULL_UP = 4 , SCMI_PINCTRL_BIAS_PULL_DEFAULT = 5 , SCMI_PINCTRL_BIAS_PULL_DOWN = 6 , SCMI_PINCTRL_DRIVE_OPEN_DRAIN = 7 ,
  SCMI_PINCTRL_DRIVE_OPEN_SOURCE = 8 , SCMI_PCINTRL_DRIVE_PUSH_PULL = 9 , SCMI_PCINTRL_DRIVE_STRENGTH = 10 , SCMI_PINCTRL_INPUT_DEBOUNCE = 11 ,
  SCMI_PINCTRL_INPUT_MODE = 12 , SCMI_PINCTRL_PULL_MODE = 13 , SCMI_PINCTRL_INPUT_VALUE = 14 , SCMI_PINCTRL_INPUT_SCHMITT = 15 ,
  SCMI_PINCTRL_LP_MODE = 16 , SCMI_PINCTRL_OUTPUT_MODE = 17 , SCMI_PINCTRL_OUTPUT_VALUE = 18 , SCMI_PINCTRL_POWER_SOURCE = 19 ,
  SCMI_PINCTRL_SLEW_RATE = 20 , SCMI_PINCTRL_RESERVED_START = 21 , SCMI_PINCTRL_RESERVED_END = 191 , SCMI_PINCTRL_VENDOR_START = 192
}
 Pinctrl configurations. More...
 

Functions

int scmi_pinctrl_settings_configure (struct scmi_pinctrl_settings *settings)
 Send the PINCTRL_SETTINGS_CONFIGURE command and get its reply.
 

Detailed Description

SCMI pinctrl protocol helpers.

Macro Definition Documentation

◆ ARM_SCMI_PINCTRL_MAX_CONFIG_SIZE

#define ARM_SCMI_PINCTRL_MAX_CONFIG_SIZE   (10 * 2)

◆ SCMI_PINCTRL_ATTRIBUTES_CONFIG_NUM

#define SCMI_PINCTRL_ATTRIBUTES_CONFIG_NUM ( attributes)
Value:
(((attributes) & GENMASK(9, 2)) >> 2)
#define GENMASK(h, l)
Create a contiguous bitmask starting at bit position l and ending at position h.
Definition util.h:79

◆ SCMI_PINCTRL_CONFIG_ATTRIBUTES

#define SCMI_PINCTRL_CONFIG_ATTRIBUTES ( fid_valid,
cfg_num,
selector )
Value:
(SCMI_FIELD_MAKE(fid_valid, BIT(1), 10) | \
SCMI_FIELD_MAKE(cfg_num, GENMASK(7, 0), 2) | \
SCMI_FIELD_MAKE(selector, GENMASK(1, 0), 0))
#define SCMI_FIELD_MAKE(x, mask, shift)
Create an SCMI message field.
Definition util.h:264
#define BIT(n)
Unsigned integer with bit position n set (signed in assembly language).
Definition util_macro.h:44

◆ SCMI_PINCTRL_NO_FUNCTION

#define SCMI_PINCTRL_NO_FUNCTION   0xFFFFFFFF

◆ SCMI_PINCTRL_SELECTOR_GROUP

#define SCMI_PINCTRL_SELECTOR_GROUP   0x1

◆ SCMI_PINCTRL_SELECTOR_PIN

#define SCMI_PINCTRL_SELECTOR_PIN   0x0

Enumeration Type Documentation

◆ scmi_pinctrl_config

Pinctrl configurations.

Enumerator
SCMI_PINCTRL_DEFAULT 
SCMI_PINCTRL_BIAS_BUS_HOLD 
SCMI_PINCTRL_BIAS_DISABLE 
SCMI_PINCTRL_BIAS_HIGH_Z 
SCMI_PINCTRL_BIAS_PULL_UP 
SCMI_PINCTRL_BIAS_PULL_DEFAULT 
SCMI_PINCTRL_BIAS_PULL_DOWN 
SCMI_PINCTRL_DRIVE_OPEN_DRAIN 
SCMI_PINCTRL_DRIVE_OPEN_SOURCE 
SCMI_PCINTRL_DRIVE_PUSH_PULL 
SCMI_PCINTRL_DRIVE_STRENGTH 
SCMI_PINCTRL_INPUT_DEBOUNCE 
SCMI_PINCTRL_INPUT_MODE 
SCMI_PINCTRL_PULL_MODE 
SCMI_PINCTRL_INPUT_VALUE 
SCMI_PINCTRL_INPUT_SCHMITT 
SCMI_PINCTRL_LP_MODE 
SCMI_PINCTRL_OUTPUT_MODE 
SCMI_PINCTRL_OUTPUT_VALUE 
SCMI_PINCTRL_POWER_SOURCE 
SCMI_PINCTRL_SLEW_RATE 
SCMI_PINCTRL_RESERVED_START 
SCMI_PINCTRL_RESERVED_END 
SCMI_PINCTRL_VENDOR_START 

◆ scmi_pinctrl_message

Pinctrl protocol command message IDs.

Enumerator
SCMI_PINCTRL_MSG_PROTOCOL_VERSION 
SCMI_PINCTRL_MSG_PROTOCOL_ATTRIBUTES 
SCMI_PINCTRL_MSG_PROTOCOL_MESSAGE_ATTRIBUTES 
SCMI_PINCTRL_MSG_PINCTRL_ATTRIBUTES 
SCMI_PINCTRL_MSG_PINCTRL_LIST_ASSOCIATIONS 
SCMI_PINCTRL_MSG_PINCTRL_SETTINGS_GET 
SCMI_PINCTRL_MSG_PINCTRL_SETTINGS_CONFIGURE 
SCMI_PINCTRL_MSG_PINCTRL_REQUEST 
SCMI_PINCTRL_MSG_PINCTRL_RELEASE 
SCMI_PINCTRL_MSG_PINCTRL_NAME_GET 
SCMI_PINCTRL_MSG_PINCTRL_SET_PERMISSIONS 
SCMI_PINCTRL_MSG_NEGOTIATE_PROTOCOL_VERSION 

Function Documentation

◆ scmi_pinctrl_settings_configure()

int scmi_pinctrl_settings_configure ( struct scmi_pinctrl_settings * settings)

Send the PINCTRL_SETTINGS_CONFIGURE command and get its reply.

Parameters
settingspointer to settings to be applied
Return values
0if successful
negativeerrno if failure