Skip to content

Commit

Permalink
iio: magnetometer: yas530: Add YAS537 variant
Browse files Browse the repository at this point in the history
Add support for the magnetometer Yamaha YAS537. The additions are based on
comparison of Yamaha Android kernel drivers for YAS532 [1] and YAS537 [2].

In the Yamaha YAS537 Android driver, there is an overflow/underflow control
implemented. For regular usage, this seems not necessary. A similar overflow/
underflow control of Yamaha YAS530/532 Android driver isn't integrated in the
mainline driver. It is therefore skipped for YAS537 in the mainline too.

Also in the Yamaha YAS537 Android driver, at the end of the reset_yas537()
function, a measurement is saved in "last_after_rcoil". Later on, this is
compared to current measurements. If the difference gets too big, a new
reset is initialized. The difference in measurements needs to be quite big,
it's hard to say if this is necessary for regular operation. Therefore this
isn't integrated in the mainline driver either.

[1] https://github.com/msm8916-mainline/android_kernel_qcom_msm8916/blob/GT-I9195I/drivers/iio/magnetometer/yas_mag_drv-yas532.c
[2] https://github.com/msm8916-mainline/android_kernel_qcom_msm8916/blob/GT-I9195I/drivers/iio/magnetometer/yas_mag_drv-yas537.c

Signed-off-by: Jakob Hauser <jahau@rocketmail.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/264c6488733a5c32089c9ab406a5bcb808c48fef.1660337264.git.jahau@rocketmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
  • Loading branch information
Jakko3 authored and jic23 committed Aug 15, 2022
1 parent 059ff0f commit 65f79b5
Show file tree
Hide file tree
Showing 2 changed files with 423 additions and 3 deletions.
4 changes: 2 additions & 2 deletions drivers/iio/magnetometer/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,8 @@ config YAMAHA_YAS530
select IIO_TRIGGERED_BUFFER
help
Say Y here to add support for the Yamaha YAS530 series of
3-Axis Magnetometers. Right now YAS530, YAS532 and YAS533 are
fully supported.
3-Axis Magnetometers. YAS530, YAS532, YAS533 and YAS537 are
supported.

This driver can also be compiled as a module.
To compile this driver as a module, choose M here: the module
Expand Down
Loading

0 comments on commit 65f79b5

Please sign in to comment.