Skip to content

Commit

Permalink
ASoC: fsi: Configure DMA slave settings
Browse files Browse the repository at this point in the history
Current FSI driver is assuming that dst_addr/src_addr of DMAEngine
will be set by platform data. But it should be set via
dmaengine_slave_config(). Special thanks to Arnd

Reported-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
  • Loading branch information
Kuninori Morimoto authored and Vinod Koul committed Feb 23, 2015
1 parent 5b7cdc8 commit 7c6cc8f
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions sound/soc/sh/fsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ struct fsi_clk {

struct fsi_priv {
void __iomem *base;
phys_addr_t phys;
struct fsi_master *master;

struct fsi_stream playback;
Expand Down Expand Up @@ -1374,9 +1375,15 @@ static int fsi_dma_probe(struct fsi_priv *fsi, struct fsi_stream *io, struct dev
struct dma_slave_config cfg = {};
int ret;

cfg.dst_addr = 0; /* use default addr */
cfg.src_addr = 0; /* use default addr */
cfg.direction = is_play ? DMA_MEM_TO_DEV : DMA_DEV_TO_MEM;
if (is_play) {
cfg.dst_addr = fsi->phys + REG_DODT;
cfg.dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
cfg.direction = DMA_MEM_TO_DEV;
} else {
cfg.src_addr = fsi->phys + REG_DIDT;
cfg.src_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
cfg.direction = DMA_DEV_TO_MEM;
}

ret = dmaengine_slave_config(io->chan, &cfg);
if (ret < 0) {
Expand Down Expand Up @@ -1940,6 +1947,7 @@ static int fsi_probe(struct platform_device *pdev)
/* FSI A setting */
fsi = &master->fsia;
fsi->base = master->base;
fsi->phys = res->start;
fsi->master = master;
fsi_port_info_init(fsi, &info.port_a);
fsi_handler_init(fsi, &info.port_a);
Expand All @@ -1952,6 +1960,7 @@ static int fsi_probe(struct platform_device *pdev)
/* FSI B setting */
fsi = &master->fsib;
fsi->base = master->base + 0x40;
fsi->phys = res->start + 0x40;
fsi->master = master;
fsi_port_info_init(fsi, &info.port_b);
fsi_handler_init(fsi, &info.port_b);
Expand Down

0 comments on commit 7c6cc8f

Please sign in to comment.