Skip to content

Commit

Permalink
iio:adis: Add support for manual self-test flag clear
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Lars-Peter Clausen authored and Jonathan Cameron committed Apr 16, 2016
1 parent 964d97b commit af8a412
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/iio/imu/adis.c
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,12 @@ static int adis_self_test(struct adis *adis)

msleep(adis->data->startup_delay);

return adis_check_status(adis);
ret = adis_check_status(adis);

if (adis->data->self_test_no_autoclear)
adis_write_reg_16(adis, adis->data->msc_ctrl_reg, 0x00);

return ret;
}

/**
Expand Down
1 change: 1 addition & 0 deletions include/linux/iio/imu/adis.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ struct adis_data {
unsigned int diag_stat_reg;

unsigned int self_test_mask;
bool self_test_no_autoclear;
unsigned int startup_delay;

const char * const *status_error_msgs;
Expand Down

0 comments on commit af8a412

Please sign in to comment.