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)
106
106
*/
107
107
void pe_snk_discovery_entry (void * obj )
108
108
{
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
+
109
114
LOG_INF ("PE_SNK_Discovery" );
115
+
116
+ usbc_vbus_enable (vbus , true);
110
117
}
111
118
112
119
/**
Original file line number Diff line number Diff line change @@ -98,12 +98,15 @@ void tc_unattached_snk_run(void *obj)
98
98
{
99
99
struct tc_sm_t * tc = (struct tc_sm_t * )obj ;
100
100
const struct device * dev = tc -> dev ;
101
+ struct usbc_port_data * data = dev -> data ;
102
+ const struct device * vbus = data -> vbus ;
101
103
102
104
/*
103
105
* Transition to AttachWait.SNK when the SNK.Rp state is present
104
106
* on at least one of its CC pins.
105
107
*/
106
108
if (tcpc_is_cc_rp (tc -> cc1 ) || tcpc_is_cc_rp (tc -> cc2 )) {
109
+ usbc_vbus_enable (vbus , true);
107
110
tc_set_state (dev , TC_ATTACH_WAIT_SNK_STATE );
108
111
}
109
112
}
@@ -240,6 +243,7 @@ void tc_attached_snk_run(void *obj)
240
243
241
244
/* Detach detection */
242
245
if (usbc_vbus_check_level (vbus , TC_VBUS_PRESENT ) == false) {
246
+ usbc_vbus_enable (vbus , false);
243
247
tc_set_state (dev , TC_UNATTACHED_SNK_STATE );
244
248
return ;
245
249
}
Original file line number Diff line number Diff line change @@ -122,11 +122,16 @@ void tc_unattached_wait_src_exit(void *obj)
122
122
void tc_attach_wait_src_entry (void * obj )
123
123
{
124
124
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 ;
125
128
126
129
LOG_INF ("AttachWait.SRC" );
127
130
128
131
/* Initialize the cc state to open */
129
132
tc -> cc_state = TC_CC_NONE ;
133
+
134
+ usbc_vbus_enable (vbus , true);
130
135
}
131
136
132
137
void tc_attach_wait_src_run (void * obj )
You can’t perform that action at this time.
0 commit comments