OSDN Git Service

android-x86/hardware-intel-libsensors.git
9 years agoGMINL-3234: Allow for a minimal sensor sampling rate
Patrick Porlan [Wed, 12 Nov 2014 14:02:07 +0000 (15:02 +0100)]
GMINL-3234: Allow for a minimal sensor sampling rate

The magnetometer is used at 5 Hz by default, which makes calibration
and filtering operate less than optimally. Allow for a minimum sampling
rate specifier, though the min_freq optional parameter.

Change-Id: I7fbb894c72f72cca17d2609454e70f5f8c7874e7
Signed-off-by: Patrick Porlan <patrick.porlan@intel.com>
9 years agoCompass calibration minor fixes
Adriana Reus [Tue, 11 Nov 2014 16:21:14 +0000 (18:21 +0200)]
Compass calibration minor fixes

Change-Id: Iccc77d87a160f6a48eb9c74c18ccfd0d1a2b2368
Signed-off-by: Adriana Reus <adriana.reus@intel.com>
9 years agoGMINL-3234: Tweak magneto filter window size
Patrick Porlan [Wed, 12 Nov 2014 13:56:28 +0000 (14:56 +0100)]
GMINL-3234: Tweak magneto filter window size

100 events is way too much, and besides, this value is being reduced
to one second worth of data samples anyway. That should reduce CPU
load and latency a little bit on fast magnetometers. On the ECS
Cruise 7 it shouldn't change much as the BMC150 operates at 30 Hz max.

Change-Id: I078d071dd7c5fb0b06e0fd01739679cff0ac8bef
Tracked-On: https://jira01.devtools.intel.com/browse/GMINL-3234
Signed-off-by: Patrick Porlan <patrick.porlan@intel.com>
9 years agoConfigurable calibration steps
Adriana Reus [Tue, 11 Nov 2014 10:37:29 +0000 (12:37 +0200)]
Configurable calibration steps

Tracked-On: https://jira01.devtools.intel.com/browse/GMINL-3783
Change-Id: I90bb09187c5d6fd8002f65c92612c381b4ea4bf5
Signed-off-by: Adriana Reus <adriana.reus@intel.com>
9 years agoDon't let the timestamp get too far behind
Adriana Reus [Mon, 10 Nov 2014 17:56:36 +0000 (19:56 +0200)]
Don't let the timestamp get too far behind

Tracked-On: https://jira01.devtools.intel.com/browse/GMINL-3896
Change-Id: I151d9cc964524998fb4fa5dc388395e5e1857eb7
Signed-off-by: Adriana Reus <adriana.reus@intel.com>
9 years agoMerge remote-tracking branch 'origin/abt/topic/gmin/l-dev/sensors/master' into gmin...
Adriana Reus [Mon, 10 Nov 2014 12:18:56 +0000 (14:18 +0200)]
Merge remote-tracking branch 'origin/abt/topic/gmin/l-dev/sensors/master' into gmin/l-dev/master

git log --pretty=format:"%h %ad | %s%d [%an]" m/abt/topic/gmin/l-dev/master..origin/abt/topic/gmin/l-dev/sensors/master:
  467a854 Fri Nov 7 14:30:05 2014 +0200 | Change enable_count with flag (origin/abt/topic/gmin/l-dev/sensors/master) [Adriana Reus]
  40a6350 Mon Nov 3 16:04:30 2014 +0200 | Magneto calibration tweaks [Adriana Reus]
  8e4a72f Thu Oct 30 16:27:00 2014 +0100 | GMINL-3234: Clamp very low gyro reading to zero [Patrick Porlan]

git diff --stat m/abt/topic/gmin/l-dev/master..HEAD:
  calibration.h         |  1 -
  common.h              |  2 +-
  compass-calibration.c | 10 ++++----
  control.c             | 37 ++++++++++++++---------------
  gyro-calibration.c    |  6 ++---
  transform.c           | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++-
  6 files changed, 91 insertions(+), 30 deletions(-)

Tracked-On: https://jira01.devtools.intel.com/browse/GMINL-3832
Change-Id: I0b48e2d201d1cb27992cbf5897468abae6d9065d
Signed-off-by: Adriana Reus <adriana.reus@intel.com>
9 years agoChange enable_count with flag
Adriana Reus [Fri, 7 Nov 2014 12:30:05 +0000 (14:30 +0200)]
Change enable_count with flag

Tracked-On: https://jira01.devtools.intel.com/browse/GMINL-3725
Change-Id: I50eae55b9128ce4e3c647dbed633fea933b522dd
Signed-off-by: Adriana Reus <adriana.reus@intel.com>
9 years agoMagneto calibration tweaks
Adriana Reus [Mon, 3 Nov 2014 14:04:30 +0000 (16:04 +0200)]
Magneto calibration tweaks

Tracked-On: https://jira01.devtools.intel.com/browse/GMINL-3514
Change-Id: I7c1f61310218551ce84fd0a497f57b850490d4a9
Signed-off-by: Adriana Reus <adriana.reus@intel.com>
9 years agoGMINL-3234: Clamp very low gyro reading to zero
Patrick Porlan [Thu, 30 Oct 2014 15:27:00 +0000 (16:27 +0100)]
GMINL-3234: Clamp very low gyro reading to zero

This avoids accumulating error over long periods of time.
Incidently, be more cautious with the gyro status field,
as it's not valid for the uncal gyro.

Tracked-On: https://jira01.devtools.intel.com/browse/GMINL-3234
Change-Id: Ic4fa964bb31c3e223eabf23382be27f51e3df529
Signed-off-by: Patrick Porlan <patrick.porlan@intel.com>
9 years agoMerge remote-tracking branch 'origin/abt/topic/gmin/l-dev/sensors/master' into gmin...
Adriana Reus [Fri, 31 Oct 2014 10:28:17 +0000 (12:28 +0200)]
Merge remote-tracking branch 'origin/abt/topic/gmin/l-dev/sensors/master' into gmin/l-dev/master

git log --pretty=format:"%h %ad | %s%d [%an]" m/abt/topic/gmin/l-dev/master..origin/abt/topic/gmin/l-dev/sensors/master:
  f883d43 Mon Oct 27 14:36:06 2014 +0200 | Provision the preferred scale (origin/abt/topic/gmin/l-dev/sensors/master) [Viorel Suman]
  9b29687 Thu Oct 30 12:56:39 2014 +0200 | Handle max_freq parameter [Adriana Reus]
  64c5e96 Tue Oct 28 12:48:34 2014 +0200 | Reset gyro filtering for each enabling. [Adriana Reus]
  537fd28 Mon Oct 27 19:04:40 2014 +0200 | Fix initialization points for event_count and meta_data_pending [Adriana Reus]
  94c3ac8 Tue Oct 28 12:22:01 2014 +0200 | Fix bug in gyro filtering call. [Adriana Reus]

git diff --stat m/abt/topic/gmin/l-dev/master..HEAD:
  common.h      |  1 -
  control.c     |  2 ++
  description.c | 11 ++++++++++-
  enumeration.c | 24 ++++++++++++++++++++----
  filtering.c   | 14 ++++++++++++++
  filtering.h   |  4 ++--
  6 files changed, 48 insertions(+), 8 deletions(-)

Tracked-On: https://jira01.devtools.intel.com/browse/GMINL-3440
Change-Id: I944e1a752ca2a93f6ce3728246aaf317729bac02
Signed-off-by: Adriana Reus <adriana.reus@intel.com>
9 years agoProvision the preferred scale
Viorel Suman [Mon, 27 Oct 2014 12:36:06 +0000 (14:36 +0200)]
Provision the preferred scale

The patch enables the provisioning of the preferred
scale for a specific sensor.

Tracked-On: https://jira01.devtools.intel.com/browse/GMINL-3156
Change-Id: I6884ea03a98621e61c39ce956e9b19624e8682f0
Signed-off-by: Viorel Suman <viorel.suman@intel.com>
Reviewed-on: https://android.intel.com:443/293561

9 years agoHandle max_freq parameter
Adriana Reus [Thu, 30 Oct 2014 10:56:39 +0000 (12:56 +0200)]
Handle max_freq parameter

Tracked-On: https://jira01.devtools.intel.com/browse/GMINL-1535
Change-Id: I5aea4c040e2da587aff7bed5b08df26ea0950bda
Signed-off-by: Adriana Reus <adriana.reus@intel.com>
Reviewed-on: https://android.intel.com:443/294928

9 years agoReset gyro filtering for each enabling.
Adriana Reus [Tue, 28 Oct 2014 10:48:34 +0000 (12:48 +0200)]
Reset gyro filtering for each enabling.

Issue: GMINL-2659
Change-Id: I1d7703cb384c8ffb40539955a91fd1d3c17a074e
Signed-off-by: Adriana Reus <adriana.reus@intel.com>
9 years agoFix initialization points for event_count and meta_data_pending
Adriana Reus [Mon, 27 Oct 2014 17:04:40 +0000 (19:04 +0200)]
Fix initialization points for event_count and meta_data_pending

Issue: GMINL-2659
Change-Id: Iec77dacc2eec496ebe5f63950840de3c3ce46aca
Signed-off-by: Adriana Reus <adriana.reus@intel.com>
9 years agoFix bug in gyro filtering call.
Adriana Reus [Tue, 28 Oct 2014 10:22:01 +0000 (12:22 +0200)]
Fix bug in gyro filtering call.

Issue: GMINL-2659
Change-Id: I49b96138fa2de50ef1f324205b354769e66a18e6
Signed-off-by: Adriana Reus <adriana.reus@intel.com>
9 years agoMerge remote-tracking branch 'origin/abt/topic/gmin/l-dev/sensors/master' into gmin...
Adriana Reus [Mon, 27 Oct 2014 15:05:26 +0000 (17:05 +0200)]
Merge remote-tracking branch 'origin/abt/topic/gmin/l-dev/sensors/master' into gmin/l-dev/master

