iio:pressure:bmp280: Read calibration data in probe
authorStefan Tatschner <stefan.tatschner@gmail.com>
Tue, 12 Dec 2017 20:35:37 +0000 (21:35 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 8 Jan 2018 15:03:43 +0000 (16:03 +0100)
commit2e419aec3b86aa76a34cb30ec4865060a6013366
tree8006f4f5ea697a6733695a8096694270580fb8f1
parent9273aa16b3847d31206d24b435f2bdd01c226cd4
iio:pressure:bmp280: Read calibration data in probe

This patch affects BME280 and BMP280. The readout of the calibration
data is moved to the probe function. Each sensor data access triggered
reading the full calibration data before this patch. According to the
datasheet, Section 4.4.2., the calibration data is stored in non-volatile
memory.

Since the calibration data does not change, and cannot be changed by the
user, we can reduce bus traffic by reading the calibration data once.
Additionally, proper organization of the data types enables removing
some odd casts in the compensation formulas.

Signed-off-by: Stefan Tatschner <stefan.tatschner@gmail.com>
Tested-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