Skip to content

Commit 3853a04

Browse files
ahunter6storulf
authored andcommitted
mmc: core: Record card drive strength
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>
1 parent e23350b commit 3853a04

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

drivers/mmc/core/sd.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,8 @@ static int sd_select_driver_type(struct mmc_card *card, u8 *status)
389389
int card_drv_type, drive_strength, drv_type;
390390
int err;
391391

392+
card->drive_strength = 0;
393+
392394
card_drv_type = card->sw_caps.sd3_drv_type | SD_DRIVER_TYPE_B;
393395

394396
drive_strength = mmc_select_drive_strength(card,
@@ -404,6 +406,7 @@ static int sd_select_driver_type(struct mmc_card *card, u8 *status)
404406
mmc_hostname(card->host));
405407
return 0;
406408
}
409+
card->drive_strength = drive_strength;
407410
}
408411

409412
if (drv_type)

drivers/mmc/core/sdio.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,8 @@ static void sdio_select_driver_type(struct mmc_card *card)
406406
unsigned char card_strength;
407407
int err;
408408

409+
card->drive_strength = 0;
410+
409411
card_drv_type = card->sw_caps.sd3_drv_type | SD_DRIVER_TYPE_B;
410412

411413
drive_strength = mmc_select_drive_strength(card,
@@ -427,6 +429,7 @@ static void sdio_select_driver_type(struct mmc_card *card)
427429
card_strength, NULL);
428430
if (err)
429431
return;
432+
card->drive_strength = drive_strength;
430433
}
431434

432435
if (drv_type)

include/linux/mmc/card.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,7 @@ struct mmc_card {
305305

306306
unsigned int sd_bus_speed; /* Bus Speed Mode set for the card */
307307
unsigned int mmc_avail_type; /* supported device type by both host and card */
308+
unsigned int drive_strength; /* for UHS-I, HS200 or HS400 */
308309

309310
struct dentry *debugfs_root;
310311
struct mmc_part part[MMC_NUM_PHY_PARTITION]; /* physical partitions */

0 commit comments

Comments
 (0)