2024-06-06 21:25:16

by Vasileios Amoiridis

[permalink] [raw]
Subject: [PATCH v2 01/19] iio: chemical: bme680: Fix pressure value output

The IIO standard units are measured in kPa while the driver
is using hPa.

Apart from checking the userspace value itself, it is mentioned also
in the Bosch API [1] that the pressure value is in Pascal.

[1]: https://github.com/boschsensortec/BME68x_SensorAPI/blob/v4.4.8/bme68x_defs.h#L742
Fixes: 1b3bd8592780 ("iio: chemical: Add support for Bosch BME680 sensor")
Signed-off-by: Vasileios Amoiridis <[email protected]>
---
drivers/iio/chemical/bme680_core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/chemical/bme680_core.c b/drivers/iio/chemical/bme680_core.c
index ef5e0e46fd34..2c40c13fe97a 100644
--- a/drivers/iio/chemical/bme680_core.c
+++ b/drivers/iio/chemical/bme680_core.c
@@ -678,7 +678,7 @@ static int bme680_read_press(struct bme680_data *data,
}

*val = bme680_compensate_press(data, adc_press);
- *val2 = 100;
+ *val2 = 1000;
return IIO_VAL_FRACTIONAL;
}


base-commit: b3019fcdeb286b2cfe45e44bccb44dbcd8ff66dd
--
2.25.1



2024-06-09 11:01:02

by Jonathan Cameron

[permalink] [raw]
Subject: Re: [PATCH v2 01/19] iio: chemical: bme680: Fix pressure value output

On Thu, 6 Jun 2024 23:22:53 +0200
Vasileios Amoiridis <[email protected]> wrote:

> The IIO standard units are measured in kPa while the driver
> is using hPa.
>
> Apart from checking the userspace value itself, it is mentioned also
> in the Bosch API [1] that the pressure value is in Pascal.
>
> [1]: https://github.com/boschsensortec/BME68x_SensorAPI/blob/v4.4.8/bme68x_defs.h#L742
> Fixes: 1b3bd8592780 ("iio: chemical: Add support for Bosch BME680 sensor")
> Signed-off-by: Vasileios Amoiridis <[email protected]>
Given we are early in the cycle I'm going to take the fixes via
the fixes-togreg branch of iio.git.

Thanks will slow down the rest a little but we still have time that
that should not matter and we'll get these fixes into stable much sooner.

Applied to the fixes-togreg branch of iio.git and marked for stable.

Thanks,

Jonathan

> ---
> drivers/iio/chemical/bme680_core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iio/chemical/bme680_core.c b/drivers/iio/chemical/bme680_core.c
> index ef5e0e46fd34..2c40c13fe97a 100644
> --- a/drivers/iio/chemical/bme680_core.c
> +++ b/drivers/iio/chemical/bme680_core.c
> @@ -678,7 +678,7 @@ static int bme680_read_press(struct bme680_data *data,
> }
>
> *val = bme680_compensate_press(data, adc_press);
> - *val2 = 100;
> + *val2 = 1000;
> return IIO_VAL_FRACTIONAL;
> }
>
>
> base-commit: b3019fcdeb286b2cfe45e44bccb44dbcd8ff66dd