From 8975cbb645f1f07c3682334d02510a8a1d3f730b Mon Sep 17 00:00:00 2001 From: Ting Shen Date: Wed, 6 May 2020 18:06:52 +0800 Subject: bc12: create bc12 driver structure To support linking multiple bc12 drivers into ec binary, we have to remove the common symbols in drivers. This CL creates a bc12_drv structure to hold the original driver-specific usb_charger_* functions, and implements common usb_charger_* functions which whill dispatch the function call based on the information in bc12_drv table. Also add a CONFIG_BC12_SINGLE_DRIVER and enabled by default for backward compatibility. If CONFIG_BC12_SINGLE_DRIVER is defined, a default bc12_drv array with proper size and content will be created for the board. BUG=b:155611686 TEST=1) make buildall. 2) verify single driver mode on krane (rt946x) and juniper (pi3usb9201). 3) verify multiple driver works on asurada, see CL:2189624 for example usage. 4) verify single driver multi chip on blooglet. BRANCH=none Signed-off-by: Ting Shen Change-Id: I8a96eda47c94aeb6cc150b498cfa1a6eefcc4a5b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2187080 Reviewed-by: Jett Rink Commit-Queue: Ting Shen Tested-by: Ting Shen --- driver/charger/rt946x.h | 1 + 1 file changed, 1 insertion(+) (limited to 'driver/charger/rt946x.h') diff --git a/driver/charger/rt946x.h b/driver/charger/rt946x.h index c2522aaf1a..38ec200c77 100644 --- a/driver/charger/rt946x.h +++ b/driver/charger/rt946x.h @@ -861,5 +861,6 @@ int mt6370_reduce_db_bl_driving(void); #endif extern const struct charger_drv rt946x_drv; +extern const struct bc12_drv rt946x_bc12_drv; #endif /* __CROS_EC_RT946X_H */ -- cgit v1.2.1