git log --pretty=format:"%h %ad | %s%d [%an]" m/abt/topic/gmin/l-dev/master..origin/abt/topic/gmin/l-dev/sensors/master:
  f4cb7dc Fri Oct 24 15:17:45 2014 +0200 | GMINL-2659: Keep recent events history for fusion-like processing (origin/abt/topic/gmin/l-dev/sensors/master) [Patrick Porlan]
  7c24cdc Mon Oct 27 13:11:25 2014 +0200 | Scale magnetic events within a sanity limit [Adriana Reus]
  ff21ce0 Thu Oct 23 16:27:42 2014 +0300 | Keep gyro cal between reboots [Adriana Reus]
  910e5cc Wed Oct 22 15:13:51 2014 +0300 | Collect a minimum number of events for filtering for noisy sensors [Adriana Reus]
  fc476f1 Fri Oct 17 15:34:20 2014 +0200 | IRDA-2056: Add type field to sensor_info structure [Patrick Porlan]

git diff --stat m/abt/topic/gmin/l-dev/master..HEAD:
  calibration.h         |  2 ++
  common.h              | 22 ++++++++++++++++++++-
  compass-calibration.c | 45 +++++++++++++++++++++++++------------------
  control.c             | 48 +++++++++++++++++++++-------------------------
  description.c         | 32 ++++++-------------------------
  enumeration.c         | 12 ++++++------
  filtering.c           | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++
  filtering.h           |  2 ++
  gyro-calibration.c    | 41 +++++++++++++++++++++++++++++++++++++--
  transform.c           | 38 ++++++++++++++++++++++--------------
  10 files changed, 201 insertions(+), 94 deletions(-)

Tracked-On: https://jira01.devtools.intel.com/browse/GMINL-3169
Change-Id: I6e0ec40cfd34c7cf3eef2428ee6b33de7f7173c4
Signed-off-by: Adriana Reus <adriana.reus@intel.com>
9 years agoMerge remote-tracking branch 'origin/abt/topic/gmin/l-dev/sensors/master' into gmin...
Adriana Reus [Mon, 27 Oct 2014 15:05:26 +0000 (17:05 +0200)]
Merge remote-tracking branch 'origin/abt/topic/gmin/l-dev/sensors/master' into gmin/l-dev/master

git log --pretty=format:"%h %ad | %s%d [%an]" m/abt/topic/gmin/l-dev/master..origin/abt/topic/gmin/l-dev/sensors/master:
  f4cb7dc Fri Oct 24 15:17:45 2014 +0200 | GMINL-2659: Keep recent events history for fusion-like processing (origin/abt/topic/gmin/l-dev/sensors/master) [Patrick Porlan]
  7c24cdc Mon Oct 27 13:11:25 2014 +0200 | Scale magnetic events within a sanity limit [Adriana Reus]
  ff21ce0 Thu Oct 23 16:27:42 2014 +0300 | Keep gyro cal between reboots [Adriana Reus]
  910e5cc Wed Oct 22 15:13:51 2014 +0300 | Collect a minimum number of events for filtering for noisy sensors [Adriana Reus]
  fc476f1 Fri Oct 17 15:34:20 2014 +0200 | IRDA-2056: Add type field to sensor_info structure [Patrick Porlan]

git diff --stat m/abt/topic/gmin/l-dev/master..HEAD:
  calibration.h         |  2 ++
  common.h              | 22 ++++++++++++++++++++-
  compass-calibration.c | 45 +++++++++++++++++++++++++------------------
  control.c             | 48 +++++++++++++++++++++-------------------------
  description.c         | 32 ++++++-------------------------
  enumeration.c         | 12 ++++++------
  filtering.c           | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++
  filtering.h           |  2 ++
  gyro-calibration.c    | 41 +++++++++++++++++++++++++++++++++++++--
  transform.c           | 38 ++++++++++++++++++++++--------------
  10 files changed, 201 insertions(+), 94 deletions(-)

Change-Id: I6e0ec40cfd34c7cf3eef2428ee6b33de7f7173c4

9 years agoGMINL-2659: Keep recent events history for fusion-like processing
Patrick Porlan [Fri, 24 Oct 2014 13:17:45 +0000 (15:17 +0200)]
GMINL-2659: Keep recent events history for fusion-like processing

We may wish to correlate recent input from several active sensors.
In preparation to that, keep the last 100 events we got for the
entire sensors collection. This is intended as a lightweight record,
built and used from the main sensor sample retrieval thread exclusively
so we don't have to deal with performance-degrading synchronization
primitives. This data will enable multi-sensors filtering decisions.

Change-Id: Ied6559c7dd91e94bebbeb1bc60182d1db3103d8c
Signed-off-by: Patrick Porlan <patrick.porlan@intel.com>
9 years agoScale magnetic events within a sanity limit
Adriana Reus [Mon, 27 Oct 2014 11:11:25 +0000 (13:11 +0200)]
Scale magnetic events within a sanity limit

Scale magnetic events even if we don't have a calibration.
If the values are considered "wrong" by Android it does not compute
values for the virtual sensors until we have a calibration and
sane looking values in place

Change-Id: I94347d98f541c85d9734ce347a070abca351de2c
Signed-off-by: Adriana Reus <adriana.reus@intel.com>
9 years agoKeep gyro cal between reboots
Adriana Reus [Thu, 23 Oct 2014 13:27:42 +0000 (16:27 +0300)]
Keep gyro cal between reboots

Issue: GMINL-2743
Change-Id: I232e979d62d12f31168c0bfdcfcd3b224d5237b3
Signed-off-by: Adriana Reus <adriana.reus@intel.com>
Reviewed-on: https://android.intel.com:443/292457

9 years agoCollect a minimum number of events for filtering for noisy sensors
Adriana Reus [Wed, 22 Oct 2014 12:13:51 +0000 (15:13 +0300)]
Collect a minimum number of events for filtering for noisy sensors

This is to make sure we have at least a couple of events for
the filtering queue and to make sure we are not sensing events
that can affect the overall mean or standard deviation.

Change-Id: If359915e7281a553758eb79ec10ea0559f9490f8
Signed-off-by: Adriana Reus <adriana.reus@intel.com>
Reviewed-on: https://android.intel.com:443/291953

9 years agoIRDA-2056: Add type field to sensor_info structure
Patrick Porlan [Fri, 17 Oct 2014 13:34:20 +0000 (15:34 +0200)]
IRDA-2056: Add type field to sensor_info structure

We were getting this information through the associated catalog
entry but it's considerably more readable this way.

Change-Id: I7b4489738e755a2831930c0a1a335a2fb9e731cc
Signed-off-by: Patrick Porlan <patrick.porlan@intel.com>
9 years agoMerge remote-tracking branch 'origin/abt/topic/gmin/l-dev/sensors/master' into gmin...
Adriana Reus [Thu, 23 Oct 2014 13:58:47 +0000 (16:58 +0300)]
Merge remote-tracking branch 'origin/abt/topic/gmin/l-dev/sensors/master' into gmin/l-dev/master

git log --pretty=format:"%h %ad | %s%d [%an]" m/abt/topic/gmin/l-dev/master..origin/abt/topic/gmin/l-dev/sensors/master:
  5b9cb96 Thu Oct 16 10:33:57 2014 +0200 | IRDA-2056: Header file cleanup (origin/abt/topic/gmin/l-dev/sensors/master) [Patrick Porlan]
  af41894 Wed Oct 15 14:30:40 2014 +0200 | IRDA-2056: Rename continuous quirk flag and fix the location where it's used [Patrick Porlan]
  7755b1c Wed Oct 15 14:29:25 2014 +0200 | IRDA-2056: Cosmetic whitespace shuffling [Patrick Porlan]
  138a7ad Wed Oct 15 14:27:10 2014 +0200 | IRDA-2056: Link the terse flag to the variable we're now using to decide whether or not to operate in "driver only sending events on motion" mode. [Patrick Porlan]
  4b21c9f Wed Oct 15 14:22:02 2014 +0200 | IRDA-2056: Remove a superfluous check [Patrick Porlan]

git diff --stat m/abt/topic/gmin/l-dev/master..HEAD:
  control.c     |  4 ++--
  description.c |  7 +++----
  description.h | 35 +++++++++++++++--------------------
  enumeration.c | 59 ++++++++++++++++++++++-------------------------------------
  4 files changed, 42 insertions(+), 63 deletions(-)

Tracked-On:https://jira01.devtools.intel.com/browse/GMINL-2821
Change-Id: I36bcd5eee3af84edc2c311a72f032bb14a3546b7
Signed-off-by: Adriana Reus <adriana.reus@intel.com>
9 years agoIRDA-2056: Header file cleanup
Patrick Porlan [Thu, 16 Oct 2014 08:33:57 +0000 (10:33 +0200)]
IRDA-2056: Header file cleanup

Order and symetry reduce the reader's cognitive load...

Change-Id: Ifa47d3a109898a16565eac7315bc35711bda4b9c
Signed-off-by: Patrick Porlan <patrick.porlan@intel.com>
Reviewed-on: https://android.intel.com:443/289221

9 years agoIRDA-2056: Rename continuous quirk flag and fix the location where it's used
Patrick Porlan [Wed, 15 Oct 2014 12:30:40 +0000 (14:30 +0200)]
IRDA-2056: Rename continuous quirk flag and fix the location where it's used

This flag is used to force use of the continuous trigger, typically
in cases where the motion trigger would otherwise be autoselected.

