summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorDaisuke Nojiri <dnojiri@chromium.org>2020-11-25 18:38:21 -0800
committerCommit Bot <commit-bot@chromium.org>2020-12-10 03:16:49 +0000
commit38981368658817aa15152d5c3aa61e56a9541580 (patch)
tree212ac529bfe2eebb996fd5c50a956fd4c5358f18 /common
parentd9b7ea8ff23a744e7a5e0f28fe7ca0e36ef11a9d (diff)
downloadchrome-ec-38981368658817aa15152d5c3aa61e56a9541580.tar.gz
PCHG: Send device event to host
This patch makes PCHG send EC_HOST_EVENT_DEVICE on every state machine cycle. The host is expected to retrieve the device event mask through EC_CMD_DEVICE_EVENT and updates port status if the mask has EC_DEVICE_EVENT_WLC. BUG=b:173235954 BRANCH=Trogdor TEST=Enabled and disabled EC_DEVICE_EVENT_WLC via deviceevent command and verified the sysfs node is updated. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Change-Id: I9dece6bc35599db3d6ae30452fd8e97bbaeab9af Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2579722 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'common')
-rw-r--r--common/peripheral_charger.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/common/peripheral_charger.c b/common/peripheral_charger.c
index 2faa315253..eeb2a4cf80 100644
--- a/common/peripheral_charger.c
+++ b/common/peripheral_charger.c
@@ -5,6 +5,7 @@
#include "atomic.h"
#include "common.h"
+#include "device_event.h"
#include "hooks.h"
#include "host_command.h"
#include "peripheral_charger.h"
@@ -320,6 +321,12 @@ void pchg_task(void *u)
pchg_run(ctx);
} while (queue_count(&ctx->events));
}
+ /*
+ * Send one host event for all ports. Currently PCHG supports
+ * only WLC but in the future other types (e.g. WPC Qi) should
+ * send different device events.
+ */
+ device_set_single_event(EC_DEVICE_EVENT_WLC);
task_wait_event(-1);
}
}