Commit 0dc6bf75 authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown

ASoC: rsnd: tidyup SSI init/start sequence

SSI want to have SSIWSR settings and SSICR settings without EN bit
when init, and SSICR EN bit only when start timing.
Otherwise, SSI output signal might be unstable.
Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent c8e969a8
...@@ -276,7 +276,7 @@ static void rsnd_ssi_master_clk_stop(struct rsnd_mod *mod, ...@@ -276,7 +276,7 @@ static void rsnd_ssi_master_clk_stop(struct rsnd_mod *mod,
rsnd_adg_ssi_clk_stop(mod); rsnd_adg_ssi_clk_stop(mod);
} }
static int rsnd_ssi_config_init(struct rsnd_mod *mod, static void rsnd_ssi_config_init(struct rsnd_mod *mod,
struct rsnd_dai_stream *io) struct rsnd_dai_stream *io)
{ {
struct rsnd_dai *rdai = rsnd_io_to_rdai(io); struct rsnd_dai *rdai = rsnd_io_to_rdai(io);
...@@ -313,8 +313,6 @@ static int rsnd_ssi_config_init(struct rsnd_mod *mod, ...@@ -313,8 +313,6 @@ static int rsnd_ssi_config_init(struct rsnd_mod *mod,
case 32: case 32:
cr_own |= DWL_24; cr_own |= DWL_24;
break; break;
default:
return -EINVAL;
} }
if (rsnd_ssi_is_dma_mode(mod)) { if (rsnd_ssi_is_dma_mode(mod)) {
...@@ -338,8 +336,16 @@ static int rsnd_ssi_config_init(struct rsnd_mod *mod, ...@@ -338,8 +336,16 @@ static int rsnd_ssi_config_init(struct rsnd_mod *mod,
ssi->cr_own = cr_own; ssi->cr_own = cr_own;
ssi->cr_mode = cr_mode; ssi->cr_mode = cr_mode;
ssi->wsr = wsr; ssi->wsr = wsr;
}
return 0; static void rsnd_ssi_register_setup(struct rsnd_mod *mod)
{
struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod);
rsnd_mod_write(mod, SSIWSR, ssi->wsr);
rsnd_mod_write(mod, SSICR, ssi->cr_own |
ssi->cr_clk |
ssi->cr_mode); /* without EN */
} }
/* /*
...@@ -360,12 +366,10 @@ static int rsnd_ssi_init(struct rsnd_mod *mod, ...@@ -360,12 +366,10 @@ static int rsnd_ssi_init(struct rsnd_mod *mod,
if (ret < 0) if (ret < 0)
return ret; return ret;
if (rsnd_ssi_is_parent(mod, io)) if (!rsnd_ssi_is_parent(mod, io))
return 0; rsnd_ssi_config_init(mod, io);
ret = rsnd_ssi_config_init(mod, io); rsnd_ssi_register_setup(mod);
if (ret < 0)
return ret;
/* clear error status */ /* clear error status */
rsnd_ssi_status_clear(mod); rsnd_ssi_status_clear(mod);
...@@ -428,22 +432,14 @@ static int rsnd_ssi_start(struct rsnd_mod *mod, ...@@ -428,22 +432,14 @@ static int rsnd_ssi_start(struct rsnd_mod *mod,
struct rsnd_dai_stream *io, struct rsnd_dai_stream *io,
struct rsnd_priv *priv) struct rsnd_priv *priv)
{ {
struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod);
u32 cr;
cr = ssi->cr_own |
ssi->cr_clk |
ssi->cr_mode;
/* /*
* EN will be set via SSIU :: SSI_CONTROL * EN will be set via SSIU :: SSI_CONTROL
* if Multi channel mode * if Multi channel mode
*/ */
if (!rsnd_ssi_multi_slaves(io)) if (rsnd_ssi_multi_slaves(io))
cr |= EN; return 0;
rsnd_mod_write(mod, SSICR, cr); rsnd_mod_bset(mod, SSICR, EN, EN);
rsnd_mod_write(mod, SSIWSR, ssi->wsr);
return 0; return 0;
} }
......
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