aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/sh/rcar/dma.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/sh/rcar/dma.c')
-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;