aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChanho Min <chanho.min@lge.com>2017-09-25 20:03:40 -0400
committerUlf Hansson <ulf.hansson@linaro.org>2017-10-02 04:11:22 -0400
commitfb458864d9a78cc433fec7979acbe4078c82d7a8 (patch)
tree871c634ab81efd3e285e2c17be3e87d173387f6b
parent9e66317d3c92ddaab330c125dfe9d06eee268aff (diff)
mmc: core: add driver strength selection when selecting hs400es
The driver strength selection is missed and required when selecting hs400es. So, It is added here. Fixes: 81ac2af65793ecf ("mmc: core: implement enhanced strobe support") Cc: stable@vger.kernel.org Signed-off-by: Hankyung Yu <hankyung.yu@lge.com> Signed-off-by: Chanho Min <chanho.min@lge.com> Reviewed-by: Adrian Hunter <adrian.hunter@intel.com> Reviewed-by: Shawn Lin <shawn.lin@rock-chips.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-rw-r--r--drivers/mmc/core/mmc.c36
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
1289static 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
1289static int mmc_select_hs400es(struct mmc_card *card) 1306static 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
1377static 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.