PASDK-577:Add McASP LLD ch reset before McASP LLD ch delete
authorFrank Livingston <frank-livingston@ti.com>
Thu, 24 May 2018 22:03:52 +0000 (17:03 -0500)
committerFrank Livingston <frank-livingston@ti.com>
Thu, 24 May 2018 22:03:52 +0000 (17:03 -0500)
Rx McASP EDMA callback function stops without this update on Input
shortcut re-select.

pasdk/test_dsp/framework/audioStreamInpProcNewIO.c
pasdk/test_dsp/framework/audioStreamOutIo.c

index fa15ce522d8e9965e2eb65be1e6f8fe6362b3348..61518a499f85d0e00e1da6e970f70e6149913858 100644 (file)
@@ -1162,6 +1162,12 @@ Int asitSelectDevices(
         //
         if (pInp->hMcaspChan != NULL)   // non-NULL McASP LLD channel handle indicates there's an active interface
         {
         //
         if (pInp->hMcaspChan != NULL)   // non-NULL McASP LLD channel handle indicates there's an active interface
         {
+            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
+            
             // Delete McASP LLD channel
             status = mcaspDeleteChan(pInp->hMcaspChan);
             if (status != Aud_EOK)
             // Delete McASP LLD channel
             status = mcaspDeleteChan(pInp->hMcaspChan);
             if (status != Aud_EOK)
@@ -1195,24 +1201,9 @@ Int asitSelectDevices(
             // Requested device is other than InNone
             //
             
             // Requested device is other than InNone
             //
             
-            //if (!d10Initialized)
-            //{
-                // FL: probably no harm in calling this for every new i/f request.
-                //     However, it can probably be moved to main() or sys init task.
-                // Initialize McASP HW details
-                //McaspDevice_init();
+            // Initialize Tx clock mux
+            D10_initClkMux((void *)pD10Params);
                 
                 
-                // Initialize Tx clock mux
-                D10_initClkMux((void *)pD10Params);
-                
-            //    d10Initialized=1;
-            //}
-            
-            if (!d10Initialized)
-            {
-                d10Initialized=1; // global flag indicating D10 init completed
-            }
-
             pReqLldCfg = (mcaspLLDconfig *)pD10Params->sio.pConfig;
             if (pReqLldCfg->hMcaspChan == NULL)
             {
             pReqLldCfg = (mcaspLLDconfig *)pD10Params->sio.pConfig;
             if (pReqLldCfg->hMcaspChan == NULL)
             {
@@ -1234,6 +1225,8 @@ Int asitSelectDevices(
                     pReqLldCfg->mcaspChanParams->noOfChannels;
                 
                 pInp->firstTimeInit = TRUE; // set flag for IO Phy & Buff initialization
                     pReqLldCfg->mcaspChanParams->noOfChannels;
                 
                 pInp->firstTimeInit = TRUE; // set flag for IO Phy & Buff initialization
+                
+                d10Initialized = 1; // indicate Input selected
             }
         }
         else
             }
         }
         else
index ee4064e004ae27f0e7eca695a9b156b0a2b88ca6..9562fed315c93cb63067ceb924c3a1dca2053584 100644 (file)
@@ -82,6 +82,9 @@ Int asopSelectDevices(
     // Deactivate currently active Output device
     if (pOut->hMcaspChan != NULL)
     {
     // Deactivate currently active Output device
     if (pOut->hMcaspChan != NULL)
     {
+        
+        // check McASP LLD control API
+        mcaspControlChan(pOut->hMcaspChan, MCASP_CHAN_RESET, NULL);
         // Delete McASP LLD channel
         status = mcaspDeleteChan(pOut->hMcaspChan);
         if (status != Aud_EOK)
         // Delete McASP LLD channel
         status = mcaspDeleteChan(pOut->hMcaspChan);
         if (status != Aud_EOK)