diff options
author | Fabio Baltieri <fabiobaltieri@google.com> | 2022-05-16 10:27:08 +0000 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-05-27 15:55:43 +0000 |
commit | be7509a8ae5e8b9983f34b1d30d0e99275f09b97 (patch) | |
tree | 2ed88c72744d1c4b3d418aafdc1087a12d4a2d09 /include | |
parent | 2024fc296cc799f75ab1ca502e73e09b6488269a (diff) | |
download | chrome-ec-be7509a8ae5e8b9983f34b1d30d0e99275f09b97.tar.gz |
bc12: split task handler in init and event
Split the bc12 internal API from a task loop handler to an init and
event handler pair of functions, moving the loop on the caller.
This is to allow handling the events from a single task on a followup
patch.
Current driver behavior should be unchanged, just bringing the loop and
wait in the generic code. For a couple of drivers (bd9995x and rt946x)
this was not quite possible as they would need some more work to fit in
that model, but then those two runs in single task mode already anyway
(HAS_TASK_USB_CHG), so no point converting them to fit the model anyway,
just running the whole driver in the init() keeps the existing behavior,
code will never reach the outer loop.
BRANCH=none
BUG=b:226411332
TEST=make buildall
TEST=zmake testall
TEST=cq dry run
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Change-Id: I8e28ad8b5b52b002587aefb68116a14b709729fe
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3663747
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/usb_charge.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/include/usb_charge.h b/include/usb_charge.h index 25fcb74314..a5284512fd 100644 --- a/include/usb_charge.h +++ b/include/usb_charge.h @@ -93,8 +93,10 @@ enum usb_switch { struct bc12_drv { /* All fields below are optional */ - /* BC1.2 detection task for this chip */ - void (*usb_charger_task)(int port); + /* BC1.2 detection task init for this chip */ + void (*usb_charger_task_init)(int port); + /* BC1.2 detection task process for this chip */ + void (*usb_charger_task_event)(int port, uint32_t evt); /* Configure USB data switches on type-C port */ void (*set_switches)(int port, enum usb_switch setting); /* Check if ramping is allowed for given supplier */ |