Skip to content
Commit bef44abc authored by Beomho Seo's avatar Beomho Seo Committed by Jonathan Cameron
Browse files

iio: ak8975: Fix calculation formula for convert micro tesla to gauss unit



This effects the reported scale of the raw values, and thus userspace
applications that use this value.

One 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 and IIO_VAL_INT_PLUS_MICRO.
As a result, read_raw call back function return accurate scale value.

Signed-off-by: default avatarBeomho Seo <beomho.seo@samsung.com>
Cc: stable@vger.kernel.org
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent d180371d
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment