PASDK-251: Input Rate now dynamically managed by CSL-I2C.
authorGovind Jeyaram <govind.j@ti.com>
Wed, 12 Apr 2017 20:37:21 +0000 (13:37 -0700)
committerGovind Jeyaram <govind.j@ti.com>
Wed, 12 Apr 2017 20:37:21 +0000 (13:37 -0700)
pasdk/test_dsp/sap/sap_d10.c

index bd85fb903f6531b47f54ff763fd7e5509c9a94e5..22c68e1b35fb5a078d33daed8f3462e92214cbda 100644 (file)
@@ -855,10 +855,24 @@ static int manageInput (DEV2_Handle device, const SAP_D10_Rx_Params *pParams, PA
         //
         pStatusIn->lock = 1;
         pStatusIn->nonaudio = PAF_IEC_AUDIOMODE_AUDIO;
-        RateHdmi = HSDIO_AudioFreq_192K;
+        /*RateHdmi = HSDIO_AudioFreq_192K;
         pStatusIn->sampleRateMeasured = RateTable_hdmi[RateHdmi];
-        pStatusIn->sampleRateData = pStatusIn->sampleRateMeasured;
+        pStatusIn->sampleRateData = pStatusIn->sampleRateMeasured; */
+        if(!HDMIGpioGetState())
+               {
+                       clear_hdmi_hmint();
+                       gHmint_ctr++;
 
+                       RateHdmi=read_hdmi_samprate();
+                       pStatusIn->sampleRateMeasured = RateTable_hdmi[RateHdmi];
+                       pStatusIn->sampleRateData = pStatusIn->sampleRateMeasured;
+                       PrevSampRate = pStatusIn->sampleRateMeasured;
+               }
+        else
+               {
+                       pStatusIn->sampleRateMeasured = PrevSampRate;
+                       pStatusIn->sampleRateData = pStatusIn->sampleRateMeasured;
+               }
 #else // _ENABLE_BENCHMARK_PCMHSR_SRC_CAR_
         //
         // Need to update input interface rate by consulting HSR4 over I2C for benchmarking configuration.
@@ -922,7 +936,7 @@ static int manageInput (DEV2_Handle device, const SAP_D10_Rx_Params *pParams, PA
        }
 
     else
-        return -1;             // Control shouldn't be here!
+       return -1;              // Control shouldn't be here!
 
     gNonAudio=pStatusIn->nonaudio;
     gLockStatus=pStatusIn->lock;