summaryrefslogtreecommitdiff
path: root/zephyr/test/drivers/src/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'zephyr/test/drivers/src/utils.c')
-rw-r--r--zephyr/test/drivers/src/utils.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/zephyr/test/drivers/src/utils.c b/zephyr/test/drivers/src/utils.c
index c88a4cde56..ba27eb7095 100644
--- a/zephyr/test/drivers/src/utils.c
+++ b/zephyr/test/drivers/src/utils.c
@@ -398,6 +398,35 @@ void host_cmd_typec_control_exit_modes(int port)
"Failed to send Type-C control for port %d", port);
}
+void host_cmd_typec_control_usb_mux_set(int port,
+ struct typec_usb_mux_set mux_set)
+{
+ struct ec_params_typec_control params = {
+ .port = port,
+ .command = TYPEC_CONTROL_COMMAND_USB_MUX_SET,
+ .mux_params = mux_set,
+ };
+ struct host_cmd_handler_args args =
+ BUILD_HOST_COMMAND_PARAMS(EC_CMD_TYPEC_CONTROL, 0, params);
+
+ zassume_ok(host_command_process(&args),
+ "Failed to send Type-C control for port %d", port);
+}
+
+void host_cmd_typec_control_clear_events(int port, uint32_t events)
+{
+ struct ec_params_typec_control params = {
+ .port = port,
+ .command = TYPEC_CONTROL_COMMAND_CLEAR_EVENTS,
+ .clear_events_mask = events,
+ };
+ struct host_cmd_handler_args args =
+ BUILD_HOST_COMMAND_PARAMS(EC_CMD_TYPEC_CONTROL, 0, params);
+
+ zassume_ok(host_command_process(&args),
+ "Failed to send Type-C control for port %d", port);
+}
+
void host_cmd_usb_pd_get_amode(
uint8_t port, uint16_t svid_idx,
struct ec_params_usb_pd_get_mode_response *response, int *response_size)