From: lanshh Date: Mon, 26 Sep 2016 08:14:08 +0000 (+0800) Subject: drivers: iio: imu: fix initial screen offset when switch app X-Git-Tag: firefly_0821_release~1478 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=245ae3931a7e97afea76bbfd5040afbd762a5bc3;p=firefly-linux-kernel-4.4.55.git drivers: iio: imu: fix initial screen offset when switch app Change-Id: Ia65b4b5e03b712d0c69546d69ea7b4364f30b05b Signed-off-by: lanshh --- diff --git a/drivers/staging/iio/imu/inv_mpu/inv_mpu_ring.c b/drivers/staging/iio/imu/inv_mpu/inv_mpu_ring.c index 7ddb67f5aa96..dead8352a1a2 100644 --- a/drivers/staging/iio/imu/inv_mpu/inv_mpu_ring.c +++ b/drivers/staging/iio/imu/inv_mpu/inv_mpu_ring.c @@ -1226,6 +1226,12 @@ static int inv_proc_event(char *raw_data, size_t raw_len, void *priv) pr_info("in:%s\n", hex); } #endif + if (st->chip_config.is_asleep) + return 0; + + if (raw_data[1] == 0) + return 0; + p = raw_data + 6; st->hid_temperature = (p[1] << 8) | p[0]; p = raw_data + 8;