From: Jonathan Cameron <jic23@kernel.org>
To: Petre Rodan <petre.rodan@subdimension.ro>
Cc: "David Lechner" <dlechner@baylibre.com>,
"Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>,
"Andreas Klinger" <ak@it-klinger.de>,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
"Jonathan Cameron" <Jonathan.Cameron@huawei.com>
Subject: Re: [PATCH 11/14] iio: pressure: mprls0025pa: fix scan_type struct
Date: Sun, 21 Dec 2025 18:34:55 +0000 [thread overview]
Message-ID: <20251221183455.3dd15dd7@jic23-huawei> (raw)
In-Reply-To: <20251218-mprls_cleanup-v1-11-b36a170f1a5c@subdimension.ro>
On Thu, 18 Dec 2025 13:05:53 +0200
Petre Rodan <petre.rodan@subdimension.ro> wrote:
> Fix the scan_type sign and realbits assignment.
>
> The pressure is a 24bit unsigned int between output_min and output_max.
>
> transfer function A: 10% to 90% of 2^24
> transfer function B: 2.5% to 22.5% of 2^24
Hmm. So, that's not ever going to use all the bits. It fits in 22 bits?
> transfer function C: 20% to 80% of 2^24
> [MPR_FUNCTION_A] = { .output_min = 1677722, .output_max = 15099494 }
> [MPR_FUNCTION_B] = { .output_min = 419430, .output_max = 3774874 }
> [MPR_FUNCTION_C] = { .output_min = 3355443, .output_max = 13421773 }
>
> Fixes: 713337d9143e ("iio: pressure: Honeywell mprls0025pa pressure sensor")
> Signed-off-by: Petre Rodan <petre.rodan@subdimension.ro>
Where possible drag any fixes as early as possible in the series as they
are more likely to be backported.
Here, I think the impact is constrained to the expected limits userspace
might work out rather than how the actual value of pressure is interpreted?
If so, good to fix but fairly minor bug.
Jonathan
> ---
> drivers/iio/pressure/mprls0025pa.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/iio/pressure/mprls0025pa.c b/drivers/iio/pressure/mprls0025pa.c
> index 9b18d5fb7e42..243a5717b88f 100644
> --- a/drivers/iio/pressure/mprls0025pa.c
> +++ b/drivers/iio/pressure/mprls0025pa.c
> @@ -165,8 +165,8 @@ static const struct iio_chan_spec mpr_channels[] = {
> BIT(IIO_CHAN_INFO_OFFSET),
> .scan_index = 0,
> .scan_type = {
> - .sign = 's',
> - .realbits = 32,
> + .sign = 'u',
> + .realbits = 24,
> .storagebits = 32,
> .endianness = IIO_CPU,
> },
>
next prev parent reply other threads:[~2025-12-21 18:35 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-18 11:05 [PATCH 00/14] iio: pressure: mprls0025pa: driver code cleanup Petre Rodan
2025-12-18 11:05 ` [PATCH 01/14] iio: pressure: mprls0025pa: Kconfig allow bus selection Petre Rodan
2025-12-20 4:39 ` Marcelo Schmitt
2025-12-21 18:06 ` Jonathan Cameron
2025-12-18 11:05 ` [PATCH 02/14] iio: pressure: mprls0025pa: remove redundant mutex Petre Rodan
2025-12-20 4:45 ` Marcelo Schmitt
2025-12-21 18:13 ` Jonathan Cameron
2025-12-18 11:05 ` [PATCH 03/14] iio: pressure: mprls0025pa: rename buffer variable Petre Rodan
2025-12-18 11:05 ` [PATCH 04/14] iio: pressure: mprls0025pa: introduce tx buffer Petre Rodan
2025-12-20 4:46 ` Marcelo Schmitt
2025-12-18 11:05 ` [PATCH 05/14] iio: pressure: mprls0025pa: zero out spi_transfer struct Petre Rodan
2025-12-21 18:18 ` Jonathan Cameron
2025-12-18 11:05 ` [PATCH 06/14] iio: pressure: mprls0025pa: memset rx_buf before reading new data Petre Rodan
2025-12-20 4:47 ` Marcelo Schmitt
2025-12-20 8:25 ` Petre Rodan
2025-12-21 18:21 ` Jonathan Cameron
2025-12-22 5:57 ` Petre Rodan
2025-12-22 14:06 ` Marcelo Schmitt
2025-12-27 14:31 ` Jonathan Cameron
2026-01-03 8:00 ` Petre Rodan
2026-01-11 11:44 ` Jonathan Cameron
2025-12-18 11:05 ` [PATCH 07/14] iio: pressure: mprls0025pa: make ops->write function consistent Petre Rodan
2025-12-20 4:49 ` Marcelo Schmitt
2025-12-20 9:59 ` Petre Rodan
2025-12-18 11:05 ` [PATCH 08/14] iio: pressure: mprls0025pa: stricter checks for the status byte Petre Rodan
2025-12-20 4:50 ` Marcelo Schmitt
2025-12-18 11:05 ` [PATCH 09/14] iio: pressure: mprls0025pa: mitigate SPI CS delay violation Petre Rodan
2025-12-20 4:51 ` Marcelo Schmitt
2025-12-20 7:48 ` Petre Rodan
2025-12-22 14:36 ` Marcelo Schmitt
2025-12-18 11:05 ` [PATCH 10/14] iio: pressure: mprls0025pa: cleanup pressure calculation Petre Rodan
2025-12-20 4:53 ` Marcelo Schmitt
2025-12-18 11:05 ` [PATCH 11/14] iio: pressure: mprls0025pa: fix scan_type struct Petre Rodan
2025-12-21 18:34 ` Jonathan Cameron [this message]
2025-12-18 11:05 ` [PATCH 12/14] iio: pressure: mprls0025pa: fix interrupt flag Petre Rodan
2025-12-21 18:38 ` Jonathan Cameron
2025-12-22 7:22 ` Petre Rodan
2025-12-27 16:40 ` Jonathan Cameron
2025-12-18 11:05 ` [PATCH 13/14] iio: pressure: mprls0025pa: cleanup includes and forward declarations Petre Rodan
2025-12-20 4:55 ` Marcelo Schmitt
2025-12-18 11:05 ` [PATCH 14/14] iio: pressure: mprls0025pa: add copyright line Petre Rodan
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=20251221183455.3dd15dd7@jic23-huawei \
--to=jic23@kernel.org \
--cc=Jonathan.Cameron@huawei.com \
--cc=ak@it-klinger.de \
--cc=andy@kernel.org \
--cc=dlechner@baylibre.com \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nuno.sa@analog.com \
--cc=petre.rodan@subdimension.ro \
/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