mirror of
https://github.com/torvalds/linux.git
synced 2024-11-29 23:51:37 +00:00
ASoC: rsnd: add rsnd_ssi_busif_err_status_clear()
Current ssi.c clears BUSIF error status at __rsnd_ssi_interrupt(), but its code is verbose. This patch off-load it to rsnd_ssi_busif_err_status_clear(). Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/8735w11jso.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
a4856e15e5
commit
691b379cbe
@ -359,6 +359,55 @@ static void rsnd_ssi_master_clk_stop(struct rsnd_mod *mod,
|
||||
rsnd_adg_ssi_clk_stop(mod);
|
||||
}
|
||||
|
||||
static bool rsnd_ssi_busif_err_status_clear(struct rsnd_mod *mod)
|
||||
{
|
||||
struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
|
||||
struct device *dev = rsnd_priv_to_dev(priv);
|
||||
u32 status;
|
||||
bool stop = false;
|
||||
int id = rsnd_mod_id(mod);
|
||||
int i;
|
||||
|
||||
switch (id) {
|
||||
case 0:
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
for (i = 0; i < 4; i++) {
|
||||
status = rsnd_mod_read(mod, SSI_SYS_STATUS(i * 2));
|
||||
status &= 0xf << (id * 4);
|
||||
|
||||
if (status) {
|
||||
rsnd_dbg_irq_status(dev, "%s err status : 0x%08x\n",
|
||||
rsnd_mod_name(mod), status);
|
||||
rsnd_mod_write(mod,
|
||||
SSI_SYS_STATUS(i * 2),
|
||||
0xf << (id * 4));
|
||||
stop = true;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 9:
|
||||
for (i = 0; i < 4; i++) {
|
||||
status = rsnd_mod_read(mod, SSI_SYS_STATUS((i * 2) + 1));
|
||||
status &= 0xf << 4;
|
||||
|
||||
if (status) {
|
||||
rsnd_dbg_irq_status(dev, "%s err status : 0x%08x\n",
|
||||
rsnd_mod_name(mod), status);
|
||||
rsnd_mod_write(mod,
|
||||
SSI_SYS_STATUS((i * 2) + 1),
|
||||
0xf << 4);
|
||||
stop = true;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return stop;
|
||||
}
|
||||
|
||||
static void rsnd_ssi_config_init(struct rsnd_mod *mod,
|
||||
struct rsnd_dai_stream *io)
|
||||
{
|
||||
@ -748,8 +797,6 @@ static void __rsnd_ssi_interrupt(struct rsnd_mod *mod,
|
||||
u32 status;
|
||||
bool elapsed = false;
|
||||
bool stop = false;
|
||||
int id = rsnd_mod_id(mod);
|
||||
int i;
|
||||
int is_tdm, is_tdm_split;
|
||||
|
||||
is_tdm = rsnd_runtime_is_tdm(io);
|
||||
@ -775,50 +822,8 @@ static void __rsnd_ssi_interrupt(struct rsnd_mod *mod,
|
||||
stop = true;
|
||||
}
|
||||
|
||||
status = 0;
|
||||
|
||||
if (is_tdm || is_tdm_split) {
|
||||
switch (id) {
|
||||
case 0:
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
for (i = 0; i < 4; i++) {
|
||||
status = rsnd_mod_read(mod,
|
||||
SSI_SYS_STATUS(i * 2));
|
||||
status &= 0xf << (id * 4);
|
||||
|
||||
if (status) {
|
||||
rsnd_dbg_irq_status(dev,
|
||||
"%s err status : 0x%08x\n",
|
||||
rsnd_mod_name(mod), status);
|
||||
rsnd_mod_write(mod,
|
||||
SSI_SYS_STATUS(i * 2),
|
||||
0xf << (id * 4));
|
||||
stop = true;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 9:
|
||||
for (i = 0; i < 4; i++) {
|
||||
status = rsnd_mod_read(mod,
|
||||
SSI_SYS_STATUS((i * 2) + 1));
|
||||
status &= 0xf << 4;
|
||||
|
||||
if (status) {
|
||||
rsnd_dbg_irq_status(dev,
|
||||
"%s err status : 0x%08x\n",
|
||||
rsnd_mod_name(mod), status);
|
||||
rsnd_mod_write(mod,
|
||||
SSI_SYS_STATUS((i * 2) + 1),
|
||||
0xf << 4);
|
||||
stop = true;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (is_tdm || is_tdm_split)
|
||||
stop |= rsnd_ssi_busif_err_status_clear(mod);
|
||||
|
||||
rsnd_ssi_status_clear(mod);
|
||||
rsnd_ssi_interrupt_out:
|
||||
|
Loading…
Reference in New Issue
Block a user