UCSI_CONSTAT
switch (UCSI_CONSTAT(con, PWR_OPMODE)) {
switch (UCSI_CONSTAT(con, PWR_OPMODE)) {
if (!UCSI_CONSTAT(con, CONNECTED)) {
switch (UCSI_CONSTAT(con, PWR_OPMODE)) {
if (!UCSI_CONSTAT(con, CONNECTED)) {
switch (UCSI_CONSTAT(con, PWR_OPMODE)) {
if (UCSI_CONSTAT(con, CONNECTED) &&
UCSI_CONSTAT(con, PWR_OPMODE) == UCSI_CONSTAT_PWR_OPMODE_PD)
if (!(UCSI_CONSTAT(con, CONNECTED))) {
if (UCSI_CONSTAT(con, PWR_DIR) != TYPEC_SINK) {
switch (UCSI_CONSTAT(con, BC_STATUS)) {
bool is_sink = UCSI_CONSTAT(con, PWR_DIR) == TYPEC_SINK;
UCSI_CONSTAT(con, SINK_PATH_STATUS_V2_0) ==
if (UCSI_CONSTAT(con, CONNECTED)) {
if (UCSI_CONSTAT(con, CONNECTED) &&
(UCSI_CONSTAT(con, PWR_DIR) == TYPEC_SINK))
switch (UCSI_CONSTAT(con, PWR_OPMODE)) {
__entry->change = UCSI_CONSTAT(con, CHANGE);
__entry->opmode = UCSI_CONSTAT(con, PWR_OPMODE);
__entry->connected = UCSI_CONSTAT(con, CONNECTED);
__entry->pwr_dir = UCSI_CONSTAT(con, PWR_DIR);
__entry->partner_flags = UCSI_CONSTAT(con, PARTNER_FLAGS);
__entry->partner_type = UCSI_CONSTAT(con, PARTNER_TYPE);
__entry->request_data_obj = UCSI_CONSTAT(con, RDO);
__entry->bc_status = UCSI_CONSTAT(con, BC_STATUS);
if (!UCSI_CONSTAT(con, CONNECTED)) {
switch (UCSI_CONSTAT(con, ORIENTATION)) {
switch (UCSI_CONSTAT(con, PWR_OPMODE)) {
con->rdo = UCSI_CONSTAT(con, RDO);
u8 pwr_opmode = UCSI_CONSTAT(con, PWR_OPMODE);
switch (UCSI_CONSTAT(con, PARTNER_TYPE)) {
UCSI_CONSTAT(con, PARTNER_FLAG_USB4_GEN4))
UCSI_CONSTAT(con, PARTNER_FLAG_USB4_GEN3))
switch (UCSI_CONSTAT(con, PARTNER_TYPE)) {
if (UCSI_CONSTAT(con, CONNECTED)) {
switch (UCSI_CONSTAT(con, PARTNER_TYPE)) {
if (UCSI_CONSTAT(con, PARTNER_FLAG_USB))
if (!(UCSI_CONSTAT(con, PARTNER_FLAG_USB)))
u8 prev_state = UCSI_CONSTAT(con, CONNECTED);
if (UCSI_CONSTAT(con, CONNECTED)) {
change = UCSI_CONSTAT(con, CHANGE);
role = UCSI_CONSTAT(con, PWR_DIR);
if (UCSI_CONSTAT(con, CONNECTED)) {
if (UCSI_CONSTAT(con, PWR_OPMODE) == UCSI_CONSTAT_PWR_OPMODE_PD) {
UCSI_CONSTAT(con, PWR_READING_READY_V2_1)) {
curr_scale = UCSI_CONSTAT(con, CURRENT_SCALE_V2_1);
volt_scale = UCSI_CONSTAT(con, VOLTAGE_SCALE_V2_1);
val = UCSI_CONSTAT(con, PEAK_CURRENT_V2_1);
val = UCSI_CONSTAT(con, AVG_CURRENT_V2_1);
val = UCSI_CONSTAT(con, VBUS_VOLTAGE_V2_1);
partner_type = UCSI_CONSTAT(con, PARTNER_TYPE);
cur_role = UCSI_CONSTAT(con, PWR_DIR);
if (UCSI_CONSTAT(con, PWR_OPMODE) != UCSI_CONSTAT_PWR_OPMODE_PD) {
switch (UCSI_CONSTAT(con, PARTNER_TYPE)) {
if (UCSI_CONSTAT(con, CONNECTED)) {
typec_set_pwr_role(con->port, UCSI_CONSTAT(con, PWR_DIR));
if (!(UCSI_CONSTAT(con, PARTNER_FLAG_USB)))
if (con->partner && UCSI_CONSTAT(con, PWR_OPMODE) == UCSI_CONSTAT_PWR_OPMODE_PD) {
connected = UCSI_CONSTAT(con, CONNECTED);
(UCSI_CONSTAT(con, PWR_DIR) || !is_source(role)))
if (!UCSI_CONSTAT(con, CONNECTED)) {