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)
committerChanho Park <chanho61.park@samsung.com>
Tue, 18 Nov 2014 02:46:56 +0000 (11:46 +0900)
commit4dc18230bb6f1dcfd650121e702559b78c5c74c4
tree6c09ea029477b4a14edd8a14e1256d6b28274f99
parent3d3d9ab72c5d7f606ae89446cf4ff5513a87809a
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