Commit b92e83f7 authored by Alexander Sverdlin's avatar Alexander Sverdlin Committed by Vinod Koul

dmaengine: ep93xx: Prepare clock before using it

Use clk_prepare_enable()/clk_disable_unprepare() in preparation for switch
to Common Clock Framework, otherwise the following is visible:

WARNING: CPU: 0 PID: 1 at drivers/clk/clk.c:1011 clk_core_enable+0x9c/0xbc
Enabling unprepared m2p0
...
Hardware name: Cirrus Logic EDB9302 Evaluation Board
...
clk_core_enable
clk_core_enable_lock
ep93xx_dma_alloc_chan_resources
dma_chan_get
find_candidate
__dma_request_channel
snd_dmaengine_pcm_request_channel
dmaengine_pcm_new
snd_soc_pcm_component_new
soc_new_pcm
snd_soc_bind_card
edb93xx_probe
...
ep93xx-i2s ep93xx-i2s: Missing dma channel for stream: 0
ep93xx-i2s ep93xx-i2s: ASoC: error at snd_soc_pcm_component_new on ep93xx-i2s: -22
edb93xx-audio edb93xx-audio: ASoC: can't create pcm CS4271 HiFi :-22
edb93xx-audio edb93xx-audio: snd_soc_register_card() failed: -22
edb93xx-audio: probe of edb93xx-audio failed with error -22
Signed-off-by: default avatarAlexander Sverdlin <alexander.sverdlin@gmail.com>
Signed-off-by: default avatarNikita Shubin <nikita.shubin@maquefel.me>
Reviewed-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20210726140001.24820-6-nikita.shubin@maquefel.meSigned-off-by: default avatarVinod Koul <vkoul@kernel.org>
parent c454d16a
...@@ -897,7 +897,7 @@ static int ep93xx_dma_alloc_chan_resources(struct dma_chan *chan) ...@@ -897,7 +897,7 @@ static int ep93xx_dma_alloc_chan_resources(struct dma_chan *chan)
if (data && data->name) if (data && data->name)
name = data->name; name = data->name;
ret = clk_enable(edmac->clk); ret = clk_prepare_enable(edmac->clk);
if (ret) if (ret)
return ret; return ret;
...@@ -936,7 +936,7 @@ static int ep93xx_dma_alloc_chan_resources(struct dma_chan *chan) ...@@ -936,7 +936,7 @@ static int ep93xx_dma_alloc_chan_resources(struct dma_chan *chan)
fail_free_irq: fail_free_irq:
free_irq(edmac->irq, edmac); free_irq(edmac->irq, edmac);
fail_clk_disable: fail_clk_disable:
clk_disable(edmac->clk); clk_disable_unprepare(edmac->clk);
return ret; return ret;
} }
...@@ -969,7 +969,7 @@ static void ep93xx_dma_free_chan_resources(struct dma_chan *chan) ...@@ -969,7 +969,7 @@ static void ep93xx_dma_free_chan_resources(struct dma_chan *chan)
list_for_each_entry_safe(desc, d, &list, node) list_for_each_entry_safe(desc, d, &list, node)
kfree(desc); kfree(desc);
clk_disable(edmac->clk); clk_disable_unprepare(edmac->clk);
free_irq(edmac->irq, edmac); free_irq(edmac->irq, edmac);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment