diff options
author | Dheeraj CVR <cvr.dheeraj@gmail.com> | 2015-01-21 19:04:31 +0530 |
---|---|---|
committer | tilaksidduram <tilaksidduram@gmail.com> | 2015-02-13 10:34:30 +0530 |
commit | a0ae6e1f8928dd155e7764bbe128b9af0dd2092d (patch) | |
tree | 5c384c7428ace74fce59a923a8a31e0d68456ecf /overlay | |
parent | e89aa59f47994f6bfd3c270470f4eee281896fde (diff) | |
download | device_samsung_n7100-a0ae6e1f8928dd155e7764bbe128b9af0dd2092d.zip device_samsung_n7100-a0ae6e1f8928dd155e7764bbe128b9af0dd2092d.tar.gz device_samsung_n7100-a0ae6e1f8928dd155e7764bbe128b9af0dd2092d.tar.bz2 |
libsensors: fix sensors enable and disable
* "//Accel sensor is first on and last off"
This is totally wrong. The since we are using a single sysfs path
to enable and disable all of the sensors, the kernel driver uses
bitwise operations on the input value to know which sensors should
be enabled. The current logic wrongly assumes that the sensors are
enabled and disabled in a specific order and if accelerometer was
disabled, all of the other sensors were being disabled too. This
caused inconsistent sensor states between the sensor HAL and the
kernel driver and most of the time, the sensors failed to work
properly and drained battery.
Simplify the code to use bitwise operations instead of arithematic
operations to keep things clean. Additionally, since two or more
sensors can be enabled or disabled at the same time, we use a lock
to prevent race conditions.
Change-Id: Ifc3fab1456d4061f58d52f2ecda822c6157aae6e
Diffstat (limited to 'overlay')
0 files changed, 0 insertions, 0 deletions