diff mbox

[v2,1/2] mmc: core: add mmc_get_dma_dir

Message ID d7faad3e-7ce6-fb7b-32cb-d8fa77ad11ff@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Heiner Kallweit March 24, 2017, 8:02 p.m. UTC
Add function for determining DMA direction to core.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Reviewed-by: Shawn Lin <shawn.lin@rock-chips.com>
---
v2:
- no changes
---
 include/linux/mmc/host.h | 6 ++++++
 1 file changed, 6 insertions(+)
diff mbox

Patch

diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 83f1c4a9..21385ac0 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -17,6 +17,7 @@ 
 #include <linux/mmc/core.h>
 #include <linux/mmc/card.h>
 #include <linux/mmc/pm.h>
+#include <linux/dma-direction.h>
 
 struct mmc_ios {
 	unsigned int	clock;			/* clock rate */
@@ -499,6 +500,11 @@  static inline bool mmc_can_retune(struct mmc_host *host)
 	return host->can_retune == 1;
 }
 
+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;
+}
+
 int mmc_send_tuning(struct mmc_host *host, u32 opcode, int *cmd_error);
 int mmc_abort_tuning(struct mmc_host *host, u32 opcode);