iio: pressure: dps310: put the chip in standby on remove
Subsystems (2)
PATCH 1/1 iio: pressure: dps310: put the chip in standby on remove
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.
---
Cc: Paulius Zaleckas <[email protected]>
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/[email protected]/
[2] https://lore.kernel.org/linux-iio/20261101173009.3549f50d@jic23-hlaptop/
drivers/iio/pressure/dps310.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/iio/pressure/dps310.c +4 -4
@@ -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
Signature · 1 line
2.43.0
Quoted 2 lines · Rupesh Majhi
Remove resets the chip, though all it needs is to stop background measurement. Write 0 to
MEAS_CTRLinstead.
On a ZTS8032, unbind leaves MEAS_CTRL at 0 with the configuration intact, and 20 unbind/bind cycles read fine.
Paulius
Jonathan Cameron
maintainerQuoted 10 lines · On Wed, 4 Nov 2026 11:14:15 +0200 Paulius Zaleckas…
Quoted 2 lines · Rupesh Majhi
Remove resets the chip, though all it needs is to stop background measurement. Write 0 to
MEAS_CTRLinstead.On a ZTS8032, unbind leaves
MEAS_CTRLat 0 with the configuration intact, and 20 unbind/bind cycles read fine.Tested-by Paulius Zaleckas <[email protected]>Paulius
Nice and applied on to of the other series on the testing branch of iio.git. Thanks,
Jonathan