FM: Avoid interferece during WAN and Fm Coex.

Changes are made to avoid interferece seen during WAN
and Fm co-ex tests, With this change FM does keep track of
WAN status such that it would enable LPF to avoid interference

Change-Id: I015cd8b3fa074c4b7b90827a1fe619d44433323b
diff --git a/helium/radio-helium-commands.h b/helium/radio-helium-commands.h
index da02f52..c5dfba9 100644
--- a/helium/radio-helium-commands.h
+++ b/helium/radio-helium-commands.h
@@ -100,6 +100,7 @@
     HCI_FM_HELIUM_RDS_GRP_COUNTERS_EXT,
     HCI_FM_HELIUM_AGC_UCCTRL = 0x8000043, /* 0x8000043 */
     HCI_FM_HELIUM_AGC_GAIN_STATE,
+    HCI_FM_HELIUM_ENABLE_LPF,
 
     /*using private CIDs under userclass*/
     HCI_FM_HELIUM_READ_DEFAULT = 0x00980928,
diff --git a/helium/radio-helium.h b/helium/radio-helium.h
index 4437748..30c3d0c 100644
--- a/helium/radio-helium.h
+++ b/helium/radio-helium.h
@@ -283,6 +283,7 @@
 #define HCI_OCF_FM_GET_CH_DET_THRESHOLD     0x0018
 #define HCI_OCF_FM_SET_BLND_TBL             0x001B
 #define HCI_OCF_FM_GET_BLND_TBL             0x001C
+#define HCI_OCF_FM_LOW_PASS_FILTER_CTRL     0x001F
 /* HCI trans control commans opcode*/
 #define HCI_OCF_FM_ENABLE_TRANS_REQ         0x0001
 #define HCI_OCF_FM_DISABLE_TRANS_REQ        0x0002
@@ -1275,6 +1276,7 @@
 int hci_fm_default_data_read_req(struct hci_fm_def_data_rd_req *def_data_rd);
 int hci_fm_get_blend_req();
 int hci_fm_set_blend_tbl_req(struct hci_fm_blend_table *blnd_tbl);
+int hci_fm_enable_lpf(int enable);
 int hci_fm_default_data_write_req(struct hci_fm_def_data_wr_req * data_wrt);
 int hci_fm_get_station_dbg_param_req();
 int hci_fm_get_station_cmd_param_req();
diff --git a/helium/radio_helium_hal.c b/helium/radio_helium_hal.c
index c3dc559..e6ab1b1 100644
--- a/helium/radio_helium_hal.c
+++ b/helium/radio_helium_hal.c
@@ -488,6 +488,11 @@
             hci_cc_station_rsp(pbuf);
             break;
 
+    case hci_recv_ctrl_cmd_op_pack(HCI_OCF_FM_LOW_PASS_FILTER_CTRL):
+            ALOGI("%s: recived LPF enable event", __func__);
+            hci_cc_rsp(pbuf);
+            break;
+
     case hci_diagnostic_cmd_op_pack(HCI_OCF_FM_STATION_DBG_PARAM):
             hci_cc_dbg_param_rsp(pbuf);
             break;
@@ -1559,6 +1564,12 @@
          radio->blend_tbl.BlendRmssiHi = val;
          ret = hci_fm_set_blend_tbl_req(&radio->blend_tbl);
          break;
+    case HCI_FM_HELIUM_ENABLE_LPF:
+         ALOGI("%s: val: %x", __func__, val);
+         if (!(ret = hci_fm_enable_lpf(val))) {
+             ALOGI("%s: command sent sucessfully", __func__, val);
+         }
+         break;
     default:
         ALOGE("%s:%s: Not a valid FM CMD!!", LOG_TAG, __func__);
         ret = 0;
diff --git a/helium/radio_helium_hal_cmds.c b/helium/radio_helium_hal_cmds.c
index 8feb41f..7945023 100644
--- a/helium/radio_helium_hal_cmds.c
+++ b/helium/radio_helium_hal_cmds.c
@@ -447,3 +447,15 @@
             HCI_OCF_FM_STATION_DBG_PARAM);
     return send_fm_cmd_pkt(opcode, 0, NULL);
 }
+
+int hci_fm_enable_lpf(int enable)
+{
+    ALOGI("%s: enable: %x", __func__, enable);
+
+    uint16_t opcode = 0;
+    int enable_lpf = enable;
+
+    opcode = hci_opcode_pack(HCI_OGF_FM_RECV_CTRL_CMD_REQ,
+                                  HCI_OCF_FM_LOW_PASS_FILTER_CTRL);
+    return send_fm_cmd_pkt(opcode, sizeof(enable_lpf), &enable_lpf);
+}