summaryrefslogtreecommitdiff
path: root/drivers/input
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2014-04-25 07:14:39 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2014-04-25 07:14:38 -0700
commitd654537c941ff8c9208ca6177cbe56783086c065 (patch)
treebb509df0f837224c2393b1c3486d93600f95eb90 /drivers/input
parent28e3dd6d40d8167f594896536aa5042cf2513ec7 (diff)
parent891b323a286af4e34dd363bc0e95823fdeb547ee (diff)
Merge "input: sensors: correct the output data reported by akm09911"
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/misc/akm09911.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/input/misc/akm09911.c b/drivers/input/misc/akm09911.c
index 1920978f230d..55f5976f23bf 100644
--- a/drivers/input/misc/akm09911.c
+++ b/drivers/input/misc/akm09911.c
@@ -1687,17 +1687,20 @@ static void akm_dev_poll(struct work_struct *work)
}
tmp = (int)((int16_t)(dat_buf[2]<<8)+((int16_t)dat_buf[1]));
- tmp = tmp * akm->sense_conf[0] / 256 + tmp / 2;
+ tmp = tmp * akm->sense_conf[0] / 128 + tmp;
mag_x = tmp;
tmp = (int)((int16_t)(dat_buf[4]<<8)+((int16_t)dat_buf[3]));
- tmp = tmp * akm->sense_conf[1] / 256 + tmp / 2;
+ tmp = tmp * akm->sense_conf[1] / 128 + tmp;
mag_y = tmp;
tmp = (int)((int16_t)(dat_buf[6]<<8)+((int16_t)dat_buf[5]));
- tmp = tmp * akm->sense_conf[2] / 256 + tmp / 2;
+ tmp = tmp * akm->sense_conf[2] / 128 + tmp;
mag_z = tmp;
+ dev_dbg(&s_akm->i2c->dev, "mag_x:%d mag_y:%d mag_z:%d\n",
+ mag_x, mag_y, mag_z);
+
switch (akm->layout) {
case 0:
case 1: