OSDN Git Service

libbt: BT USB support kitkat-x86 android-x86-4.4-r1 android-x86-4.4-r2 android-x86-4.4-r3
authorravindranath <ravindranathx.doddi@intel.com>
Sat, 23 Feb 2013 00:03:06 +0000 (19:03 -0500)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Mon, 9 Dec 2013 14:39:26 +0000 (22:39 +0800)
1. Skip baud rate configuration
2. Read BD Address from device
3. No specific configuration is required for SCO
4. SCO does not use I2S interface

Issue: AXIA-1459
Issue: AXIA-1460
Change-Id: I22a8cdde2b5b2ad11b21e7d1d2578b4323e812b2
Signed-off-by: Ravindranath Doddi <ravindranathx.doddi@wipro.com>
include/vnd_generic_usb.txt [new file with mode: 0644]
src/hardware.c
vnd_buildcfg.mk

diff --git a/include/vnd_generic_usb.txt b/include/vnd_generic_usb.txt
new file mode 100644 (file)
index 0000000..e8aabb2
--- /dev/null
@@ -0,0 +1,8 @@
+BLUETOOTH_HCI_USE_USB = TRUE
+USE_CONTROLLER_BDADDR = TRUE
+SCO_USE_I2S_INTERFACE = FALSE
+FW_PATCHFILE_LOCATION = "/system/lib/firmware"
+BTVND_DBG = FALSE
+BTHW_DBG = TRUE
+VNDUSERIAL_DBG = FALSE
+UPIO_DBG = FALSE
index c8bf746..186c60a 100644 (file)
@@ -680,7 +680,11 @@ void hw_config_cback(void *p_mem)
 
                 if (is_proceeding == FALSE)
                 {
+#if (BLUETOOTH_HCI_USE_USB == TRUE)
+                    is_proceeding = hw_config_read_bdaddr(p_buf);
+#else
                     is_proceeding = hw_config_set_bdaddr(p_buf);
+#endif
                 }
                 break;
 
@@ -732,6 +736,18 @@ void hw_config_cback(void *p_mem)
 
                 /* fall through intentionally */
             case HW_CFG_START:
+#if (BLUETOOTH_HCI_USE_USB == TRUE)
+                /* read local name */
+                UINT16_TO_STREAM(p, HCI_READ_LOCAL_NAME);
+                *p = 0; /* parameter length */
+
+                p_buf->len = HCI_CMD_PREAMBLE_SIZE;
+                hw_cfg_cb.state = HW_CFG_READ_LOCAL_NAME;
+
+                is_proceeding = bt_vendor_cbacks->xmit_cb(HCI_READ_LOCAL_NAME, \
+                                                    p_buf, hw_config_cback);
+                break;
+#endif
                 if (UART_TARGET_BAUD_RATE > 3000000)
                 {
                     /* set UART clock to 48MHz */
@@ -1124,6 +1140,13 @@ void hw_sco_config(void)
     HC_BT_HDR  *p_buf = NULL;
     uint8_t     *p, ret;
 
+#if (BLUETOOTH_HCI_USE_USB == TRUE)
+    /* Nothing specific is required for SCO connection, return SUCCESS */
+    if (bt_vendor_cbacks)
+        bt_vendor_cbacks->scocfg_cb(BT_VND_OP_RESULT_SUCCESS);
+    return;
+#endif
+
 #if (!defined(SCO_USE_I2S_INTERFACE) || (SCO_USE_I2S_INTERFACE == FALSE))
     uint16_t cmd_u16 = HCI_CMD_PREAMBLE_SIZE + SCO_PCM_PARAM_SIZE;
 #else
index b65033a..c6d2619 100644 (file)
@@ -3,8 +3,12 @@ intermediates := $(local-intermediates-dir)
 SRC := $(call my-dir)/include/$(addprefix vnd_, $(addsuffix .txt,$(basename $(TARGET_DEVICE))))
 ifeq (,$(wildcard $(SRC)))
 # configuration file does not exist. Use default one
+ifeq ($(BLUETOOTH_HCI_USE_USB), true)
+SRC := $(call my-dir)/include/vnd_generic_usb.txt
+else
 SRC := $(call my-dir)/include/vnd_generic.txt
 endif
+endif
 GEN := $(intermediates)/vnd_buildcfg.h
 TOOL := $(TOP_DIR)external/bluetooth/bluedroid/tools/gen-buildcfg.sh