FM: Add SSR support for cherokee
This provide hardware error event to FM module during SOC
failure and resets FM gracefully.
Change-Id: Ic4345e02c8a1cba218414afdfcf3e76734c314b0
diff --git a/helium/radio-helium.h b/helium/radio-helium.h
index 9952884..8599316 100644
--- a/helium/radio-helium.h
+++ b/helium/radio-helium.h
@@ -497,6 +497,8 @@
#define HCI_EV_SEARCH_LIST_COMPLETE 0x14
#define HCI_EV_RADIO_TEXT_PLUS_ID 0x18
#define HCI_EV_RADIO_TEXT_PLUS_TAG 0x19
+#define HCI_EV_HW_ERR_EVENT 0x1A
+
#define HCI_REQ_DONE 0
#define HCI_REQ_PEND 1
diff --git a/helium/radio_helium_hal.c b/helium/radio_helium_hal.c
index 0c68972..a9aa9f0 100644
--- a/helium/radio_helium_hal.c
+++ b/helium/radio_helium_hal.c
@@ -103,6 +103,9 @@
if (radio->mode == FM_TURNING_OFF) {
jni_cb->disabled_cb();
radio->mode = FM_OFF;
+ //close the userial port and power off the chip
+ fm_userial_close();
+ fm_power(FM_RADIO_DISABLE);
}
}
@@ -514,6 +517,13 @@
}
}
+static void hci_ev_hw_error(char *buff)
+{
+ ALOGE("%s:%s: start", LOG_TAG, __func__);
+ jni_cb->disabled_cb();
+ fm_userial_close();
+}
+
static void hci_buff_ert(struct rds_grp_data *rds_buf)
{
int i;
@@ -701,6 +711,9 @@
case HCI_EV_RADIO_TEXT_PLUS_TAG:
hci_ev_rt_plus_tag(((FM_EVT_HDR *)evt_buf)->cmd_params);
break;
+ case HCI_EV_HW_ERR_EVENT:
+ hci_ev_hw_error(((FM_EVT_HDR *)evt_buf)->cmd_params);
+ break;
default:
break;
}