Lines Matching defs:state

213 	/* Anything >0 represents an active state */
315 struct mutex lock; /* tcpm state machine lock */
380 enum tcpm_state state;
463 /* PD state for Vendor Defined Messages */
485 /* Deadline in jiffies to exit src_try_wait state */
515 * of contaminant in the connector pins based on the tcpm state machine
530 * tcpm_queue_message or messages that send after state changes,
718 (port->state == SRC_UNATTACHED || port->state == SNK_UNATTACHED ||
719 port->state == TOGGLING || port->state == CHECK_CONTAMINANT))
879 * TCPCI: Move to APPLY_RC state to prevent disconnect during PR_SWAP
1025 static int tcpm_mux_set(struct tcpm_port *port, int state,
1031 tcpm_log(port, "Requesting mux state %d, usb-role %d, orientation %d",
1032 state, usb_role, orientation);
1044 return typec_set_mode(port->typec_port, state);
1336 static void tcpm_set_state(struct tcpm_port *port, enum tcpm_state state,
1340 tcpm_log(port, "pending state change %s -> %s @ %u ms [%s %s]",
1341 tcpm_states[port->state], tcpm_states[state], delay_ms,
1343 port->delayed_state = state;
1348 tcpm_log(port, "state change %s -> %s [%s %s]",
1349 tcpm_states[port->state], tcpm_states[state],
1352 port->prev_state = port->state;
1353 port->state = state;
1355 * Don't re-queue the state machine work item if we're currently
1356 * in the state machine and we're immediately changing states.
1357 * tcpm_state_machine_work() will continue running the state
1365 static void tcpm_set_state_cond(struct tcpm_port *port, enum tcpm_state state,
1368 if (port->enter_state == port->state)
1369 tcpm_set_state(port, state, delay_ms);
1372 "skipped %sstate change %s -> %s [%u ms], context state %s [%s %s]",
1374 tcpm_states[port->state], tcpm_states[state],
1477 switch (port->state) {
1519 if (port->state == SNK_READY ||
1520 port->state == SNK_SOFT_RESET)
1554 /* Set ready, vdm state machine will actually send */
2084 if (port->state == SRC_VDM_IDENTITY_REQUEST) {
2267 * - If there are responses to send, it will be cleared in the state machine.
2270 * - Otherwise, it will be cleared in the state machine if timeout or it will go
2273 * - We will send NAK and the flag will be cleared in the state machine.
2284 * We are done with any state stored in the port struct now, except
2448 * if there's traffic or we're not in PDO ready state don't send
2451 if (port->state != SRC_READY && port->state != SNK_READY &&
2452 port->state != SRC_VDM_IDENTITY_REQUEST) {
2533 if (port->state == SRC_VDM_IDENTITY_REQUEST) {
2630 * a state change.
2931 enum tcpm_state state,
2935 switch (port->state) {
2939 tcpm_set_state(port, state, delay_ms);
2955 port->upcoming_state = state;
2967 switch (port->state) {
3100 } else if (port->state == SNK_WAIT_CAPABILITIES) {
3161 if (port->state == SRC_SEND_CAPABILITIES)
3206 if (port->state != SRC_READY && port->state != SNK_READY)
3249 * Stop VDM state machine if interrupted by other Messages while NOT_SUPP is allowed in
3271 switch (port->state) {
3286 * in a transitional state.
3316 switch (port->state) {
3393 switch (port->state) {
3413 * which returns to ready state
3527 /* stopping VDM state machine if interrupted by other Messages */
3708 * Send queued message without affecting state.
3709 * Return true if state machine should go back to sleep,
4494 if (port->state == SNK_WAIT_CAPABILITIES)
4580 if (port->tcpc->check_contaminant && port->state != CHECK_CONTAMINANT)
4582 port->state == SRC_UNATTACHED) ||
4584 port->state == SNK_UNATTACHED) ||
4586 port->state == SNK_UNATTACHED));
4588 port->enter_state = port->state;
4589 switch (port->state) {
4634 * Until then, ignore any state changes.
4725 * However, that can result in state machine hang-ups.
4726 * Reset it only in READY state to improve stability.
4803 * state.
4818 * ready state, but if done after a Vconn Swap following Discover
4921 * TCPM stays in this state indefinitely until VBUS
5030 /* Restore back to the original state */
5044 /* Restore back to the original state */
5111 * state.
5126 * ready state, but if done after a Vconn Swap following Discover
5246 /* Note: There is no guarantee that VBUS is on in this state */
5250 * mode should transition to state PE_SRC_Transition_to_default.
5256 * - Transition to state PE_Src_Startup
5257 * SNK only ports shall transition to state Snk_Startup
5622 /* AMS intermediate state */
5635 /* Chunk state */
5650 WARN(1, "Unexpected port state %d\n", port->state);
5666 /* If we were queued due to a delayed state change, update it now */
5668 tcpm_log(port, "state change %s -> %s [delayed %ld ms]",
5669 tcpm_states[port->state],
5671 port->prev_state = port->state;
5672 port->state = port->delayed_state;
5677 * Continue running as long as we have (non-delayed) state changes
5681 prev_state = port->state;
5685 } while (port->state != prev_state && !port->delayed_state);
5704 "CC1: %u -> %u, CC2: %u -> %u [state %s, polarity %d, %s]",
5705 old_cc1, cc1, old_cc2, cc2, tcpm_states[port->state],
5710 switch (port->state) {
5826 /* Hand over to state machine if needed */
5870 * CC state change is expected in PR_SWAP
5911 switch (port->state) {
5996 switch (port->state) {
6006 /* Hand over to state machine if needed */
6058 * Force to unattached state to re-initiate connection.
6099 switch (port->state) {
6150 switch (port->state) {
6213 if (port->state == SNK_READY) {
6238 if (port->state == CHECK_CONTAMINANT) {
6312 return port->port_type == TYPEC_PORT_DRP && port->state == TOGGLING;
6339 /* Send when the state machine is idle */
6340 if (port->state != SNK_READY || port->vdm_sm_running || port->send_discover ||
6374 if ((port->state != SRC_READY && port->state != SNK_READY &&
6375 port->state != SRC_VDM_IDENTITY_REQUEST) || port->vdm_sm_running) {
6398 if (port->state != SRC_READY && port->state != SNK_READY) {
6470 if (port->state != SRC_READY && port->state != SNK_READY) {
6515 if (port->state != SRC_READY && port->state != SNK_READY) {
6583 if (port->state != SNK_READY) {
6644 if (port->state != SNK_READY) {
6703 if (port->state != SNK_READY) {
6868 switch (port->state) {