diff options
author | Kiran Raparthy <krapar@codeaurora.org> | 2015-06-26 17:04:45 +0530 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2015-07-06 06:31:44 -0700 |
commit | 2f2f10e13d53558c837d5177aa6e08ae06b420a7 (patch) | |
tree | 0734e8c9572188fdd41fbc645deca11c94e9134d | |
parent | 7fd639c5baecca2c0ab179621f05499e069e6419 (diff) | |
download | qcom-2f2f10e13d53558c837d5177aa6e08ae06b420a7.tar.gz |
input: sensors: read 16-bit output data in continuous mode
Read 16-bit output data in continuous measurement mode to use
the same sensitivity adjustments as single measurement mode.
This allows the driver to report proper magnitude to userspace
in continuous measurement mode.
Change-Id: I3f3fa46e98f703bae9328df7bdb2150cb843bba8
Signed-off-by: Kiran Raparthy <krapar@codeaurora.org>
-rw-r--r-- | drivers/input/misc/akm8963.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/input/misc/akm8963.c b/drivers/input/misc/akm8963.c index 4477296df03..e88dfca28f7 100644 --- a/drivers/input/misc/akm8963.c +++ b/drivers/input/misc/akm8963.c @@ -467,7 +467,10 @@ static int AKECS_GetData_Poll( /* Check ST bit */ if (!(AKM_DRDY_IS_HIGH(buffer[0]))) + { dev_dbg(&akm->i2c->dev, "DRDY is low. Use last value.\n"); + return 0; + } /* Read rest data */ buffer[1] = AKM_REG_STATUS + 1; @@ -890,7 +893,8 @@ static int akm_enable_set(struct sensors_classdev *sensors_cdev, if (akm->delay[MAG_DATA_FLAG] < MAX_SNG_MEASURE_SUPPORTED) { AKECS_SetMode(akm, - AK8963_MODE_CONT2_MEASURE); + AK8963_MODE_CONT2_MEASURE | + AKM8963_BIT_OP_16); akm->use_sng_measure = false; } else { AKECS_SetMode(akm, |