mmc: add mmc_get_dma_dir() helper 60/268160/2
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Fri, 14 Feb 2020 07:40:25 +0000 (16:40 +0900)
committerMarek Szyprowski <m.szyprowski@samsung.com>
Thu, 16 Dec 2021 16:18:05 +0000 (17:18 +0100)
Copied from Linux kernel.
include/linux/mmc/host.h

Change-Id: I56a5906ea9635137d2680a5e017ae05158909c18
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
include/mmc.h

index 686ba00656543e9b8244fc3c3ee4f214d4350c5a..d16fc14fb6b49cc3da85d65ab8c130ac007860a8 100644 (file)
@@ -12,6 +12,7 @@
 #include <linux/list.h>
 #include <linux/sizes.h>
 #include <linux/compiler.h>
+#include <linux/dma-direction.h>
 #include <part.h>
 
 #if CONFIG_IS_ENABLED(MMC_HS200_SUPPORT)
@@ -865,4 +866,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_ */