mirror of
https://github.com/torvalds/linux.git
synced 2026-07-28 01:55:51 +02:00
ASoC: rsnd: Add reset controller support to rsnd_mod
The RZ/G3E SoC requires per-module reset control for the audio subsystem. Add reset controller support to struct rsnd_mod and update rsnd_mod_init() to accept and handle a reset_control parameter and mirror it in rsnd_mod_quit(). Signed-off-by: John Madieu <john.madieu.xa@bp.renesas.com> Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://patch.msgid.link/20260525110230.4014435-4-john.madieu.xa@bp.renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
c075827936
commit
83c9631e97
|
|
@ -780,7 +780,7 @@ int rsnd_adg_probe(struct rsnd_priv *priv)
|
|||
return -ENOMEM;
|
||||
|
||||
ret = rsnd_mod_init(priv, &adg->mod, &adg_ops,
|
||||
NULL, 0, 0);
|
||||
NULL, NULL, 0, 0);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
|
|
|
|||
|
|
@ -171,7 +171,7 @@ int rsnd_cmd_probe(struct rsnd_priv *priv)
|
|||
|
||||
for_each_rsnd_cmd(cmd, priv, i) {
|
||||
int ret = rsnd_mod_init(priv, rsnd_mod_get(cmd),
|
||||
&rsnd_cmd_ops, NULL,
|
||||
&rsnd_cmd_ops, NULL, NULL,
|
||||
RSND_MOD_CMD, i);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
|
|
|||
|
|
@ -196,18 +196,29 @@ int rsnd_mod_init(struct rsnd_priv *priv,
|
|||
struct rsnd_mod *mod,
|
||||
struct rsnd_mod_ops *ops,
|
||||
struct clk *clk,
|
||||
struct reset_control *rstc,
|
||||
enum rsnd_mod_type type,
|
||||
int id)
|
||||
{
|
||||
int ret = clk_prepare(clk);
|
||||
int ret;
|
||||
|
||||
ret = clk_prepare_enable(clk);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = reset_control_deassert(rstc);
|
||||
if (ret) {
|
||||
clk_disable_unprepare(clk);
|
||||
return ret;
|
||||
}
|
||||
|
||||
clk_disable(clk);
|
||||
|
||||
mod->id = id;
|
||||
mod->ops = ops;
|
||||
mod->type = type;
|
||||
mod->clk = clk;
|
||||
mod->rstc = rstc;
|
||||
mod->priv = priv;
|
||||
|
||||
return 0;
|
||||
|
|
@ -215,6 +226,8 @@ int rsnd_mod_init(struct rsnd_priv *priv,
|
|||
|
||||
void rsnd_mod_quit(struct rsnd_mod *mod)
|
||||
{
|
||||
reset_control_assert(mod->rstc);
|
||||
mod->rstc = NULL;
|
||||
clk_unprepare(mod->clk);
|
||||
mod->clk = NULL;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -360,7 +360,7 @@ int rsnd_ctu_probe(struct rsnd_priv *priv)
|
|||
}
|
||||
|
||||
ret = rsnd_mod_init(priv, rsnd_mod_get(ctu), &rsnd_ctu_ops,
|
||||
clk, RSND_MOD_CTU, i);
|
||||
clk, NULL, RSND_MOD_CTU, i);
|
||||
if (ret)
|
||||
goto rsnd_ctu_probe_done;
|
||||
|
||||
|
|
|
|||
|
|
@ -803,7 +803,7 @@ static int rsnd_dma_alloc(struct rsnd_dai_stream *io, struct rsnd_mod *mod,
|
|||
|
||||
*dma_mod = rsnd_mod_get(dma);
|
||||
|
||||
ret = rsnd_mod_init(priv, *dma_mod, ops, NULL,
|
||||
ret = rsnd_mod_init(priv, *dma_mod, ops, NULL, NULL,
|
||||
type, dma_id);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
|
@ -879,5 +879,5 @@ int rsnd_dma_probe(struct rsnd_priv *priv)
|
|||
priv->dma = dmac;
|
||||
|
||||
/* dummy mem mod for debug */
|
||||
return rsnd_mod_init(NULL, &mem, &mem_ops, NULL, 0, 0);
|
||||
return rsnd_mod_init(NULL, &mem, &mem_ops, NULL, NULL, 0, 0);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -364,7 +364,7 @@ int rsnd_dvc_probe(struct rsnd_priv *priv)
|
|||
}
|
||||
|
||||
ret = rsnd_mod_init(priv, rsnd_mod_get(dvc), &rsnd_dvc_ops,
|
||||
clk, RSND_MOD_DVC, i);
|
||||
clk, NULL, RSND_MOD_DVC, i);
|
||||
if (ret)
|
||||
goto rsnd_dvc_probe_done;
|
||||
|
||||
|
|
|
|||
|
|
@ -328,7 +328,7 @@ int rsnd_mix_probe(struct rsnd_priv *priv)
|
|||
}
|
||||
|
||||
ret = rsnd_mod_init(priv, rsnd_mod_get(mix), &rsnd_mix_ops,
|
||||
clk, RSND_MOD_MIX, i);
|
||||
clk, NULL, RSND_MOD_MIX, i);
|
||||
if (ret)
|
||||
goto rsnd_mix_probe_done;
|
||||
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@
|
|||
#include <linux/list.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/reset.h>
|
||||
#include <linux/sh_dma.h>
|
||||
#include <linux/workqueue.h>
|
||||
#include <sound/soc.h>
|
||||
|
|
@ -353,6 +354,7 @@ struct rsnd_mod {
|
|||
struct rsnd_mod_ops *ops;
|
||||
struct rsnd_priv *priv;
|
||||
struct clk *clk;
|
||||
struct reset_control *rstc;
|
||||
u32 status;
|
||||
};
|
||||
/*
|
||||
|
|
@ -420,6 +422,7 @@ int rsnd_mod_init(struct rsnd_priv *priv,
|
|||
struct rsnd_mod *mod,
|
||||
struct rsnd_mod_ops *ops,
|
||||
struct clk *clk,
|
||||
struct reset_control *rstc,
|
||||
enum rsnd_mod_type type,
|
||||
int id);
|
||||
void rsnd_mod_quit(struct rsnd_mod *mod);
|
||||
|
|
|
|||
|
|
@ -766,7 +766,7 @@ int rsnd_src_probe(struct rsnd_priv *priv)
|
|||
}
|
||||
|
||||
ret = rsnd_mod_init(priv, rsnd_mod_get(src),
|
||||
&rsnd_src_ops, clk, RSND_MOD_SRC, i);
|
||||
&rsnd_src_ops, clk, NULL, RSND_MOD_SRC, i);
|
||||
if (ret)
|
||||
goto rsnd_src_probe_done;
|
||||
|
||||
|
|
|
|||
|
|
@ -1225,7 +1225,7 @@ int rsnd_ssi_probe(struct rsnd_priv *priv)
|
|||
ops = &rsnd_ssi_dma_ops;
|
||||
|
||||
ret = rsnd_mod_init(priv, rsnd_mod_get(ssi), ops, clk,
|
||||
RSND_MOD_SSI, i);
|
||||
NULL, RSND_MOD_SSI, i);
|
||||
if (ret)
|
||||
goto rsnd_ssi_probe_done;
|
||||
|
||||
|
|
|
|||
|
|
@ -586,7 +586,7 @@ int rsnd_ssiu_probe(struct rsnd_priv *priv)
|
|||
}
|
||||
|
||||
ret = rsnd_mod_init(priv, rsnd_mod_get(ssiu),
|
||||
ops, NULL, RSND_MOD_SSIU, i);
|
||||
ops, NULL, NULL, RSND_MOD_SSIU, i);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user