diff options
author | Gwendal Grignou <gwendal@chromium.org> | 2015-09-08 11:51:25 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2015-09-29 19:38:21 -0700 |
commit | d0e1c2394c641afdbd633e9393131fe03fdefa9f (patch) | |
tree | a2561e8865a92ec480e90ba25d88a5491d57b999 /include | |
parent | 1092919c51101cdbee266f21a493d95c7f0cd77c (diff) | |
download | chrome-ec-d0e1c2394c641afdbd633e9393131fe03fdefa9f.tar.gz |
common: motion: Separate motion task interval from AP configuration
Some sensors are in forced mode, motion sense must be scheduled at
their ODR. However the host may not want the data right away,
so motion task may not wake up the host that often.
Add a new variable motion_int_interval that defines the maximum interval
between FIFO host event.
BRANCH=smaug
BUG=chrome-os-partner:43800
TEST=Check that light sensor is polled at ODR frequency.
Check that when AP does not want any event, no FIFO host event are
requested.
Check CTS tests work as before.
Reenable motion_lid unit test.
Change-Id: Ie25e6cbe28fed899073856057855ffa03c0cd9fd
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/301134
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/config.h | 6 | ||||
-rw-r--r-- | include/motion_sense.h | 4 |
2 files changed, 8 insertions, 2 deletions
diff --git a/include/config.h b/include/config.h index 619dd2c04d..c5264c57b7 100644 --- a/include/config.h +++ b/include/config.h @@ -44,6 +44,12 @@ /* The amount of free entries that trigger an interrupt to the AP. */ #undef CONFIG_ACCEL_FIFO_THRES +/* + * Sensors in this mask are in forced mode: they needed to be polled + * at their data rate frequency. + */ +#undef CONFIG_ACCEL_FORCE_MODE_MASK + /* Specify type of accelerometers attached. */ #undef CONFIG_ACCEL_KXCJ9 #undef CONFIG_ACCEL_KX022 diff --git a/include/motion_sense.h b/include/motion_sense.h index ec2219a0e3..ff99c40af4 100644 --- a/include/motion_sense.h +++ b/include/motion_sense.h @@ -137,8 +137,8 @@ extern const unsigned motion_sensor_count; /* For testing purposes: export the sampling interval. */ extern enum chipset_state_mask sensor_active; -extern unsigned accel_interval; -int motion_sense_set_accel_interval(void); +extern unsigned motion_interval; +int motion_sense_set_motion_intervals(void); /* * Priority of the motion sense resume/suspend hooks, to be sure associated |