diff options
author | Gwendal Grignou <gwendal@chromium.org> | 2015-09-25 14:57:13 -0700 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2016-08-25 20:58:31 +0000 |
commit | 8d97622c2af30c0c56a664006288a467792413df (patch) | |
tree | 7666afcef7e362456d2c646eee534e5d69b06823 | |
parent | 53fdd5d52e24a5e50e85fd127177ebd5d92be5ba (diff) | |
download | chrome-ec-8d97622c2af30c0c56a664006288a467792413df.tar.gz |
UPSTREAM: common: motion: Fix setting of Significant motion.
cl/296213 had another bug that prevent Significant motion gesture to be
set: In set_activity, activity is a number, not a bitfield.
BRANCH=smaug, samus
BUG=chrome-os-partner:45704, b:27849483
TEST=With ectool motionsense set_activity and list_activity,
check we can set/reset the significant motion activity.
Change-Id: Iff921f3f5edcee74ed3540139f13da301f149173
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/302641
Reviewed-by: Alec Berg <alecaberg@chromium.org>
(cherry picked from commit cf25d26c2740cb86adf235ee33dd15653c7c522b)
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/370542
-rw-r--r-- | common/motion_sense.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/common/motion_sense.c b/common/motion_sense.c index f05e8e91b0..2451ec9c75 100644 --- a/common/motion_sense.c +++ b/common/motion_sense.c @@ -1058,7 +1058,8 @@ static int host_cmd_motion_sense(struct host_cmd_handler_args *args) sensor = &motion_sensors[i]; sensor->drv->list_activities(sensor, &enabled, &disabled); - if (in->set_activity.activity & (enabled | disabled)) + if ((1 << in->set_activity.activity) & + (enabled | disabled)) ret = sensor->drv->manage_activity(sensor, in->set_activity.activity, in->set_activity.enable, |