diff options
author | Angel Iglesias <ang.iglesiasg@gmail.com> | 2022-09-13 01:48:21 +0200 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2022-09-21 19:42:54 +0200 |
commit | 327b5c0512c18287162d0f12949aae41d64358b0 (patch) | |
tree | 0f8f287ecaca6cd2ad5e03a10148801d1913fd37 /drivers/iio/pressure/bmp280.h | |
parent | iio: pressure: bmp280: simplify driver initialization logic (diff) | |
download | linux-327b5c0512c18287162d0f12949aae41d64358b0.tar.xz linux-327b5c0512c18287162d0f12949aae41d64358b0.zip |
iio: pressure: bmp280: Fix alignment for DMA safety
Adds DMA-safe buffers to driver data struct to store raw data from sensors
The multiple buffers used thorough the driver share the same memory
allocated as part of the device data instance. The union containing
the buffers is aligned to allow safe usage with DMA operations, such
as regmap bulk read calls.
Updated measurement and calibration reading functions to use the safe
DMA buffers.
Suggested-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Angel Iglesias <ang.iglesiasg@gmail.com>
Link: https://lore.kernel.org/r/7919793f7f63224d5ce413c66d648029683c17ac.1663025017.git.ang.iglesiasg@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/pressure/bmp280.h')
-rw-r--r-- | drivers/iio/pressure/bmp280.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/iio/pressure/bmp280.h b/drivers/iio/pressure/bmp280.h index 03a539223417..c9214a7e5cc6 100644 --- a/drivers/iio/pressure/bmp280.h +++ b/drivers/iio/pressure/bmp280.h @@ -13,8 +13,8 @@ #define BMP280_REG_PRESS_LSB 0xF8 #define BMP280_REG_PRESS_MSB 0xF7 -/* Helper mask to truncate excess 12 bits on pressure and temp readings */ -#define BMP280_MEAS_TRIM_MASK GENMASK(31, 12) +/* Helper mask to truncate excess 4 bits on pressure and temp readings */ +#define BMP280_MEAS_TRIM_MASK GENMASK(24, 4) #define BMP280_REG_CONFIG 0xF5 #define BMP280_REG_CTRL_MEAS 0xF4 |