File tree Expand file tree Collapse file tree 3 files changed +16
-0
lines changed
Expand file tree Collapse file tree 3 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -106,7 +106,14 @@ void pe_snk_startup_run(void *obj)
106106 */
107107void pe_snk_discovery_entry (void * obj )
108108{
109+ struct policy_engine * pe = (struct policy_engine * )obj ;
110+ const struct device * dev = pe -> dev ;
111+ struct usbc_port_data * data = dev -> data ;
112+ const struct device * vbus = data -> vbus ;
113+
109114 LOG_INF ("PE_SNK_Discovery" );
115+
116+ usbc_vbus_enable (vbus , true);
110117}
111118
112119/**
Original file line number Diff line number Diff line change @@ -98,12 +98,15 @@ void tc_unattached_snk_run(void *obj)
9898{
9999 struct tc_sm_t * tc = (struct tc_sm_t * )obj ;
100100 const struct device * dev = tc -> dev ;
101+ struct usbc_port_data * data = dev -> data ;
102+ const struct device * vbus = data -> vbus ;
101103
102104 /*
103105 * Transition to AttachWait.SNK when the SNK.Rp state is present
104106 * on at least one of its CC pins.
105107 */
106108 if (tcpc_is_cc_rp (tc -> cc1 ) || tcpc_is_cc_rp (tc -> cc2 )) {
109+ usbc_vbus_enable (vbus , true);
107110 tc_set_state (dev , TC_ATTACH_WAIT_SNK_STATE );
108111 }
109112}
@@ -240,6 +243,7 @@ void tc_attached_snk_run(void *obj)
240243
241244 /* Detach detection */
242245 if (usbc_vbus_check_level (vbus , TC_VBUS_PRESENT ) == false) {
246+ usbc_vbus_enable (vbus , false);
243247 tc_set_state (dev , TC_UNATTACHED_SNK_STATE );
244248 return ;
245249 }
Original file line number Diff line number Diff line change @@ -122,11 +122,16 @@ void tc_unattached_wait_src_exit(void *obj)
122122void tc_attach_wait_src_entry (void * obj )
123123{
124124 struct tc_sm_t * tc = (struct tc_sm_t * )obj ;
125+ const struct device * dev = tc -> dev ;
126+ struct usbc_port_data * data = dev -> data ;
127+ const struct device * vbus = data -> vbus ;
125128
126129 LOG_INF ("AttachWait.SRC" );
127130
128131 /* Initialize the cc state to open */
129132 tc -> cc_state = TC_CC_NONE ;
133+
134+ usbc_vbus_enable (vbus , true);
130135}
131136
132137void tc_attach_wait_src_run (void * obj )
You can’t perform that action at this time.
0 commit comments