summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Barber <smbarber@chromium.org>2016-07-07 11:40:38 -0700
committerchrome-bot <chrome-bot@chromium.org>2016-07-09 01:40:59 -0700
commit24abdc9a4e2dc056815feea2150b1d50f4d7c836 (patch)
tree507504fa02df7e7c4879445311878cac21f3829b
parent815b1356903306c66b3a433f0daa4577e1182a2e (diff)
downloadchrome-ec-24abdc9a4e2dc056815feea2150b1d50f4d7c836.tar.gz
common: add EC_FEATURE_RTC to features host command
If the EC has CONFIG_HOSTCMD_RTC set to 'y', then export this via the features host command. The kernel can then use this feature to expose an RTC device under /dev/rtc*. Signed-off-by: Stephen Barber <smbarber@chromium.org> BRANCH=none BUG=chrome-os-partner:54639 TEST=`ectool inventory` shows RTC on kevin Change-Id: I644c8e61c4d9f691cc6ca94ef60bee4384c21660 Reviewed-on: https://chromium-review.googlesource.com/359414 Commit-Ready: Stephen Barber <smbarber@chromium.org> Tested-by: Stephen Barber <smbarber@chromium.org> Reviewed-by: Shawn N <shawnn@chromium.org>
-rw-r--r--common/host_command.c3
-rw-r--r--include/ec_commands.h2
-rw-r--r--util/ectool.c1
3 files changed, 6 insertions, 0 deletions
diff --git a/common/host_command.c b/common/host_command.c
index 2a4c48a803..3fa537b0cf 100644
--- a/common/host_command.c
+++ b/common/host_command.c
@@ -755,6 +755,9 @@ static int host_command_get_features(struct host_cmd_handler_args *args)
#ifdef CONFIG_USB_MUX_VIRTUAL
| EC_FEATURE_MASK_0(EC_FEATURE_USBC_SS_MUX_VIRTUAL)
#endif
+#ifdef CONFIG_HOSTCMD_RTC
+ | EC_FEATURE_MASK_0(EC_FEATURE_RTC)
+#endif
;
return EC_RES_SUCCESS;
}
diff --git a/include/ec_commands.h b/include/ec_commands.h
index f532dfe84b..18f5f839f7 100644
--- a/include/ec_commands.h
+++ b/include/ec_commands.h
@@ -955,6 +955,8 @@ enum ec_feature_code {
EC_FEATURE_VSTORE = 25,
/* EC decides on USB-C SS mux state, muxes configured by host */
EC_FEATURE_USBC_SS_MUX_VIRTUAL = 26,
+ /* EC has RTC feature that can be controlled by host commands */
+ EC_FEATURE_RTC = 27,
};
#define EC_FEATURE_MASK_0(event_code) (1UL << (event_code % 32))
diff --git a/util/ectool.c b/util/ectool.c
index 90d77d488a..bc6353640a 100644
--- a/util/ectool.c
+++ b/util/ectool.c
@@ -473,6 +473,7 @@ static const char * const ec_feature_names[] = {
[EC_FEATURE_MOTION_SENSE_FIFO] = "FIFO for Motion Sensors events",
[EC_FEATURE_VSTORE] = "Temporary secure vstore",
[EC_FEATURE_USBC_SS_MUX_VIRTUAL] = "Host-controlled USB-C SS mux",
+ [EC_FEATURE_RTC] = "Real-time clock",
};
int cmd_inventory(int argc, char *argv[])