diff options
author | ravindranath <ravindranathx.doddi@intel.com> | 2013-02-22 19:03:06 -0500 |
---|---|---|
committer | Ricardo Cerqueira <cyanogenmod@cerqueira.org> | 2013-07-14 00:42:41 +0100 |
commit | 94e39fa0c9a78d302e03461df5c31dee6dccf251 (patch) | |
tree | ca88e20dcf4e627eab3d0059178e3896ce02384e /libbt | |
parent | 3fd03785ae85df41b661b1508dc0f6ec60a18f8a (diff) | |
download | device_common-94e39fa0c9a78d302e03461df5c31dee6dccf251.zip device_common-94e39fa0c9a78d302e03461df5c31dee6dccf251.tar.gz device_common-94e39fa0c9a78d302e03461df5c31dee6dccf251.tar.bz2 |
libbt: BT USB support
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>
Diffstat (limited to 'libbt')
-rw-r--r-- | libbt/include/vnd_generic_usb.txt | 8 | ||||
-rw-r--r-- | libbt/src/hardware.c | 25 | ||||
-rw-r--r-- | libbt/vnd_buildcfg.mk | 6 |
3 files changed, 37 insertions, 2 deletions
diff --git a/libbt/include/vnd_generic_usb.txt b/libbt/include/vnd_generic_usb.txt new file mode 100644 index 0000000..7ab6cb0 --- /dev/null +++ b/libbt/include/vnd_generic_usb.txt @@ -0,0 +1,8 @@ +BLUETOOTH_HCI_USE_USB = TRUE +USE_CONTROLLER_BDADDR = TRUE +SCO_USE_I2S_INTERFACE = FALSE +FW_PATCHFILE_LOCATION = "/system/etc/firmware" +BTVND_DBG = FALSE +BTHW_DBG = TRUE +VNDUSERIAL_DBG = FALSE +UPIO_DBG = FALSE diff --git a/libbt/src/hardware.c b/libbt/src/hardware.c index bfb1cf7..392704e 100644 --- a/libbt/src/hardware.c +++ b/libbt/src/hardware.c @@ -776,7 +776,11 @@ void hw_config_cback(void *p_mem) if (is_proceeding == FALSE) { - is_proceeding = hw_config_set_bdaddr(p_buf); +#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; @@ -832,6 +836,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 */ @@ -1224,6 +1240,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 diff --git a/libbt/vnd_buildcfg.mk b/libbt/vnd_buildcfg.mk index 9aa57f0..1343d31 100644 --- a/libbt/vnd_buildcfg.mk +++ b/libbt/vnd_buildcfg.mk @@ -6,7 +6,11 @@ else SRC := $(call my-dir)/include/$(addprefix vnd_, $(addsuffix .txt,$(basename $(TARGET_DEVICE)))) ifeq (,$(wildcard $(SRC))) # configuration file does not exist. Use default one -SRC := $(call my-dir)/include/vnd_generic.txt +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 endif GEN := $(intermediates)/vnd_buildcfg.h |