diff options
author | Colin Parker <colin.parker@aclima.io> | 2017-08-28 19:21:39 -0400 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2017-09-24 11:58:14 -0400 |
commit | 4b1f0c31f96c45e8521dd84aae50f2aa4aecfb7b (patch) | |
tree | 714847ed4fc10b9c642488d0ce7ded46f3ec6fa8 | |
parent | e6f4794371ee7cce1339e7ca9542f1e703c5f84a (diff) |
IIO: BME280: Updates to Humidity readings need ctrl_reg write!
The ctrl_reg register needs to be written after any write to
the humidity registers. The value written to the ctrl_reg register
does not necessarily need to change, but a write operation must
occur.
The regmap_update_bits functions will not write to a register
if the register value matches the value to be written. This saves
unnecessary bus operations. The change in this patch forces a bus
write during the chip_config operation by switching to
regmap_write_bits.
This will fix issues where the Humidity Sensor Oversampling bits
are not updated after initialization.
Signed-off-by: Colin Parker <colin.parker@aclima.io>
Acked-by: Andreas Klinger <ak@it-klinger.de>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-rw-r--r-- | drivers/iio/pressure/bmp280-core.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iio/pressure/bmp280-core.c b/drivers/iio/pressure/bmp280-core.c index d82b788374b6..e442c5248427 100644 --- a/drivers/iio/pressure/bmp280-core.c +++ b/drivers/iio/pressure/bmp280-core.c | |||
@@ -558,7 +558,7 @@ static int bmp280_chip_config(struct bmp280_data *data) | |||
558 | u8 osrs = BMP280_OSRS_TEMP_X(data->oversampling_temp + 1) | | 558 | u8 osrs = BMP280_OSRS_TEMP_X(data->oversampling_temp + 1) | |
559 | BMP280_OSRS_PRESS_X(data->oversampling_press + 1); | 559 | BMP280_OSRS_PRESS_X(data->oversampling_press + 1); |
560 | 560 | ||
561 | ret = regmap_update_bits(data->regmap, BMP280_REG_CTRL_MEAS, | 561 | ret = regmap_write_bits(data->regmap, BMP280_REG_CTRL_MEAS, |
562 | BMP280_OSRS_TEMP_MASK | | 562 | BMP280_OSRS_TEMP_MASK | |
563 | BMP280_OSRS_PRESS_MASK | | 563 | BMP280_OSRS_PRESS_MASK | |
564 | BMP280_MODE_MASK, | 564 | BMP280_MODE_MASK, |