summaryrefslogtreecommitdiff
path: root/common/usb_charger.c
diff options
context:
space:
mode:
authorVijay Hiremath <vijay.p.hiremath@intel.com>2016-06-12 00:39:34 -0700
committerchrome-bot <chrome-bot@chromium.org>2016-06-14 14:12:03 -0700
commit4e3f5aa4a8bc96d0743fe42705ddad3379a0ff9a (patch)
tree604d09d80bade2a3b2155dd7e3ecedc9563250bc /common/usb_charger.c
parentc5cad4bca52e4b546e59874e356b409bec7fdfc8 (diff)
downloadchrome-ec-4e3f5aa4a8bc96d0743fe42705ddad3379a0ff9a.tar.gz
BD99955: Use only one USB charger task for both the ports
There is only one charger IC and one interrupt PIN for both the ports and also from the ISR it's not possible to decode from which port the interrupt is triggered hence a deferred function is used to trigger the wake event for the ports. As there is no additional benefit of having an extra task, added code to use only one USB charger task for both the ports. BUG=chrome-os-partner:54272 BRANCH=none TEST=Manually tested on Amenia. BC1.2 detection is success and the battery can charge on both the ports (VBUS/VCC). Change-Id: I2745a5a179662aaeef8d48c8c1763919e8853fd0 Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Reviewed-on: https://chromium-review.googlesource.com/351752 Commit-Ready: Vijay P Hiremath <vijay.p.hiremath@intel.com> Tested-by: Vijay P Hiremath <vijay.p.hiremath@intel.com> Reviewed-by: Shawn N <shawnn@chromium.org>
Diffstat (limited to 'common/usb_charger.c')
-rw-r--r--common/usb_charger.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/common/usb_charger.c b/common/usb_charger.c
index 9888dac199..33754120a1 100644
--- a/common/usb_charger.c
+++ b/common/usb_charger.c
@@ -63,8 +63,13 @@ void usb_charger_vbus_change(int port, int vbus_level)
/* Update VBUS supplier and signal VBUS change to USB_CHG task */
update_vbus_supplier(port, vbus_level);
+#ifdef HAS_TASK_USB_CHG
/* USB Charger task */
+ task_set_event(TASK_ID_USB_CHG, (1 << port), 0);
+#else
+ /* USB Charger task(s) */
task_set_event(USB_CHG_PORT_TO_TASK_ID(port), USB_CHG_EVENT_VBUS, 0);
+#endif
#ifdef CONFIG_USB_PD_VBUS_DETECT_CHARGER
/* USB PD task */