[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240519152130.32ec84b9@jic23-huawei>
Date: Sun, 19 May 2024 15:22:35 +0100
From: Jonathan Cameron <jic23@...nel.org>
To: Vasileios Amoiridis <vassilisamir@...il.com>
Cc: lars@...afoo.de, andriy.shevchenko@...ux.intel.com,
ang.iglesiasg@...il.com, mazziesaccount@...il.com, ak@...klinger.de,
petre.rodan@...dimension.ro, phil@...pberrypi.com, 579lpy@...il.com,
linus.walleij@...aro.org, semen.protsenko@...aro.org,
linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org, Jonathan Cameron
<Jonathan.Cameron@...wei.com>
Subject: Re: [PATCH v7 1/5] iio: pressure: bmp280: Refactorize reading
functions
On Mon, 13 May 2024 01:05:20 +0200
Vasileios Amoiridis <vassilisamir@...il.com> wrote:
> For BMP18x, BMP28x, BME280, BMP38x the reading of the pressure
> value requires an update of the t_fine variable which happens
> through reading the temperature value.
>
> So all the bmpxxx_read_press() functions of the above sensors
> are internally calling the equivalent bmpxxx_read_temp() function
> in order to update the t_fine value. By just looking at the code
> this functionality is a bit hidden and is not easy to understand
> why those channels are not independent.
>
> This commit tries to clear these things a bit by splitting the
> bmpxxx_{read/compensate}_{temp/press/humid}() to the following:
>
> i. bmpxxx_read_{temp/press/humid}_adc(): read the raw value from
> the sensor.
>
> ii. bmpxx_calc_t_fine(): calculate the t_fine variable.
>
> iii. bmpxxx_get_t_fine(): get the t_fine variable.
>
> iv. bmpxxx_compensate_{temp/press/humid}(): compensate the adc
> values and return the calculated value.
>
> v. bmpxxx_read_{temp/press/humid}(): combine calls of the
> aforementioned functions to return the requested value.
>
> Suggested-by: Jonathan Cameron <Jonathan.Cameron@...wei.com>
> Signed-off-by: Vasileios Amoiridis <vassilisamir@...il.com>
Applied with a fix...
drivers/iio/pressure/bmp280-core.c: In function ‘bmp180_read_press’:
drivers/iio/pressure/bmp280-core.c:2091:9: error: ‘ret’ undeclared (first use in this function); did you mean ‘net’?
2091 | ret = bmp180_get_t_fine(data, &t_fine);
| ^~~
| net
I guess something got lost in rebasing. Anyhow, fix obvious so not
problem.
Thanks,
Jonathan
Powered by blists - more mailing lists