From 673665032d4f7d0809367edf0d8deddbee24b726 Mon Sep 17 00:00:00 2001 From: Tony Zou Date: Thu, 27 Dec 2018 16:31:22 +0800 Subject: P9221: Add P9221 driver This patch adds P9221 driver and enable it for Flapjack. The driver originates from https://android.googlesource.com/kernel /msm/+/android-msm-bluecross-4.9-pie-qpr1/drivers/power/supply/qcom /p9221_charger.c CQ-DEPEND=CL:1445133 CL:1551583 BRANCH=none BUG=b:126162615 TEST=Verify charging from PD and WPC as follows: 1. Charge with PD charger. Place DUT on WPC charger. -> PD charger continues to charge. 2. Unplug PD charger. -> WPC starts charging as GPP. 3. Plug PD charger. -> PD charger starts charging at 2A@9V TEST=Verify OTG and WPC functionality as follows: 1. Plug fan to USB port: -> Fan spins 2. Place DUT on WPC charger: -> WPC starts charging as GPP. Fan continues to spin. 3. Remove DUT from WPC charger: -> Fan continues to spin. 4. Do 1 and 2 then unplug USB fan: -> WPC starts charging. TEST=/sys/class/power_supply/CROS_USBPD_CHARGER0/usb_type is BrickID /sys/class/power_supply/sbs-12-000b/status is ok Change-Id: I5fbd0237cedd8095f98582c39973d432e733f2cd Signed-off-by: Tony Zou Signed-off-by: Daisuke Nojiri Reviewed-on: https://chromium-review.googlesource.com/1448193 Commit-Ready: ChromeOS CL Exonerator Bot --- include/charge_manager.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include') diff --git a/include/charge_manager.h b/include/charge_manager.h index 41ba9bcb59..6177408acb 100644 --- a/include/charge_manager.h +++ b/include/charge_manager.h @@ -44,6 +44,11 @@ enum charge_supplier { #endif /* CHARGE_MANAGER_BC12 */ #if CONFIG_DEDICATED_CHARGE_PORT_COUNT > 0 CHARGE_SUPPLIER_DEDICATED, +#endif +#ifdef CONFIG_WIRELESS_CHARGER_P9221_R7 + CHARGE_SUPPLIER_WPC_BPP, + CHARGE_SUPPLIER_WPC_EPP, + CHARGE_SUPPLIER_WPC_GPP, #endif CHARGE_SUPPLIER_COUNT }; -- cgit v1.2.1