diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2018-09-05 23:21:47 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2018-09-06 06:13:24 -0400 |
commit | 6c92d5a2744e27619a8fcc9d74b91ee9f1cdebd1 (patch) | |
tree | 335404facbecb446b854b847828dac5b02947a3f | |
parent | 69235ccf491d2e26aefd465c0d3ccd1e3b2a9a9c (diff) |
ASoC: rsnd: don't fallback to PIO mode when -EPROBE_DEFER
Current rsnd driver will fallback to PIO mode if it can't get DMA
handler. But, DMA might return -EPROBE_DEFER when probe timing.
This driver always fallback to PIO mode especially from
commit ac6bbf0cdf4206c ("iommu: Remove IOMMU_OF_DECLARE") because
of this reason.
The DMA driver will be probed later, but sound driver might be
probed as PIO mode in such case. This patch fixup this issue.
Then, -EPROBE_DEFER is not error. Thus, let's don't indicate error
message in such case.
And it needs to call rsnd_adg_remove() individually if probe failed,
because it registers clk which should be unregister.
Maybe PIO fallback feature itself is not needed,
but let's keep it so far.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | sound/soc/sh/rcar/core.c | 10 | ||||
-rw-r--r-- | sound/soc/sh/rcar/dma.c | 4 |
2 files changed, 13 insertions, 1 deletions
diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c index b35f5509cfe2..d23c2bbff0cf 100644 --- a/sound/soc/sh/rcar/core.c +++ b/sound/soc/sh/rcar/core.c | |||
@@ -478,7 +478,7 @@ static int rsnd_status_update(u32 *status, | |||
478 | (func_call && (mod)->ops->fn) ? #fn : ""); \ | 478 | (func_call && (mod)->ops->fn) ? #fn : ""); \ |
479 | if (func_call && (mod)->ops->fn) \ | 479 | if (func_call && (mod)->ops->fn) \ |
480 | tmp = (mod)->ops->fn(mod, io, param); \ | 480 | tmp = (mod)->ops->fn(mod, io, param); \ |
481 | if (tmp) \ | 481 | if (tmp && (tmp != -EPROBE_DEFER)) \ |
482 | dev_err(dev, "%s[%d] : %s error %d\n", \ | 482 | dev_err(dev, "%s[%d] : %s error %d\n", \ |
483 | rsnd_mod_name(mod), rsnd_mod_id(mod), \ | 483 | rsnd_mod_name(mod), rsnd_mod_id(mod), \ |
484 | #fn, tmp); \ | 484 | #fn, tmp); \ |
@@ -1561,6 +1561,14 @@ exit_snd_probe: | |||
1561 | rsnd_dai_call(remove, &rdai->capture, priv); | 1561 | rsnd_dai_call(remove, &rdai->capture, priv); |
1562 | } | 1562 | } |
1563 | 1563 | ||
1564 | /* | ||
1565 | * adg is very special mod which can't use rsnd_dai_call(remove), | ||
1566 | * and it registers ADG clock on probe. | ||
1567 | * It should be unregister if probe failed. | ||
1568 | * Mainly it is assuming -EPROBE_DEFER case | ||
1569 | */ | ||
1570 | rsnd_adg_remove(priv); | ||
1571 | |||
1564 | return ret; | 1572 | return ret; |
1565 | } | 1573 | } |
1566 | 1574 | ||
diff --git a/sound/soc/sh/rcar/dma.c b/sound/soc/sh/rcar/dma.c index fe63ef8600d0..d65ea7bc4dac 100644 --- a/sound/soc/sh/rcar/dma.c +++ b/sound/soc/sh/rcar/dma.c | |||
@@ -241,6 +241,10 @@ static int rsnd_dmaen_attach(struct rsnd_dai_stream *io, | |||
241 | /* try to get DMAEngine channel */ | 241 | /* try to get DMAEngine channel */ |
242 | chan = rsnd_dmaen_request_channel(io, mod_from, mod_to); | 242 | chan = rsnd_dmaen_request_channel(io, mod_from, mod_to); |
243 | if (IS_ERR_OR_NULL(chan)) { | 243 | if (IS_ERR_OR_NULL(chan)) { |
244 | /* Let's follow when -EPROBE_DEFER case */ | ||
245 | if (PTR_ERR(chan) == -EPROBE_DEFER) | ||
246 | return PTR_ERR(chan); | ||
247 | |||
244 | /* | 248 | /* |
245 | * DMA failed. try to PIO mode | 249 | * DMA failed. try to PIO mode |
246 | * see | 250 | * see |