AD9371 temperature reading

I added a debugfs option to read the internal temperature of the AD9371 based on the procedure outlined in the user guide:

MYKONOS_setupTempSensor()
MYKONOS_setAuxAdcChannel(), channel 16
MYKONOS_startTempMeasurement()
MYKONOS_readTempSensor
Here are the printk ouputs added for debug:

ad9371_debugfs_write() - temp cfg: dec 7, offset 0, override 0, window 15

MYKONOS_readTempSensor() - temp sensor code 20

ad9371_debugfs_write() - temp stat: code -83, winExceeded 0, winHiLo 0, valid 1

What am I missing in getting a meaningful temperature value?

Here is the diff for the linux source (needs cleanup, just proof of concept right now):

diff --git a/drivers/iio/adc/ad9371.c b/drivers/iio/adc/ad9371.c
index 9622e2eba09e..25c126775ed2 100644
--- a/drivers/iio/adc/ad9371.c
+++ b/drivers/iio/adc/ad9371.c
@@ -552,6 +552,7 @@ static int ad9371_setup(struct ad9371_rf_phy *phy)
    } else {
        dev_err(&phy->spi->dev, "Requesting device clock %u failed got %ld",
            mykDevice->clocks->deviceClock_kHz * 1000, dev_clk);
+       printk("%s() - %d\n", __func__, __LINE__);
        return -EINVAL;
    }

@@ -561,7 +562,10 @@ static int ad9371_setup(struct ad9371_rf_phy *phy)

    ret = clk_set_rate(phy->jesd_rx_clk, lane_rate_kHz);
    if (ret < 0)
+   {
+       printk("%s() - %d\n", __func__, __LINE__);
        return ret;
+   }

    lane_rate_kHz = mykDevice->obsRx->orxProfile->iqRate_kHz *
            mykDevice->obsRx->framer->M *
@@ -569,7 +573,10 @@ static int ad9371_setup(struct ad9371_rf_phy *phy)

    ret = clk_set_rate(phy->jesd_rx_os_clk, lane_rate_kHz);
    if (ret < 0)
+   {
+       printk("%s() - %d\n", __func__, __LINE__);
        return ret;
+   }

    lane_rate_kHz = mykDevice->tx->txProfile->iqRate_kHz *
            mykDevice->tx->deframer->M *
@@ -577,7 +584,10 @@ static int ad9371_setup(struct ad9371_rf_phy *phy)

    ret = clk_set_rate(phy->jesd_tx_clk, lane_rate_kHz);
    if (ret < 0)
+   {
+       printk("%s() - %d\n", __func__, __LINE__);
        return ret;
+   }

    /* Toggle RESETB pin on Mykonos device */

@@ -2485,6 +2495,45 @@ static ssize_t ad9371_debugfs_write(struct file *file,
            return ret;

        return count;
+   case DBGFS_DIE_TEMP:
+   {
+       mutex_lock(&phy->indio_dev->mlock);
+
+       //mykonosTempSensorConfig_t tcfg = { 7, 67, 1, 15 };
+       mykonosTempSensorConfig_t tcfg = { 7, 0, 0, 15 };
+#if 0
+       ret = MYKONOS_getTempSensorConfig(phy->mykDevice, &tcfg);
+       if ( ret != MYKONOS_ERR_GPIO_OK ) 
+               printk("%s() - %d ERR: %d\n", __func__, __LINE__, ret);
+#endif
+       printk("%s() - temp cfg: dec %d, offset %d, override %d, window %d\n", __func__, tcfg.tempDecimation, 
+                       tcfg.offset, tcfg.overrideFusedOffset, tcfg.tempWindow);
+
+       ret = MYKONOS_setupTempSensor(phy->mykDevice, &tcfg);
+       if ( ret != MYKONOS_ERR_GPIO_OK ) 
+               printk("%s() - %d ERR: %d\n", __func__, __LINE__, ret);
+
+       ret = MYKONOS_setAuxAdcChannel(phy->mykDevice, MYK_TEMPSENSOR);
+       if ( ret != MYKONOS_ERR_GPIO_OK ) 
+               printk("%s() - %d ERR: %d\n", __func__, __LINE__, ret);
+
+       ret = MYKONOS_startTempMeasurement(phy->mykDevice);
+       if ( ret != MYKONOS_ERR_GPIO_OK ) 
+               printk("%s() - %d ERR: %d\n", __func__, __LINE__, ret);
+       msleep( 10 );
+
+       mykonosTempSensorStatus_t tstat;
+       ret = MYKONOS_readTempSensor(phy->mykDevice, &tstat);
+       if ( ret != MYKONOS_ERR_GPIO_OK ) 
+               printk("%s() - %d ERR: %d\n", __func__, __LINE__, ret);
+       printk("%s() - temp stat: code %d, winExceeded %d, winHiLo %d, valid %d\n", __func__, tstat.tempCode,
+                       tstat.windowExceeded, tstat.windowHiLo, tstat.tempValid);
+       mutex_unlock(&phy->indio_dev->mlock);
+       if (ret < 0)
+           return ret;
+
+       return count;
+   }
    default:
        break;
    }
@@ -2551,6 +2600,7 @@ static int ad9371_register_debugfs(struct iio_dev *indio_dev)
    ad9371_add_debugfs_entry(phy, "bist_prbs_obs", DBGFS_BIST_PRBS_OBS);
    ad9371_add_debugfs_entry(phy, "bist_tone", DBGFS_BIST_TONE);
    ad9371_add_debugfs_entry(phy, "monitor_out", DBGFS_MONITOR_OUT);
+   ad9371_add_debugfs_entry(phy, "die_temperature", DBGFS_DIE_TEMP);

    for (i = 0; i < phy->ad9371_debugfs_entry_index; i++)
        d = debugfs_create_file(
diff --git a/drivers/iio/adc/ad9371.h b/drivers/iio/adc/ad9371.h
index dbbd4da798bd..408329ff0ddf 100644
--- a/drivers/iio/adc/ad9371.h
+++ b/drivers/iio/adc/ad9371.h
@@ -39,6 +39,7 @@ enum debugfs_cmd {
    DBGFS_BIST_PRBS_OBS,
    DBGFS_BIST_TONE,
    DBGFS_MONITOR_OUT,
+   DBGFS_DIE_TEMP,
 };