diff mbox series

[v3,09/11] mmc: add mmc_get_dma_dir() helper

Message ID 20200214074027.19824-10-yamada.masahiro@socionext.com
State Accepted
Commit a7b2b6cc0aa9294b570a3161a05c6ccf4c0b6e40
Headers show
Series mmc: sdhci: code clean-up and fix cache coherency problem | expand

Commit Message

Masahiro Yamada Feb. 14, 2020, 7:40 a.m. UTC
Copied from Linux kernel.
include/linux/mmc/host.h

Signed-off-by: Masahiro Yamada <yamada.masahiro at socionext.com>
---

Changes in v3: None
Changes in v2: None

 include/mmc.h | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Jaehoon Chung Feb. 18, 2020, 11:20 a.m. UTC | #1
On 2/14/20 4:40 PM, Masahiro Yamada wrote:
> Copied from Linux kernel.
> include/linux/mmc/host.h
> 
> Signed-off-by: Masahiro Yamada <yamada.masahiro at socionext.com>

Reviewed-by: Jaehoon Chung <jh80.chung at samsung.com>

Best Regards,
Jaehoon Chung

> ---
> 
> Changes in v3: None
> Changes in v2: None
> 
>  include/mmc.h | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/include/mmc.h b/include/mmc.h
> index b5cb514f57d6..71e2e1735ad5 100644
> --- a/include/mmc.h
> +++ b/include/mmc.h
> @@ -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)
> @@ -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_ */
>
diff mbox series

Patch

diff --git a/include/mmc.h b/include/mmc.h
index b5cb514f57d6..71e2e1735ad5 100644
--- a/include/mmc.h
+++ b/include/mmc.h
@@ -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)
@@ -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_ */