diff options
author | Linux Build Service Account <lnxbuild@localhost> | 2017-05-15 11:02:23 -0600 |
---|---|---|
committer | Linux Build Service Account <lnxbuild@localhost> | 2017-05-15 11:02:23 -0600 |
commit | 540b80f51e565f429381898c4752e88f05082f2a (patch) | |
tree | a41d56baf78cfc73ce6bea66b4cae7b51a069847 | |
parent | e304af7ccf9cf61a3ef6562ffec434a7d6e5e402 (diff) | |
parent | 6a71c31f1f2cf02f4a639602922fa15abf7152a1 (diff) | |
download | bt-540b80f51e565f429381898c4752e88f05082f2a.tar.gz |
Merge 6a71c31f1f2cf02f4a639602922fa15abf7152a1 on remote branch
Change-Id: I27a5e021ca416a355298a50860be0221ac51ce3a
-rw-r--r-- | libbt-vendor/Android.mk | 2 | ||||
-rwxr-xr-x[-rw-r--r--] | libbt-vendor/src/bt_vendor_qcom.c | 20 |
2 files changed, 18 insertions, 4 deletions
diff --git a/libbt-vendor/Android.mk b/libbt-vendor/Android.mk index 87eb71c..8d3f9d4 100644 --- a/libbt-vendor/Android.mk +++ b/libbt-vendor/Android.mk @@ -30,10 +30,8 @@ LOCAL_SRC_FILES := \ src/hw_ar3k.c \ src/bt_vendor_persist.cpp -ifneq ($(TARGET_USES_AOSP),true) #Disable this flag in case if FM over UART support not needed LOCAL_CFLAGS := -DFM_OVER_UART -endif ifneq (,$(filter userdebug eng,$(TARGET_BUILD_VARIANT))) LOCAL_CFLAGS += -DPANIC_ON_SOC_CRASH diff --git a/libbt-vendor/src/bt_vendor_qcom.c b/libbt-vendor/src/bt_vendor_qcom.c index 8cb928b..8cbf5d1 100644..100755 --- a/libbt-vendor/src/bt_vendor_qcom.c +++ b/libbt-vendor/src/bt_vendor_qcom.c @@ -451,6 +451,9 @@ static int bt_powerup(int en ) return -1; } } + /* Always perform BT power action so as to have the chance to + recover BT power properly from un-expected error. */ +#ifdef CHECK_BT_POWER_PERFORM_ACTION if(can_perform_action(on) == false) { ALOGE("%s:can't perform action as it is being used by other clients", __func__); #ifdef WIFI_BT_STATUS_SYNC @@ -459,6 +462,9 @@ static int bt_powerup(int en ) #endif goto done; } +#else + ALOGI("%s: always perform action", __func__); +#endif ret = asprintf(&enable_ldo_path, "/sys/class/rfkill/rfkill%d/device/extldo", q->rfkill_id); if( (ret < 0 ) || (enable_ldo_path == NULL) ) { @@ -796,6 +802,16 @@ static int __op(bt_vendor_opcode_t opcode, void *param) case BT_SOC_ROME: case BT_SOC_AR3K: case BT_SOC_CHEROKEE: + if (q->soc_type == BT_SOC_ROME) + { + if (nState == BT_VND_PWR_ON) + { + /* Always power BT off before power on. */ + ALOGI("bt-vendor: always power off before power on"); + bt_powerup(BT_VND_PWR_OFF); + } + } + /* BT Chipset Power Control through Device Tree Node */ retval = bt_powerup(nState); default: @@ -1458,10 +1474,10 @@ static bool is_debug_force_special_bytes() { } // Entry point of DLib +/* Remove 'ssr_cleanup' because it's not defined in 'bt_vendor_interface_t'. */ const bt_vendor_interface_t BLUETOOTH_VENDOR_LIB_INTERFACE = { sizeof(bt_vendor_interface_t), init, op, - cleanup, - ssr_cleanup + cleanup }; |