Correct FM sequence in turn on and audio focus loss/gain cases for wcn3990

The FM sequence is different for wcn3990 compared to older targets ->
When enabling FM ->
1. Enable Cherokee SB slave block.
2. From FM audio driver configure SB master and port.
3. Enable FM radio on Cherokee.

When audio focus changes from FM to A2DP ->
1. FM audio driver disable/resets SB port.
2. Cherokee FM radio is shutdown (SB slave port is left enabled).

When turning off FM ->
1. FM audio driver disables/shuts down SB port.
2. Cherokee FM shuts down both FM radio and SB slave block.

Change-Id: Ib6e7efd94d82f7e4249f5b1676a7e591c339058b
diff --git a/helium/radio-helium.h b/helium/radio-helium.h
index 200e006..79f61bd 100644
--- a/helium/radio-helium.h
+++ b/helium/radio-helium.h
@@ -171,6 +171,7 @@
 typedef void (*fm_set_blnd_cb) (int status);
 typedef void (*fm_get_stn_prm_cb) (int val, int status);
 typedef void (*fm_get_stn_dbg_prm_cb) (int val, int status);
+typedef void (*fm_enable_slimbus_cb) (int status);
 
 typedef struct {
     size_t  size;
@@ -206,6 +207,7 @@
     fm_set_blnd_cb fm_set_blend_cb;
     fm_get_stn_prm_cb fm_get_station_param_cb;
     fm_get_stn_dbg_prm_cb fm_get_station_debug_param_cb;
+    fm_enable_slimbus_cb enable_slimbus_cb;
 } fm_hal_callbacks_t;
 
 /* Opcode OCF */
diff --git a/helium/radio_helium_hal.c b/helium/radio_helium_hal.c
index 1109ca3..a25d888 100644
--- a/helium/radio_helium_hal.c
+++ b/helium/radio_helium_hal.c
@@ -79,7 +79,6 @@
         return;
     }
     rsp = (struct hci_fm_conf_rsp *)ev_rsp;
-    hal->jni_cb->thread_evt_cb(0);
     radio_hci_req_complete(rsp->status);
     hal->jni_cb->enabled_cb();
     if (rsp->status == FM_HC_STATUS_SUCCESS)
@@ -394,6 +393,13 @@
     clear_all_bit(station_dbg_param_mask_flag);
 }
 
+static void hci_cc_enable_slimbus_rsp(char *ev_buff)
+{
+    ALOGV("%s status %d", __func__, ev_buff[0]);
+    hal->jni_cb->thread_evt_cb(0);
+    hal->jni_cb->enable_slimbus_cb(ev_buff[0]);
+}
+
 static inline void hci_cmd_complete_event(char *buff)
 {
     uint16_t opcode;
@@ -491,6 +497,10 @@
             hci_cc_dbg_param_rsp(pbuf);
             break;
 
+    case hci_diagnostic_cmd_op_pack(HCI_OCF_FM_ENABLE_SLIMBUS):
+            hci_cc_enable_slimbus_rsp(pbuf);
+            break;
+
 /*    case hci_common_cmd_op_pack(HCI_OCF_FM_GET_SPUR_TABLE):
             hci_cc_get_spur_tbl(buff);
             break;