diff options
author | Ulf Hansson <ulf.hansson@linaro.org> | 2014-10-20 11:33:53 +0200 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@linaro.org> | 2014-11-10 12:40:41 +0100 |
commit | 148bcab28f51c80f13e5ad678fe840e8a34af46f (patch) | |
tree | 9f8d81b82725f2e9e02c82e48acdb79d3e8301ce /drivers/mmc/core/mmc.c | |
parent | a1fc444e83de05ebbb6269029c9888b8f8b11490 (diff) | |
download | linux-148bcab28f51c80f13e5ad678fe840e8a34af46f.tar.gz linux-148bcab28f51c80f13e5ad678fe840e8a34af46f.tar.bz2 linux-148bcab28f51c80f13e5ad678fe840e8a34af46f.zip |
mmc: core: Add helper function for EXT_CSD support
The helper function mmc_can_ext_csd() will return a positive value if
the card supports the EXT_CSD register. Start using it at relavant
places in the mmc core.
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc/core/mmc.c')
-rw-r--r-- | drivers/mmc/core/mmc.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index 5226ef8c0c2d..7c257c93ecd7 100644 --- a/drivers/mmc/core/mmc.c +++ b/drivers/mmc/core/mmc.c @@ -190,7 +190,7 @@ static int mmc_get_ext_csd(struct mmc_card *card, u8 **new_ext_csd) *new_ext_csd = NULL; - if (card->csd.mmca_vsn < CSD_SPEC_VER_4) + if (!mmc_can_ext_csd(card)) return 0; /* @@ -852,7 +852,7 @@ static int mmc_select_powerclass(struct mmc_card *card) int err, ddr; /* Power class selection is supported for versions >= 4.0 */ - if (card->csd.mmca_vsn < CSD_SPEC_VER_4) + if (!mmc_can_ext_csd(card)) return 0; bus_width = host->ios.bus_width; @@ -913,7 +913,7 @@ static int mmc_select_bus_width(struct mmc_card *card) unsigned idx, bus_width = 0; int err = 0; - if ((card->csd.mmca_vsn < CSD_SPEC_VER_4) && + if (!mmc_can_ext_csd(card) && !(host->caps & (MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA))) return 0; @@ -1154,7 +1154,7 @@ static int mmc_select_timing(struct mmc_card *card) { int err = 0; - if (card->csd.mmca_vsn < CSD_SPEC_VER_4) + if (!mmc_can_ext_csd(card)) goto bus_speed; if (card->mmc_avail_type & EXT_CSD_CARD_TYPE_HS200) |