Logo Search packages:      
Sourcecode: linux-fsl-imx51 version File versions  Download package

static int freq_equal ( unsigned long  freq1,
unsigned long  freq2 
) [static]

Compare two frequences using allowable tolerance

The MX3 PLL can generate many frequencies. This function compares the generated frequency to the requested frequency and determines it they are within and acceptable tolerance.

Parameters:
freq1 desired frequency
freq2 generated frequency
Returns:
Returns 0 is frequencies are within talerance and non-zero is they are not.

Definition at line 95 of file mxc_pm.c.

Referenced by cal_pdr0_value().

{
      if (freq1 > freq2) {
            return (freq1 - freq2) <= (freq1 / FREQ_COMP_TOLERANCE);
      }
      return (freq2 - freq1) <= (freq1 / FREQ_COMP_TOLERANCE);
}


Generated by  Doxygen 1.6.0   Back to index