Skip to content

Commit 8507853

Browse files
committed
iio: adc: adrv9002: Fix setting MCS delays
For TX ports, if dpd is not set, we will continue the loop and possibly skipping the delays. Fix it with a new dpd helper for better control flow. Fixes: 83b745b ("iio: adrv9002: support mcs delays settings") Signed-off-by: Nuno Sa <nuno.sa@analog.com>
1 parent 6751d92 commit 8507853

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

drivers/iio/adc/navassa/adrv9002.c

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3243,6 +3243,14 @@ static u64 adrv9002_get_init_carrier(const struct adrv9002_chan *c)
32433243
return DIV_ROUND_CLOSEST_ULL(lo_freq, c->ext_lo->divider);
32443244
}
32453245

3246+
static int adrv9002_init_dpd(const struct adrv9002_rf_phy *phy, const struct adrv9002_tx_chan *tx)
3247+
{
3248+
if (!tx->elb_en || !tx->dpd_init || !tx->dpd_init->enable)
3249+
return 0;
3250+
3251+
return api_call(phy, adi_adrv9001_dpd_Initial_Configure, tx->channel.number, tx->dpd_init);
3252+
}
3253+
32463254
/*
32473255
* All of these structures are taken from TES when exporting the default profile to C code. Consider
32483256
* about having all of these configurable through devicetree.
@@ -3307,13 +3315,7 @@ static int adrv9002_radio_init(const struct adrv9002_rf_phy *phy)
33073315
return ret;
33083316

33093317
if (c->port == ADI_TX) {
3310-
struct adrv9002_tx_chan *tx = chan_to_tx(c);
3311-
3312-
if (!tx->elb_en || !tx->dpd_init || !tx->dpd_init->enable)
3313-
continue;
3314-
3315-
ret = api_call(phy, adi_adrv9001_dpd_Initial_Configure,
3316-
c->number, tx->dpd_init);
3318+
ret = adrv9002_init_dpd(phy, chan_to_tx(c));
33173319
if (ret)
33183320
return ret;
33193321
}

0 commit comments

Comments
 (0)