]> git.sur5r.net Git - u-boot/commitdiff
mmc: compile out more code if support for UHS and HS200 is not enabled
authorJean-Jacques Hiblot <jjhiblot@ti.com>
Thu, 4 Jan 2018 14:23:30 +0000 (15:23 +0100)
committerJaehoon Chung <jh80.chung@samsung.com>
Fri, 12 Jan 2018 09:11:23 +0000 (18:11 +0900)
Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
drivers/mmc/mmc.c

index 67d05c5413969422176c724514d0b649073e127e..18d202d3b758f3b2e9e594adaaea435d2122fbd8 100644 (file)
@@ -799,9 +799,11 @@ static int mmc_set_card_speed(struct mmc *mmc, enum bus_mode mode)
        case MMC_DDR_52:
                speed_bits = EXT_CSD_TIMING_HS;
                break;
+#if CONFIG_IS_ENABLED(MMC_HS200_SUPPORT)
        case MMC_HS_200:
                speed_bits = EXT_CSD_TIMING_HS200;
                break;
+#endif
        case MMC_LEGACY:
                speed_bits = EXT_CSD_TIMING_LEGACY;
                break;
@@ -851,10 +853,12 @@ static int mmc_get_capabilities(struct mmc *mmc)
        cardtype = ext_csd[EXT_CSD_CARD_TYPE] & 0x3f;
        mmc->cardtype = cardtype;
 
+#if CONFIG_IS_ENABLED(MMC_HS200_SUPPORT)
        if (cardtype & (EXT_CSD_CARD_TYPE_HS200_1_2V |
                        EXT_CSD_CARD_TYPE_HS200_1_8V)) {
                mmc->card_caps |= MMC_MODE_HS200;
        }
+#endif
        if (cardtype & EXT_CSD_CARD_TYPE_52) {
                if (cardtype & EXT_CSD_CARD_TYPE_DDR_52)
                        mmc->card_caps |= MMC_MODE_DDR_52MHz;
@@ -1307,10 +1311,15 @@ static int sd_set_card_speed(struct mmc *mmc, enum bus_mode mode)
 
        switch (mode) {
        case SD_LEGACY:
-       case UHS_SDR12:
                speed = UHS_SDR12_BUS_SPEED;
                break;
        case SD_HS:
+               speed = HIGH_SPEED_BUS_SPEED;
+               break;
+#if CONFIG_IS_ENABLED(MMC_UHS_SUPPORT)
+       case UHS_SDR12:
+               speed = UHS_SDR12_BUS_SPEED;
+               break;
        case UHS_SDR25:
                speed = UHS_SDR25_BUS_SPEED;
                break;
@@ -1323,6 +1332,7 @@ static int sd_set_card_speed(struct mmc *mmc, enum bus_mode mode)
        case UHS_SDR104:
                speed = UHS_SDR104_BUS_SPEED;
                break;
+#endif
        default:
                return -EINVAL;
        }