aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2015-03-09 21:25:01 -0400
committerMark Brown <broonie@kernel.org>2015-03-11 07:56:50 -0400
commit8537483a17038f08c68c1f0a561f0fe686e5706f (patch)
treef04bf38bd90fa0d5b3921d5470f4aa7a3a2bcfef /sound
parent6ec6fb6f231547834925ff802deb4415f49f708e (diff)
ASoC: rsnd: recover PIO mode for new dma interface
Renesas sound driver needs 1st/2nd DMA interface, and 1st DMA is using DMAEngine, and 2nd is using local method now. 2nd DMA had been DMAEngine, but it was moved to local method by previous patchset. But then, it lost PIO mode fallback when probe. this patch recovers it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/sh/rcar/dma.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/sound/soc/sh/rcar/dma.c b/sound/soc/sh/rcar/dma.c
index 2b73df84a769..cd7b79a01ce2 100644
--- a/sound/soc/sh/rcar/dma.c
+++ b/sound/soc/sh/rcar/dma.c
@@ -539,6 +539,13 @@ void rsnd_dma_start(struct rsnd_dma *dma)
539 539
540void rsnd_dma_quit(struct rsnd_dma *dma) 540void rsnd_dma_quit(struct rsnd_dma *dma)
541{ 541{
542 struct rsnd_mod *mod = rsnd_dma_to_mod(dma);
543 struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
544 struct rsnd_dma_ctrl *dmac = rsnd_priv_to_dmac(priv);
545
546 if (!dmac)
547 return;
548
542 dma->ops->quit(dma); 549 dma->ops->quit(dma);
543} 550}
544 551
@@ -548,8 +555,18 @@ int rsnd_dma_init(struct rsnd_priv *priv, struct rsnd_dma *dma, int id)
548 struct rsnd_mod *mod_from; 555 struct rsnd_mod *mod_from;
549 struct rsnd_mod *mod_to; 556 struct rsnd_mod *mod_to;
550 struct rsnd_dai_stream *io = rsnd_mod_to_io(mod); 557 struct rsnd_dai_stream *io = rsnd_mod_to_io(mod);
558 struct rsnd_dma_ctrl *dmac = rsnd_priv_to_dmac(priv);
551 int is_play = rsnd_io_is_play(io); 559 int is_play = rsnd_io_is_play(io);
552 560
561 /*
562 * DMA failed. try to PIO mode
563 * see
564 * rsnd_ssi_fallback()
565 * rsnd_rdai_continuance_probe()
566 */
567 if (!dmac)
568 return -EAGAIN;
569
553 rsnd_dma_of_path(dma, is_play, &mod_from, &mod_to); 570 rsnd_dma_of_path(dma, is_play, &mod_from, &mod_to);
554 571
555 dma->src_addr = rsnd_dma_addr(priv, mod_from, is_play, 1); 572 dma->src_addr = rsnd_dma_addr(priv, mod_from, is_play, 1);
@@ -589,7 +606,7 @@ int rsnd_dma_probe(struct platform_device *pdev,
589 dmac = devm_kzalloc(dev, sizeof(*dmac), GFP_KERNEL); 606 dmac = devm_kzalloc(dev, sizeof(*dmac), GFP_KERNEL);
590 if (!dmac || !res) { 607 if (!dmac || !res) {
591 dev_err(dev, "dma allocate failed\n"); 608 dev_err(dev, "dma allocate failed\n");
592 return -ENOMEM; 609 return 0; /* it will be PIO mode */
593 } 610 }
594 611
595 dmac->dmapp_num = 0; 612 dmac->dmapp_num = 0;