Commit 92d0f925 authored by Simon Horman's avatar Simon Horman Committed by Ulf Hansson

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: default avatarSimon Horman <horms+renesas@verge.net.au>
Reviewed-by: default avatarWolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent 603aa14d
...@@ -126,6 +126,11 @@ static void renesas_sdhi_sys_dmac_abort_dma(struct tmio_mmc_host *host) ...@@ -126,6 +126,11 @@ static void renesas_sdhi_sys_dmac_abort_dma(struct tmio_mmc_host *host)
renesas_sdhi_sys_dmac_enable_dma(host, true); renesas_sdhi_sys_dmac_enable_dma(host, true);
} }
static void renesas_sdhi_sys_dmac_dataend_dma(struct tmio_mmc_host *host)
{
complete(&host->dma_dataend);
}
static void renesas_sdhi_sys_dmac_dma_callback(void *arg) static void renesas_sdhi_sys_dmac_dma_callback(void *arg)
{ {
struct tmio_mmc_host *host = arg; struct tmio_mmc_host *host = arg;
...@@ -451,6 +456,7 @@ static const struct tmio_mmc_dma_ops renesas_sdhi_sys_dmac_dma_ops = { ...@@ -451,6 +456,7 @@ static const struct tmio_mmc_dma_ops renesas_sdhi_sys_dmac_dma_ops = {
.request = renesas_sdhi_sys_dmac_request_dma, .request = renesas_sdhi_sys_dmac_request_dma,
.release = renesas_sdhi_sys_dmac_release_dma, .release = renesas_sdhi_sys_dmac_release_dma,
.abort = renesas_sdhi_sys_dmac_abort_dma, .abort = renesas_sdhi_sys_dmac_abort_dma,
.dataend = renesas_sdhi_sys_dmac_dataend_dma,
}; };
static int renesas_sdhi_sys_dmac_probe(struct platform_device *pdev) static int renesas_sdhi_sys_dmac_probe(struct platform_device *pdev)
......
...@@ -122,6 +122,7 @@ struct tmio_mmc_dma_ops { ...@@ -122,6 +122,7 @@ struct tmio_mmc_dma_ops {
struct tmio_mmc_data *pdata); struct tmio_mmc_data *pdata);
void (*release)(struct tmio_mmc_host *host); void (*release)(struct tmio_mmc_host *host);
void (*abort)(struct tmio_mmc_host *host); void (*abort)(struct tmio_mmc_host *host);
void (*dataend)(struct tmio_mmc_host *host);
}; };
struct tmio_mmc_host { struct tmio_mmc_host {
......
...@@ -87,6 +87,12 @@ static inline void tmio_mmc_abort_dma(struct tmio_mmc_host *host) ...@@ -87,6 +87,12 @@ static inline void tmio_mmc_abort_dma(struct tmio_mmc_host *host)
host->dma_ops->abort(host); host->dma_ops->abort(host);
} }
static inline void tmio_mmc_dataend_dma(struct tmio_mmc_host *host)
{
if (host->dma_ops)
host->dma_ops->dataend(host);
}
void tmio_mmc_enable_mmc_irqs(struct tmio_mmc_host *host, u32 i) void tmio_mmc_enable_mmc_irqs(struct tmio_mmc_host *host, u32 i)
{ {
host->sdcard_irq_mask &= ~(i & TMIO_MASK_IRQ); 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) ...@@ -605,11 +611,11 @@ static void tmio_mmc_data_irq(struct tmio_mmc_host *host, unsigned int stat)
if (done) { if (done) {
tmio_mmc_disable_mmc_irqs(host, TMIO_STAT_DATAEND); tmio_mmc_disable_mmc_irqs(host, TMIO_STAT_DATAEND);
complete(&host->dma_dataend); tmio_mmc_dataend_dma(host);
} }
} else if (host->chan_rx && (data->flags & MMC_DATA_READ) && !host->force_pio) { } else if (host->chan_rx && (data->flags & MMC_DATA_READ) && !host->force_pio) {
tmio_mmc_disable_mmc_irqs(host, TMIO_STAT_DATAEND); tmio_mmc_disable_mmc_irqs(host, TMIO_STAT_DATAEND);
complete(&host->dma_dataend); tmio_mmc_dataend_dma(host);
} else { } else {
tmio_mmc_do_data_irq(host); tmio_mmc_do_data_irq(host);
tmio_mmc_disable_mmc_irqs(host, TMIO_MASK_READOP | TMIO_MASK_WRITEOP); tmio_mmc_disable_mmc_irqs(host, TMIO_MASK_READOP | TMIO_MASK_WRITEOP);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment