/** * * Function Name: csl_dsp_sp_cnfg_msg * * @note This function configures speaker protection. * * @param control 0/1 - disable/enable * @param mode 0 - mono (stereo is not supported) * @param Init 0/1 - no initialization/initializes the internal * parameters and take new configuration * @param sp_config_struct configuration structure * @param sp_config_struct variables structure * * @return 0/1 - pass/failed * *****************************************************************************/ UInt16 csl_dsp_sp_cnfg_msg(UInt16 control, UInt16 mode, UInt16 Init, UInt32 *sp_config_struct, UInt32 *sp_vars_struct) { if (Init) { memcpy(&vp_shared_mem->shared_SP_left_config, sp_config_struct, sizeof(dummy2_config_t)); memcpy(&vp_shared_mem->shared_SP_input, sp_vars_struct, sizeof(dummy4_input_t)); } VPRIPCMDQ_SP(control, mode, Init); return 0; }
UInt32 audio_control_dsp(UInt32 param1, UInt32 param2, UInt32 param3, UInt32 param4, UInt32 param5, UInt32 param6) { UInt32 val = (UInt32) 0; Audio_Params_t audioParam; UInt32 tid; /* MsgType_t msgType; RPC_ACK_Result_t ackResult; */ unsigned long jiff_in = 0; aTrace(LOG_AUDIO_DRIVER, "\n\r * audio_control_dsp (AP) param1 %ld, param2 %ld" " param3 %ld param4 %ld *\n\r", param1, param2, param3, param4); if (inCpReset) return val; switch (param1) { case AUDDRV_DSPCMD_COMMAND_DIGITAL_SOUND: VPRIPCMDQ_DigitalSound((UInt16) param2); break; case AUDDRV_DSPCMD_COMMAND_SET_BT_NB: VPRIPCMDQ_SetBTNarrowBand((UInt16) param2); break; case AUDDRV_DSPCMD_COMMAND_USB_HEADSET: VPRIPCMDQ_USBHeadset((UInt16) param2); break; case AUDDRV_DSPCMD_MM_VPU_ENABLE: VPRIPCMDQ_MMVPUEnable((UInt16) param2); break; case AUDDRV_DSPCMD_MM_VPU_DISABLE: VPRIPCMDQ_MMVPUDisable(); break; /* AMCR PCM enable bit is controlled by ARM audio */ case AUDDRV_DSPCMD_AUDIO_SET_PCM: VPRIPCMDQ_DigitalSound((UInt16) param2); break; case AUDDRV_DSPCMD_COMMAND_VOIF_CONTROL: VPRIPCMDQ_VOIFControl((UInt16) param2); break; case AUDDRV_DSPCMD_COMMAND_SP: VPRIPCMDQ_SP((UInt16) param2, (UInt16) param3, (UInt16) param4); break; case AUDDRV_DSPCMD_COMMAND_CLEAR_VOIPMODE: VPRIPCMDQ_Clear_VoIPMode((UInt16) param2); break; default: audioParam.param1 = param1; audioParam.param2 = param2; audioParam.param3 = param3; audioParam.param4 = param4; audioParam.param5 = param5; audioParam.param6 = param6; tid = s_sid++; /* RPC_SyncCreateTID(&val, sizeof(UInt32)); */ aTrace(LOG_AUDIO_DRIVER, "audio_control_dsp tid=%ld,param1=%ld\n", tid, param1); /** init completion before send this DSP command */ if (param1 == AUDDRV_DSPCMD_AUDIO_ENABLE) { /*aError("i_c");*/ init_completion(&audioEnableDone); /*aError("i_d");*/ } CAPI2_audio_control_dsp(tid, audioClientId, &audioParam); /* RPC_SyncWaitForResponse(tid, audioClientId, &ackResult, &msgType, NULL); */ if (param1 == AUDDRV_DSPCMD_AUDIO_ENABLE) { /** wait for response from DSP for this command. Response usually comes back very fast, less than 10ms */ jiff_in = wait_for_completion_timeout( &audioEnableDone, timeout_jiff); if (!jiff_in) { aError("!!!Timeout on COMMAND_AUDIO_ENABLE %d" " resp!!!\n", (int)param2); /** IPCCP_SetCPCrashedStatus(IPC_AP_ASSERT); BUG_ON(1); panic("COMMAND_AUDIO_ENABLE timeout"); */ } #if defined(ENABLE_DMA_VOICE) { UInt16 dsp_path; dsp_path = csl_dsp_caph_control_aadmac_get_enable_path(); csl_caph_enable_adcpath_by_dsp(dsp_path); } #endif } break; } return val; }