iio: ak8975: Fix calculation formula for convert micro tesla to gauss unit
authorBeomho Seo <beomho.seo@samsung.com>
Mon, 10 Feb 2014 00:52:28 +0000 (09:52 +0900)
committerMarek Szyprowski <m.szyprowski@samsung.com>
Thu, 15 May 2014 05:27:04 +0000 (07:27 +0200)
commitb9390f357f2a3f0dd062211b2a5047df412011cc
tree805c7f276f938b0cf6a16c5287b45ce71115601a
parentf3003d7b7de9e2ff875e491fd25bf775189449a1
iio: ak8975: Fix calculation formula for convert micro tesla to gauss unit

Oen micro tesla equal 0.01 gauss. So I have fixed calculation formula And add RAW_TO_GAUSS macro.
ASA is in the range of 0 to 255. If multiply 0.003, calculation result(in_magn_[*]_scale) is
always 0. So multiply 3000 and return IIO_VAL_INT_PLUS_MICRO.
As a result read_raw call back function return accurate scale value.

Change-Id: Ia00b801d4867955eef661b64add82ca634f0256c
Signed-off-by: Beomho Seo <beomho.seo@samsung.com>
drivers/iio/magnetometer/ak8975.c