From a7b2b6cc0aa9294b570a3161a05c6ccf4c0b6e40 Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Fri, 14 Feb 2020 16:40:25 +0900 Subject: [PATCH] mmc: add mmc_get_dma_dir() helper Copied from Linux kernel. include/linux/mmc/host.h Signed-off-by: Masahiro Yamada Reviewed-by: Jaehoon Chung --- include/mmc.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/mmc.h b/include/mmc.h index b5cb514f57..71e2e1735a 100644 --- a/include/mmc.h +++ b/include/mmc.h @@ -12,6 +12,7 @@ #include #include #include +#include #include #if CONFIG_IS_ENABLED(MMC_HS200_SUPPORT) @@ -880,4 +881,9 @@ int mmc_get_env_dev(void); */ struct blk_desc *mmc_get_blk_desc(struct mmc *mmc); +static inline enum dma_data_direction mmc_get_dma_dir(struct mmc_data *data) +{ + return data->flags & MMC_DATA_WRITE ? DMA_TO_DEVICE : DMA_FROM_DEVICE; +} + #endif /* _MMC_H_ */ -- 2.39.5