diff options
author | Vijay Hiremath <vijay.p.hiremath@intel.com> | 2016-06-12 00:39:34 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2016-06-14 14:12:03 -0700 |
commit | 4e3f5aa4a8bc96d0743fe42705ddad3379a0ff9a (patch) | |
tree | 604d09d80bade2a3b2155dd7e3ecedc9563250bc /include/usb_charge.h | |
parent | c5cad4bca52e4b546e59874e356b409bec7fdfc8 (diff) | |
download | chrome-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 'include/usb_charge.h')
-rw-r--r-- | include/usb_charge.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/usb_charge.h b/include/usb_charge.h index 5de334583d..382f373f8a 100644 --- a/include/usb_charge.h +++ b/include/usb_charge.h @@ -48,9 +48,16 @@ int usb_charge_set_mode(int usb_port_id, enum usb_charge_mode mode); int usb_charge_ports_enabled(void); /* Events handled by the USB_CHG task */ +#ifdef HAS_TASK_USB_CHG +/* One task for all the ports */ +#define USB_CHG_EVENT_VBUS_P0 TASK_EVENT_CUSTOM(1) +#define USB_CHG_EVENT_VBUS_P1 TASK_EVENT_CUSTOM(2) +#elif defined(HAS_TASK_USB_CHG_P0) +/* One task per port */ #define USB_CHG_EVENT_BC12 TASK_EVENT_CUSTOM(1) #define USB_CHG_EVENT_VBUS TASK_EVENT_CUSTOM(2) #define USB_CHG_EVENT_INTR TASK_EVENT_CUSTOM(4) +#endif /* * Define USB_CHG_PORT_TO_TASK_ID() and TASK_ID_TO_USB_CHG__PORT() macros to |