Skip to content

iio: ak8975: Fix calculation formula and add device name

Beomho Seo linux-iio 2 versions – Applied

Status from this message: Applied to the fixes-togreg branch of iio.git

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v1 Latest posting 2/22 patches 3 repliesApplied
  2. v1 posting 1/22 patches 2 repliesSuperseded

Patches in v1 posting 2/2 Applied

#Subject and filesSizeRepliesApplied
1/2iio: ak8975: Fix calculation formula for convert micro tesla to gauss unitdrivers/iio/magnetometer/ak8975.c+9 -72 replies
2/2iio: ak8975: Add device namedrivers/iio/magnetometer/ak8975.c+1 -01 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH RESEND 0/2] iio: ak8975: Fix calculation formula and add device name

Three months ago Peter Meerwald revised description of device driver[1].
Correctly, device's sensitivity is 0.3 uT/LSB typ and One micro tesla equal 0.01 gauss[2]. So I have fixed calculation formula,And then add RAW_TO_GAUSS macro.
Scale are returned as VAL_INT_PLUS_MICRO.
Additionally, I have add device name.

Tested on exynos4412 board, with following result:

-sh-4.1# cat name
ak8975
-sh-4.1# cat in_magn_x_raw
80
-sh-4.1# cat in_magn_x_scale
0.003609

Calculate the result 80 x 0.003609 = 0.28872 Gauss. 0.28872 G equal 288.72 mG

I think this magnitude value is proper level[3].

[1] http://marc.info/?l=linux-iio&m=138220306822747&w=2
[2] http://en.wikipedia.org/wiki/Gauss_(unit)
[3] http://en.wikipedia.org/wiki/Orders_of_magnitude_(magnetic_field)

Beomho Seo (2):
iio: ak8975: Fix calculation formula for microtesla to gauss unit
iio: ak8975: Add device name

 drivers/iio/magnetometer/ak8975.c |   17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)
Signature · 1 line
Best Regards,