/* Get the target clock frequency to be set on the bus. */
UINT32 EmmcGetTargetClockFreq(IN SD_MMC_HC_PRIVATE_DATA *Private, IN UINT8 SlotIndex, IN EMMC_EXT_CSD *ExtCsd, IN SD_MMC_BUS_MODE BusTiming)
/* Get the target clock frequency to be set on the bus. */
UINT32 EmmcGetTargetClockFreq(IN SD_MMC_HC_PRIVATE_DATA *Private, IN UINT8 SlotIndex, IN EMMC_EXT_CSD *ExtCsd, IN SD_MMC_BUS_MODE BusTiming)
{
  UINT32  PreferredClockFreq;
  UINT32  MaxClockFreq;
  PreferredClockFreq = Private->Slot[SlotIndex].OperatingParameters.ClockFreq;
  switch (BusTiming) {
    case SdMmcMmcHs400:
    case SdMmcMmcHs200:
      MaxClockFreq = 200;
      break;
    case SdMmcMmcHsSdr:
    case SdMmcMmcHsDdr:
      MaxClockFreq = 52;
      break;
    default:
      MaxClockFreq = 26;
      break;
  }
  if ((PreferredClockFreq != EDKII_SD_MMC_CLOCK_FREQ_IGNORE) && (PreferredClockFreq < MaxClockFreq)) {
    return PreferredClockFreq;
  } else {
    return MaxClockFreq;
  }
}