diff options
Diffstat (limited to 'driver/ppc/aoz1380.c')
-rw-r--r-- | driver/ppc/aoz1380.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/driver/ppc/aoz1380.c b/driver/ppc/aoz1380.c index 67ad00c5e8..42239dd168 100644 --- a/driver/ppc/aoz1380.c +++ b/driver/ppc/aoz1380.c @@ -37,8 +37,19 @@ static uint32_t flags[CONFIG_USB_PD_PORT_MAX_COUNT]; static int aoz1380_init(int port) { + int rv; + bool is_sinking, is_sourcing; + flags[port] = 0; + rv = tcpm_get_snk_ctrl(port, &is_sinking); + if (rv == EC_SUCCESS && is_sinking) + AOZ1380_SET_FLAG(port, AOZ1380_FLAGS_SINK_ENABLED); + + rv = tcpm_get_src_ctrl(port, &is_sourcing); + if (rv == EC_SUCCESS && is_sourcing) + AOZ1380_SET_FLAG(port, AOZ1380_FLAGS_SOURCE_ENABLED); + return EC_SUCCESS; } |