mmc: core: Record card drive strength
authorAdrian Hunter <adrian.hunter@intel.com>
Fri, 6 Feb 2015 12:12:56 +0000 (14:12 +0200)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 1 Jun 2015 07:07:13 +0000 (09:07 +0200)
In preparation for adding drive strength support
for eMMC, add drive_strength to struct mmc_card
to record the card drive strength for UHS-I modes
and HS200 / HS400. For eMMC this will be needed
when switching between HS200 and HS400.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/core/sd.c
drivers/mmc/core/sdio.c
include/linux/mmc/card.h

index 9771b84db4b340ff4ff12be971eb9d6379824757..b99e25b9bcdcbe2647eb1f90b83b1eb5214c4e4e 100644 (file)
@@ -389,6 +389,8 @@ static int sd_select_driver_type(struct mmc_card *card, u8 *status)
        int card_drv_type, drive_strength, drv_type;
        int err;
 
+       card->drive_strength = 0;
+
        card_drv_type = card->sw_caps.sd3_drv_type | SD_DRIVER_TYPE_B;
 
        drive_strength = mmc_select_drive_strength(card,
@@ -404,6 +406,7 @@ static int sd_select_driver_type(struct mmc_card *card, u8 *status)
                                mmc_hostname(card->host));
                        return 0;
                }
+               card->drive_strength = drive_strength;
        }
 
        if (drv_type)
index 73b091331c9699901c261a5528912e582f38bba8..b91abedcfdca7054654a774f22a357d93661293a 100644 (file)
@@ -406,6 +406,8 @@ static void sdio_select_driver_type(struct mmc_card *card)
        unsigned char card_strength;
        int err;
 
+       card->drive_strength = 0;
+
        card_drv_type = card->sw_caps.sd3_drv_type | SD_DRIVER_TYPE_B;
 
        drive_strength = mmc_select_drive_strength(card,
@@ -427,6 +429,7 @@ static void sdio_select_driver_type(struct mmc_card *card)
                                       card_strength, NULL);
                if (err)
                        return;
+               card->drive_strength = drive_strength;
        }
 
        if (drv_type)
index 19f0175c0afa68a99faf3684dda69fe7967ef5a3..2f073d5557934854107e87bfa7ec0d5b05e3810c 100644 (file)
@@ -305,6 +305,7 @@ struct mmc_card {
 
        unsigned int            sd_bus_speed;   /* Bus Speed Mode set for the card */
        unsigned int            mmc_avail_type; /* supported device type by both host and card */
+       unsigned int            drive_strength; /* for UHS-I, HS200 or HS400 */
 
        struct dentry           *debugfs_root;
        struct mmc_part part[MMC_NUM_PHY_PARTITION]; /* physical partitions */