diff options
Diffstat (limited to 'drivers/mmc/core/mmc.c')
-rw-r--r-- | drivers/mmc/core/mmc.c | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index a7eb623f8daa..36217ad5e9b1 100644 --- a/drivers/mmc/core/mmc.c +++ b/drivers/mmc/core/mmc.c | |||
@@ -1286,6 +1286,23 @@ out_err: | |||
1286 | return err; | 1286 | return err; |
1287 | } | 1287 | } |
1288 | 1288 | ||
1289 | static void mmc_select_driver_type(struct mmc_card *card) | ||
1290 | { | ||
1291 | int card_drv_type, drive_strength, drv_type; | ||
1292 | |||
1293 | card_drv_type = card->ext_csd.raw_driver_strength | | ||
1294 | mmc_driver_type_mask(0); | ||
1295 | |||
1296 | drive_strength = mmc_select_drive_strength(card, | ||
1297 | card->ext_csd.hs200_max_dtr, | ||
1298 | card_drv_type, &drv_type); | ||
1299 | |||
1300 | card->drive_strength = drive_strength; | ||
1301 | |||
1302 | if (drv_type) | ||
1303 | mmc_set_driver_type(card->host, drv_type); | ||
1304 | } | ||
1305 | |||
1289 | static int mmc_select_hs400es(struct mmc_card *card) | 1306 | static int mmc_select_hs400es(struct mmc_card *card) |
1290 | { | 1307 | { |
1291 | struct mmc_host *host = card->host; | 1308 | struct mmc_host *host = card->host; |
@@ -1341,6 +1358,8 @@ static int mmc_select_hs400es(struct mmc_card *card) | |||
1341 | goto out_err; | 1358 | goto out_err; |
1342 | } | 1359 | } |
1343 | 1360 | ||
1361 | mmc_select_driver_type(card); | ||
1362 | |||
1344 | /* Switch card to HS400 */ | 1363 | /* Switch card to HS400 */ |
1345 | val = EXT_CSD_TIMING_HS400 | | 1364 | val = EXT_CSD_TIMING_HS400 | |
1346 | card->drive_strength << EXT_CSD_DRV_STR_SHIFT; | 1365 | card->drive_strength << EXT_CSD_DRV_STR_SHIFT; |
@@ -1374,23 +1393,6 @@ out_err: | |||
1374 | return err; | 1393 | return err; |
1375 | } | 1394 | } |
1376 | 1395 | ||
1377 | static void mmc_select_driver_type(struct mmc_card *card) | ||
1378 | { | ||
1379 | int card_drv_type, drive_strength, drv_type; | ||
1380 | |||
1381 | card_drv_type = card->ext_csd.raw_driver_strength | | ||
1382 | mmc_driver_type_mask(0); | ||
1383 | |||
1384 | drive_strength = mmc_select_drive_strength(card, | ||
1385 | card->ext_csd.hs200_max_dtr, | ||
1386 | card_drv_type, &drv_type); | ||
1387 | |||
1388 | card->drive_strength = drive_strength; | ||
1389 | |||
1390 | if (drv_type) | ||
1391 | mmc_set_driver_type(card->host, drv_type); | ||
1392 | } | ||
1393 | |||
1394 | /* | 1396 | /* |
1395 | * For device supporting HS200 mode, the following sequence | 1397 | * For device supporting HS200 mode, the following sequence |
1396 | * should be done before executing the tuning process. | 1398 | * should be done before executing the tuning process. |