ec/google/chromeec: Consider custom_pld when checking USB port number

Currently only PLD group is used to check USB port number. In the
future, we want to use custom PLD fields, so custom PLD should also be
considered when checking USB port number.

BUG=b:216376040
TEST=emerge-brya coreboot & SSDT dump in Brya test device

Signed-off-by: Won Chung <wonchung@google.com>
Change-Id: Id8076a2a952de61a6f38fbdecd76e991487bf696
Reviewed-on: https://review.coreboot.org/c/coreboot/+/61387
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
This commit is contained in:
Won Chung 2022-01-25 22:22:31 +00:00 committed by Tim Wawrzynczak
parent a3f8eda8a6
commit f6bd2788b8
1 changed files with 6 additions and 1 deletions

View File

@ -60,7 +60,12 @@ static void get_usb_port_references(int port_number, struct device **usb2_port,
* Check for a matching port number (the 'token' field in 'group'). Note that * Check for a matching port number (the 'token' field in 'group'). Note that
* 'port_number' is 0-based, whereas the 'token' field is 1-based. * 'port_number' is 0-based, whereas the 'token' field is 1-based.
*/ */
if (config->group.token != (port_number + 1)) int group_token;
if (config->use_custom_pld)
group_token = config->custom_pld.group.token;
else
group_token = config->group.token;
if (group_token != (port_number + 1))
continue; continue;
switch (port->path.usb.port_type) { switch (port->path.usb.port_type) {