Also, there are cases, such as with the Invensense driver that we
have on the T100, where a single trigger will control several
sensors because they're associated to the same iio device. In that
case having a single sensor forced to continous mode will imply that
no sensor co-located on the same iio device can be in "only send
events whenever there's motion" mode.

Change-Id: I4d01d2d964b70dead3e67c54bdd92d7d938cbf23
Signed-off-by: Patrick Porlan <patrick.porlan@intel.com>
Reviewed-on: https://android.intel.com:443/289220

9 years agoIRDA-2056: Cosmetic whitespace shuffling
Patrick Porlan [Wed, 15 Oct 2014 12:29:25 +0000 (14:29 +0200)]
IRDA-2056: Cosmetic whitespace shuffling

Change-Id: Ie6aecf3f7f595e4c8bd4ca9cd15b1562b81dfe92
Signed-off-by: Patrick Porlan <patrick.porlan@intel.com>
Reviewed-on: https://android.intel.com:443/289219

9 years agoIRDA-2056: Link the terse flag to the variable we're now using to decide
Patrick Porlan [Wed, 15 Oct 2014 12:27:10 +0000 (14:27 +0200)]
IRDA-2056: Link the terse flag to the variable we're now using to decide
whether or not to operate in "driver only sending events on
motion" mode.

Change-Id: I9600e4d8611715b2a55a523613af1dec368a8893
Signed-off-by: Patrick Porlan <patrick.porlan@intel.com>
Reviewed-on: https://android.intel.com:443/289218

9 years agoIRDA-2056: Remove a superfluous check
Patrick Porlan [Wed, 15 Oct 2014 12:22:02 +0000 (14:22 +0200)]
IRDA-2056: Remove a superfluous check

We don't really have to check whether or not a sensor type is
defined as continuous by Android when we encounter a motion
trigger for the associated sensor. Simply record the name, and
we'll decide later if, and when, it has to be selected.

Change-Id: Ibc77470db1d66cc67f5e799f0db454e3157f3945
Signed-off-by: Patrick Porlan <patrick.porlan@intel.com>
Reviewed-on: https://android.intel.com:443/289217

9 years agoMerge remote-tracking branch 'origin/abt/topic/gmin/l-dev/sensors/master' into gmin...
Adriana Reus [Tue, 21 Oct 2014 15:11:26 +0000 (18:11 +0300)]
Merge remote-tracking branch 'origin/abt/topic/gmin/l-dev/sensors/master' into gmin/l-dev/master

git log --pretty=format:"%h %ad | %s%d [%an]" m/abt/topic/gmin/l-dev/master..origin/abt/topic/gmin/l-dev/sensors/master:
  8f3c496 Mon Oct 20 20:12:36 2014 +0300 | Synchronize our timestamps with the SystemClock.getRealtimeNanos (origin/abt/topic/gmin/l-dev/sensors/master) [Adriana Reus]
  60c1864 Wed Oct 15 14:13:13 2014 +0200 | IRDA-2056: Minor rework to the trigger switching code [Patrick Porlan]
  58f7faf Wed Oct 15 14:11:32 2014 +0200 | IRDA-2056: Minor cosmetic tweaks [Patrick Porlan]
  dd4d8ca Wed Oct 15 14:03:24 2014 +0200 | IRDA-2056: Refine the test we use to decide to apply gyro calibration [Patrick Porlan]
  db7e7fb Wed Oct 15 11:32:36 2014 +0200 | IRDA-2056: Fix accuracy indicator for gyroscope readings. [Patrick Porlan]
  5caa616 Fri Oct 17 10:01:29 2014 +0300 | Include acceptable threshold on TS [Viorel Suman]

git diff --stat m/abt/topic/gmin/l-dev/master..HEAD:
  common.h           |  3 +++
  control.c          | 61 ++++++++++++++++++++++++++++++++++++++----------------
  gyro-calibration.c |  2 --
  transform.c        | 19 +++++++++++++++--
  utils.c            | 42 ++++++++++++++++++++++++++++++++-----
  utils.h            |  7 ++++---
  6 files changed, 104 insertions(+), 30 deletions(-)
~

Tracked-On:https://jira01.devtools.intel.com/browse/GMINL-2673
Change-Id: Ice355c5abc14344b224b5a933cb1a9519ec305a0
Signed-off-by: Adriana Reus <adriana.reus@intel.com>
9 years agoSynchronize our timestamps with the SystemClock.getRealtimeNanos
Adriana Reus [Mon, 20 Oct 2014 17:12:36 +0000 (20:12 +0300)]
Synchronize our timestamps with the SystemClock.getRealtimeNanos

It seems we get unsynced after a suspend/resume cycle.
Sync the clocks once per sensor enabling.
CDD required us to be in sync anyway.

Tracked-On: https://jira01.devtools.intel.com/browse/GMINL-1535
Change-Id: I2422551837832575492ee2d0c1a7adb1163b3167
Signed-off-by: Adriana Reus <adriana.reus@intel.com>
9 years agoIRDA-2056: Minor rework to the trigger switching code
Patrick Porlan [Wed, 15 Oct 2014 12:13:13 +0000 (14:13 +0200)]
IRDA-2056: Minor rework to the trigger switching code

Isolate the test that we use to switch from the motion trigger to
the continous one (for accelerometer based games that are sensitive
to small motion thresholds) into a function. Also, specifically
deactivate this behaviour for drivers marked as terse: for those it
may make sense to initialize the motion trigger name field with the
same string as the initial trigger name field, so let's check for
the terse flag.

Change-Id: Ia666caed8f04345aca7c09d6a686107590ffc590
Signed-off-by: Patrick Porlan <patrick.porlan@intel.com>
9 years agoIRDA-2056: Minor cosmetic tweaks
Patrick Porlan [Wed, 15 Oct 2014 12:11:32 +0000 (14:11 +0200)]
IRDA-2056: Minor cosmetic tweaks

Change-Id: I6032b66272dd6056b192ba52a6d2f573eca4d779
Signed-off-by: Patrick Porlan <patrick.porlan@intel.com>
9 years agoIRDA-2056: Refine the test we use to decide to apply gyro calibration
Patrick Porlan [Wed, 15 Oct 2014 12:03:24 +0000 (14:03 +0200)]
IRDA-2056: Refine the test we use to decide to apply gyro calibration

The terse flag should only be used with drivers that a) don't
expose a recognizable motion trigger (we currently look for the
any-motion substring), b) are not for sensor types that Android
defines as continuous, and c) are nonetheless on-change. As of
today the only remaining example of this that I can think of
are the XPS 12 ISH drivers, so I prefer not to use this flag
to decide whether or not to apply calibration. Checking whether
we're using the initial or motion trigger seems better, if not
fully satisfactory.

Change-Id: I24c6632497f758e1301da7927ec94bf17f6fe84d
Signed-off-by: Patrick Porlan <patrick.porlan@intel.com>
9 years agoIRDA-2056: Fix accuracy indicator for gyroscope readings.
Patrick Porlan [Wed, 15 Oct 2014 09:32:36 +0000 (11:32 +0200)]
IRDA-2056: Fix accuracy indicator for gyroscope readings.

Report medium accuracy rather than the default (unreliable) one
if we're not using calibration.

Change-Id: I648075681eed0a82bc081babe8a0825096bbe4a4

9 years agoInclude acceptable threshold on TS
Viorel Suman [Fri, 17 Oct 2014 07:01:29 +0000 (10:01 +0300)]
Include acceptable threshold on TS

The patch takes in consideration the acceptable threshold when adjusting
the event timestamp. The accelerometer threshold is enforced to "1" in
order to make happy virtual sensors test cases - virtual sensors events
are clones of accel events (so are the timestamps), see "process" method
in GravitySensor.cpp, OrientationSensor.cpp, RotationVectorSensor.cpp
from frameworks/native/services/sensorservice.

Tracked-On: https://jira01.devtools.intel.com/browse/GMINL-264
Change-Id: Ie9e05949154ed2f4e3bac4f1d405bb41c6a7ddcb
Signed-off-by: Viorel Suman <viorel.suman@intel.com>
9 years agoMerge remote-tracking branch 'origin/abt/topic/gmin/l-dev/sensors/master' into gmin...
Adriana Reus [Thu, 16 Oct 2014 15:25:08 +0000 (18:25 +0300)]
Merge remote-tracking branch 'origin/abt/topic/gmin/l-dev/sensors/master' into gmin/l-dev/master

git log --pretty=format:"%h %ad | %s%d [%an]" m/abt/topic/gmin/l-dev/master..origin/abt/topic/gmin/l-dev/sensors/master:
  c5d1ab6 Wed Oct 15 19:42:45 2014 +0300 | Limit max frequency to 400Hz (origin/abt/topic/gmin/l-dev/sensors/master) [Adriana Reus]
  c1b848a Mon Oct 13 09:32:10 2014 +0300 | Fix using s as index to array before check [Viorel Suman]
  d52af6c Mon Aug 11 14:46:19 2014 +0300 | sens: update properties name and value max size [Octavian Purdila]
  e338f33 Tue Jul 29 17:20:00 2014 +0300 | sens: HAL library path autodetect [Octavian Purdila]
  a2b5a4f Tue Jul 29 16:08:57 2014 +0300 | sens: use Android.mk to get the HAL sources for the Linux build [Octavian Purdila]

git diff --stat m/abt/topic/gmin/l-dev/master..HEAD:
  Android.mk                |  4 +---
  Makefile                  | 11 ++++++-----
  common.h                  |  2 +-
  control.c                 |  6 +++---
  linux/cutils/properties.h |  4 ++--
  sens.c                    | 31 +++++++++++++++++++++++++++----
  6 files changed, 40 insertions(+), 18 deletions(-)

