]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - processor-sdk/performance-audio-sr.git/commitdiff
PASDK-218: Clean up the code removing deadwood.
authorGovind Jeyaram <govind.j@ti.com>
Tue, 18 Jul 2017 00:37:00 +0000 (17:37 -0700)
committerGovind Jeyaram <govind.j@ti.com>
Tue, 18 Jul 2017 00:37:00 +0000 (17:37 -0700)
pasdk/test_dsp/sap/sap_mcasp.c

index 2adffe09b954e3e36b7862235ebe2f1de7f250ca..747e7666cf98b7f4f354d17dfde56d890f203b6b 100644 (file)
@@ -229,8 +229,6 @@ Void SAP_MCASP_init (Void)
         base[_MCASP_PDIR_OFFSET] = 0;  // all input by default
     }
 
         base[_MCASP_PDIR_OFFSET] = 0;  // all input by default
     }
 
-    
-
 } // SAP_MCASP_init
 
 // -----------------------------------------------------------------------------
 } // SAP_MCASP_init
 
 // -----------------------------------------------------------------------------
@@ -533,21 +531,10 @@ Int SAP_MCASP_enable (DEV2_Handle device)
         pSers =&base[_MCASP_SRCTL0_OFFSET];
         for (i=0; i < _MCASP_CHANNEL_CNT; i++)
         {
         pSers =&base[_MCASP_SRCTL0_OFFSET];
         for (i=0; i < _MCASP_CHANNEL_CNT; i++)
         {
-               timeout = 0;
             if (pDevExt->pParams->sap.pinMask & (1 << i))
             {
                //Log_info3(( "SAP_MCASP_enable(): wait for serializer %d.  pSers: 0x%x, *pSers: 0x%x", i, pSers, *pSers));
             if (pDevExt->pParams->sap.pinMask & (1 << i))
             {
                //Log_info3(( "SAP_MCASP_enable(): wait for serializer %d.  pSers: 0x%x, *pSers: 0x%x", i, pSers, *pSers));
-                while ((*pSers & _MCASP_SRCTL_XRDY_MASK) != 0)
-                {
-                       timeout++;
-                       if (timeout > 10000)
-                       {
-                               Log_info1("SAP_MCASP_enable(): McASP serializer %d timed out.\n", i);
-                               result = SIO2_ETIMEOUT;
-                               break;
-                       }
-
-                }
+                while ((*pSers & _MCASP_SRCTL_XRDY_MASK) != 0);
             }
             *pSers++;
         }
             }
             *pSers++;
         }
@@ -601,7 +588,7 @@ Int SAP_MCASP_reset (DEV2_Handle device)
     {
        //TRACE_TERSE1(( "SAP_MCASP_reset(0x%x) input device.", device));
         // disable FIFO if present
     {
        //TRACE_TERSE1(( "SAP_MCASP_reset(0x%x) input device.", device));
         // disable FIFO if present
-        Log_info1("SAP_MCASP_reset(0x%x) input device.", device); //DJDBG
+        Log_info1("SAP_MCASP_reset(0x%x) input device.", device);
         if (sapMcaspDrv.fifoPresent[mcaspNum])
             fifoBase[_MCASP_RFIFOCTL_OFFSET] &=
                 ~(MCASP_RFIFOCTL_RENA_ENABLE << _MCASP_RFIFOCTL_RENA_SHIFT);
         if (sapMcaspDrv.fifoPresent[mcaspNum])
             fifoBase[_MCASP_RFIFOCTL_OFFSET] &=
                 ~(MCASP_RFIFOCTL_RENA_ENABLE << _MCASP_RFIFOCTL_RENA_SHIFT);
@@ -639,7 +626,7 @@ Int SAP_MCASP_reset (DEV2_Handle device)
     else 
     {
        //TRACE_TERSE1(("SAP_MCASP_reset(0x%x) output device.", device));
     else 
     {
        //TRACE_TERSE1(("SAP_MCASP_reset(0x%x) output device.", device));
-        Log_info1("SAP_MCASP_reset(0x%x) output device.", device); //DJDBG
+        Log_info1("SAP_MCASP_reset(0x%x) output device.", device);
         // disable FIFO if present
         if (sapMcaspDrv.fifoPresent[mcaspNum])
             fifoBase[_MCASP_WFIFOCTL_OFFSET] &=
         // disable FIFO if present
         if (sapMcaspDrv.fifoPresent[mcaspNum])
             fifoBase[_MCASP_WFIFOCTL_OFFSET] &=
@@ -707,7 +694,6 @@ Int SAP_MCASP_reset (DEV2_Handle device)
 // the settings will never take affect which would lead to a lockup condition.
 
 #define INT_MAX 0xFFFFFFFF // maximum value returned by Clock_getTicks
 // the settings will never take affect which would lead to a lockup condition.
 
 #define INT_MAX 0xFFFFFFFF // maximum value returned by Clock_getTicks
-#define USEC_PER_MSEC   ( 1000 ) // microseconds per millisecond
 
 Int SAP_MCASP_waitSet (MCASP_Handle hMcasp, Uint32 wrReg, Uint32 rdReg, Uint32 mask, Uint32 timeout)
 {
 
 Int SAP_MCASP_waitSet (MCASP_Handle hMcasp, Uint32 wrReg, Uint32 rdReg, Uint32 mask, Uint32 timeout)
 {
@@ -729,27 +715,6 @@ Int SAP_MCASP_waitSet (MCASP_Handle hMcasp, Uint32 wrReg, Uint32 rdReg, Uint32 m
     // set register with mask value
     base[wrReg] = (base[rdReg] | mask) & resMask;
 
     // set register with mask value
     base[wrReg] = (base[rdReg] | mask) & resMask;
 
-#if 0
-    // convert timeout from milliseconds to nTicks
-    timeout = CLK_countspms () * timeout;
-
-    timeStart = CLK_gethtime ();
-    while (1) {
-        // return success if register has latched value
-        if ((base[rdReg] & mask) == mask)
-            break;
-        timeNow = CLK_gethtime ();
-        elapsed = timeNow - timeStart;
-        // check for wrap aound
-        if (timeNow <= timeStart)
-            elapsed = INT_MAX - timeStart + timeNow;
-        
-        // return error if timeout reached
-        if (elapsed > timeout)
-            return SYS_ETIMEOUT;
-    }
-#endif
-
     timeStart = Clock_getTicks();
     while (1) {
                if ((base[rdReg] & mask) == mask)
     timeStart = Clock_getTicks();
     while (1) {
                if ((base[rdReg] & mask) == mask)