summaryrefslogtreecommitdiff
path: root/util/ectool.c
diff options
context:
space:
mode:
Diffstat (limited to 'util/ectool.c')
-rw-r--r--util/ectool.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/util/ectool.c b/util/ectool.c
index 3872241217..62f2799453 100644
--- a/util/ectool.c
+++ b/util/ectool.c
@@ -1677,6 +1677,7 @@ static int ms_help(const char *cmd)
{
printf("Usage:\n");
printf(" %s - dump all motion data\n", cmd);
+ printf(" %s active - print active flag\n", cmd);
printf(" %s info NUM - print sensor info\n", cmd);
printf(" %s ec_rate [RATE_MS] - set/get sample rate\n", cmd);
printf(" %s odr NUM [ODR [ROUNDUP]] - set/get sensor ODR\n", cmd);
@@ -1719,12 +1720,37 @@ static int cmd_motionsense(int argc, char **argv)
resp.dump.data[3*i+1],
resp.dump.data[3*i+2]);
else
+ /*
+ * Warning: the following string printed out
+ * is read by an autotest. Do not change string
+ * without consulting autotest for
+ * kernel_CrosECSysfsAccel.
+ */
printf("None\n");
}
return 0;
}
+ if (argc == 2 && !strcasecmp(argv[1], "active")) {
+ param.cmd = MOTIONSENSE_CMD_DUMP;
+ rv = ec_command(EC_CMD_MOTION_SENSE_CMD, 0,
+ &param, ms_command_sizes[param.cmd].insize,
+ &resp, ms_command_sizes[param.cmd].outsize);
+
+ /*
+ * Warning: the following strings printed out are read in an
+ * autotest. Do not change string without consulting autotest
+ * for kernel_CrosECSysfsAccel.
+ */
+ if (resp.dump.module_flags & MOTIONSENSE_MODULE_FLAG_ACTIVE)
+ printf("1\n");
+ else
+ printf("0\n");
+
+ return 0;
+ }
+
if (argc == 3 && !strcasecmp(argv[1], "info")) {
param.cmd = MOTIONSENSE_CMD_INFO;