OSDN Git Service
STPK-1429 Offload poll mode sensors data acquisition to threads
I have seen sysfs reads blocking for 200 ms on the MRD 7 ALS,
with proximity, temperature and combined magnetometer x,y,z
in the 100 ms ballpark. This ended up blocking the main sensor
poll loop for large windows, with the effect that high frequency
sensors events were not delivered for extended amounts of time.
This offloads these sysfs reads to dedicated threads: there is
is one of these per enabled poll-mode sensor, and they communicate
their data through a pollable fd (something we can't have directly
on sysfs files). As a result we get much smoother and timely
event delivery overall, while simplifying the code somewhat: the
poll call can always use an infinite timeout, thereby voiding
the need for a wakeup fd, as well as complex timeout calculations.
Issue: STPK-1429
Change-Id: I4a45ede2369bcca03b9da78e98abb83ff5879c73
Signed-off-by: Patrick Porlan <patrick.porlan@intel.com>