OSDN Git Service

iio: magnetometer: yas530: Add function pointers to "chip_info"
authorJakob Hauser <jahau@rocketmail.com>
Fri, 12 Aug 2022 22:05:02 +0000 (00:05 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 15 Aug 2022 21:30:04 +0000 (22:30 +0100)
commit059ff0f9a10508c39f2c22d4144e88156bbf86ef
tree93cf767c11e2e112a0c4536d66bff796db53a7eb
parent2d6676ecbe6a39fb1e002b89781e4158e77a784e
iio: magnetometer: yas530: Add function pointers to "chip_info"

Add function pointers to the "chip_info" structure to ease the handling of
different YAS variants.

In the function yas5xx_probe(), the function call for "measure_offsets" was
added as a conditional "if (ci->measure_offsets)". This is a preparatory step
for YAS537, as this variant doesn't need an offset measurement.

Signed-off-by: Jakob Hauser <jahau@rocketmail.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/4bd3f96262e0132b7f9720521a801da3c18abd95.1660337264.git.jahau@rocketmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/magnetometer/yamaha-yas530.c