Skip to content

Commit

Permalink
iio: adc: ad9361: move GPO initialization earlier in the setup
Browse files Browse the repository at this point in the history
Some device configurations require that the GPO be set into a specific
setting before doing init ops.

One example is when a GPO is used to enable a reference clock.
That means that the GPOs should already have a specific configuration
before doing init/calibration ops.

Signed-off-by: Alexandru Ardelean <[email protected]>
  • Loading branch information
commodo authored and dbogdan committed Feb 28, 2018
1 parent b58e9ef commit c951e05
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/iio/adc/ad9361.c
Original file line number Diff line number Diff line change
Expand Up @@ -4672,6 +4672,10 @@ static int ad9361_setup(struct ad9361_rf_phy *phy)
}
}

ret = ad9361_gpo_setup(phy, &pd->gpo_ctrl);
if (ret < 0)
return ret;

if (pd->port_ctrl.pp_conf[2] & FDD_RX_RATE_2TX_RATE)
phy->rx_eq_2tx = true;

Expand Down Expand Up @@ -4753,10 +4757,6 @@ static int ad9361_setup(struct ad9361_rf_phy *phy)
if (ret < 0)
return ret;

ret = ad9361_gpo_setup(phy, &pd->gpo_ctrl);
if (ret < 0)
return ret;

ret = ad9361_set_ref_clk_cycles(phy, refin_Hz);
if (ret < 0)
return ret;
Expand Down

0 comments on commit c951e05

Please sign in to comment.