software/drivers/sd8887/src/bluetooth/bt/bt_main.c
/**
 *  @brief This function send init commands to firmware
 *
 *  @param priv   A pointer to bt_private structure
 *  @return       BT_STATUS_SUCESS/BT_STATUS_FAILURE
 */
@brief This function send init commands to firmware
@param priv   A pointer to bt_private structure
@return       BT_STATUS_SUCESS/BT_STATUS_FAILURE
@brief This function send init commands to firmware @param priv A pointer to bt_private structure @return BT_STATUS_SUCESS / BT_STATUS_FAILURE
int
bt_init_cmd(bt_private *priv)
{
	int ret = BT_STATUS_SUCCESS;
	ENTER();
	ret = bt_send_module_cfg_cmd(priv, MODULE_BRINGUP_REQ);
	if (ret < 0) {
		PRINTM(FATAL, "Module cfg command send failed!\n");
		goto done;
	}
	ret = bt_set_ble_deepsleep(priv, deep_sleep ? TRUE : FALSE);
	if (ret < 0) {
		PRINTM(FATAL, "%s BLE deepsleep failed!\n",
		       deep_sleep ? "Enable" : "Disable");
		goto done;
	}
	if (psmode) {
		priv->bt_dev.psmode = TRUE;
		priv->bt_dev.idle_timeout = DEFAULT_IDLE_TIME;
		ret = bt_enable_ps(priv);
		if (ret < 0) {
			PRINTM(FATAL, "Enable PS mode failed!\n");
			goto done;
		}
	}
#if defined(SDIO_SUSPEND_RESUME)
	priv->bt_dev.gpio_gap = DEF_GPIO_GAP;
	ret = bt_send_hscfg_cmd(priv);
	if (ret < 0) {
		PRINTM(FATAL, "Send HSCFG failed!\n");
		goto done;
	}
#endif
	priv->bt_dev.sdio_pull_cfg = 0xffffffff;
	priv->bt_dev.sdio_pull_ctrl = 0;
	wake_up_interruptible(&priv->MainThread.waitQ);
done:
	LEAVE();
	return ret;
}
int bt_init_cmd ( bt_private * priv ) { int ret = BT_STATUS_SUCCESS ; ENTER ( ) ; ret = bt_send_module_cfg_cmd ( priv , MODULE_BRINGUP_REQ ) ; if ( ret < 0 ) { PRINTM ( FATAL , " \n " ) ; goto done ; } ret = bt_set_ble_deepsleep ( priv , deep_sleep ? TRUE : FALSE ) ; if ( ret < 0 ) { PRINTM ( FATAL , " \n " , deep_sleep ? " " : " " ) ; goto done ; } if ( psmode ) { priv -> bt_dev . psmode = TRUE ; priv -> bt_dev . idle_timeout = DEFAULT_IDLE_TIME ; ret = bt_enable_ps ( priv ) ; if ( ret < 0 ) { PRINTM ( FATAL , " \n " ) ; goto done ; } } #if defined ( SDIO_SUSPEND_RESUME ) priv -> bt_dev . gpio_gap = DEF_GPIO_GAP ; ret = bt_send_hscfg_cmd ( priv ) ; if ( ret < 0 ) { PRINTM ( FATAL , " \n " ) ; goto done ; } #endif priv -> bt_dev . sdio_pull_cfg = 0xffffffff ; priv -> bt_dev . sdio_pull_ctrl = 0 ; wake_up_interruptible ( & priv -> MainThread . waitQ ) ; done : LEAVE ( ) ; return ret ; }
@brief This function send init commands to firmware
  @param priv   A pointer to bt_private structure
  @return       BT_STATUS_SUCESS/BT_STATUS_FAILURE
@brief This function send init commands to firmware @param priv A pointer to bt_private structure @return BT_STATUS_SUCESS / BT_STATUS_FAILURE