mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-12-29 01:50:53 +00:00
samus: Fixed a bug in host_sensor_id_to_motion_sensor
BUG=chrome-os-partner:32368 BRANCH=ToT TEST=Verified on Samus. cd /sys/bus/iio/devices/iio:device0 cat *peak_scale Change-Id: I2b0606e55bfa5e498255c6c42240ee3f9236e4f1 Signed-off-by: Sheng-Liang Song <ssl@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/220991 Reviewed-by: Alec Berg <alecaberg@chromium.org>
This commit is contained in:
committed by
chrome-internal-fetch
parent
91cfdd0dac
commit
ac1c82a35b
@@ -432,29 +432,28 @@ static struct motion_sensor_t
|
||||
|
||||
for (i = 0; i < motion_sensor_count; ++i) {
|
||||
|
||||
sensor = &motion_sensors[i];
|
||||
|
||||
if ((LOCATION_BASE == sensor->location)
|
||||
&& (SENSOR_ACCELEROMETER == sensor->type)
|
||||
&& (host_id == EC_MOTION_SENSOR_ACCEL_BASE)) {
|
||||
sensor = &motion_sensors[i];
|
||||
break;
|
||||
}
|
||||
|
||||
if ((LOCATION_LID == sensor->location)
|
||||
&& (SENSOR_ACCELEROMETER == sensor->type)
|
||||
&& (host_id == EC_MOTION_SENSOR_ACCEL_LID)) {
|
||||
sensor = &motion_sensors[i];
|
||||
break;
|
||||
}
|
||||
|
||||
if ((LOCATION_BASE == sensor->location)
|
||||
&& (SENSOR_GYRO == sensor->type)
|
||||
&& (host_id == EC_MOTION_SENSOR_GYRO)) {
|
||||
sensor = &motion_sensors[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!sensor)
|
||||
if (i == motion_sensor_count)
|
||||
return NULL;
|
||||
|
||||
if ((sensor->power == SENSOR_POWER_ON)
|
||||
|
||||
Reference in New Issue
Block a user