Skip to content
Snippets Groups Projects
Commit 68b3f616 authored by Service qcabuildsw's avatar Service qcabuildsw Committed by Gerrit - the friendly Code Review server
Browse files

Merge "FM Radio: Wait for disable to complete" into fm.lnx.2.1-dev

parents ffc1653b a1805d9a
No related branches found
No related tags found
No related merge requests found
...@@ -677,6 +677,12 @@ void fm_hci_close(void *arg) { ...@@ -677,6 +677,12 @@ void fm_hci_close(void *arg) {
return; return;
} }
event_notification(hci, HC_EVENT_EXIT); event_notification(hci, HC_EVENT_EXIT);
pthread_mutex_lock(&hci->event_lock);
again:
pthread_cond_wait(&hci->event_cond, &hci->event_lock);
if (!(ready_events & HC_EVENT_EXIT_DONE))
goto again;
pthread_mutex_unlock(&hci->event_lock);
} }
int fm_hci_init(fm_hci_hal_t *hci_hal) int fm_hci_init(fm_hci_hal_t *hci_hal)
...@@ -785,6 +791,7 @@ static void fm_hci_exit(void *arg) ...@@ -785,6 +791,7 @@ static void fm_hci_exit(void *arg)
vendor_close(hci); vendor_close(hci);
pthread_cond_broadcast(&hci->event_cond); pthread_cond_broadcast(&hci->event_cond);
pthread_cond_broadcast(&hci->cmd_credits_cond); pthread_cond_broadcast(&hci->cmd_credits_cond);
event_notification(hci, HC_EVENT_EXIT_DONE);
stop_rx_thread(hci); stop_rx_thread(hci);
stop_tx_thread(hci); stop_tx_thread(hci);
ALOGD("Tx, Rx Threads join done"); ALOGD("Tx, Rx Threads join done");
......
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
#define HC_EVENT_LPM_IDLE_TIMEOUT 0x0100 #define HC_EVENT_LPM_IDLE_TIMEOUT 0x0100
#define HC_EVENT_EXIT 0x0200 #define HC_EVENT_EXIT 0x0200
#define HC_EVENT_EPILOG 0x0400 #define HC_EVENT_EPILOG 0x0400
#define HC_EVENT_EXIT_DONE 0x8000
#define MAX_FM_CMD_CNT 100 #define MAX_FM_CMD_CNT 100
#define FM_CMD 0x11 #define FM_CMD 0x11
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment