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

Commit a17bde16 authored by Ritesh Harjani's avatar Ritesh Harjani Committed by Gerrit - the friendly Code Review server
Browse files

mmc: core: Check if card supports strobe before calling host ops



Should check if mmc_card supports strobe before calling
enhanced strobe host ops. This also adds a macro for use
by LLD to know if card supports strobe

Change-Id: Id79098ff66bd36be2496b86bf71556204aca7fe3
Signed-off-by: default avatarRitesh Harjani <riteshh@codeaurora.org>
parent 9d19a050
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1198,7 +1198,7 @@ static int mmc_select_hs400(struct mmc_card *card)
	mmc_set_timing(host, MMC_TIMING_MMC_HS400);
	mmc_set_bus_speed(card);

	if (host->ops->enhanced_strobe) {
	if (card->ext_csd.strobe_support && host->ops->enhanced_strobe) {
		mmc_host_clk_hold(host);
		err = host->ops->enhanced_strobe(host);
		mmc_host_clk_release(host);
+3 −0
Original line number Diff line number Diff line
@@ -98,6 +98,7 @@ struct mmc_ext_csd {
	u8			raw_rpmb_size_mult;	/* 168 */
	u8			raw_erased_mem_count;	/* 181 */
	u8			strobe_support;		/* 184 */
#define MMC_STROBE_SUPPORT	(1 << 0)
	u8			raw_ext_csd_structure;	/* 194 */
	u8			raw_card_type;		/* 196 */
	u8			raw_drive_strength;	/* 197 */
@@ -579,6 +580,8 @@ static inline void __maybe_unused remove_quirk(struct mmc_card *card, int data)
#define mmc_card_set_auto_bkops(c)	((c)->state |= MMC_STATE_AUTO_BKOPS)
#define mmc_card_clr_auto_bkops(c)	((c)->state &= ~MMC_STATE_AUTO_BKOPS)

#define mmc_card_strobe(c) (((c)->ext_csd).strobe_support & MMC_STROBE_SUPPORT)

/*
 * Quirk add/remove for MMC products.
 */