summaryrefslogtreecommitdiff
path: root/chip
diff options
context:
space:
mode:
authorShelley Chen <shchen@chromium.org>2016-05-26 11:13:40 -0700
committerchrome-bot <chrome-bot@chromium.org>2016-05-27 13:47:02 -0700
commitcebf8734d96d8c6a44185ee1b7d38b4d42efd36a (patch)
tree9cd0599cdb625af60b94115f33e0cf29c9ad2b82 /chip
parent641b02a46c323a4560e9e6ff75478680ff9a6e7d (diff)
downloadchrome-ec-cebf8734d96d8c6a44185ee1b7d38b4d42efd36a.tar.gz
kevin: rk3399: ectool interface for EC RTC alarm
Only way to set alarm previously was through rtcalarm command on EC console. Implemented interface through ectool so that the AP can set it as well. BUG=chrome-os-partner:52218 BRANCH=None TEST=from AP console, run ectool rtcalarm <sec> Should see [event set 0x02000000] from EC console in approximately <sec> seconds. Change-Id: I3202b826cb994dbca456b8b9c22bbca4dbe2766a Signed-off-by: Shelley Chen <shchen@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/347493 Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Diffstat (limited to 'chip')
-rw-r--r--chip/npcx/system.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/chip/npcx/system.c b/chip/npcx/system.c
index 46547ff737..0411892214 100644
--- a/chip/npcx/system.c
+++ b/chip/npcx/system.c
@@ -762,6 +762,17 @@ DECLARE_HOST_COMMAND(EC_CMD_RTC_SET_VALUE,
system_rtc_set_value,
EC_VER_MASK(0));
+static int system_rtc_set_alarm(struct host_cmd_handler_args *args)
+{
+ const struct ec_params_rtc *p = args->params;
+
+ system_set_rtc_alarm(p->time, 0);
+ return EC_RES_SUCCESS;
+}
+DECLARE_HOST_COMMAND(EC_CMD_RTC_SET_ALARM,
+ system_rtc_set_alarm,
+ EC_VER_MASK(0));
+
#ifdef CONFIG_EXTERNAL_STORAGE
void system_jump_to_booter(void)
{