usb-c: add PE_SRC_Disabled support.
with this fix the pd stack works with type-c devices that does not respond to pd. Signed-off-by: Johan Carlsson <johan.carlsson@teenage.engineering>
This commit is contained in:
parent
cae67312d1
commit
9b021bc8e1
4 changed files with 32 additions and 3 deletions
|
@ -1371,6 +1371,12 @@ static const struct smf_state pe_states[PE_STATE_COUNT] = {
|
||||||
pe_src_ready_exit,
|
pe_src_ready_exit,
|
||||||
NULL,
|
NULL,
|
||||||
NULL),
|
NULL),
|
||||||
|
[PE_SRC_DISABLED] = SMF_CREATE_STATE(
|
||||||
|
pe_src_disabled_entry,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL),
|
||||||
[PE_SRC_TRANSITION_TO_DEFAULT] = SMF_CREATE_STATE(
|
[PE_SRC_TRANSITION_TO_DEFAULT] = SMF_CREATE_STATE(
|
||||||
pe_src_transition_to_default_entry,
|
pe_src_transition_to_default_entry,
|
||||||
pe_src_transition_to_default_run,
|
pe_src_transition_to_default_run,
|
||||||
|
|
|
@ -83,6 +83,8 @@ enum usbc_pe_state {
|
||||||
PE_SRC_TRANSITION_SUPPLY,
|
PE_SRC_TRANSITION_SUPPLY,
|
||||||
/** PE_SRC_Ready */
|
/** PE_SRC_Ready */
|
||||||
PE_SRC_READY,
|
PE_SRC_READY,
|
||||||
|
/** PE_SRC_Disabled */
|
||||||
|
PE_SRC_DISABLED,
|
||||||
/** PE_SRC_Hard_Reset */
|
/** PE_SRC_Hard_Reset */
|
||||||
PE_SRC_HARD_RESET,
|
PE_SRC_HARD_RESET,
|
||||||
/** PE_SRC_Hard_Reset_Received */
|
/** PE_SRC_Hard_Reset_Received */
|
||||||
|
|
|
@ -154,9 +154,12 @@ void pe_src_discovery_run(void *obj)
|
||||||
* 1) The SourceCapabilityTimer times out
|
* 1) The SourceCapabilityTimer times out
|
||||||
* 2) And CapsCounter ≤ nCapsCount
|
* 2) And CapsCounter ≤ nCapsCount
|
||||||
*/
|
*/
|
||||||
if (usbc_timer_expired(&pe->pd_t_typec_send_source_cap)
|
if (usbc_timer_expired(&pe->pd_t_typec_send_source_cap)) {
|
||||||
&& pe->caps_counter <= PD_N_CAPS_COUNT) {
|
if (pe->caps_counter <= PD_N_CAPS_COUNT) {
|
||||||
pe_set_state(dev, PE_SRC_SEND_CAPABILITIES);
|
pe_set_state(dev, PE_SRC_SEND_CAPABILITIES);
|
||||||
|
} else {
|
||||||
|
pe_set_state(dev, PE_SRC_DISABLED);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -483,6 +486,19 @@ void pe_src_ready_exit(void *obj)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief 8.3.3.2.7 PE_SRC_Disabled State
|
||||||
|
*/
|
||||||
|
void pe_src_disabled_entry(void *obj)
|
||||||
|
{
|
||||||
|
LOG_INF("PE_SRC_Disabled");
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Unresponsive to USB Power Delivery messaging, but not to Hard Reset
|
||||||
|
* Signaling. See pe_got_hard_reset
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief 8.3.3.2.11 PE_SRC_Transition_to_default State
|
* @brief 8.3.3.2.11 PE_SRC_Transition_to_default State
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -57,6 +57,11 @@ void pe_src_ready_entry(void *obj);
|
||||||
void pe_src_ready_run(void *obj);
|
void pe_src_ready_run(void *obj);
|
||||||
void pe_src_ready_exit(void *obj);
|
void pe_src_ready_exit(void *obj);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief PE_SRC_Disabled State
|
||||||
|
*/
|
||||||
|
void pe_src_disabled_entry(void *obj);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief PE_SRC_Transition_To_Default State
|
* @brief PE_SRC_Transition_To_Default State
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue