Linux IIO development
 help / color / mirror / Atom feed
From: Rupesh Majhi <zoone.rupert@gmail.com>
To: David Lechner <dlechner@baylibre.com>
Cc: "Eddie James" <eajames@linux.ibm.com>,
	"Jonathan Cameron" <jic23@kernel.org>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iio: pressure: dps310: fix pressure result shift bit definition
Date: Mon, 27 Jul 2026 18:09:34 +0300	[thread overview]
Message-ID: <20260727150934.9471-1-zoone.rupert@gmail.com> (raw)
In-Reply-To: <bb74b15e-6a95-4eaa-82bf-7c256b554c45@baylibre.com>

On 7/27/26 4:27 PM, David Lechner wrote:
> In your followup work, it would be nice to start with a patch to
> sort these in a logical order.
>
> Right now, there is a mix of GENMASK being sorted from high to low
> while bits are low to high (with DPS310_INT_HL being out of order).
> Normally, we go from low to high on everything because that is how
> datasheets usually list things.

Makes sense, I will do that. I have a cleanup series queued from Andy's
review of the ACPI fix, so the sort will go in as the first patch of that,
after the buffer work lands.

One thing worth flagging about the block you pasted: it keeps FIFO_EN at
BIT(5) and SPI_EN at BIT(6), which is what the driver has today, but the
datasheet puts FIFO_EN at bit 1 and SPI_MODE at bit 0. Datasheet V1.1
(2019-07-11), section 8.6 "Interrupt and FIFO configuration (CFG_REG)", the
bit table reads INT_HL, INT_FIFO, INT_TMP, INT_PRS, T_SHIFT, P_SHIFT,
FIFO_EN, SPI_MODE for bits 7 down to 0. So bits 5 and 6 are INT_TMP and
INT_FIFO.

Neither define is used right now, so nothing is broken today, but the FIFO
enable is needed by the FIFO patches. I have that as a separate one-liner
ahead of them, since it changes values rather than moving lines around.

That leaves CFG_REG looking like this once both go in:

#define DPS310_CFG_REG		0x09
#define  DPS310_INT_HL		BIT(7)
#define  DPS310_TMP_SHIFT_EN	BIT(3)
#define  DPS310_PRS_SHIFT_EN	BIT(2)
#define  DPS310_FIFO_EN		BIT(1)
#define  DPS310_SPI_EN		BIT(0)

I left the three interrupt enables at bits 6 to 4 out, since nothing uses
them and the driver has no interrupt path. Say if you would rather see them
defined for completeness.

The rest of your ordering I will take as is.

Thanks for looking at this.

Rupesh

  reply	other threads:[~2026-07-27 15:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-27  7:05 [PATCH] iio: pressure: dps310: fix pressure result shift bit definition Rupesh Majhi
2026-07-27 13:27 ` David Lechner
2026-07-27 15:09   ` Rupesh Majhi [this message]
2026-07-28 21:30     ` Jonathan Cameron

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=20260727150934.9471-1-zoone.rupert@gmail.com \
    --to=zoone.rupert@gmail.com \
    --cc=andy@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=eajames@linux.ibm.com \
    --cc=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.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