Skip to content

Commit 2881ba9

Browse files
Victor Shihstorulf
authored andcommitted
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: Victor Shih <[email protected]> Acked-by: Adrian Hunter <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Ulf Hansson <[email protected]>
1 parent 14633da commit 2881ba9

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

drivers/mmc/host/sdhci.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -900,4 +900,20 @@ void sdhci_switch_external_dma(struct sdhci_host *host, bool en);
900900
void sdhci_set_data_timeout_irq(struct sdhci_host *host, bool enable);
901901
void __sdhci_set_timeout(struct sdhci_host *host, struct mmc_command *cmd);
902902

903+
#if defined(CONFIG_DYNAMIC_DEBUG) || \
904+
(defined(CONFIG_DYNAMIC_DEBUG_CORE) && defined(DYNAMIC_DEBUG_MODULE))
905+
#define SDHCI_DBG_ANYWAY 0
906+
#elif defined(DEBUG)
907+
#define SDHCI_DBG_ANYWAY 1
908+
#else
909+
#define SDHCI_DBG_ANYWAY 0
910+
#endif
911+
912+
#define sdhci_dbg_dumpregs(host, fmt) \
913+
do { \
914+
DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt); \
915+
if (DYNAMIC_DEBUG_BRANCH(descriptor) || SDHCI_DBG_ANYWAY) \
916+
sdhci_dumpregs(host); \
917+
} while (0)
918+
903919
#endif /* __SDHCI_HW_H */

0 commit comments

Comments
 (0)