Skip to content

Commit 92d0f92

Browse files
hormsstorulf
authored andcommitted
mmc: tmio, renesas-sdhi: add dataend to DMA ops
Add dataend to DMA ops to allow DMAC implementation dependent handling of DMA data end. Also implement the operation for SDHI. Signed-off-by: Simon Horman <horms+renesas@verge.net.au> Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
1 parent 603aa14 commit 92d0f92

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

drivers/mmc/host/renesas_sdhi_sys_dmac.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,11 @@ static void renesas_sdhi_sys_dmac_abort_dma(struct tmio_mmc_host *host)
126126
renesas_sdhi_sys_dmac_enable_dma(host, true);
127127
}
128128

129+
static void renesas_sdhi_sys_dmac_dataend_dma(struct tmio_mmc_host *host)
130+
{
131+
complete(&host->dma_dataend);
132+
}
133+
129134
static void renesas_sdhi_sys_dmac_dma_callback(void *arg)
130135
{
131136
struct tmio_mmc_host *host = arg;
@@ -451,6 +456,7 @@ static const struct tmio_mmc_dma_ops renesas_sdhi_sys_dmac_dma_ops = {
451456
.request = renesas_sdhi_sys_dmac_request_dma,
452457
.release = renesas_sdhi_sys_dmac_release_dma,
453458
.abort = renesas_sdhi_sys_dmac_abort_dma,
459+
.dataend = renesas_sdhi_sys_dmac_dataend_dma,
454460
};
455461

456462
static int renesas_sdhi_sys_dmac_probe(struct platform_device *pdev)

drivers/mmc/host/tmio_mmc.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ struct tmio_mmc_dma_ops {
122122
struct tmio_mmc_data *pdata);
123123
void (*release)(struct tmio_mmc_host *host);
124124
void (*abort)(struct tmio_mmc_host *host);
125+
void (*dataend)(struct tmio_mmc_host *host);
125126
};
126127

127128
struct tmio_mmc_host {

drivers/mmc/host/tmio_mmc_core.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,12 @@ static inline void tmio_mmc_abort_dma(struct tmio_mmc_host *host)
8787
host->dma_ops->abort(host);
8888
}
8989

90+
static inline void tmio_mmc_dataend_dma(struct tmio_mmc_host *host)
91+
{
92+
if (host->dma_ops)
93+
host->dma_ops->dataend(host);
94+
}
95+
9096
void tmio_mmc_enable_mmc_irqs(struct tmio_mmc_host *host, u32 i)
9197
{
9298
host->sdcard_irq_mask &= ~(i & TMIO_MASK_IRQ);
@@ -605,11 +611,11 @@ static void tmio_mmc_data_irq(struct tmio_mmc_host *host, unsigned int stat)
605611

606612
if (done) {
607613
tmio_mmc_disable_mmc_irqs(host, TMIO_STAT_DATAEND);
608-
complete(&host->dma_dataend);
614+
tmio_mmc_dataend_dma(host);
609615
}
610616
} else if (host->chan_rx && (data->flags & MMC_DATA_READ) && !host->force_pio) {
611617
tmio_mmc_disable_mmc_irqs(host, TMIO_STAT_DATAEND);
612-
complete(&host->dma_dataend);
618+
tmio_mmc_dataend_dma(host);
613619
} else {
614620
tmio_mmc_do_data_irq(host);
615621
tmio_mmc_disable_mmc_irqs(host, TMIO_MASK_READOP | TMIO_MASK_WRITEOP);

0 commit comments

Comments
 (0)