Skip to content

Commit 1457283

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 29cad76 commit 1457283

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
@@ -979,6 +979,11 @@ static ssize_t adrv9025_phy_tx_read(struct iio_dev *indio_dev,
979979
ret = adi_adrv9025_TrackingCalsEnableGet(phy->madDevice, &mask);
980980
val = !!(tmask & mask);
981981
break;
982+
case TX_DPD:
983+
tmask = ADI_ADRV9025_TRACK_TX1_DPD << chan->channel;
984+
ret = adi_adrv9025_TrackingCalsEnableGet(phy->madDevice, &mask);
985+
val = !!(tmask & mask);
986+
break;
982987
case TX_RF_BANDWIDTH:
983988
val = phy->deviceInitStruct.tx.txChannelCfg[chan->channel]
984989
.profile.rfBandwidth_kHz *
@@ -1039,6 +1044,15 @@ static ssize_t adrv9025_phy_tx_write(struct iio_dev *indio_dev,
10391044
if (ret)
10401045
ret = adrv9025_dev_err(phy);
10411046
break;
1047+
case TX_DPD:
1048+
mask = ADI_ADRV9025_TRACK_TX1_DPD << chan->channel;
1049+
1050+
ret = adi_adrv9025_TrackingCalsEnableSet(phy->madDevice, mask,
1051+
enable ? ADI_ADRV9025_TRACKING_CAL_ENABLE :
1052+
ADI_ADRV9025_TRACKING_CAL_DISABLE);
1053+
if (ret)
1054+
ret = adrv9025_dev_err(phy);
1055+
break;
10421056
default:
10431057
ret = -EINVAL;
10441058
}
@@ -1175,6 +1189,7 @@ static struct iio_chan_spec_ext_info adrv9025_phy_tx_ext_info[] = {
11751189
_ADRV9025_EXT_TX_INFO("quadrature_tracking_en", TX_QEC),
11761190
_ADRV9025_EXT_TX_INFO("lo_leakage_tracking_en", TX_LOL),
11771191
_ADRV9025_EXT_TX_INFO("rf_bandwidth", TX_RF_BANDWIDTH),
1192+
_ADRV9025_EXT_TX_INFO("dpd_en", TX_DPD),
11781193
{},
11791194
};
11801195
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)