未验证 提交 6c92d5a2 编写于 作者: K Kuninori Morimoto 提交者: Mark Brown

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 ac6bbf0c ("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: NKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: NMark Brown <broonie@kernel.org>
上级 69235ccf
...@@ -478,7 +478,7 @@ static int rsnd_status_update(u32 *status, ...@@ -478,7 +478,7 @@ static int rsnd_status_update(u32 *status,
(func_call && (mod)->ops->fn) ? #fn : ""); \ (func_call && (mod)->ops->fn) ? #fn : ""); \
if (func_call && (mod)->ops->fn) \ if (func_call && (mod)->ops->fn) \
tmp = (mod)->ops->fn(mod, io, param); \ tmp = (mod)->ops->fn(mod, io, param); \
if (tmp) \ if (tmp && (tmp != -EPROBE_DEFER)) \
dev_err(dev, "%s[%d] : %s error %d\n", \ dev_err(dev, "%s[%d] : %s error %d\n", \
rsnd_mod_name(mod), rsnd_mod_id(mod), \ rsnd_mod_name(mod), rsnd_mod_id(mod), \
#fn, tmp); \ #fn, tmp); \
...@@ -1561,6 +1561,14 @@ static int rsnd_probe(struct platform_device *pdev) ...@@ -1561,6 +1561,14 @@ static int rsnd_probe(struct platform_device *pdev)
rsnd_dai_call(remove, &rdai->capture, priv); rsnd_dai_call(remove, &rdai->capture, priv);
} }
/*
* adg is very special mod which can't use rsnd_dai_call(remove),
* and it registers ADG clock on probe.
* It should be unregister if probe failed.
* Mainly it is assuming -EPROBE_DEFER case
*/
rsnd_adg_remove(priv);
return ret; return ret;
} }
......
...@@ -241,6 +241,10 @@ static int rsnd_dmaen_attach(struct rsnd_dai_stream *io, ...@@ -241,6 +241,10 @@ static int rsnd_dmaen_attach(struct rsnd_dai_stream *io,
/* try to get DMAEngine channel */ /* try to get DMAEngine channel */
chan = rsnd_dmaen_request_channel(io, mod_from, mod_to); chan = rsnd_dmaen_request_channel(io, mod_from, mod_to);
if (IS_ERR_OR_NULL(chan)) { if (IS_ERR_OR_NULL(chan)) {
/* Let's follow when -EPROBE_DEFER case */
if (PTR_ERR(chan) == -EPROBE_DEFER)
return PTR_ERR(chan);
/* /*
* DMA failed. try to PIO mode * DMA failed. try to PIO mode
* see * see
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册