mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-07 19:49:33 -04:00
iio: adc: ad7173: 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: 031bdc8aee ("iio: adc: ad7173: add calibration support")
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Link: https://patch.msgid.link/8319fa2dc881c9899d60db4eba7fe8e984716617.1740655250.git.u.kleine-koenig@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
committed by
Jonathan Cameron
parent
aac287ec80
commit
7021d97fb8
@@ -345,6 +345,9 @@ static ssize_t ad7173_write_syscalib(struct iio_dev *indio_dev,
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
if (!iio_device_claim_direct(indio_dev))
|
||||
return -EBUSY;
|
||||
|
||||
mode = st->channels[chan->channel].syscalib_mode;
|
||||
if (sys_calib) {
|
||||
if (mode == AD7173_SYSCALIB_ZERO_SCALE)
|
||||
@@ -355,6 +358,8 @@ static ssize_t ad7173_write_syscalib(struct iio_dev *indio_dev,
|
||||
chan->address);
|
||||
}
|
||||
|
||||
iio_device_release_direct(indio_dev);
|
||||
|
||||
return ret ? : len;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user