summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRockchip2015-02-28 11:42:37 +0800
committerRockchip2015-02-28 11:42:37 +0800
commit88e06ce6f0c9af4a8d44e19f44594030b2df576e (patch)
tree1a47a0d9a9f1d8dba4d22a0b3fd059e728ec6aa5
parente00ef2c1027b45e212d1bc8f58e192655c07c6fa (diff)
support different wifi bt chip auto compatible
like auto recognize rtl8188eu, ap6210, esp8089 in android
-rwxr-xr-x[-rw-r--r--]bluetooth/libbt/Android.mk3
-rwxr-xr-xbluetooth/libbt/src/hardware.c18
-rwxr-xr-xbluetooth/libbt_rtk8723bs/Android.mk9
-rwxr-xr-xbluetooth/libbt_rtk8723bs/src/hardware.c23
-rwxr-xr-xbluetooth/libbt_rtk_usb/Android.mk8
5 files changed, 40 insertions, 21 deletions
diff --git a/bluetooth/libbt/Android.mk b/bluetooth/libbt/Android.mk
index 12780ff..f304915 100644..100755
--- a/bluetooth/libbt/Android.mk
+++ b/bluetooth/libbt/Android.mk
@@ -19,7 +19,8 @@ LOCAL_C_INCLUDES += \
LOCAL_SHARED_LIBRARIES := \
libcutils \
- liblog
+ liblog \
+ libhardware_legacy
LOCAL_MODULE := libbt-vendor
LOCAL_MODULE_TAGS := optional
diff --git a/bluetooth/libbt/src/hardware.c b/bluetooth/libbt/src/hardware.c
index 9d8829e..75463bd 100755
--- a/bluetooth/libbt/src/hardware.c
+++ b/bluetooth/libbt/src/hardware.c
@@ -483,26 +483,28 @@ static uint8_t hw_config_findpatch(char *p_chip_id_str)
// cmy@20121128: get bt module and replace chip name
char bt_chip[64] = "";
- if (bt_get_chipname(bt_chip, 63) == 0)
+ extern int check_wifi_chip_type_string(char *type);
+ check_wifi_chip_type_string(bt_chip);
+ //if (bt_get_chipname(bt_chip, 63) == 0)
{
ALOGI("BT module name is: %s\n", bt_chip);
- if (!strcmp(bt_chip, "ap6210"))
+ if (!strcmp(bt_chip, "AP6210"))
sprintf(p_chip_id_str, "bcm20710a1_26M");
- else if (!strcmp(bt_chip, "ap6210_24M"))
+ else if (!strcmp(bt_chip, "AP6210_24M"))
sprintf(p_chip_id_str, "bcm20710a1_24M");
- else if (!strcmp(bt_chip, "ap6330") || !strcmp(bt_chip, "ap6493"))
+ else if (!strcmp(bt_chip, "AP6330") || !strcmp(bt_chip, "AP6493"))
sprintf(p_chip_id_str, "bcm40183b2");
- else if (!strcmp(bt_chip, "ap6335")) {
+ else if (!strcmp(bt_chip, "AP6335")) {
if (!strcmp(p_chip_id_str, "BCM20702A"))
sprintf(p_chip_id_str, "bcm20710a1_26M");
else
sprintf(p_chip_id_str, "bcm4339a0");
}
- else if (!strcmp(bt_chip, "ap6476"))
+ else if (!strcmp(bt_chip, "AP6476"))
sprintf(p_chip_id_str, "bcm2076b1");
- else if (!strcmp(bt_chip, "ap6441") || !strcmp(bt_chip, "ap6234"))
+ else if (!strcmp(bt_chip, "AP6441") || !strcmp(bt_chip, "AP6234"))
sprintf(p_chip_id_str, "bcm43341b0");
- else if (!strcmp(bt_chip, "ap6335"))
+ else if (!strcmp(bt_chip, "AP6335"))
sprintf(p_chip_id_str, "bcm4339a0");
else if (!strcmp(bt_chip, "awnb108"))
sprintf(p_chip_id_str, "awnb108");
diff --git a/bluetooth/libbt_rtk8723bs/Android.mk b/bluetooth/libbt_rtk8723bs/Android.mk
index cf80849..90a4b34 100755
--- a/bluetooth/libbt_rtk8723bs/Android.mk
+++ b/bluetooth/libbt_rtk8723bs/Android.mk
@@ -1,6 +1,6 @@
LOCAL_PATH := $(call my-dir)
-ifeq ($(findstring rtl8723bs, $(BOARD_CONNECTIVITY_MODULE)), rtl8723bs)
+#ifeq ($(strip $(BOARD_CONNECTIVITY_MODULE)), rtl8723bs)
include $(CLEAR_VARS)
@@ -17,9 +17,10 @@ LOCAL_C_INCLUDES += \
$(BDROID_DIR)/hci/include
LOCAL_SHARED_LIBRARIES := \
- libcutils
+ libcutils \
+ libhardware_legacy
-LOCAL_MODULE := libbt-vendor
+LOCAL_MODULE := libbt-vendor-rtl8723bs
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_CLASS := SHARED_LIBRARIES
LOCAL_MODULE_OWNER := realtek
@@ -29,4 +30,4 @@ include $(LOCAL_PATH)/vnd_buildcfg.mk
include $(BUILD_SHARED_LIBRARY)
-endif # BOARD_CONNECTIVITY_MODULE
+#endif # BOARD_CONNECTIVITY_MODULE
diff --git a/bluetooth/libbt_rtk8723bs/src/hardware.c b/bluetooth/libbt_rtk8723bs/src/hardware.c
index 7b5c385..59db0d2 100755
--- a/bluetooth/libbt_rtk8723bs/src/hardware.c
+++ b/bluetooth/libbt_rtk8723bs/src/hardware.c
@@ -72,8 +72,8 @@
#define HCI_UART_3WIRE 2
-#define FIRMWARE_DIRECTORY "/system/etc/firmware/rtlbt/"
-#define BT_CONFIG_DIRECTORY "/system/etc/firmware/rtlbt/"
+#define FIRMWARE_DIRECTORY "/system/etc/firmware/"
+#define BT_CONFIG_DIRECTORY "/system/etc/firmware/"
#define PATCH_DATA_FIELD_MAX_SIZE 252
#define BT_CAL_DIRECTORY "/data/misc/bluedroid/"
@@ -573,10 +573,18 @@ static uint8_t hw_config_set_controller_baudrate(HC_BT_HDR *p_buf, uint32_t baud
return (retval);
}
+static char bt_chip_type[64];
+
static const char *get_firmware_name()
{
static char firmware_file_name[PATH_MAX] = {0};
- sprintf(firmware_file_name, FIRMWARE_DIRECTORY"rtlbt_fw");
+ if (bt_chip_type[0] == 0)
+ check_wifi_chip_type_string(bt_chip_type);
+ if (!strcmp(bt_chip_type, "RTL8723BS")) {
+ sprintf(firmware_file_name, FIRMWARE_DIRECTORY"rtl8723bs_fw");
+ } else {
+ sprintf(firmware_file_name, FIRMWARE_DIRECTORY"rtl8723bs_VQ0_fw");
+ }
return firmware_file_name;
}
@@ -776,7 +784,14 @@ uint32_t rtk_get_bt_config(unsigned char** config_buf,
int fd;
FILE* file = NULL;
- sprintf(bt_config_file_name, BT_CONFIG_DIRECTORY"rtlbt_config");
+ if (bt_chip_type[0] == 0)
+ check_wifi_chip_type_string(bt_chip_type);
+ if (!strcmp(bt_chip_type, "RTL8723BS")) {
+ sprintf(bt_config_file_name, BT_CONFIG_DIRECTORY"rtl8723bs_config");
+ } else {
+ sprintf(bt_config_file_name, BT_CONFIG_DIRECTORY"rtl8723bs_VQ0_config");
+ }
+
ALOGI("BT config file: %s", bt_config_file_name);
if (stat(bt_config_file_name, &st) < 0)
diff --git a/bluetooth/libbt_rtk_usb/Android.mk b/bluetooth/libbt_rtk_usb/Android.mk
index 883dcf2..8dcd4cd 100755
--- a/bluetooth/libbt_rtk_usb/Android.mk
+++ b/bluetooth/libbt_rtk_usb/Android.mk
@@ -1,7 +1,7 @@
LOCAL_PATH := $(call my-dir)
-ifeq ($(strip $(BOARD_CONNECTIVITY_MODULE)),\
- $(filter $(BOARD_CONNECTIVITY_MODULE), rtl8723au rtl8723bu rtl8761auv))
+#ifeq ($(strip $(BOARD_CONNECTIVITY_MODULE)),\
+# $(filter $(BOARD_CONNECTIVITY_MODULE), rtl8723au rtl8723bu rtl8761auv))
include $(CLEAR_VARS)
@@ -17,7 +17,7 @@ LOCAL_C_INCLUDES += \
LOCAL_SHARED_LIBRARIES := \
libcutils
-LOCAL_MODULE := libbt-vendor
+LOCAL_MODULE := libbt-vendor-rtl8723bu
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_CLASS := SHARED_LIBRARIES
LOCAL_MODULE_OWNER := realtek
@@ -27,4 +27,4 @@ include $(LOCAL_PATH)/vnd_buildcfg.mk
include $(BUILD_SHARED_LIBRARY)
-endif # BOARD_CONNECTIVITY_MODULE
+#endif # BOARD_CONNECTIVITY_MODULE