aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/sh
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2015-02-16 20:48:19 -0500
committerVinod Koul <vinod.koul@intel.com>2015-02-23 05:43:23 -0500
commit7c6cc8f2012f4146b05b8ec7238f98884100db8c (patch)
tree6f279ed38fea7ff688c93727d2febe25afd0a669 /sound/soc/sh
parent5b7cdc8068e3f02ff4c6ef75bd7398af244869d4 (diff)
ASoC: fsi: Configure DMA slave settings
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>
Diffstat (limited to 'sound/soc/sh')
-rw-r--r--sound/soc/sh/fsi.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c
index dc28b03db6e5..bb20550b007c 100644
--- a/sound/soc/sh/fsi.c
+++ b/sound/soc/sh/fsi.c
@@ -250,6 +250,7 @@ struct fsi_clk {
250 250
251struct fsi_priv { 251struct fsi_priv {
252 void __iomem *base; 252 void __iomem *base;
253 phys_addr_t phys;
253 struct fsi_master *master; 254 struct fsi_master *master;
254 255
255 struct fsi_stream playback; 256 struct fsi_stream playback;
@@ -1374,9 +1375,15 @@ static int fsi_dma_probe(struct fsi_priv *fsi, struct fsi_stream *io, struct dev
1374 struct dma_slave_config cfg = {}; 1375 struct dma_slave_config cfg = {};
1375 int ret; 1376 int ret;
1376 1377
1377 cfg.dst_addr = 0; /* use default addr */ 1378 if (is_play) {
1378 cfg.src_addr = 0; /* use default addr */ 1379 cfg.dst_addr = fsi->phys + REG_DODT;
1379 cfg.direction = is_play ? DMA_MEM_TO_DEV : DMA_DEV_TO_MEM; 1380 cfg.dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
1381 cfg.direction = DMA_MEM_TO_DEV;
1382 } else {
1383 cfg.src_addr = fsi->phys + REG_DIDT;
1384 cfg.src_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
1385 cfg.direction = DMA_DEV_TO_MEM;
1386 }
1380 1387
1381 ret = dmaengine_slave_config(io->chan, &cfg); 1388 ret = dmaengine_slave_config(io->chan, &cfg);
1382 if (ret < 0) { 1389 if (ret < 0) {
@@ -1940,6 +1947,7 @@ static int fsi_probe(struct platform_device *pdev)
1940 /* FSI A setting */ 1947 /* FSI A setting */
1941 fsi = &master->fsia; 1948 fsi = &master->fsia;
1942 fsi->base = master->base; 1949 fsi->base = master->base;
1950 fsi->phys = res->start;
1943 fsi->master = master; 1951 fsi->master = master;
1944 fsi_port_info_init(fsi, &info.port_a); 1952 fsi_port_info_init(fsi, &info.port_a);
1945 fsi_handler_init(fsi, &info.port_a); 1953 fsi_handler_init(fsi, &info.port_a);
@@ -1952,6 +1960,7 @@ static int fsi_probe(struct platform_device *pdev)
1952 /* FSI B setting */ 1960 /* FSI B setting */
1953 fsi = &master->fsib; 1961 fsi = &master->fsib;
1954 fsi->base = master->base + 0x40; 1962 fsi->base = master->base + 0x40;
1963 fsi->phys = res->start + 0x40;
1955 fsi->master = master; 1964 fsi->master = master;
1956 fsi_port_info_init(fsi, &info.port_b); 1965 fsi_port_info_init(fsi, &info.port_b);
1957 fsi_handler_init(fsi, &info.port_b); 1966 fsi_handler_init(fsi, &info.port_b);