[PATCH] iio: pressure: dps310: put the chip in standby on remove
From: Rupesh Majhi
Date: Mon Nov 02 2026 - 02:28:40 EST
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@xxxxxxxxxx>
Signed-off-by: Rupesh Majhi <zoone.rupert@xxxxxxxxx>
---
Cc: Paulius Zaleckas <paulius.zaleckas@xxxxxxxxx>
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@xxxxxxxxx/
[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