From: Jonathan Cameron <jic23@kernel.org>
To: Vasileios Amoiridis <vassilisamir@gmail.com>
Cc: lars@metafoo.de, andriy.shevchenko@linux.intel.com,
ang.iglesiasg@gmail.com, mazziesaccount@gmail.com,
ak@it-klinger.de, petre.rodan@subdimension.ro,
phil@raspberrypi.com, 579lpy@gmail.com,
u.kleine-koenig@pengutronix.de, biju.das.jz@bp.renesas.com,
linus.walleij@linaro.org, semen.protsenko@linaro.org,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
Jonathan Cameron <Jonathan.Cameron@huawei.com>
Subject: Re: [PATCH v4 2/6] iio: pressure: bmp280: Refactorize reading functions
Date: Sat, 13 Apr 2024 17:56:12 +0100 [thread overview]
Message-ID: <20240413175612.5b117573@jic23-huawei> (raw)
In-Reply-To: <20240407172920.264282-3-vassilisamir@gmail.com>
On Sun, 7 Apr 2024 19:29:16 +0200
Vasileios Amoiridis <vassilisamir@gmail.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@huawei.com>
> Signed-off-by: Vasileios Amoiridis <vassilisamir@gmail.com>
Looks good to me. Thanks for tidying this up.
next prev parent reply other threads:[~2024-04-13 16:56 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-07 17:29 [PATCH v4 0/6] Driver cleanup and series to add triggered buffer Vasileios Amoiridis
2024-04-07 17:29 ` [PATCH v4 1/6] iio: pressure: bmp280: Various driver cleanups Vasileios Amoiridis
2024-04-13 16:52 ` Jonathan Cameron
2024-04-14 16:19 ` Vasileios Amoiridis
2024-04-14 18:13 ` Jonathan Cameron
2024-04-14 23:41 ` Vasileios Amoiridis
2024-04-07 17:29 ` [PATCH v4 2/6] iio: pressure: bmp280: Refactorize reading functions Vasileios Amoiridis
2024-04-13 16:56 ` Jonathan Cameron [this message]
2024-04-07 17:29 ` [PATCH v4 3/6] iio: pressure: bmp280: Introduce new cleanup routines Vasileios Amoiridis
2024-04-13 16:58 ` Jonathan Cameron
2024-04-07 17:29 ` [PATCH v4 4/6] iio: pressure: bmp280: Generalize read_{temp,press,humid}() functions Vasileios Amoiridis
2024-04-07 17:29 ` [PATCH v4 5/6] iio: pressure: bmp280: Add SCALE, RAW values in channels and refactorize them Vasileios Amoiridis
2024-04-07 17:29 ` [PATCH v4 6/6] iio: pressure: bmp280: Add triggered buffer support Vasileios Amoiridis
2024-04-13 17:06 ` Jonathan Cameron
2024-04-07 21:51 ` [PATCH v4 0/6] Driver cleanup and series to add triggered buffer Angel Iglesias
2024-04-08 15:01 ` Andy Shevchenko
2024-04-08 16:58 ` Vasileios Amoiridis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240413175612.5b117573@jic23-huawei \
--to=jic23@kernel.org \
--cc=579lpy@gmail.com \
--cc=Jonathan.Cameron@huawei.com \
--cc=ak@it-klinger.de \
--cc=andriy.shevchenko@linux.intel.com \
--cc=ang.iglesiasg@gmail.com \
--cc=biju.das.jz@bp.renesas.com \
--cc=lars@metafoo.de \
--cc=linus.walleij@linaro.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mazziesaccount@gmail.com \
--cc=petre.rodan@subdimension.ro \
--cc=phil@raspberrypi.com \
--cc=semen.protsenko@linaro.org \
--cc=u.kleine-koenig@pengutronix.de \
--cc=vassilisamir@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox