Skip to content

Commit 08808b3

Browse files
ukleinekjic23
authored andcommitted
iio: adc: ad7192: Grab direct mode for calibration
While a calibration is running, better don't make the device do anything else. To enforce that, grab direct mode during calibration. Fixes: 42776c1 ("staging: iio: adc: ad7192: Add system calibration support") Signed-off-by: Uwe Kleine-König <[email protected]> Link: https://patch.msgid.link/8aade802afca6a89641e24c1ae1d4b8d82cff58d.1740655250.git.u.kleine-koenig@baylibre.com Signed-off-by: Jonathan Cameron <[email protected]>
1 parent 7021d97 commit 08808b3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/iio/adc/ad7192.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,9 @@ static ssize_t ad7192_write_syscalib(struct iio_dev *indio_dev,
257257
if (ret)
258258
return ret;
259259

260+
if (!iio_device_claim_direct(indio_dev))
261+
return -EBUSY;
262+
260263
temp = st->syscalib_mode[chan->channel];
261264
if (sys_calib) {
262265
if (temp == AD7192_SYSCALIB_ZERO_SCALE)
@@ -267,6 +270,8 @@ static ssize_t ad7192_write_syscalib(struct iio_dev *indio_dev,
267270
chan->address);
268271
}
269272

273+
iio_device_release_direct(indio_dev);
274+
270275
return ret ? ret : len;
271276
}
272277

0 commit comments

Comments
 (0)