Skip to content

Commit

Permalink
mmc: core: fix the signaling 1.8V for HS200
Browse files Browse the repository at this point in the history
Currently only 1.2V is treated for HS200 mode. If the host has only
1.8V I/O capability not 1.2V, mmc_set_signal_voltage can't be called
for 1.8V HS200. EXT_CSD_CARD_TYPE_SDR_1_8V needs to be considered.

Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com>
Reviewed-by: Subhash Jadavani <subhashj@codeaurora.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
  • Loading branch information
Seungwon Jeon authored and Chris Ball committed May 9, 2012
1 parent 96cf5f0 commit 10942aa
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions drivers/mmc/core/mmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,7 @@ static int mmc_select_powerclass(struct mmc_card *card,
*/
static int mmc_select_hs200(struct mmc_card *card)
{
int idx, err = 0;
int idx, err = -EINVAL;
struct mmc_host *host;
static unsigned ext_csd_bits[] = {
EXT_CSD_BUS_WIDTH_4,
Expand All @@ -744,10 +744,12 @@ static int mmc_select_hs200(struct mmc_card *card)
host = card->host;

if (card->ext_csd.card_type & EXT_CSD_CARD_TYPE_SDR_1_2V &&
host->caps2 & MMC_CAP2_HS200_1_2V_SDR)
if (mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_120, 0))
err = mmc_set_signal_voltage(host,
MMC_SIGNAL_VOLTAGE_180, 0);
host->caps2 & MMC_CAP2_HS200_1_2V_SDR)
err = mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_120, 0);

if (err && card->ext_csd.card_type & EXT_CSD_CARD_TYPE_SDR_1_8V &&
host->caps2 & MMC_CAP2_HS200_1_8V_SDR)
err = mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_180, 0);

/* If fails try again during next card power cycle */
if (err)
Expand Down

0 comments on commit 10942aa

Please sign in to comment.