From be172a615a0832e9881c787ce98ba74974f1a0c0 Mon Sep 17 00:00:00 2001
From: Josh Blum <josh@joshknows.com>
Date: Fri, 28 Sep 2012 16:58:28 -0700
Subject: lfrx: disable dc offset correction when using LFRX

---
 host/lib/usrp/b100/b100_impl.cpp   | 3 +++
 host/lib/usrp/e100/e100_impl.cpp   | 3 +++
 host/lib/usrp/usrp1/usrp1_impl.cpp | 3 +++
 host/lib/usrp/usrp2/usrp2_impl.cpp | 3 +++
 4 files changed, 12 insertions(+)

(limited to 'host/lib/usrp')

diff --git a/host/lib/usrp/b100/b100_impl.cpp b/host/lib/usrp/b100/b100_impl.cpp
index b226e113a..a5a0ef9b0 100644
--- a/host/lib/usrp/b100/b100_impl.cpp
+++ b/host/lib/usrp/b100/b100_impl.cpp
@@ -440,6 +440,9 @@ b100_impl::b100_impl(const device_addr_t &device_addr){
     tx_db_eeprom.load(*_fpga_i2c_ctrl, I2C_ADDR_TX_A);
     gdb_eeprom.load(*_fpga_i2c_ctrl, I2C_ADDR_TX_A ^ 5);
 
+    //disable rx dc offset if LFRX
+    if (rx_db_eeprom.id == 0x000f) _tree->access<bool>(rx_fe_path / "dc_offset" / "enable").set(false);
+
     //create the properties and register subscribers
     _tree->create<dboard_eeprom_t>(mb_path / "dboards/A/rx_eeprom")
         .set(rx_db_eeprom)
diff --git a/host/lib/usrp/e100/e100_impl.cpp b/host/lib/usrp/e100/e100_impl.cpp
index eb8804776..a0fa6c47e 100644
--- a/host/lib/usrp/e100/e100_impl.cpp
+++ b/host/lib/usrp/e100/e100_impl.cpp
@@ -399,6 +399,9 @@ e100_impl::e100_impl(const uhd::device_addr_t &device_addr){
     tx_db_eeprom.load(*_fpga_i2c_ctrl, I2C_ADDR_TX_DB);
     gdb_eeprom.load(*_fpga_i2c_ctrl, I2C_ADDR_TX_DB ^ 5);
 
+    //disable rx dc offset if LFRX
+    if (rx_db_eeprom.id == 0x000f) _tree->access<bool>(rx_fe_path / "dc_offset" / "enable").set(false);
+
     //create the properties and register subscribers
     _tree->create<dboard_eeprom_t>(mb_path / "dboards/A/rx_eeprom")
         .set(rx_db_eeprom)
diff --git a/host/lib/usrp/usrp1/usrp1_impl.cpp b/host/lib/usrp/usrp1/usrp1_impl.cpp
index 470a71d68..a5e51b7d2 100644
--- a/host/lib/usrp/usrp1/usrp1_impl.cpp
+++ b/host/lib/usrp/usrp1/usrp1_impl.cpp
@@ -360,6 +360,9 @@ usrp1_impl::usrp1_impl(const device_addr_t &device_addr){
         tx_db_eeprom.load(*_fx2_ctrl, (db == "A")? (I2C_ADDR_TX_A) : (I2C_ADDR_TX_B));
         gdb_eeprom.load(*_fx2_ctrl, (db == "A")? (I2C_ADDR_TX_A ^ 5) : (I2C_ADDR_TX_B ^ 5));
 
+        //disable rx dc offset if LFRX
+        if (rx_db_eeprom.id == 0x000f) _tree->access<bool>(mb_path / "rx_frontends" / db / "dc_offset" / "enable").set(false);
+
         //create the properties and register subscribers
         _tree->create<dboard_eeprom_t>(mb_path / "dboards" / db/ "rx_eeprom")
             .set(rx_db_eeprom)
diff --git a/host/lib/usrp/usrp2/usrp2_impl.cpp b/host/lib/usrp/usrp2/usrp2_impl.cpp
index 42b1acc4c..21f166aa1 100644
--- a/host/lib/usrp/usrp2/usrp2_impl.cpp
+++ b/host/lib/usrp/usrp2/usrp2_impl.cpp
@@ -666,6 +666,9 @@ usrp2_impl::usrp2_impl(const device_addr_t &_device_addr){
         tx_db_eeprom.load(*_mbc[mb].iface, USRP2_I2C_ADDR_TX_DB);
         gdb_eeprom.load(*_mbc[mb].iface, USRP2_I2C_ADDR_TX_DB ^ 5);
 
+        //disable rx dc offset if LFRX
+        if (rx_db_eeprom.id == 0x000f) _tree->access<bool>(rx_fe_path / "dc_offset" / "enable").set(false);
+
         //create the properties and register subscribers
         _tree->create<dboard_eeprom_t>(mb_path / "dboards/A/rx_eeprom")
             .set(rx_db_eeprom)
-- 
cgit v1.2.3