Skip to content

Commit dce3be3

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 74442b9 commit dce3be3

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
@@ -976,6 +976,11 @@ static ssize_t adrv9025_phy_tx_read(struct iio_dev *indio_dev,
976976
ret = adi_adrv9025_TrackingCalsEnableGet(phy->madDevice, &mask);
977977
val = !!(tmask & mask);
978978
break;
979+
case TX_DPD:
980+
tmask = ADI_ADRV9025_TRACK_TX1_DPD << chan->channel;
981+
ret = adi_adrv9025_TrackingCalsEnableGet(phy->madDevice, &mask);
982+
val = !!(tmask & mask);
983+
break;
979984
case TX_RF_BANDWIDTH:
980985
val = phy->deviceInitStruct.tx.txChannelCfg[chan->channel]
981986
.profile.rfBandwidth_kHz *
@@ -1036,6 +1041,15 @@ static ssize_t adrv9025_phy_tx_write(struct iio_dev *indio_dev,
10361041
if (ret)
10371042
ret = adrv9025_dev_err(phy);
10381043
break;
1044+
case TX_DPD:
1045+
mask = ADI_ADRV9025_TRACK_TX1_DPD << chan->channel;
1046+
1047+
ret = adi_adrv9025_TrackingCalsEnableSet(phy->madDevice, mask,
1048+
enable ? ADI_ADRV9025_TRACKING_CAL_ENABLE :
1049+
ADI_ADRV9025_TRACKING_CAL_DISABLE);
1050+
if (ret)
1051+
ret = adrv9025_dev_err(phy);
1052+
break;
10391053
default:
10401054
ret = -EINVAL;
10411055
}
@@ -1172,6 +1186,7 @@ static struct iio_chan_spec_ext_info adrv9025_phy_tx_ext_info[] = {
11721186
_ADRV9025_EXT_TX_INFO("quadrature_tracking_en", TX_QEC),
11731187
_ADRV9025_EXT_TX_INFO("lo_leakage_tracking_en", TX_LOL),
11741188
_ADRV9025_EXT_TX_INFO("rf_bandwidth", TX_RF_BANDWIDTH),
1189+
_ADRV9025_EXT_TX_INFO("dpd_en", TX_DPD),
11751190
{},
11761191
};
11771192
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)