Tracked-On: https://jira01.devtools.intel.com/browse/GMINL-2463
Change-Id: I54b6ee99aa16c5cc96b33ab9c5878ce634f3f845
Signed-off-by: Adriana Reus <adriana.reus@intel.com>
9 years agoMerge remote-tracking branch 'origin/abt/topic/gmin/l-dev/sensors/master' into gmin...
Adriana Reus [Thu, 16 Oct 2014 15:25:08 +0000 (18:25 +0300)]
Merge remote-tracking branch 'origin/abt/topic/gmin/l-dev/sensors/master' into gmin/l-dev/master

git log --pretty=format:"%h %ad | %s%d [%an]" m/abt/topic/gmin/l-dev/master..origin/abt/topic/gmin/l-dev/sensors/master:
  c5d1ab6 Wed Oct 15 19:42:45 2014 +0300 | Limit max frequency to 400Hz (origin/abt/topic/gmin/l-dev/sensors/master) [Adriana Reus]
  c1b848a Mon Oct 13 09:32:10 2014 +0300 | Fix using s as index to array before check [Viorel Suman]
  d52af6c Mon Aug 11 14:46:19 2014 +0300 | sens: update properties name and value max size [Octavian Purdila]
  e338f33 Tue Jul 29 17:20:00 2014 +0300 | sens: HAL library path autodetect [Octavian Purdila]
  a2b5a4f Tue Jul 29 16:08:57 2014 +0300 | sens: use Android.mk to get the HAL sources for the Linux build [Octavian Purdila]

git diff --stat m/abt/topic/gmin/l-dev/master..HEAD:
  Android.mk                |  4 +---
  Makefile                  | 11 ++++++-----
  common.h                  |  2 +-
  control.c                 |  6 +++---
  linux/cutils/properties.h |  4 ++--
  sens.c                    | 31 +++++++++++++++++++++++++++----
  6 files changed, 40 insertions(+), 18 deletions(-)

Change-Id: I54b6ee99aa16c5cc96b33ab9c5878ce634f3f845

9 years agoLimit max frequency to 400Hz
Adriana Reus [Wed, 15 Oct 2014 16:42:45 +0000 (19:42 +0300)]
Limit max frequency to 400Hz

It seems that having the accel and the gyro work at very high
frequencies (> 500) at the same time does not go very well with the
overall cpu loading and can affect other threads, for example the magnetometer
events don't come as fast as cts would like it given these conditions.

Tracked-On: https://jira01.devtools.intel.com/browse/GMINL-2227
Change-Id: I69480b393794afb072654451a468c30bb821466a
Signed-off-by: Adriana Reus <adriana.reus@intel.com>
9 years agoFix using s as index to array before check
Viorel Suman [Mon, 13 Oct 2014 06:32:10 +0000 (09:32 +0300)]
Fix using s as index to array before check

The patch fixes the using of s as index to array
sensor_info before check.

Issue: GMINL-2312
Change-Id: I17f474526c9e48bc598e067106738d50b87398a5
Signed-off-by: Viorel Suman <viorel.suman@intel.com>
9 years agosens: update properties name and value max size
Octavian Purdila [Mon, 11 Aug 2014 11:46:19 +0000 (14:46 +0300)]
sens: update properties name and value max size

Update the Linux properties name and value max size to match those in
Android.

Change-Id: I9ac24242b1056a5e65f921a31d9ec583d166bae2
Signed-off-by: Octavian Purdila <octavian.purdila@intel.com>
9 years agosens: HAL library path autodetect
Octavian Purdila [Tue, 29 Jul 2014 14:20:00 +0000 (17:20 +0300)]
sens: HAL library path autodetect

Change-Id: Ic32e932ad5f179f7cba710c21e07e6cb0c1d3623
Signed-off-by: Octavian Purdila <octavian.purdila@intel.com>
9 years agosens: use Android.mk to get the HAL sources for the Linux build
Octavian Purdila [Tue, 29 Jul 2014 13:08:57 +0000 (16:08 +0300)]
sens: use Android.mk to get the HAL sources for the Linux build

Also, use the same name for the Linux build HAL (sensors.gmin.so).

Change-Id: I3290c6347a3746634d721367eb2b6b42d92e759e
Signed-off-by: Octavian Purdila <octavian.purdila@intel.com>
9 years agoMerge remote-tracking branch 'origin/abt/topic/gmin/l-dev/sensors/master' into gmin...
Adriana Reus [Wed, 8 Oct 2014 09:22:32 +0000 (12:22 +0300)]
Merge remote-tracking branch 'origin/abt/topic/gmin/l-dev/sensors/master' into gmin/l-dev/master

git log --pretty=format:"%h %ad | %s%d [%an]" m/abt/topic/gmin/l-dev/master..origin/abt/topic/gmin/l-dev/sensors/master:
  8fb9851 Tue Oct 7 16:01:48 2014 +0300 | Retry when sysfs_write_str fails (origin/abt/topic/gmin/l-dev/sensors/master) [Viorel Suman]
  d679bc6 Tue Sep 30 17:07:53 2014 +0300 | Acquisition routine review [Viorel Suman]
  b1efe3a Fri Oct 3 15:12:44 2014 +0300 | Some tweaks to the median filter [Adriana Reus]
  d1b25b5 Mon Oct 6 16:17:16 2014 +0300 | Fixing some compiler warnings [Adriana Reus]
  344447a Fri Sep 26 12:15:15 2014 +0300 | Upgrade HAL version to 1_3 [Adriana Reus]
  2e4e1a2 Thu Sep 25 14:42:49 2014 +0300 | Implement batch and flush functions [Adriana Reus]
  b24d658 Fri Oct 3 10:24:36 2014 +0300 | Min/Max delay for Light and Temperature [Viorel Suman]

git diff --stat m/abt/topic/gmin/l-dev/master..HEAD:
  common.h      |   6 +++
  control.c     | 124 ++++++++++++++++++++++++++++++++++++----------------------
  control.h     |   3 +-
  description.c | 113 +++++++++++++++++++++++++++++++++++-----------------
  description.h |   2 +
  entry.c       |  19 +++++++--
  enumeration.c |  28 ++++---------
  filtering.c   |  69 +++++++++++++++++++-------------
  filtering.h   |  26 +++---------
  transform.c   |   2 +-
  utils.c       |   2 +-
  utils.h       |   1 +
  12 files changed, 239 insertions(+), 156 deletions(-)

Change-Id: Ic4fb49db812d123bc903e9106f5a2b7c220ef490
Signed-off-by: Adriana Reus <adriana.reus@intel.com>
9 years agoRetry when sysfs_write_str fails
Viorel Suman [Tue, 7 Oct 2014 13:01:48 +0000 (16:01 +0300)]
Retry when sysfs_write_str fails

The sysfs_write_str might fail if called
often on the same file. We retry a few times
in that case.

Change-Id: I42cdc2484728ab837a35b54d01ed87abd6bdcb0c
Signed-off-by: Viorel Suman <viorel.suman@intel.com>
9 years agoAcquisition routine review
Viorel Suman [Tue, 30 Sep 2014 14:07:53 +0000 (17:07 +0300)]
Acquisition routine review

The OVERHEAD_THRESHOLD is a quite subjective
platform specific constant, so the current patch
tries to adjust in a more elegant way the target_time
passed to pthread_cond_timedwait.

Issue: GMINL-1535
Change-Id: Ic4156b1cf5e712eee9ca7e1cc597b0b3fef3432e
Signed-off-by: Viorel Suman <viorel.suman@intel.com>
9 years agoSome tweaks to the median filter
Adriana Reus [Fri, 3 Oct 2014 12:12:44 +0000 (15:12 +0300)]
Some tweaks to the median filter

Made it field number agnostic, also window size agnostic.

Change-Id: I3ac5afaeec4cb8e7be6e0bccbb6dd34324316592
Signed-off-by: Adriana Reus <adriana.reus@intel.com>
9 years agoFixing some compiler warnings
Adriana Reus [Mon, 6 Oct 2014 13:17:16 +0000 (16:17 +0300)]
Fixing some compiler warnings

vendor/intel/hardware/iio-sensors/./entry.c:29:2: warning: implicit declaration of function 'sensor_get_quirks' [-Wimplicit-function-declaration]

vendor/intel/hardware/iio-sensors/./enumeration.c:338:2: warning: format '%ld' expects argument of type 'long int', but argument 7 has type 'int32_t' [-Wformat=]

vendor/intel/hardware/iio-sensors/./description.c:443:2: warning: implicit declaration of function 'sysfs_read_str' [-Wimplicit-function-declaration]

vendor/intel/hardware/iio-sensors/./description.c:460:4: warning: implicit declaration of function 'isspace' [-Wimplicit-function-declaration]

Change-Id: I6baa6ead295e24d18bf8af5c8db3293d565738d8
Signed-off-by: Adriana Reus <adriana.reus@intel.com>
9 years agoUpgrade HAL version to 1_3
Adriana Reus [Fri, 26 Sep 2014 09:15:15 +0000 (12:15 +0300)]
Upgrade HAL version to 1_3

Signed-off-by: Adriana Reus <adriana.reus@intel.com>
Change-Id: Iecf94131c3e6cd62b6eb3d4027c08ec16a210632

9 years agoImplement batch and flush functions
Adriana Reus [Thu, 25 Sep 2014 11:42:49 +0000 (14:42 +0300)]
Implement batch and flush functions

We need these so that we can upgrade the HAL.
Even if we don't have batch yet, the 1_3 API is requiring them.

