Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: 031bdc8aee01 ("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>

authored by

Uwe Kleine-König and committed by
Jonathan Cameron
7021d97f aac287ec

+5
+5
drivers/iio/adc/ad7173.c
··· 345 345 if (ret) 346 346 return ret; 347 347 348 + if (!iio_device_claim_direct(indio_dev)) 349 + return -EBUSY; 350 + 348 351 mode = st->channels[chan->channel].syscalib_mode; 349 352 if (sys_calib) { 350 353 if (mode == AD7173_SYSCALIB_ZERO_SCALE) ··· 357 354 ret = ad_sd_calibrate(&st->sd, AD7173_MODE_CAL_SYS_FULL, 358 355 chan->address); 359 356 } 357 + 358 + iio_device_release_direct(indio_dev); 360 359 361 360 return ret ? : len; 362 361 }