mmc: sd: Macro name cleanup for high speed dtr
authorQiang Liu <qiang.liu@freescale.com>
Tue, 8 Nov 2011 13:43:08 +0000 (08:43 -0500)
committerChris Ball <cjb@laptop.org>
Thu, 12 Jan 2012 04:58:40 +0000 (23:58 -0500)
Add new macros for the high speed 50MHz case, rather than having
a confusing reuse of the value for UHS SDR50, which is 100MHz.

Reported-by: Aaron Lu <aaron.lu@amd.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
drivers/mmc/core/sd.c
include/linux/mmc/card.h

index f2a05ea40f2a3ed705e220fd5216d508d538b033..f54392c4638ad4f4794b3a1fc47b8463b78799c3 100644 (file)
@@ -307,8 +307,8 @@ static int mmc_read_switch(struct mmc_card *card)
                goto out;
        }
 
-       if (status[13] & UHS_SDR50_BUS_SPEED)
-               card->sw_caps.hs_max_dtr = 50000000;
+       if (status[13] & SD_MODE_HIGH_SPEED)
+               card->sw_caps.hs_max_dtr = HIGH_SPEED_MAX_DTR;
 
        if (card->scr.sda_spec3) {
                card->sw_caps.sd3_bus_mode = status[13];
index c8ef9bc54d500d0df052d4bd433e4b24d1855bb1..2c9be29684cf99e38a30891d06a6641b09071924 100644 (file)
@@ -110,6 +110,7 @@ struct sd_ssr {
 struct sd_switch_caps {
        unsigned int            hs_max_dtr;
        unsigned int            uhs_max_dtr;
+#define HIGH_SPEED_MAX_DTR     50000000
 #define UHS_SDR104_MAX_DTR     208000000
 #define UHS_SDR50_MAX_DTR      100000000
 #define UHS_DDR50_MAX_DTR      50000000
@@ -117,11 +118,13 @@ struct sd_switch_caps {
 #define UHS_SDR12_MAX_DTR      25000000
        unsigned int            sd3_bus_mode;
 #define UHS_SDR12_BUS_SPEED    0
+#define HIGH_SPEED_BUS_SPEED   1
 #define UHS_SDR25_BUS_SPEED    1
 #define UHS_SDR50_BUS_SPEED    2
 #define UHS_SDR104_BUS_SPEED   3
 #define UHS_DDR50_BUS_SPEED    4
 
+#define SD_MODE_HIGH_SPEED     (1 << HIGH_SPEED_BUS_SPEED)
 #define SD_MODE_UHS_SDR12      (1 << UHS_SDR12_BUS_SPEED)
 #define SD_MODE_UHS_SDR25      (1 << UHS_SDR25_BUS_SPEED)
 #define SD_MODE_UHS_SDR50      (1 << UHS_SDR50_BUS_SPEED)