mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] iio: pressure: dps310: put the chip in standby on remove
@ 2026-11-02  7:27 Rupesh Majhi
  0 siblings, 0 replies; only message in thread
From: Rupesh Majhi @ 2026-11-02  7:27 UTC (permalink / raw)
  To: Andy Shevchenko, David Lechner, Eddie James, Jonathan Cameron,
	Nuno Sá
  Cc: linux-iio, linux-kernel, Rupesh Majhi, Paulius Zaleckas

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-02  7:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-02  7:27 [PATCH] iio: pressure: dps310: put the chip in standby on remove Rupesh Majhi

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®