Change-Id: I47da935b38bf1b051e3b5a18951d8f4724a82e31
Signed-off-by: Adriana Reus <adriana.reus@intel.com>
9 years agoMin/Max delay for Light and Temperature
Viorel Suman [Fri, 3 Oct 2014 07:24:36 +0000 (10:24 +0300)]
Min/Max delay for Light and Temperature

The patch reviews the get_min_delay and
get_max_delay methods, and sets the min delay
for polling light and temperature sensors.

Change-Id: I75303c672c7ccc5ec5fe4d7f879ed934cda1f55a
Signed-off-by: Viorel Suman <viorel.suman@intel.com>
9 years agoMerge remote-tracking branch 'origin/abt/topic/gmin/l-dev/sensors/master' into gmin...
Adriana Reus [Wed, 1 Oct 2014 15:17:20 +0000 (18:17 +0300)]
Merge remote-tracking branch 'origin/abt/topic/gmin/l-dev/sensors/master' into gmin/l-dev/master

git log --pretty=format:"%h %ad | %s%d [%an]" m/abt/topic/gmin/l-dev/master..origin/abt/topic/gmin/l-dev/sensors/master:
  66e23b6 Tue Sep 30 17:03:23 2014 +0300 | load/set_timestamp functions implementation (origin/abt/topic/gmin/l-dev/sensors/master) [Viorel Suman]
  5426187 Mon Sep 29 17:59:12 2014 +0200 | IRDA-1184: Fix event duplication condition [Patrick Porlan]
  91169af Mon Sep 29 17:26:00 2014 +0200 | IRDA-1184: Fix poll time calculation routine [Patrick Porlan]
  2afe869 Tue Sep 23 16:23:10 2014 +0300 | Moving average optimization [Viorel Suman]
  6cd353a Wed Oct 1 12:08:58 2014 +0300 | Minor clean-up [Adriana Reus]
  c8bc431 Wed Oct 1 11:42:12 2014 +0300 | Don't setup the timestamp artificially for non-continous sensors [Adriana Reus]
  58dfca4 Thu Sep 25 15:37:21 2014 +0300 | Clamp frequency to smallest supported rate if requested lower [Adriana Reus]
  77fd2f6 Wed Sep 24 16:43:08 2014 +0200 | IRDA-1184: Alternate between triggers depending on sampling rate [Patrick Porlan]
  c230e47 Thu Sep 18 23:22:31 2014 +0200 | control: Retry when buffer enabling fails [Samuel Ortiz]
  8977477 Thu Sep 25 12:12:44 2014 +0300 | Initialize fifoReservedEventCount and fifoMaxEventCount [Adriana Reus]

git diff --stat m/abt/topic/gmin/l-dev/master..HEAD:
  calibration.h         |    8 -----
  common.h              |    1 +
  compass-calibration.c |    6 ++++
  control.c             |   93 +++++++++++++++++++++++++++++++++++++++++--------
  description.h         |    3 ++
  enumeration.c         |    6 ++++
  transform.c           |   41 ++++++++++++++--------
  utils.c               |   15 ++++++--
  utils.h               |    2 ++
  9 files changed, 135 insertions(+), 40 deletions(-)

Change-Id: Idc427a94cdc7645185dba5f57e5d8359d7a46815
Signed-off-by: Adriana Reus <adriana.reus@intel.com>
9 years agoload/set_timestamp functions implementation
Viorel Suman [Tue, 30 Sep 2014 14:03:23 +0000 (17:03 +0300)]
load/set_timestamp functions implementation

The patch implements the load_timestamp and
set_timestamp functions aimed to provide a
common way to manage the timestamps.

Change-Id: If5d5d86ed9f83298385e7736345f7eee2884418c
Signed-off-by: Viorel Suman <viorel.suman@intel.com>
9 years agoIRDA-1184: Fix event duplication condition
Patrick Porlan [Mon, 29 Sep 2014 15:59:12 +0000 (17:59 +0200)]
IRDA-1184: Fix event duplication condition

Now that we can dynamically switch between continous and motion
triggers, checking for the terse flag is not necessary, and is
confusing.

Issue: IRDA-1184

Change-Id: Iaed039550a2d4d30b1cb1aa1c03785d4bcbe6b70
Signed-off-by: Patrick Porlan <patrick.porlan@intel.com>
9 years agoIRDA-1184: Fix poll time calculation routine
Patrick Porlan [Mon, 29 Sep 2014 15:26:00 +0000 (17:26 +0200)]
IRDA-1184: Fix poll time calculation routine

The poll delay should be maximum if we're operating in continuous mode
even if the sensor supports a motion trigger. This should very slightly
lower CPU consumption, avoiding a few unrequired exits from epoll.

Issue: IRDA-1184

Change-Id: I026be3de5fed49b77f7d9ac3718ab7c71e527d9d
Signed-off-by: Patrick Porlan <patrick.porlan@intel.com>
9 years agoMoving average optimization
Viorel Suman [Tue, 23 Sep 2014 13:23:10 +0000 (16:23 +0300)]
Moving average optimization

The patch optimizes the moving average calculation
by introducing the moving history sum calculated
while the new data is recorded.

Change-Id: I9a8a505c983ecd48c1e160495ea45030dabbf535
Signed-off-by: Viorel Suman <viorel.suman@intel.com>
9 years agoMinor clean-up
Adriana Reus [Wed, 1 Oct 2014 09:08:58 +0000 (12:08 +0300)]
Minor clean-up

Change-Id: Ib2b81f09c6a640f858b2564cb8232622693f3c4c
Signed-off-by: Adriana Reus <adriana.reus@intel.com>
9 years agoDon't setup the timestamp artificially for non-continous sensors
Adriana Reus [Wed, 1 Oct 2014 08:42:12 +0000 (11:42 +0300)]
Don't setup the timestamp artificially for non-continous sensors

Change-Id: I52c2e8777f28ea8a958f3078486ec0dcce4e505d
Signed-off-by: Adriana Reus <adriana.reus@intel.com>
9 years agoClamp frequency to smallest supported rate if requested lower
Adriana Reus [Thu, 25 Sep 2014 12:37:21 +0000 (15:37 +0300)]
Clamp frequency to smallest supported rate if requested lower

As per HAL spec requirements.
Signed-off-by: Adriana Reus <adriana.reus@intel.com>
Change-Id: I31df5dfef5bf5ba463aeaa295369fea1f19cf96d

9 years agoIRDA-1184: Alternate between triggers depending on sampling rate
Patrick Porlan [Wed, 24 Sep 2014 14:43:08 +0000 (16:43 +0200)]
IRDA-1184: Alternate between triggers depending on sampling rate

The BMC150 accel driver any-motion trigger is too jerky for certain
games such as the "sniper shooter" one, or "doodle jump". Switch back
to continuous event generation mode if a sampling rate above 25 is
requested, which should keep both the launcher (15 events per second)
and games (60 events per second) happy.

Issue: IRDA-1184

Change-Id: I16000d57e17506aa7e7c0a4f83ced7739e01dd01
Signed-off-by: Patrick Porlan <patrick.porlan@intel.com>
9 years agocontrol: Retry when buffer enabling fails
Samuel Ortiz [Thu, 18 Sep 2014 21:22:31 +0000 (23:22 +0200)]
control: Retry when buffer enabling fails

On suspend/resume cycles, enabling the data buffer might fail and thus
would keep the driver in sleep mode.
We retry a few times in that case, giving the driver a few ms to come
back from suspend.

Issue: IRDA-603
Change-Id: Icd781d6574052d1c87a9f0b29b68ea72aa4dbbb2
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
9 years agoInitialize fifoReservedEventCount and fifoMaxEventCount
Adriana Reus [Thu, 25 Sep 2014 09:12:44 +0000 (12:12 +0300)]
Initialize fifoReservedEventCount and fifoMaxEventCount

Set them up to 0 as we are not implementing batch yet,
will be set up appropriately when we will have batch mode.

Change-Id: Ia6d3fc46d12ce453deb150e312afb6ae5043a973
Signed-off-by: Adriana Reus <adriana.reus@intel.com>
9 years agoMerge remote-tracking branch 'origin/abt/topic/gmin/l-dev/sensors/master' into gmin...
Viorel Suman [Wed, 24 Sep 2014 14:29:10 +0000 (17:29 +0300)]
Merge remote-tracking branch 'origin/abt/topic/gmin/l-dev/sensors/master' into gmin/l-dev/master

git log --pretty=format:"%h %ad | %s%d [%an]" origin/abt/topic/gmin/l-dev/master..origin/abt/topic/gmin/l-dev/sensors/master:
  ccf4852 Wed Sep 24 14:53:45 2014 +0300 | Adapt polling rate to get a real frequency closer to the advertised one (origin/abt/topic/gmin/l-dev/sensors/master) [Adriana Reus]
  83d771c Wed Sep 24 12:33:11 2014 +0300 | Median filter implementation [Adriana Reus]
  38059a0 Thu Sep 18 16:08:42 2014 +0300 | The event timestamp as function of frequency [Viorel Suman]
  eb6f309 Thu Sep 18 14:36:04 2014 +0300 | Revert "[Workaround] Fix event timestamp recurrency" [Viorel Suman]

git diff --stat origin/abt/topic/gmin/l-dev/master..HEAD:
  Android.mk    |   1 +
  common.h      |   5 ++-
  control.c     |  36 +++++++++++++++-----
  description.c |   6 +++-
  description.h |   1 +
  enumeration.c |  28 +++++++++++++++
  filtering.c   | 108 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  filtering.h   |  25 ++++++++++++++
  transform.c   |   3 +-
  9 files changed, 202 insertions(+), 11 deletions(-)

