summaryrefslogtreecommitdiff
path: root/drivers/iio/pressure/bmp280.h
diff options
context:
space:
mode:
authorAndreas Klinger <ak@it-klinger.de>2017-07-25 11:11:14 +0200
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2017-07-30 14:41:12 +0100
commiteb92b4183d93a6f101a6bd3aaae651de404c119a (patch)
tree764cfc1057925e126774dc1c053c4fc1dfaad5da /drivers/iio/pressure/bmp280.h
parent055655a9f0fefef2256310a128a4cdaff8b8c432 (diff)
iio: bmp280: properly initialize device for humidity reading
If the device is not initialized at least once it happens that the humidity reading is skipped, which means the special value 0x8000 is delivered. For omitting this case the oversampling of the humidity must be set before the oversampling of the temperature und pressure is set as written in the datasheet of the BME280. Furthermore proper error detection is added in case a skipped value is read from the device. This is done also for pressure and temperature reading. Especially it don't make sense to compensate this value and treat it as regular value. Signed-off-by: Andreas Klinger <ak@it-klinger.de> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/pressure/bmp280.h')
-rw-r--r--drivers/iio/pressure/bmp280.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/iio/pressure/bmp280.h b/drivers/iio/pressure/bmp280.h
index 2c770e13be0e..61347438b779 100644
--- a/drivers/iio/pressure/bmp280.h
+++ b/drivers/iio/pressure/bmp280.h
@@ -96,6 +96,11 @@
#define BME280_CHIP_ID 0x60
#define BMP280_SOFT_RESET_VAL 0xB6
+/* BMP280 register skipped special values */
+#define BMP280_TEMP_SKIPPED 0x80000
+#define BMP280_PRESS_SKIPPED 0x80000
+#define BMP280_HUMIDITY_SKIPPED 0x8000
+
/* Regmap configurations */
extern const struct regmap_config bmp180_regmap_config;
extern const struct regmap_config bmp280_regmap_config;