Commit 2881ba9a authored by Victor Shih's avatar Victor Shih Committed by Ulf Hansson
Browse files

mmc: sdhci: Add a helper function for dump register in dynamic debug mode



Add a helper function for dump register in dynamic debug mode.

Signed-off-by: default avatarVictor Shih <victor.shih@genesyslogic.com.tw>
Acked-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20250606110121.96314-3-victorshihgli@gmail.com


Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent 14633da0
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -900,4 +900,20 @@ void sdhci_switch_external_dma(struct sdhci_host *host, bool en);
void sdhci_set_data_timeout_irq(struct sdhci_host *host, bool enable);
void __sdhci_set_timeout(struct sdhci_host *host, struct mmc_command *cmd);

#if defined(CONFIG_DYNAMIC_DEBUG) || \
	(defined(CONFIG_DYNAMIC_DEBUG_CORE) && defined(DYNAMIC_DEBUG_MODULE))
#define SDHCI_DBG_ANYWAY 0
#elif defined(DEBUG)
#define SDHCI_DBG_ANYWAY 1
#else
#define SDHCI_DBG_ANYWAY 0
#endif

#define sdhci_dbg_dumpregs(host, fmt)					\
do {									\
	DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt);			\
	if (DYNAMIC_DEBUG_BRANCH(descriptor) ||	SDHCI_DBG_ANYWAY)	\
		sdhci_dumpregs(host);					\
} while (0)

#endif /* __SDHCI_HW_H */