Change-Id: I74cefcc04c195180362a9c34f4d57cda9e5151f1
Signed-off-by: Viorel Suman <viorel.suman@intel.com>
9 years agoAdapt polling rate to get a real frequency closer to the advertised one
Adriana Reus [Wed, 24 Sep 2014 11:53:45 +0000 (14:53 +0300)]
Adapt polling rate to get a real frequency closer to the advertised one

When polling try to compensate for the iio overhead in
order to try to get a frequency closer to the advertised one.
It helps for a bunch of cts tests.

Signed-off-by: Adriana Reus <adriana.reus@intel.com>
Change-Id: I9fd6352d9515faff368167f8f2be66869cf75eda

9 years agoMedian filter implementation
Adriana Reus [Wed, 24 Sep 2014 09:33:11 +0000 (12:33 +0300)]
Median filter implementation

Use a median filter for gyroscope. It seems better
suited for the type of noise we are observing and it
also solves cts standard deviation failures

Signed-off-by: Adriana Reus <adriana.reus@intel.com>
Change-Id: Ib53846cfb92912ae66d16e6993e6f97d4a3e3328

9 years agoThe event timestamp as function of frequency
Viorel Suman [Thu, 18 Sep 2014 13:08:42 +0000 (16:08 +0300)]
The event timestamp as function of frequency

The patch guards the sensor event timestamp
as function of frequency in order to fix the
"EventGapVerification" and "FrequencyVerification"
from the new L-Dessert SingleSensorTests CTS test
case. It also introduces the CONTINUOUS_DRIVER quirk
used to enforce the continuous driver mode.

Issue: GMINL-544
Change-Id: I5b6accd1c7fa84e3eaeeb48c77fe86bc824781b3
Signed-off-by: Viorel Suman <viorel.suman@intel.com>
9 years agoRevert "[Workaround] Fix event timestamp recurrency"
Viorel Suman [Thu, 18 Sep 2014 11:36:04 +0000 (14:36 +0300)]
Revert "[Workaround] Fix event timestamp recurrency"

This reverts commit b1f370d00598b68a52c754495e6455a8af5c2b35.
Change-Id: If9aa055b01ad2326f5c567a7c25f207188b206eb

9 years agoMerge remote-tracking branch 'origin/abt/topic/gmin/l-dev/sensors/master' into gmin...
Adriana Reus [Thu, 18 Sep 2014 09:43:01 +0000 (12:43 +0300)]
Merge remote-tracking branch 'origin/abt/topic/gmin/l-dev/sensors/master' into gmin/l-dev/master

git log --pretty=format:"%h %ad | %s%d [%an]" m/abt/topic/gmin/l-dev/master..origin/abt/topic/gmin/l-dev/sensors/master:
  ca5db17 Wed Sep 17 17:26:14 2014 +0300 | Setup some sanity limitations for magnetometer calibration (origin/abt/topic/gmin/l-dev/sensors/master) [Adriana Reus]
  642a2d2 Wed Sep 17 15:38:04 2014 +0300 | Change the uncalibrated vs calibrated order. [Adriana Reus]
  3dc768c Tue Sep 16 14:08:10 2014 +0300 | Don't calibrate gyro if terse driver [Adriana Reus]

git diff --stat m/abt/topic/gmin/l-dev/master..HEAD:
  calibration.h         |    3 +++
  compass-calibration.c |   18 ++++++++++++++++++
  control.c             |   19 +++++++++++--------
  transform.c           |    3 ++-
  4 files changed, 34 insertions(+), 9 deletions(-)

Change-Id: I08d7310a03dcacfc2285496d199873840191d3a2

9 years agoSetup some sanity limitations for magnetometer calibration
Adriana Reus [Wed, 17 Sep 2014 14:26:14 +0000 (17:26 +0300)]
Setup some sanity limitations for magnetometer calibration

We never considered a certain magnetic field strength
because it varies depending on the location. Added some
sanity checking though because sometimes the calibration
gets a big bias and reduces the data values.

Change-Id: I7020b68f0bbd6ed0ba9bded1dbd3936034d92aa5
Signed-off-by: Adriana Reus <adriana.reus@intel.com>
9 years agoChange the uncalibrated vs calibrated order.
Adriana Reus [Wed, 17 Sep 2014 12:38:04 +0000 (15:38 +0300)]
Change the uncalibrated vs calibrated order.

Send the calibrated event before the corresponding uncalibrated
one for gyro. It pleases Cts Verifier.

Signed-off-by: Adriana Reus <adriana.reus@intel.com>
Change-Id: I0e1be4d38b47ba3d1fcb6ee33ba43c0b99afe31f

9 years agoDon't calibrate gyro if terse driver
Adriana Reus [Tue, 16 Sep 2014 11:08:10 +0000 (14:08 +0300)]
Don't calibrate gyro if terse driver

If we get events on a on-change basis it's better not to
attempt a calibration since we may receive the same event
duplicated and may end up with a wrong bias.

Issue: GMINL-1234
Signed-off-by: Adriana Reus <adriana.reus@intel.com>
Change-Id: Ieb99ee794299f3112f3149757a5a2ae0cdfc256e

9 years agoMerge remote-tracking branch 'origin/abt/topic/gmin/l-dev/sensors/master' into gmin...
Adriana Reus [Mon, 15 Sep 2014 14:22:01 +0000 (17:22 +0300)]
Merge remote-tracking branch 'origin/abt/topic/gmin/l-dev/sensors/master' into gmin/l-dev/master

git log --pretty=format:"%h %ad | %s%d [%an]" m/abt/topic/gmin/l-dev/master..origin/abt/topic/gmin/l-dev/sensors/master:
  298c194 Fri Aug 29 13:57:07 2014 +0200 | Refine sensor property get function to filter by iio dev name (origin/abt/topic/gmin/l-dev/sensors/master) [Patrick Porlan]
  b1f370d Mon Sep 15 14:06:56 2014 +0300 | [Workaround] Fix event timestamp recurrency [Adriana Reus]
  8b0553e Mon Sep 15 14:05:29 2014 +0300 | Limit max frequency to 1000 Hz [Adriana Reus]
  05135a5 Mon Sep 15 14:03:27 2014 +0300 | Revert "STPK-1429: Always wait for at least 1 ms before repeating samples" [Adriana Reus]

git diff --stat m/abt/topic/gmin/l-dev/master..HEAD:
  common.h      |    1 +
  control.c     |   13 ++++---------
  description.c |   25 ++++++++++++++++++++++++-
  3 files changed, 29 insertions(+), 10 deletions(-)

Change-Id: Ic8e63f31165e0e63e41c32d745cde37dae17da9b

9 years agoRefine sensor property get function to filter by iio dev name
Patrick Porlan [Fri, 29 Aug 2014 11:57:07 +0000 (13:57 +0200)]
Refine sensor property get function to filter by iio dev name

This enables having multiple sensors of the same type.

ro.iio.anglvel.bmg160.name is picked up instead of
ro.iio.anglvel.name if the iio device name fort he sensor we
are querying is bmg160.

Change-Id: I62995ea293b765585778a2190bff31c6a75c3ef5
Signed-off-by: Patrick Porlan <patrick.porlan@intel.com>
9 years ago[Workaround] Fix event timestamp recurrency
Adriana Reus [Mon, 15 Sep 2014 11:06:56 +0000 (14:06 +0300)]
[Workaround] Fix event timestamp recurrency

A lot of new cts test for sensors expect to have
very regular intervals for events or else they will
report event gaps. Getting the timestamp right before
reporting seems to level them.

Issue: GMINL-544
Change-Id: Ie9554ba3ff95a5fa2c5bb29083181bf23776765e
Signed-off-by: Adriana Reus <adriana.reus@intel.com>
9 years agoLimit max frequency to 1000 Hz
Adriana Reus [Mon, 15 Sep 2014 11:05:29 +0000 (14:05 +0300)]
Limit max frequency to 1000 Hz

Android sets up 1000 hz for DELAY_FASTEST. This conflicts
with some cts tests for sensors that report higher frequencies
(example bmg160 gyro). Since none of the current sensors actually
report these kind of high values to userspace it also
doesn't make much sense to duplicate events in a higher rate.

Issue: GMINL-544
Change-Id: I2ded62ca7345b0f49c4b8b20ce3022055bacbdd1
Signed-off-by: Adriana Reus <adriana.reus@intel.com>
9 years agoRevert "STPK-1429: Always wait for at least 1 ms before repeating samples"
Adriana Reus [Mon, 15 Sep 2014 11:03:27 +0000 (14:03 +0300)]
Revert "STPK-1429: Always wait for at least 1 ms before repeating samples"

This adds an artificial limitation for frequency which makes
some cts tests fail. They expect to receive higher frequencies
(example 1000 hz) but this limits the frequency at aroung 850 hz.
I wasn't able to see any side effect from removing this, so revert
at least for the moment.

This reverts commit 4c189692e67bc68d520d7adf462348ea4fd54900.

Issue: GMINL-544

9 years agoMerge remote-tracking branch 'origin/abt/topic/gmin/l-dev/sensors/master' into gmin...
Adriana Reus [Tue, 9 Sep 2014 14:55:30 +0000 (17:55 +0300)]
Merge remote-tracking branch 'origin/abt/topic/gmin/l-dev/sensors/master' into gmin/l-dev/master

