From f6bd2788b82d5d3ade1cf5f619d422696be8cf32 Mon Sep 17 00:00:00 2001 From: Won Chung Date: Tue, 25 Jan 2022 22:22:31 +0000 Subject: 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 Change-Id: Id8076a2a952de61a6f38fbdecd76e991487bf696 Reviewed-on: https://review.coreboot.org/c/coreboot/+/61387 Tested-by: build bot (Jenkins) Reviewed-by: Tim Wawrzynczak --- src/ec/google/chromeec/ec_acpi.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/ec/google/chromeec/ec_acpi.c b/src/ec/google/chromeec/ec_acpi.c index 9343d6d4f4..e344df098b 100644 --- a/src/ec/google/chromeec/ec_acpi.c +++ b/src/ec/google/chromeec/ec_acpi.c @@ -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 * '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; switch (port->path.usb.port_type) { -- cgit v1.2.3