From 27db31e6d02a54d5706d8cb4d1b5db6ff757f659 Mon Sep 17 00:00:00 2001 From: Karthikeyan Ramasubramanian Date: Wed, 2 Oct 2019 15:09:45 -0600 Subject: Add a board specific helper to return USB PD port count Certain SKUs of certain boards have less number of USB PD ports than configured in CONFIG_USB_PD_PORT_MAX_COUNT. Hence define an overrideable board specific helper to return the number of USB PD ports. This helps to avoid initiating a PD firmware update in SKUs where there are less number of USB PD ports. Also update charge manager to ensure that absent/ invalid PD ports are skipped during port initialization and management. BUG=b:140816510, b:143196487 BRANCH=octopus TEST=make -j buildall; Boot to ChromeOS in bobba(2A + 2C config) and garg(2A + 1C + 1HDMI config). Change-Id: Ie345cef470ad878ec443ddf4797e5d17cfe1f61e Signed-off-by: Karthikeyan Ramasubramanian Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1879338 Tested-by: Karthikeyan Ramasubramanian Reviewed-by: Jett Rink Commit-Queue: Karthikeyan Ramasubramanian --- driver/bc12/pi3usb9201.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'driver/bc12') diff --git a/driver/bc12/pi3usb9201.c b/driver/bc12/pi3usb9201.c index be2844e3e3..7f11e1da8a 100644 --- a/driver/bc12/pi3usb9201.c +++ b/driver/bc12/pi3usb9201.c @@ -244,7 +244,7 @@ void usb_charger_task(void *u) * Set most recent bc1.2 detection supplier result to * CHARGE_SUPPLIER_NONE for all ports. */ - for (i = 0; i < CONFIG_USB_PD_PORT_MAX_COUNT; i++) + for (i = 0; i < board_get_usb_pd_port_count(); i++) bc12_supplier[port] = CHARGE_SUPPLIER_NONE; /* -- cgit v1.2.1