git log --pretty=format:"%h %ad | %s%d [%an]" m/abt/topic/gmin/l-dev/master..origin/abt/topic/gmin/l-dev/sensors/master:
  28c665e Mon Aug 18 11:28:26 2014 +0300 | Fix build for x86_64 (origin/abt/topic/gmin/l-dev/sensors/master) [Irina Tirdea]
  4acf533 Thu Sep 4 13:54:01 2014 +0300 | Populate minDelay field. [Adriana Reus]
  61a5b42 Thu Aug 28 19:20:01 2014 +0200 | GMIN-2992: Prefix uncalibrated gyro name with Uncalibrated [Patrick Porlan]
  7d7c4b0 Wed Aug 27 18:12:10 2014 +0200 | GMIN-3015: Initialize accuracy flag on accel and gyro samples [Patrick Porlan]
  25e58ad Wed Aug 27 18:36:43 2014 +0200 | GMIN-3015: Refine a little bit the magnetometer accuracy indicator [Patrick Porlan]

git diff --stat m/abt/topic/gmin/l-dev/master..HEAD:
  compass-calibration.c |   31 +++++++++++++++++++++----
  control.c             |   15 +++++++-----
  description.c         |   62 +++++++++++++++++++++++++++++++++++++++++++++++++
  enumeration.c         |    8 +++++++
  gyro-calibration.c    |    5 ++++
  transform.c           |    2 ++
  6 files changed, 112 insertions(+), 11 deletions(-)

Change-Id: I2c9474899c85908c2c69eab675bf90b751cdca3a

9 years agoFix build for x86_64
Irina Tirdea [Mon, 18 Aug 2014 08:28:26 +0000 (11:28 +0300)]
Fix build for x86_64

target  C: sensors.gmin <= vendor/intel/hardware/iio-sensors/./control.c
vendor/intel/hardware/iio-sensors/./control.c: In function 'acquisition_routine':
vendor/intel/hardware/iio-sensors/./control.c:337:10: error: cast from pointer
to integer of different size [-Werror=pointer-to-int-cast]
  int s = (int) param;
          ^
vendor/intel/hardware/iio-sensors/./control.c: In function
'start_acquisition_thread':
vendor/intel/hardware/iio-sensors/./control.c:453:5: error: cast to pointer
from integer of different size [-Werror=int-to-pointer-cast]
     (void*) s);
     ^

Change-Id: Id994ceab05378e53b38bfafa4ead9121eb4163e8
Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
9 years agoPopulate minDelay field.
Adriana Reus [Thu, 4 Sep 2014 10:54:01 +0000 (13:54 +0300)]
Populate minDelay field.

Populate minDelay field with what data we find in
'sampling_frequencies_available'.
For sensors in poll mode where we don't have a way to
request a frequency, artificially set up a limit per
CDD requirements.

Signed-off-by: Adriana Reus <adriana.reus@intel.com>
Change-Id: I962e6e352a07f42b4833a83908a4b984a3f17235

9 years agoGMIN-2992: Prefix uncalibrated gyro name with Uncalibrated
Patrick Porlan [Thu, 28 Aug 2014 17:20:01 +0000 (19:20 +0200)]
GMIN-2992: Prefix uncalibrated gyro name with Uncalibrated

Otherwise it's not clear in many applications which of the two
gyroscopes is the uncalibrated one.

Issue: GMIN-2992

Change-Id: I5610e16290e0e8914efb8bf5aa3a8250bc141509
Signed-off-by: Patrick Porlan <patrick.porlan@intel.com>
9 years agoGMIN-3015: Initialize accuracy flag on accel and gyro samples
Patrick Porlan [Wed, 27 Aug 2014 16:12:10 +0000 (18:12 +0200)]
GMIN-3015: Initialize accuracy flag on accel and gyro samples

It's done already for magnetometer samples, and this flag does not
exist for sensors other than 3D (see sensors.h). This indicator is
visible in applications such as My Sensors, and may be used by the
sensors framework to decide how much it can trust incoming data.

Issue: GMIN-3015

Change-Id: I6773819396b1adc44ab0b56f7cf3b9e295706644
Signed-off-by: Patrick Porlan <patrick.porlan@intel.com>
9 years agoGMIN-3015: Refine a little bit the magnetometer accuracy indicator
Patrick Porlan [Wed, 27 Aug 2014 16:36:43 +0000 (18:36 +0200)]
GMIN-3015: Refine a little bit the magnetometer accuracy indicator

We now start at the default (unreliable) level then increase as we
go through calibration stages.

Issue: GMIN-3015

Change-Id: I3432feaad3426748b991da94bc41983d0b97943d
Signed-off-by: Patrick Porlan <patrick.porlan@intel.com>
9 years agoMerge remote-tracking branch 'origin/abt/topic/gmin/l-dev/sensors/master' into gmin...
Adriana Reus [Wed, 3 Sep 2014 09:23:22 +0000 (12:23 +0300)]
Merge remote-tracking branch 'origin/abt/topic/gmin/l-dev/sensors/master' into gmin/l-dev/master

git log --pretty=format:"%h %ad | %s%d [%an]" m/abt/topic/gmin/l-dev/master..origin/abt/topic/gmin/l-dev/sensors/master:
  e58ac5e Tue Aug 26 11:57:01 2014 +0200 | GMIN-2992: Revisit gyroscope calibration (origin/abt/topic/gmin/l-dev/sensors/master) [Patrick Porlan]
  85c4211 Tue Aug 26 15:51:42 2014 +0200 | GMIN-2992: Don't be as heavy handed with gyro filtering as compass [Patrick Porlan]
  86b28ca Tue Aug 26 11:00:52 2014 +0200 | GMIN-2992: Use much larger set for gyro calibration [Patrick Porlan]
  aac966e Mon Aug 25 18:51:55 2014 +0200 | GMIN-2992: Start with -dev trigger before switching to -any-motion [Patrick Porlan]
  50e0b4b Mon Aug 4 20:01:38 2014 +0200 | Reconciliate tree with SP version regarding uncalibrated gyro. [Patrick Porlan]
  c4b7635 Wed Aug 20 19:30:30 2014 +0200 | GMIN-2992: Enable filtering on accelerometer and gyroscope [Patrick Porlan]
  ac3a0ef Wed Aug 20 16:31:19 2014 +0200 | GMIN-3044: Fix a few edge cases in filtering code [Patrick Porlan]
  1f3fb0e Wed Aug 20 16:24:46 2014 +0200 | GMIN-3044: Fix a problem were filtering would not reengage [Patrick Porlan]
  9d9e281 Wed Aug 20 11:28:57 2014 +0200 | PLD processing readibility tweaks [Patrick Porlan]
  97b100e Tue Aug 19 11:54:44 2014 +0200 | Enable .panel and .rotation specifiers in property files [Patrick Porlan]
  e366844 Mon Aug 18 14:53:25 2014 +0200 | Derive sensor orientation from PLD ACPI data if available. [Patrick Porlan]
  1fdd271 Mon Aug 18 14:44:52 2014 +0200 | Small changes intended at making the code more readable [Patrick Porlan]

git diff --stat m/abt/topic/gmin/l-dev/master..HEAD:
  calibration.h      |    8 +-
  common.h           |   19 ++-
  control.c          |  109 ++++++++++++++---
  description.c      |   29 +++--
  description.h      |   13 +-
  enumeration.c      |  335 ++++++++++++++++++++++++++++++++++++++--------------
  gyro-calibration.c |  138 ++++++++++++----------
  transform.c        |   67 ++++++-----
  8 files changed, 498 insertions(+), 220 deletions(-)

Change-Id: I182f02ee05a281cfb009f6d4fc42107f5d39647e

9 years agoGMIN-2992: Revisit gyroscope calibration
Patrick Porlan [Tue, 26 Aug 2014 09:57:01 +0000 (11:57 +0200)]
GMIN-2992: Revisit gyroscope calibration

Modify the code so it provides valid uncalibrated gyro samples
while calibrating (we simply use bias 0 until we can determine
it), and compute bias iteratively (no need for long term sample
storage).

I can now pass the Cts Verifier gyroscope measurement test
effortlessly, and the delayed calibration is also visible in
applications such as Sensor Readout.

Issue: GMIN-2992

Change-Id: I7d86c529da0167e72ab93039d370f2df1c058ab3
Signed-off-by: Patrick Porlan <patrick.porlan@intel.com>
9 years agoGMIN-2992: Don't be as heavy handed with gyro filtering as compass
Patrick Porlan [Tue, 26 Aug 2014 13:51:42 +0000 (15:51 +0200)]
GMIN-2992: Don't be as heavy handed with gyro filtering as compass

The gyroscope is not so noisy, so limit ourselves to a smaller
window size in the interest of better response time.

Issue: GMIN-2992

Change-Id: Ida74cae999007eca90c708ccf35cd3f6c706f04c
Signed-off-by: Patrick Porlan <patrick.porlan@intel.com>
9 years agoGMIN-2992: Use much larger set for gyro calibration
Patrick Porlan [Tue, 26 Aug 2014 09:00:52 +0000 (11:00 +0200)]
GMIN-2992: Use much larger set for gyro calibration

We need to be strict about the criteria for gyro calibration, as
it's a very rapid firing sensor (100 Hz is common) and the effect
of a miscalibrated gyro sensor is serious. Better err on the safe
side, as we simply don't know if the device is still or not.

Issue: GMIN-2992

Change-Id: I931b012be7771e27e81a80f5f5f9e0d64b126886
Signed-off-by: Patrick Porlan <patrick.porlan@intel.com>
9 years agoGMIN-2992: Start with -dev trigger before switching to -any-motion
Patrick Porlan [Mon, 25 Aug 2014 16:51:55 +0000 (18:51 +0200)]
GMIN-2992: Start with -dev trigger before switching to -any-motion

Otherwise we're stuck waiting for a first sample (in order to engage
the periodic repeat-last-sample-if-nothing-arrived-for-a-while code)
which makes a variety of tests fail.

Issue: GMIN-2992

