mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Rupesh Majhi <zoone.rupert@gmail.com>
To: "Andy Shevchenko" <andy@kernel.org>,
	"David Lechner" <dlechner@baylibre.com>,
	"Eddie James" <eajames@linux.ibm.com>,
	"Jonathan Cameron" <jic23@kernel.org>,
	"Nuno Sá" <nuno.sa@analog.com>
Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
	Rupesh Majhi <zoone.rupert@gmail.com>,
	Paulius Zaleckas <paulius.zaleckas@gmail.com>
Subject: [PATCH] iio: pressure: dps310: put the chip in standby on remove
Date: Mon,  2 Nov 2026 09:27:55 +0200	[thread overview]
Message-ID: <20261102072755.17043-1-zoone.rupert@gmail.com> (raw)

Remove resets the chip, though all it needs is to stop background
measurement. Write 0 to MEAS_CTRL instead.

Probe now resets the chip itself, so nothing depends on this reset.

Suggested-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Rupesh Majhi <zoone.rupert@gmail.com>
---
Cc: Paulius Zaleckas <paulius.zaleckas@gmail.com>

Applies on top of the dps310 fixes series [1], which resets the chip at
probe. Discussion: [2].

Tested on a DPS310 on a BeagleBone Black. Written with help from an LLM
coding assistant.

[1] https://lore.kernel.org/linux-iio/20261029220635.18816-1-zoone.rupert@gmail.com/
[2] https://lore.kernel.org/linux-iio/20261101173009.3549f50d@jic23-hlaptop/

 drivers/iio/pressure/dps310.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/iio/pressure/dps310.c b/drivers/iio/pressure/dps310.c
index c364fbaeb3fe..5cee23986f30 100644
--- a/drivers/iio/pressure/dps310.c
+++ b/drivers/iio/pressure/dps310.c
@@ -1391,11 +1391,12 @@ static irqreturn_t dps310_trigger_handler(int irq, void *p)
 	return IRQ_HANDLED;
 }
 
-static void dps310_reset(void *action_data)
+static void dps310_standby(void *action_data)
 {
 	struct dps310_data *data = action_data;
 
-	dps310_reset_wait(data);
+	regmap_write_bits(data->regmap, DPS310_MEAS_CFG,
+			  DPS310_MEAS_CTRL_BITS, 0);
 }
 
 static const struct regmap_config dps310_regmap_config = {
@@ -1449,8 +1450,7 @@ static int dps310_probe(struct i2c_client *client)
 	if (IS_ERR(data->regmap))
 		return PTR_ERR(data->regmap);
 
-	/* Register to run the device reset when the device is removed */
-	rc = devm_add_action_or_reset(dev, dps310_reset, data);
+	rc = devm_add_action_or_reset(dev, dps310_standby, data);
 	if (rc)
 		return rc;
 

base-commit: d1425b382b9cc5bd19223fad8ba4a8af3dbe1305
prerequisite-patch-id: 22f0452fa0da955789612d82cac492cb20ca45a5
prerequisite-patch-id: 53d86ea85edbf34082bf9bf9e590c6436994982d
prerequisite-patch-id: f5af50326a55df0acc42474b3fe04e60f25a3e16
-- 
2.43.0


                 reply	other threads:[~2026-11-02  7:28 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20261102072755.17043-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 \
    --cc=paulius.zaleckas@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

all inboxes | Powered by JetHome®