Skip to content

Commit 523346f

Browse files
committed
iio: adc: adrv902x: Add DPD enable functionality
Add IIO attribute for enabling DPD. Signed-off-by: George Mois <[email protected]>
1 parent 4193c38 commit 523346f

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

drivers/iio/adc/adrv902x/adrv9025.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -977,6 +977,11 @@ static ssize_t adrv9025_phy_tx_read(struct iio_dev *indio_dev,
977977
ret = adi_adrv9025_TrackingCalsEnableGet(phy->madDevice, &mask);
978978
val = !!(tmask & mask);
979979
break;
980+
case TX_DPD:
981+
tmask = ADI_ADRV9025_TRACK_TX1_DPD << chan->channel;
982+
ret = adi_adrv9025_TrackingCalsEnableGet(phy->madDevice, &mask);
983+
val = !!(tmask & mask);
984+
break;
980985
case TX_RF_BANDWIDTH:
981986
val = phy->deviceInitStruct.tx.txChannelCfg[chan->channel]
982987
.profile.rfBandwidth_kHz *
@@ -1037,6 +1042,15 @@ static ssize_t adrv9025_phy_tx_write(struct iio_dev *indio_dev,
10371042
if (ret)
10381043
ret = adrv9025_dev_err(phy);
10391044
break;
1045+
case TX_DPD:
1046+
mask = ADI_ADRV9025_TRACK_TX1_DPD << chan->channel;
1047+
1048+
ret = adi_adrv9025_TrackingCalsEnableSet(phy->madDevice, mask,
1049+
enable ? ADI_ADRV9025_TRACKING_CAL_ENABLE :
1050+
ADI_ADRV9025_TRACKING_CAL_DISABLE);
1051+
if (ret)
1052+
ret = adrv9025_dev_err(phy);
1053+
break;
10401054
default:
10411055
ret = -EINVAL;
10421056
}
@@ -1173,6 +1187,7 @@ static struct iio_chan_spec_ext_info adrv9025_phy_tx_ext_info[] = {
11731187
_ADRV9025_EXT_TX_INFO("quadrature_tracking_en", TX_QEC),
11741188
_ADRV9025_EXT_TX_INFO("lo_leakage_tracking_en", TX_LOL),
11751189
_ADRV9025_EXT_TX_INFO("rf_bandwidth", TX_RF_BANDWIDTH),
1190+
_ADRV9025_EXT_TX_INFO("dpd_en", TX_DPD),
11761191
{},
11771192
};
11781193
static int adrv9025_gainindex_to_gain(struct adrv9025_rf_phy *phy, int channel,

drivers/iio/adc/adrv902x/adrv9025.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ enum adrv9025_tx_ext_info {
7272
TX_QEC,
7373
TX_LOL,
7474
TX_RF_BANDWIDTH,
75+
TX_DPD,
7576
};
7677

7778
enum adrv9025_iio_voltage_in {

0 commit comments

Comments
 (0)