Skip to content

Commit

Permalink
iio: adc: ad9361_conv: Skip digital tune on AXI slave cores
Browse files Browse the repository at this point in the history
In MCS setups, the secondary AD936x won't reliably work unless the
complete MCS sequence has been performed. So we skip tuning on the
secondary device. It's up to the user responsibility to run the MCS
sequence and rerun the digital tuning afterwards. The libad9361
has all the required logic and can handle this.

Signed-off-by: Michael Hennerich <[email protected]>
  • Loading branch information
mhennerich committed Jan 11, 2022
1 parent 839d73c commit 8077957
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions drivers/iio/adc/ad9361_conv.c
Original file line number Diff line number Diff line change
Expand Up @@ -694,14 +694,16 @@ static int ad9361_post_setup(struct iio_dev *indio_dev)

flags = 0;

ret = ad9361_dig_tune(phy, (axiadc_read(st, ADI_AXI_REG_ID)) ?
0 : 61440000, flags);
ret = ad9361_dig_tune(phy, 61440000, axiadc_read(st, ADI_AXI_REG_ID) ?
flags | RESTORE_DEFAULT : flags);
if (ret < 0)
goto error;

if (flags & (DO_IDELAY | DO_ODELAY)) {
ret = ad9361_dig_tune(phy, (axiadc_read(st, ADI_AXI_REG_ID)) ?
0 : 61440000, flags & BE_VERBOSE);
ret = ad9361_dig_tune(phy, 61440000,
axiadc_read(st, ADI_AXI_REG_ID) ?
flags | RESTORE_DEFAULT | BE_VERBOSE :
flags | BE_VERBOSE);
if (ret < 0)
goto error;
}
Expand Down

0 comments on commit 8077957

Please sign in to comment.