/* Get the target bus width to be set on the bus. */
UINT8 SdGetTargetBusWidth(IN SD_MMC_HC_PRIVATE_DATA *Private, IN UINT8 SlotIndex, IN SD_MMC_BUS_MODE BusTiming)
/* Get the target bus width to be set on the bus. */
UINT8 SdGetTargetBusWidth(IN SD_MMC_HC_PRIVATE_DATA *Private, IN UINT8 SlotIndex, IN SD_MMC_BUS_MODE BusTiming)
{
  UINT8  BusWidth;
  UINT8  PreferredBusWidth;
  PreferredBusWidth = Private->Slot[SlotIndex].OperatingParameters.BusWidth;
  if ((BusTiming == SdMmcSdDs) || (BusTiming == SdMmcSdHs)) {
    if ((PreferredBusWidth != EDKII_SD_MMC_BUS_WIDTH_IGNORE) &&
        ((PreferredBusWidth == 1) || (PreferredBusWidth == 4)))
    {
      BusWidth = PreferredBusWidth;
    } else {
      BusWidth = 4;
    }
  } else {
    BusWidth = 4;
  }
  return BusWidth;
}