ASoC: rsnd: ssiu: reset SSI_MODE register
Subsystems (3)
PATCH 1/1 ASoC: rsnd: ssiu: reset SSI_MODE register
From: Jiada Wang <[email protected]>
register SSI_MODE is set when SSI works in TDM Extended or TDM (Ex-)Split mode, but it isn't reset after SSI stops. this will cause issue, if SSI starts to work in other modes which requie SSI_MODE to have different value.
This patch resets SSI_MODE register in .stop callback, when last stream calls .stop.
--- sound/soc/sh/rcar/ssiu.c | 2 ++ 1 file changed, 2 insertions(+)
sound/soc/sh/rcar/ssiu.c +2 -0
@@ -217,6 +217,8 @@ static int rsnd_ssiu_stop_gen2(struct rsnd_mod *mod,if (rsnd_ssi_multi_slaves_runtime (io))rsnd_mod_write (mod,SSI_CONTROL ,0 ); +rsnd_mod_write (mod,SSI_MODE ,0 ); +return 0 ; }
Signature · 1 line
1.7.9.5
Hi Jiada
Quoted 19 lines
register
SSI_MODEis set when SSI works in TDM Extended or TDM (Ex-)Split mode, but it isn't reset after SSI stops. this will cause issue, if SSI starts to work in other modes which requieSSI_MODEto have different value.This patch resets
SSI_MODEregister in .stop callback, when last stream calls .stop.Fixes 186fadc132f0 ("ASoC: rsnd: add TDM Extend Mode support")Signed-off-by Jiada Wang <[email protected]>--- sound/soc/sh/rcar/ssiu.c | 2 ++ 1 file changed, 2 insertions(+)sound/soc/sh/rcar/ssiu.c +0
-0
sound/soc/sh/rcar/ssiu.c static int rsnd_ssiu_stop_gen2(struct rsnd_mod *mod, · line 223
Quoted 7 lines
sound/soc/sh/rcar/ssiu.c +2
-0@@ -217,6 +217,8 @@ static int rsnd_ssiu_stop_gen2(struct rsnd_mod *mod,if (rsnd_ssi_multi_slaves_runtime (io))rsnd_mod_write (mod,SSI_CONTROL ,0 ); +rsnd_mod_write (mod,SSI_MODE ,0 ); +return 0 ; }
Thank you for your patch.
But, I don't want to reset register when stop, because it might be point-less if SoC has power domain. How about this or similar (not tested) ?
------------------
sound/soc/sh/rcar/ssiu.c +7 -8
@@ -130,14 +130,13 @@ static int rsnd_ssiu_init_gen2(struct rsnd_mod *mod,if (ret <0 )return ret; -if (rsnd_runtime_is_ssi_tdm (io)) { -/* -* TDM Extend Mode -* see -* rsnd_ssi_config_init() -*/ -rsnd_mod_write (mod,SSI_MODE ,0x1 ); - } +/* +* TDM Extend Mode +* see +* rsnd_ssi_config_init() +*/ +rsnd_mod_write (mod,SSI_MODE , +rsnd_runtime_is_ssi_tdm (io) ?0x1 :0x0 );if (rsnd_ssi_use_busif (io)) { rsnd_mod_write(mod, SSI_BUSIF_ADINR,
Best regards
---
Kuninori Morimoto
Hello Morimoto-san
Quoted 49 lines · Kuninori Morimoto
Hi Jiada
Quoted 19 lines
register
SSI_MODEis set when SSI works in TDM Extended or TDM (Ex-)Split mode, but it isn't reset after SSI stops. this will cause issue, if SSI starts to work in other modes which requieSSI_MODEto have different value.This patch resets
SSI_MODEregister in .stop callback, when last stream calls .stop.Fixes 186fadc132f0 ("ASoC: rsnd: add TDM Extend Mode support")Signed-off-by Jiada Wang <[email protected]>--- sound/soc/sh/rcar/ssiu.c | 2 ++ 1 file changed, 2 insertions(+)sound/soc/sh/rcar/ssiu.c +0
-0sound/soc/sh/rcar/ssiu.c static int rsnd_ssiu_stop_gen2(struct rsnd_mod *mod, · line 223
Quoted 7 lines
sound/soc/sh/rcar/ssiu.c +2
-0@@ -217,6 +217,8 @@ static int rsnd_ssiu_stop_gen2(struct rsnd_mod *mod,if (rsnd_ssi_multi_slaves_runtime (io))rsnd_mod_write (mod,SSI_CONTROL ,0 ); +rsnd_mod_write (mod,SSI_MODE ,0 ); +return 0 ; }Thank you for your patch.
But, I don't want to reset register when stop, because it might be point-less if SoC has power domain. How about this or similar (not tested) ?------------------
sound/soc/sh/rcar/ssiu.c +0
-5@@ -130,14 +130,13 @@ static int rsnd_ssiu_init_gen2(struct rsnd_mod *mod,if (ret <0 )return ret; -if (rsnd_runtime_is_ssi_tdm (io)) { -/* -* TDM Extend Mode -* see -* rsnd_ssi_config_init()
sound/soc/sh/rcar/ssiu.c static int rsnd_ssiu_init_gen2(struct rsnd_mod *mod, · line 139
Quoted 10 lines
sound/soc/sh/rcar/ssiu.c +7
-3-*/ -rsnd_mod_write (mod,SSI_MODE ,0x1 ); - } +/* +* TDM Extend Mode +* see +* rsnd_ssi_config_init() +*/ +rsnd_mod_write (mod,SSI_MODE , +rsnd_runtime_is_ssi_tdm (io) ?0x1 :0x0 );
Thanks for your suggestion,
I will do some test for this change,
if it works fine, I will submit ver2 with it
Thanks,
Jiada
Quoted 9 lines
sound/soc/sh/rcar/ssiu.c +0
-0if (rsnd_ssi_use_busif (io)) { rsnd_mod_write(mod, SSI_BUSIF_ADINR,Best regards
---
Kuninori Morimoto
Hi Jiada
Quoted 20 lines
Quoted 20 lines
------------------
sound/soc/sh/rcar/ssiu.c +3
-8@@ -130,14 +130,13 @@ static int rsnd_ssiu_init_gen2(struct rsnd_mod *mod,if (ret <0 )return ret; -if (rsnd_runtime_is_ssi_tdm (io)) { -/* -* TDM Extend Mode -* see -* rsnd_ssi_config_init() -*/ -rsnd_mod_write (mod,SSI_MODE ,0x1 ); - } +/* +* TDM Extend Mode +* see
Quoted 8 lines
sound/soc/sh/rcar/ssiu.c static int rsnd_ssiu_init_gen2(struct rsnd_mod *mod, · line 139
Quoted 4 lines
sound/soc/sh/rcar/ssiu.c +4
-0+* rsnd_ssi_config_init() +*/ +rsnd_mod_write (mod,SSI_MODE , +rsnd_runtime_is_ssi_tdm (io) ?0x1 :0x0 );Thanks for your suggestion,
I will do some test for this change,
if it works fine, I will submit ver2 with it
Thanks
Best regards
---
Kuninori Morimoto