summaryrefslogtreecommitdiffstats
path: root/drivers/mci/imx-esdhc.h
diff options
context:
space:
mode:
authorAndrey Smirnov <andrew.smirnov@gmail.com>2019-12-02 07:19:52 -0800
committerSascha Hauer <s.hauer@pengutronix.de>2019-12-04 08:37:12 +0100
commite158af3ac254ffb56cccb2fd7b7da2e2d50710f3 (patch)
tree8f9af908b137bf2297704cf6ab360b9f17c91523 /drivers/mci/imx-esdhc.h
parentab77fa93540a1dbb081a16ee678a085bc1386623 (diff)
downloadbarebox-e158af3ac254ffb56cccb2fd7b7da2e2d50710f3.tar.gz
barebox-e158af3ac254ffb56cccb2fd7b7da2e2d50710f3.tar.xz
mci: imx-esdhc: Share code for esdhc_(setup|do)_data operations
PBL and PIO case of the regular driver do exaclty the same thing during esdhc_(setup|do)_data stages of esdhc_send_cmd(). Move the code to a common file and adjust all of the users accordingly. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/mci/imx-esdhc.h')
-rw-r--r--drivers/mci/imx-esdhc.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/mci/imx-esdhc.h b/drivers/mci/imx-esdhc.h
index e5647187b4..8ab6b0bb8c 100644
--- a/drivers/mci/imx-esdhc.h
+++ b/drivers/mci/imx-esdhc.h
@@ -22,6 +22,7 @@
#ifndef __FSL_ESDHC_H__
#define __FSL_ESDHC_H__
+#include <dma.h>
#include <errno.h>
#include <asm/byteorder.h>
#include <linux/bitfield.h>
@@ -128,6 +129,12 @@ struct fsl_esdhc_host {
struct sdhci sdhci;
};
+struct fsl_esdhc_dma_transfer {
+ dma_addr_t dma;
+ unsigned int size;
+ enum dma_data_direction dir;
+};
+
static inline int esdhc_is_usdhc(struct fsl_esdhc_host *data)
{
@@ -166,5 +173,10 @@ esdhc_setbits32(struct fsl_esdhc_host *host, unsigned int reg,
}
void esdhc_populate_sdhci(struct fsl_esdhc_host *host);
+int esdhc_setup_data(struct fsl_esdhc_host *host, struct mci_data *data,
+ struct fsl_esdhc_dma_transfer *tr);
+int esdhc_do_data(struct fsl_esdhc_host *host, struct mci_data *data,
+ struct fsl_esdhc_dma_transfer *tr);
+
#endif /* __FSL_ESDHC_H__ */