Change-Id: I13093f364455a566de80a5e185707590007d8235
Signed-off-by: Patrick Porlan <patrick.porlan@intel.com>
9 years agoReconciliate tree with SP version regarding uncalibrated gyro.
Patrick Porlan [Mon, 4 Aug 2014 18:01:38 +0000 (20:01 +0200)]
Reconciliate tree with SP version regarding uncalibrated gyro.

Looks like something was lost during integrations.

Change-Id: I756b24fe7a61142cde184f589f95f3bfd950ceb0
Signed-off-by: Patrick Porlan <patrick.porlan@intel.com>
9 years agoGMIN-2992: Enable filtering on accelerometer and gyroscope
Patrick Porlan [Wed, 20 Aug 2014 17:30:30 +0000 (19:30 +0200)]
GMIN-2992: Enable filtering on accelerometer and gyroscope

Cts Verifier is frequently failing the gyro tests because it's very
sensitive to out of spec samples. Filtering the BMG160 output makes
it happy, so let's enable filtering on other sensor types than just
magnetometer. We may want to tune filter latency though.

Issue: GMIN-2992

Change-Id: I0cbea2195a616ffd922c67246d04d0af8619398c
Signed-off-by: Patrick Porlan <patrick.porlan@intel.com>
9 years agoGMIN-3044: Fix a few edge cases in filtering code
Patrick Porlan [Wed, 20 Aug 2014 14:31:19 +0000 (16:31 +0200)]
GMIN-3044: Fix a few edge cases in filtering code

- limit ourselves to a window size of 100 to limit CPU usage

- start filtering as soon as we have a few samples instead of
  waiting for a full history buffer

- drop out if we're operating with window size = 1

And restructure the code a little bit for improved clarity.

Issue: GMIN-3044

Change-Id: Ia4e6208bfb86bccda8473502f3f1d16ef61771ca
Signed-off-by: Patrick Porlan <patrick.porlan@intel.com>
9 years agoGMIN-3044: Fix a problem were filtering would not reengage
Patrick Porlan [Wed, 20 Aug 2014 14:24:46 +0000 (16:24 +0200)]
GMIN-3044: Fix a problem were filtering would not reengage

We wouldn't reallocate the history buffer after a disable
enable cycle if the sampling rate was unchanged, and the
filtering code fails silently if the history buffer is nil.

This could cause filtering to simply don't work in several
scenarios.

Issue: GMIN-3044

Change-Id: I6f0d7428a6caebe903315d6f5a1141dd466e1957
Signed-off-by: Patrick Porlan <patrick.porlan@intel.com>
9 years agoPLD processing readibility tweaks
Patrick Porlan [Wed, 20 Aug 2014 09:28:57 +0000 (11:28 +0200)]
PLD processing readibility tweaks

Use symbols rather than direct numeric values, as suggested by Samuel.

Change-Id: I82ad7714946d4b46e9b396b3b04edccfe415e954
Signed-off-by: Patrick Porlan <patrick.porlan@intel.com>
9 years agoEnable .panel and .rotation specifiers in property files
Patrick Porlan [Tue, 19 Aug 2014 09:54:44 +0000 (11:54 +0200)]
Enable .panel and .rotation specifiers in property files

This is a convenient way to check or override PLD settings
during development. These are of course optional, per sensor,
and if found the BIOS values are ignored.

Change-Id: I03fadb70245476d49df5bd9167980e9fad9a662d
Signed-off-by: Patrick Porlan <patrick.porlan@intel.com>
9 years agoDerive sensor orientation from PLD ACPI data if available.
Patrick Porlan [Mon, 18 Aug 2014 12:53:25 +0000 (14:53 +0200)]
Derive sensor orientation from PLD ACPI data if available.

We use the panel indicator (front or back side of the board) as
well as rotation indicator to generate suitable scaling and order
directives. Note that this is a default state, so expressing
ordering or scaling needs though properties will supersede these.

Change-Id: I1eeaffb838ee53d7e7f7216c07cae9211801d88a
Signed-off-by: Patrick Porlan <patrick.porlan@intel.com>
9 years agoSmall changes intended at making the code more readable
Patrick Porlan [Mon, 18 Aug 2014 12:44:52 +0000 (14:44 +0200)]
Small changes intended at making the code more readable

Intermediate variables are nice.

Change-Id: Ia95169c724d2b7604d8967f88ccf669c85a31152
Signed-off-by: Patrick Porlan <patrick.porlan@intel.com>
9 years agoMerge remote-tracking branch 'origin/abt/topic/gmin/l-dev/sensors/master' into gmin...
Adriana Reus [Thu, 14 Aug 2014 16:27:44 +0000 (19:27 +0300)]
Merge remote-tracking branch 'origin/abt/topic/gmin/l-dev/sensors/master' into gmin/l-dev/master

git log --pretty=format:"%h %ad | %s%d [%an]" m/abt/topic/gmin/l-dev/master..origin/abt/topic/gmin/l-dev/sensors/master:
  f3307d0 Thu Aug 14 16:08:25 2014 +0300 | Add multiple calibration levels (origin/abt/topic/gmin/l-dev/sensors/master) [Adriana Reus]
  f876d44 Wed Aug 13 19:03:03 2014 +0300 | Change data sample size for calibration [Adriana Reus]

git diff --stat m/abt/topic/gmin/l-dev/master..HEAD:
  calibration.h         |   22 +++++++++-------------
  common.h              |    2 +-
  compass-calibration.c |   35 +++++++++++++----------------------
  enumeration.c         |    2 +-
  gyro-calibration.c    |    6 +++---
  5 files changed, 27 insertions(+), 40 deletions(-)

Change-Id: Ia63d8752e62028b81289c9ed74992ada843f18ca

9 years agoAdd multiple calibration levels
Adriana Reus [Thu, 14 Aug 2014 13:08:25 +0000 (16:08 +0300)]
Add multiple calibration levels

In an attempt to provide an initial estimation faster.

Signed-off-by: Adriana Reus <adriana.reus@intel.com>
Change-Id: Ia8e0beaf2ad5424f96ebdf700d179ec0fa31c87c

9 years agoChange data sample size for calibration
Adriana Reus [Wed, 13 Aug 2014 16:03:03 +0000 (19:03 +0300)]
Change data sample size for calibration

ECS seems to take a lot of time to calibrate because of noisy
events. A smaller data sample size seems to somewhat help and
it doesn't affect calibration in any other way.

Change-Id: I706ced6408c0915162aafbcf2cfed7f3be9c0ff9
Signed-off-by: Adriana Reus <adriana.reus@intel.com>
9 years agoMerge remote-tracking branch 'origin/abt/topic/gmin/l-dev/sensors/master' into gmin...
Adriana Reus [Wed, 13 Aug 2014 15:43:55 +0000 (18:43 +0300)]
Merge remote-tracking branch 'origin/abt/topic/gmin/l-dev/sensors/master' into gmin/l-dev/master

git log --pretty=format:"%h %ad | %s%d [%an]" m/abt/topic/gmin/l-dev/master..origin/abt/topic/gmin/l-dev/sensors/master:
  752fe0e Tue Aug 12 20:58:58 2014 +0200 | GMIN-3044: Implement a simple filtering routine for noisy sensors (origin/abt/topic/gmin/l-dev/sensors/master) [Patrick Porlan]
  4c18969 Fri Aug 8 16:45:26 2014 +0200 | STPK-1429: Always wait for at least 1 ms before repeating samples [Patrick Porlan]
  06f5f6a Thu Aug 7 11:06:41 2014 +0200 | GMIN-2525: Ensure that we select a motion trigger if available [Patrick Porlan]
  e135a70 Mon Aug 11 16:13:22 2014 +0300 | Fix uncalibrated gyroscope trigger name [Adriana Reus]
  7cceddf Thu Aug 7 15:28:51 2014 +0300 | Populate maxDelay field [Adriana Reus]
  ce90973 Mon Aug 4 21:00:16 2014 +0200 | Delete a couple of unused variables. [Patrick Porlan]

git diff --stat m/abt/topic/gmin/l-dev/master..HEAD:
  common.h      |    9 ++++++
  control.c     |   18 +++++++++---
  description.c |   48 +++++++++++++++++++++++++++++++
  enumeration.c |   87 ++++++++++++++++++++++++++++++++++++++++++++++++++++-----
  transform.c   |   58 ++++++++++++++++++++++++++++++++++++++
  5 files changed, 209 insertions(+), 11 deletions(-)

Change-Id: I2fe75740013ad51747cded5fc337af8905b71706

9 years agoGMIN-3044: Implement a simple filtering routine for noisy sensors
Patrick Porlan [Tue, 12 Aug 2014 18:58:58 +0000 (20:58 +0200)]
GMIN-3044: Implement a simple filtering routine for noisy sensors

Keep a window of samples worth a second, and output the moving
average of the last recorded samples in order to smooth out
readings from extremely noisy sensors such as the BMM050 magneto.

We may want to use more advanced filters in the future.

Issue: GMIN-3044

Change-Id: I10bc0ddb960ed31e89228bc69fcf17f38fa85b97
Signed-off-by: Patrick Porlan <patrick.porlan@intel.com>
9 years agoSTPK-1429: Always wait for at least 1 ms before repeating samples
Patrick Porlan [Fri, 8 Aug 2014 14:45:26 +0000 (16:45 +0200)]
STPK-1429: Always wait for at least 1 ms before repeating samples

Auto-repetition of events at very high sample rates can make the
device unresponsive.

Issue: STPK-1429

Change-Id: Id846f7a8e313b96099e78fbb0e53a93ca6d194f2
Signed-off-by: Patrick Porlan <patrick.porlan@intel.com>