ASoC: rsnd: merge .nolock_start and .prepare
Main purpose of .nolock_start is we need to call some function without spinlock. OTOH we have .prepare which main purpose is called under atomic context. Then, it is called without spinlock. In summary, our main callback init/quit, and start/stop are called under "atomic context and with spinlock". And some function need to be called under "non-atomic context or without spinlock". Let's merge .nolock_start and prepare to be more clear code. Then, let's rename nolock_stop to cleanup Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Tested-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Tento commit je obsažen v:
@@ -106,9 +106,9 @@ static int rsnd_dmaen_stop(struct rsnd_mod *mod,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int rsnd_dmaen_nolock_stop(struct rsnd_mod *mod,
|
||||
struct rsnd_dai_stream *io,
|
||||
struct rsnd_priv *priv)
|
||||
static int rsnd_dmaen_cleanup(struct rsnd_mod *mod,
|
||||
struct rsnd_dai_stream *io,
|
||||
struct rsnd_priv *priv)
|
||||
{
|
||||
struct rsnd_dma *dma = rsnd_mod_to_dma(mod);
|
||||
struct rsnd_dmaen *dmaen = rsnd_dma_to_dmaen(dma);
|
||||
@@ -116,7 +116,7 @@ static int rsnd_dmaen_nolock_stop(struct rsnd_mod *mod,
|
||||
/*
|
||||
* DMAEngine release uses mutex lock.
|
||||
* Thus, it shouldn't be called under spinlock.
|
||||
* Let's call it under nolock_start
|
||||
* Let's call it under prepare
|
||||
*/
|
||||
if (dmaen->chan)
|
||||
dma_release_channel(dmaen->chan);
|
||||
@@ -126,9 +126,9 @@ static int rsnd_dmaen_nolock_stop(struct rsnd_mod *mod,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int rsnd_dmaen_nolock_start(struct rsnd_mod *mod,
|
||||
struct rsnd_dai_stream *io,
|
||||
struct rsnd_priv *priv)
|
||||
static int rsnd_dmaen_prepare(struct rsnd_mod *mod,
|
||||
struct rsnd_dai_stream *io,
|
||||
struct rsnd_priv *priv)
|
||||
{
|
||||
struct rsnd_dma *dma = rsnd_mod_to_dma(mod);
|
||||
struct rsnd_dmaen *dmaen = rsnd_dma_to_dmaen(dma);
|
||||
@@ -142,7 +142,7 @@ static int rsnd_dmaen_nolock_start(struct rsnd_mod *mod,
|
||||
/*
|
||||
* DMAEngine request uses mutex lock.
|
||||
* Thus, it shouldn't be called under spinlock.
|
||||
* Let's call it under nolock_start
|
||||
* Let's call it under prepare
|
||||
*/
|
||||
dmaen->chan = rsnd_dmaen_request_channel(io,
|
||||
dma->mod_from,
|
||||
@@ -287,8 +287,8 @@ static int rsnd_dmaen_pointer(struct rsnd_mod *mod,
|
||||
|
||||
static struct rsnd_mod_ops rsnd_dmaen_ops = {
|
||||
.name = "audmac",
|
||||
.nolock_start = rsnd_dmaen_nolock_start,
|
||||
.nolock_stop = rsnd_dmaen_nolock_stop,
|
||||
.prepare = rsnd_dmaen_prepare,
|
||||
.cleanup = rsnd_dmaen_cleanup,
|
||||
.start = rsnd_dmaen_start,
|
||||
.stop = rsnd_dmaen_stop,
|
||||
.pointer= rsnd_dmaen_pointer,
|
||||
|
Odkázat v novém úkolu
Zablokovat Uživatele