IIO: BME280: Updates to Humidity readings need ctrl_reg write!
authorColin Parker <colin.parker@aclima.io>
Mon, 28 Aug 2017 23:21:39 +0000 (16:21 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Oct 2017 09:51:18 +0000 (11:51 +0200)
commitf0865d60f3a54bd66356026c83cfa9ec564b18e3
tree90efbc0ca56fbd565f87adb7495dfe42a8ce9475
parent9af1bd5e705a5a9dbeff42bab077afe3ba881968
IIO: BME280: Updates to Humidity readings need ctrl_reg write!

commit 4b1f0c31f96c45e8521dd84aae50f2aa4aecfb7b upstream.

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>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/iio/pressure/bmp280-core.c