Please enable JavaScript.
Coggle requires JavaScript to display documents.
struct ucsi (ucsi.c) (struct ucsi_connector *connector (ucsi.c) (struct…
struct ucsi (ucsi.c)
-
-
struct ucsi_capability *cap
/ Data structure filled by PPM in response to GET_CAPABILITY command. /
struct ucsi_capability {
u32 attributes;
#define UCSI_CAP_ATTR_DISABLE_STATE BIT(0)
#define UCSI_CAP_ATTR_BATTERY_CHARGING BIT(1)
#define UCSI_CAP_ATTR_USB_PD BIT(2)
#define UCSI_CAP_ATTR_TYPEC_CURRENT BIT(6)
#define UCSI_CAP_ATTR_POWER_AC_SUPPLY BIT(8)
#define UCSI_CAP_ATTR_POWER_OTHER BIT(10)
#define UCSI_CAP_ATTR_POWER_VBUS BIT(14)
u32 num_connectors:8;
u32 features:24;
#define UCSI_CAP_SET_UOM BIT(0)
#define UCSI_CAP_SET_PDM BIT(1)
#define UCSI_CAP_ALT_MODE_DETAILS BIT(2)
#define UCSI_CAP_ALT_MODE_OVERRIDE BIT(3)
#define UCSI_CAP_PDO_DETAILS BIT(4)
#define UCSI_CAP_CABLE_DETAILS BIT(5)
#define UCSI_CAP_EXT_SUPPLY_NOTIFICATIONS BIT(6)
#define UCSI_CAP_PD_RESET BIT(7)
u8 num_alt_modes;
u8 reserved;
u16 bc_version;
u16 pd_version;
u16 typec_version;
} __packed;
-
struct ucsi_ppm *ppm
struct ucsi_ppm {
struct ucsi_data data;
int (cmd)(struct ucsi_ppm , struct ucsi_control );
int (sync)(struct ucsi_ppm ); };
struct ucsi_data {
u16 version;
u16 reserved;
union {
u32 raw_cci;
struct ucsi_cci cci;
};
struct ucsi_control ctrl;
u32 message_in[4];
u32 message_out[4];
} __packed;
struct ucsi_control ctrl61 struct ucsi_control {
union {
u64 raw_cmd;
struct ucsi_command cmd;
struct ucsi_uor_cmd uor;
struct ucsi_ack_cmd ack;
struct ucsi_con_rst con_rst;
};
};
/ Set USB Operation Mode Command structure / struct ucsi_uor_cmd {
u8 cmd;
u8 length;
u16 con_num:7;
u16 role:3;
#define UCSI_UOR_ROLE_DFP BIT(0)
#define UCSI_UOR_ROLE_UFP BIT(1)
#define UCSI_UOR_ROLE_DRP BIT(2)
u16:6; / reserved /
} __packed;
/ ACK Command structure /
struct ucsi_ack_cmd {
u8 cmd;
u8 length;
u8 cci_ack:1;
u8 cmd_ack:1;
u8:6; / reserved /
} __packed;
/ Default fields in CONTROL data structure /
struct ucsi_command {
u8 cmd;
u8 length;
u64 data:48;
} __packed;
/ Connector Reset Command structure /
struct ucsi_con_rst {
u8 cmd;
u8 length;
u8 con_num:7;
u8 hard_reset:1;
} __packed;
/ Command Status and Connector Change Indication (CCI) data structure /
struct ucsi_cci {
u8:1; / reserved /
u8 connector_change:7;
u8 data_length;
u16:9; / reserved /
u16 not_supported:1;
u16 cancel_complete:1;
u16 reset_complete:1;
u16 busy:1;
u16 ack_complete:1;
u16 error:1;
u16 cmd_complete:1;
} __packed;
-