Commit 6282b5c6 authored by Linus Walleij's avatar Linus Walleij Committed by Jonathan Cameron

iio: pressure: bmp280: BMP280 calibration to entropy

The BMP280/BME280 calibration data should also go into the
entropy pool, like we do for BMP180.

This just adds the temperature and pressure calibration, the
humidity calibration seems like too much annoying calls to
add.

Cc: Tomasz Duszynski <tduszyns@gmail.com>
Cc: Stefan Tatschner <stefan.tatschner@gmail.com>
Cc: Andreas Klinger <ak@it-klinger.de>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent 3b5de76b
...@@ -164,6 +164,9 @@ static int bmp280_read_calib(struct bmp280_data *data, ...@@ -164,6 +164,9 @@ static int bmp280_read_calib(struct bmp280_data *data,
return ret; return ret;
} }
/* Toss the temperature calibration data into the entropy pool */
add_device_randomness(t_buf, sizeof(t_buf));
calib->T1 = le16_to_cpu(t_buf[T1]); calib->T1 = le16_to_cpu(t_buf[T1]);
calib->T2 = le16_to_cpu(t_buf[T2]); calib->T2 = le16_to_cpu(t_buf[T2]);
calib->T3 = le16_to_cpu(t_buf[T3]); calib->T3 = le16_to_cpu(t_buf[T3]);
...@@ -177,6 +180,9 @@ static int bmp280_read_calib(struct bmp280_data *data, ...@@ -177,6 +180,9 @@ static int bmp280_read_calib(struct bmp280_data *data,
return ret; return ret;
} }
/* Toss the pressure calibration data into the entropy pool */
add_device_randomness(p_buf, sizeof(p_buf));
calib->P1 = le16_to_cpu(p_buf[P1]); calib->P1 = le16_to_cpu(p_buf[P1]);
calib->P2 = le16_to_cpu(p_buf[P2]); calib->P2 = le16_to_cpu(p_buf[P2]);
calib->P3 = le16_to_cpu(p_buf[P3]); calib->P3 = le16_to_cpu(p_buf[P3]);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment