]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
iio: pressure: bmp280: Generalize read_*() functions
authorVasileios Amoiridis <vassilisamir@gmail.com>
Fri, 28 Jun 2024 17:17:24 +0000 (19:17 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 3 Aug 2024 09:13:36 +0000 (10:13 +0100)
commit74353ceb3533ff1bcef1645cdab549d1a7dfaa22
tree12e14913171cc25ba18a32df99573f0a48fcb700
parent7c7d9170305435f5c6f9fac3174118e81fc8178d
iio: pressure: bmp280: Generalize read_*() functions

Add the coefficients for the IIO standard units and the IIO value
inside the chip_info structure.

Move the calculations for the IIO unit compatibility from inside the
read_{temp,press,humid}() functions and move them to the general
read_raw() function.

In this way, all the data for the calculation of the value are
located in the chip_info structure of the respective sensor.

Signed-off-by: Vasileios Amoiridis <vassilisamir@gmail.com>
Acked-by: Adam Rizkalla <ajarizzo@gmail.com>
Link: https://patch.msgid.link/20240628171726.124852-2-vassilisamir@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/pressure/bmp280-core.c
drivers/iio/pressure/bmp280.h