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

Commit 3853a042 authored by Adrian Hunter's avatar Adrian Hunter Committed by Ulf Hansson
Browse files

mmc: core: Record card drive strength



In preparation for adding drive strength support
for eMMC, add drive_strength to struct mmc_card
to record the card drive strength for UHS-I modes
and HS200 / HS400. For eMMC this will be needed
when switching between HS200 and HS400.

Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent e23350b3
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -389,6 +389,8 @@ static int sd_select_driver_type(struct mmc_card *card, u8 *status)
	int card_drv_type, drive_strength, drv_type;
	int card_drv_type, drive_strength, drv_type;
	int err;
	int err;


	card->drive_strength = 0;

	card_drv_type = card->sw_caps.sd3_drv_type | SD_DRIVER_TYPE_B;
	card_drv_type = card->sw_caps.sd3_drv_type | SD_DRIVER_TYPE_B;


	drive_strength = mmc_select_drive_strength(card,
	drive_strength = mmc_select_drive_strength(card,
@@ -404,6 +406,7 @@ static int sd_select_driver_type(struct mmc_card *card, u8 *status)
				mmc_hostname(card->host));
				mmc_hostname(card->host));
			return 0;
			return 0;
		}
		}
		card->drive_strength = drive_strength;
	}
	}


	if (drv_type)
	if (drv_type)
+3 −0
Original line number Original line Diff line number Diff line
@@ -406,6 +406,8 @@ static void sdio_select_driver_type(struct mmc_card *card)
	unsigned char card_strength;
	unsigned char card_strength;
	int err;
	int err;


	card->drive_strength = 0;

	card_drv_type = card->sw_caps.sd3_drv_type | SD_DRIVER_TYPE_B;
	card_drv_type = card->sw_caps.sd3_drv_type | SD_DRIVER_TYPE_B;


	drive_strength = mmc_select_drive_strength(card,
	drive_strength = mmc_select_drive_strength(card,
@@ -427,6 +429,7 @@ static void sdio_select_driver_type(struct mmc_card *card)
				       card_strength, NULL);
				       card_strength, NULL);
		if (err)
		if (err)
			return;
			return;
		card->drive_strength = drive_strength;
	}
	}


	if (drv_type)
	if (drv_type)
+1 −0
Original line number Original line Diff line number Diff line
@@ -305,6 +305,7 @@ struct mmc_card {


	unsigned int		sd_bus_speed;	/* Bus Speed Mode set for the card */
	unsigned int		sd_bus_speed;	/* Bus Speed Mode set for the card */
	unsigned int		mmc_avail_type;	/* supported device type by both host and card */
	unsigned int		mmc_avail_type;	/* supported device type by both host and card */
	unsigned int		drive_strength;	/* for UHS-I, HS200 or HS400 */


	struct dentry		*debugfs_root;
	struct dentry		*debugfs_root;
	struct mmc_part	part[MMC_NUM_PHY_PARTITION]; /* physical partitions */
	struct mmc_part	part[MMC_NUM_PHY_PARTITION]; /* physical partitions */