iio: magnetometer: mmc35240: Fix broken processed value
authorDaniel Baluta <daniel.baluta@intel.com>
Fri, 5 Jun 2015 11:03:12 +0000 (14:03 +0300)
committerJonathan Cameron <jic23@kernel.org>
Sun, 7 Jun 2015 15:33:18 +0000 (16:33 +0100)
commitc2890547a035e019df646be5d56adc0ee1b0a327
treeac91a209896814deb26e737af1f3bd343807dd96
parentbd35a214f56158d11e46c4a9d8436139f58e7099
iio: magnetometer: mmc35240: Fix broken processed value

The current computation for fractional part of the magnetic
field is broken. This patch fixes it by taking a different
approach. We expose the raw reading in milli Gauss (to avoid
rounding errors) with a scale of 0.001.

Thus the final computation is done in userspace where floating
point operation are more relaxed.

Fixes: abeb6b1e7b ("iio: magnetometer: Add support for MEMSIC MMC35240")
Signed-off-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/magnetometer/mmc35240.c
This page took 0.025048 seconds and 5 git commands to generate.