aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
authorSubhash Jadavani <subhashj@codeaurora.org>2012-04-03 02:55:58 -0400
committerChris Ball <cjb@laptop.org>2012-04-05 20:32:31 -0400
commit93fc5a47f25c41125b30c0bf4f243bf3204a1a0a (patch)
treeec82fab62c5c989d0a6ce94695cd5b67c1c9f392 /drivers/mmc
parentfc307df88f0d77505c19756d95be66c981c421ea (diff)
mmc: core: fix power class selection
mmc_select_powerclass() function returns error if eMMC VDD level supported by host is between 2.7v to 3.2v. According to eMMC specification, valid voltage for high voltage cards is 2.7v to 3.6v. This patch ensures that 2.7v to 3.6v VDD range is treated as valid range. Also, failure to set the power class shouldn't be treated as fatal error because even if setting the power class fails, card can still work in default power class. If mmc_select_powerclass() returns error, just print the warning message and go ahead with rest of the card initialization. Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org> Acked-by: Girish K S <girish.shivananjappa@linaro.org> Reviewed-by: Namjae Jeon <linkinjeon@gmail.com> Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/core/mmc.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index 02914d609a91..54df5adc0413 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -695,6 +695,11 @@ static int mmc_select_powerclass(struct mmc_card *card,
695 else if (host->ios.clock <= 200000000) 695 else if (host->ios.clock <= 200000000)
696 index = EXT_CSD_PWR_CL_200_195; 696 index = EXT_CSD_PWR_CL_200_195;
697 break; 697 break;
698 case MMC_VDD_27_28:
699 case MMC_VDD_28_29:
700 case MMC_VDD_29_30:
701 case MMC_VDD_30_31:
702 case MMC_VDD_31_32:
698 case MMC_VDD_32_33: 703 case MMC_VDD_32_33:
699 case MMC_VDD_33_34: 704 case MMC_VDD_33_34:
700 case MMC_VDD_34_35: 705 case MMC_VDD_34_35:
@@ -1111,11 +1116,10 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
1111 ext_csd_bits = (bus_width == MMC_BUS_WIDTH_8) ? 1116 ext_csd_bits = (bus_width == MMC_BUS_WIDTH_8) ?
1112 EXT_CSD_BUS_WIDTH_8 : EXT_CSD_BUS_WIDTH_4; 1117 EXT_CSD_BUS_WIDTH_8 : EXT_CSD_BUS_WIDTH_4;
1113 err = mmc_select_powerclass(card, ext_csd_bits, ext_csd); 1118 err = mmc_select_powerclass(card, ext_csd_bits, ext_csd);
1114 if (err) { 1119 if (err)
1115 pr_err("%s: power class selection to bus width %d failed\n", 1120 pr_warning("%s: power class selection to bus width %d"
1116 mmc_hostname(card->host), 1 << bus_width); 1121 " failed\n", mmc_hostname(card->host),
1117 goto err; 1122 1 << bus_width);
1118 }
1119 } 1123 }
1120 1124
1121 /* 1125 /*
@@ -1147,10 +1151,10 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
1147 err = mmc_select_powerclass(card, ext_csd_bits[idx][0], 1151 err = mmc_select_powerclass(card, ext_csd_bits[idx][0],
1148 ext_csd); 1152 ext_csd);
1149 if (err) 1153 if (err)
1150 pr_err("%s: power class selection to " 1154 pr_warning("%s: power class selection to "
1151 "bus width %d failed\n", 1155 "bus width %d failed\n",
1152 mmc_hostname(card->host), 1156 mmc_hostname(card->host),
1153 1 << bus_width); 1157 1 << bus_width);
1154 1158
1155 err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL, 1159 err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
1156 EXT_CSD_BUS_WIDTH, 1160 EXT_CSD_BUS_WIDTH,
@@ -1178,10 +1182,10 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
1178 err = mmc_select_powerclass(card, ext_csd_bits[idx][1], 1182 err = mmc_select_powerclass(card, ext_csd_bits[idx][1],
1179 ext_csd); 1183 ext_csd);
1180 if (err) 1184 if (err)
1181 pr_err("%s: power class selection to " 1185 pr_warning("%s: power class selection to "
1182 "bus width %d ddr %d failed\n", 1186 "bus width %d ddr %d failed\n",
1183 mmc_hostname(card->host), 1187 mmc_hostname(card->host),
1184 1 << bus_width, ddr); 1188 1 << bus_width, ddr);
1185 1189
1186 err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL, 1190 err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
1187 EXT_CSD_BUS_WIDTH, 1191 EXT_CSD_BUS_WIDTH,