]> git.baikalelectronics.ru Git - kernel.git/commit
iio: pressure: bmp280: simplify driver initialization logic
authorAngel Iglesias <ang.iglesiasg@gmail.com>
Mon, 12 Sep 2022 23:47:31 +0000 (01:47 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Wed, 21 Sep 2022 17:42:54 +0000 (18:42 +0100)
commitbee75aee6fcc41ab0cd390b09b5076dbc61459c8
tree935f8556d39df7ca2a3980b8e91d2a93294052aa
parent2a1542e322513c632e02b0608f3bb9bb500c0873
iio: pressure: bmp280: simplify driver initialization logic

Simplified common initialization logic of different sensor types
unifying calibration and initial configuration recovery.

Default config param values of each sensor type are stored inside
chip_info structure and used to initialize sensor data struct instance.

The helper functions for read each sensor type calibration are converted
to a callback available on the chip_info struct.

Separated bme280 specific calibration code from bmp280 function. Dropped
the additional chip_id argument in bmp280 code as is not longer required.
Now both bmp280/bme280 calibration function use same signature as bmp180.

Suggested-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Angel Iglesias <ang.iglesiasg@gmail.com>
Link: https://lore.kernel.org/r/584c90f309e4f24bf2e4aa2b15c8577d288f978d.1663025017.git.ang.iglesiasg@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/pressure/bmp280-core.c