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

iio:adis: Add support for manual self-test flag clear

Some variants of the devices from the ADIS family don't auto-clear the
self-test bit after the self-test has completed. Instead we have to
manually clear. Add support for this to the ADIS library.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>

authored by

Lars-Peter Clausen and committed by
Jonathan Cameron
af8a4127 964d97bd

+7 -1
+6 -1
drivers/iio/imu/adis.c
··· 324 324 325 325 msleep(adis->data->startup_delay); 326 326 327 - return adis_check_status(adis); 327 + ret = adis_check_status(adis); 328 + 329 + if (adis->data->self_test_no_autoclear) 330 + adis_write_reg_16(adis, adis->data->msc_ctrl_reg, 0x00); 331 + 332 + return ret; 328 333 } 329 334 330 335 /**
+1
include/linux/iio/imu/adis.h
··· 41 41 unsigned int diag_stat_reg; 42 42 43 43 unsigned int self_test_mask; 44 + bool self_test_no_autoclear; 44 45 unsigned int startup_delay; 45 46 46 47 const char * const *status_error_msgs;