summaryrefslogtreecommitdiffstats
path: root/fm_hci
diff options
context:
space:
mode:
authorSatish kumar sugasi <ssugas@codeaurora.org>2016-08-29 18:08:22 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2016-10-25 14:45:27 -0700
commit38c637e54740b8144803d6cab0d1270371f973c1 (patch)
tree4dc4f3d85af5f58592aae7cac565fb985c8bd0a6 /fm_hci
parenteead6724ffb7f01e5e58bfe60e8d585f1d661c1a (diff)
downloadandroid_hardware_qcom_fm-38c637e54740b8144803d6cab0d1270371f973c1.tar.gz
android_hardware_qcom_fm-38c637e54740b8144803d6cab0d1270371f973c1.tar.bz2
android_hardware_qcom_fm-38c637e54740b8144803d6cab0d1270371f973c1.zip
Call FM power off api after SSR
This adds logic to do Power control operations after SSR event received.invokes fmhal service to do Power OFF chip Change-Id: Ia4e2e720943b02625d22d78757c2f3c748ddec53
Diffstat (limited to 'fm_hci')
-rw-r--r--fm_hci/fm_hci.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/fm_hci/fm_hci.c b/fm_hci/fm_hci.c
index 2fafe83..a3666af 100644
--- a/fm_hci/fm_hci.c
+++ b/fm_hci/fm_hci.c
@@ -57,6 +57,7 @@ static int fm_hal_fd =0;
#define WAIT_TIMEOUT 200000 /* 200*1000us */
static void fm_hci_exit(void *arg);
+static int power(struct fm_hci_t *hci, fm_power_state_t state);
static void event_notification(struct fm_hci_t *hci, uint16_t event)
{
@@ -178,7 +179,7 @@ static int read_fm_event(struct fm_hci_t *hci, struct fm_event_header_t *pbuf, i
{
fd_set readFds;
sigset_t sigmask, emptymask;
- int n = 0, ret = -1, evt_len = -1;
+ int n = 0, ret = -1, evt_len = -1,status=0;
volatile int fd = hci->fd;
struct sigaction action;
@@ -230,6 +231,10 @@ static int read_fm_event(struct fm_hci_t *hci, struct fm_event_header_t *pbuf, i
ALOGI("%s: FM H/w Err Event Recvd. Event Code: 0x%2x", __func__, pbuf->evt_code);
lib_running =0;
hci->vendor->ssr_cleanup(0x22);
+ status = power(hci, FM_RADIO_DISABLE);
+ if (status < 0) {
+ ALOGE("power off fm radio failed during SSR ");
+ }
} else {
ALOGE("%s: Not CS/CC Event: Recvd. Event Code: 0x%2x", __func__, pbuf->evt_code);
}