diff --git a/pasdk/test_dsp/framework/audioStreamInpProcNewIO.c b/pasdk/test_dsp/framework/audioStreamInpProcNewIO.c
index e5b962961cbc7912e2cada5dff78f42ac2c6a84f..d332c088c7547a412c26954677ed15ac889039f0 100644 (file)
#include "ioPhy.h"
#include "ioData.h"
+#include <pa_i13_evmk2g_io_a.h>
#define STRIDE_WORST_CASE 32 // 4-byte (32-bit) word, 2 slots, 4 serializers
@@ -113,6 +114,7 @@ extern Void taskAsipFxnInit(const PAF_ASIT_Params *pP,const PAF_ASIT_Patchs *pQ)
extern XDAS_Int32 D10_initClkMux(void *pD10Params);
extern XDAS_Int32 D10_RxControl(const void *pD10RxParams,
XDAS_Int32 code, XDAS_Int32 arg);
+extern Aud_STATUS D10_initHDMI(void);
/*
* Functions only used in this file
}
}
+// Indicates whether Input has been selected
Int d10Initialized = 0;
//extern Aud_STATUS mcaspAudioConfig(void);
//extern void McaspDevice_init(void);
PAF_AST_IoInp *pInp
)
{
- Aud_STATUS status;
+ Int32 status;
+ Aud_STATUS audStatus;
const PAF_SIO_Params *pInPrms;
mcaspLLDconfig *pLldCfg;
mcaspLLDconfig *pReqLldCfg;
Int zMD;
Int interface;
const PAF_SIO_Params *pD10Params;
+ UInt postedEvents;
zMD = pAstCfg->masterDec;
{
d10Initialized = 0; // indicate no Input selected
- // check McASP LLD control API
- mcaspControlChan(pInp->hMcaspChan, MCASP_CHAN_RESET, NULL); // Rx reset channel
- //mcaspControlChan(pInp->hMcaspChan, MCASP_DEVICE_RESET, NULL); // Reset Tx/Rx channel
+ // Reset channel
+ status = mcaspControlChan(pInp->hMcaspChan, MCASP_CHAN_RESET, NULL); // Rx reset channel
+ //status = mcaspControlChan(pInp->hMcaspChan, MCASP_DEVICE_RESET, NULL); // Reset Tx/Rx channel
+ if (status != MCASP_COMPLETED)
+ {
+ Log_info0("asitSelectDevices(): McASP channel reset failed!\n");
+ return ASIP_ERR_MCASP_CFG;
+ }
// Delete McASP LLD channel
status = mcaspDeleteChan(pInp->hMcaspChan);
- if (status != Aud_EOK)
+ if (status != MCASP_COMPLETED)
{
Log_info0("asitSelectDevices(): McASP channel deletion failed!\n");
return ASIP_ERR_MCASP_CFG;
}
+ // Clear (drop) already posted Input data events
+ postedEvents = Event_getPostedEvents(gAsitEvtHandle);
+ while ((postedEvents & ASIT_EVTMSK_INPDATA) != 0)
+ {
+ Event_pend(gAsitEvtHandle, ASIT_EVTMSK_NONE, ASIT_EVTMSK_INPDATA, 0);
+ postedEvents = Event_getPostedEvents(gAsitEvtHandle);
+ }
+
pInp->hMcaspChan = NULL; // reset active McASP LLD handle
if (pInp->pRxParams != NULL) // sanity check, pInp->pRxParams should be non NULL if pInp->hMcaspChan is non NULL
{
//
// Requested device is other than InNone
//
+ if((interface == DEVINP_HDMI) || (interface == DEVINP_HDMI_STEREO))
+ {
+ D10_initHDMI();
+ }
// Initialize Tx clock mux
D10_initClkMux((void *)pD10Params);
{
// Create McASP LLD channel
mcaspChanHandle = NULL;
- status = mcasplldChanCreate(pReqLldCfg, &mcaspChanHandle);
- if (status != Aud_EOK)
+ audStatus = mcasplldChanCreate(pReqLldCfg, &mcaspChanHandle);
+ if (audStatus != Aud_EOK)
{
Log_info0("asitSelectDevices(): McASP channel creation failed!\n");
return ASIP_ERR_MCASP_CFG;