Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ee4ee9d0 authored by Ulf Hansson's avatar Ulf Hansson Committed by Matt Wagantall
Browse files

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.

Change-Id: I27df83b6266587628f3fccf50df6498f59892ed5
Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
Git-commit: 148bcab28f51c80f13e5ad678fe840e8a34af46f
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git


Signed-off-by: default avatarVenkat Gopalakrishnan <venkatg@codeaurora.org>
parent 54f5beb8
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -191,7 +191,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;

	/*
@@ -847,7 +847,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;
@@ -908,7 +908,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;

@@ -1266,7 +1266,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)
+5 −0
Original line number Diff line number Diff line
@@ -680,3 +680,8 @@ int mmc_send_hpi_cmd(struct mmc_card *card, u32 *status)

	return 0;
}

int mmc_can_ext_csd(struct mmc_card *card)
{
	return (card && card->csd.mmca_vsn > CSD_SPEC_VER_3);
}
+1 −0
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ int mmc_spi_read_ocr(struct mmc_host *host, int highcap, u32 *ocrp);
int mmc_spi_set_crc(struct mmc_host *host, int use_crc);
int mmc_bus_test(struct mmc_card *card, u8 bus_width);
int mmc_send_hpi_cmd(struct mmc_card *card, u32 *status);
int mmc_can_ext_csd(struct mmc_card *card);

#endif