author | Weiguang Ruan <Weiguang.ruan@amlogic.com> | 2016-02-22 11:58:16 (GMT) |
---|---|---|
committer | Weiguang Ruan <Weiguang.ruan@amlogic.com> | 2016-04-19 06:38:15 (GMT) |
commit | 7fb68025e139728ec596cfecdc6982298a17dcba (patch) | |
tree | ea53d58030fac831f574ea679f8a74f3850c7f5e | |
parent | 662261a9faf9915cc65a51ccf50e66f15a8d95c3 (diff) | |
download | libbt-7fb68025e139728ec596cfecdc6982298a17dcba.zip libbt-7fb68025e139728ec596cfecdc6982298a17dcba.tar.gz libbt-7fb68025e139728ec596cfecdc6982298a17dcba.tar.bz2 |
PD #119211 bt: add support for AP6269/AP6242
Change-Id: Ia5cd9bfea1fd6f17f2db32a80ef751ff0ebc730c
-rw-r--r-- | Android.mk | 6 | ||||
-rw-r--r-- | conf/bcm_usb_bt/Android.mk | 14 | ||||
-rw-r--r-- | conf/bcm_usb_bt/bt_vendor.conf | 5 | ||||
-rwxr-xr-x | src/userial_vendor.c | 13 |
4 files changed, 34 insertions, 4 deletions
@@ -31,7 +31,11 @@ include $(LOCAL_PATH)/vnd_buildcfg.mk include $(BUILD_SHARED_LIBRARY) -include $(LOCAL_PATH)/conf/meson/Android.mk +ifeq ($(BCM_USB_BT), true) + include $(LOCAL_PATH)/conf/bcm_usb_bt/Android.mk +else + include $(LOCAL_PATH)/conf/meson/Android.mk +endif ifeq ($(TARGET_PRODUCT), full_maguro) include $(LOCAL_PATH)/conf/samsung/maguro/Android.mk diff --git a/conf/bcm_usb_bt/Android.mk b/conf/bcm_usb_bt/Android.mk new file mode 100644 index 0000000..974e213 --- a/dev/null +++ b/conf/bcm_usb_bt/Android.mk @@ -0,0 +1,14 @@ +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_MODULE := bt_vendor.conf +LOCAL_MODULE_CLASS := ETC +LOCAL_MODULE_PATH := $(TARGET_OUT)/etc/bluetooth + +LOCAL_MODULE_TAGS := eng + +LOCAL_SRC_FILES := $(LOCAL_MODULE) + +include $(BUILD_PREBUILT) + diff --git a/conf/bcm_usb_bt/bt_vendor.conf b/conf/bcm_usb_bt/bt_vendor.conf new file mode 100644 index 0000000..651bda6 --- a/dev/null +++ b/conf/bcm_usb_bt/bt_vendor.conf @@ -0,0 +1,5 @@ +# UART device port where Bluetooth controller is attached +UartPort = /dev/btusb0 + +# Firmware patch file location +FwPatchFilePath = /etc/bluetooth/ diff --git a/src/userial_vendor.c b/src/userial_vendor.c index 3ff518b..02a2678 100755 --- a/src/userial_vendor.c +++ b/src/userial_vendor.c @@ -195,6 +195,7 @@ int userial_vendor_open(tUSERIAL_CFG *p_cfg) uint8_t data_bits; uint16_t parity; uint8_t stop_bits; + uint8_t cnt = 0; vnd_userial.fd = -1; @@ -240,12 +241,18 @@ int userial_vendor_open(tUSERIAL_CFG *p_cfg) } ALOGI("userial vendor open: opening %s", vnd_userial.port_name); - - if ((vnd_userial.fd = open(vnd_userial.port_name, O_RDWR)) == -1) +open_retry: + if ((vnd_userial.fd = open(vnd_userial.port_name, O_RDWR)) < 0) { - ALOGE("userial vendor open: unable to open %s", vnd_userial.port_name); + ALOGE("userial vendor open: unable to open %s, retrying....", vnd_userial.port_name); + usleep(50000); + cnt++; + if (cnt < 40) + goto open_retry; + ALOGE("userial vendor open fail!!"); return -1; } + ALOGE("userial vendor open success!!"); tcflush(vnd_userial.fd, TCIOFLUSH); |