From 13e0e2facd831d71fb6a2d0021c11203c1a873ff Mon Sep 17 00:00:00 2001 From: Zhao Xuewen Date: Fri, 18 Sep 2015 19:07:35 +0800 Subject: Bluetooth:config SCO seting for HFP call 1, enable SCO_USE_I2S_INTERFACE for sturgeon 2, configure audio configuration in hw_sco_config for I2S as SCO_CODEC_CVSD by default BUG=24044548 Change-Id: Id39102ee812eb2b173dfab45f4fb97fd99c5e7b8 Signed-off-by: z00184990 --- src/hardware.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src') diff --git a/src/hardware.c b/src/hardware.c index b97d5f1..bf59896 100755 --- a/src/hardware.c +++ b/src/hardware.c @@ -1292,8 +1292,28 @@ void hw_sco_config(void) * and FM on the same PCM pins, we defer Bluetooth audio (SCO/eSCO) * configuration till SCO/eSCO is being established; * i.e. in hw_set_audio_state() call. + * When configured as I2S only, Bluetooth audio configuration is executed + * immediately with SCO_CODEC_CVSD by default. */ + if (SCO_INTERFACE_I2S == sco_bus_interface) { + HC_BT_HDR *p_buf = NULL; + uint16_t cmd_u16 = HCI_CMD_PREAMBLE_SIZE + SCO_I2SPCM_PARAM_SIZE; + + if (bt_vendor_cbacks) + p_buf = (HC_BT_HDR *)bt_vendor_cbacks->alloc(BT_HC_HDR_SIZE + cmd_u16); + + if (p_buf) { + p_buf->event = MSG_STACK_TO_HC_HCI_CMD; + p_buf->offset = 0; + p_buf->layer_specific = 0; + p_buf->len = cmd_u16; + hw_sco_i2spcm_config(p_buf, SCO_CODEC_CVSD); + } else { + ALOGE("Cannot allocate memory for p_buf in hw_sco_config sco config"); + } + } + if (bt_vendor_cbacks) { bt_vendor_cbacks->scocfg_cb(BT_VND_OP_RESULT_SUCCESS); -- cgit v1.2.3