mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-07 11:33:58 -04:00
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: 42776c14c6 ("staging: iio: adc: ad7192: Add system calibration support")
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Link: https://patch.msgid.link/8aade802afca6a89641e24c1ae1d4b8d82cff58d.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
7021d97fb8
commit
08808b3ef3
@@ -257,6 +257,9 @@ static ssize_t ad7192_write_syscalib(struct iio_dev *indio_dev,
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
if (!iio_device_claim_direct(indio_dev))
|
||||
return -EBUSY;
|
||||
|
||||
temp = st->syscalib_mode[chan->channel];
|
||||
if (sys_calib) {
|
||||
if (temp == AD7192_SYSCALIB_ZERO_SCALE)
|
||||
@@ -267,6 +270,8 @@ static ssize_t ad7192_write_syscalib(struct iio_dev *indio_dev,
|
||||
chan->address);
|
||||
}
|
||||
|
||||
iio_device_release_direct(indio_dev);
|
||||
|
||||
return ret ? ret : len;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user