[PATCH] ASoC: fsl_sai: remove reset code from dai_probe

Subsystems: freescale soc sound drivers, sound, sound - soc layer / dynamic audio power management (asoc), the rest

STALE1984d

6 messages, 4 authors, 2021-03-19 · open the first message on its own page

[PATCH] ASoC: fsl_sai: remove reset code from dai_probe

From: Shengjiu Wang <hidden>
Date: 2021-03-16 09:41:06

From: Viorel Suman <redacted>

SAI software reset is done in runtime resume,
there is no need to do it in fsl_sai_dai_probe.

Signed-off-by: Viorel Suman <redacted>
Signed-off-by: Shengjiu Wang <redacted>
---
 sound/soc/fsl/fsl_sai.c | 7 -------
 1 file changed, 7 deletions(-)
diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c
index 6ef2ce348232..9e7893f91882 100644
--- a/sound/soc/fsl/fsl_sai.c
+++ b/sound/soc/fsl/fsl_sai.c
@@ -711,13 +711,6 @@ static int fsl_sai_dai_probe(struct snd_soc_dai *cpu_dai)
 	struct fsl_sai *sai = dev_get_drvdata(cpu_dai->dev);
 	unsigned int ofs = sai->soc_data->reg_offset;
 
-	/* Software Reset for both Tx and Rx */
-	regmap_write(sai->regmap, FSL_SAI_TCSR(ofs), FSL_SAI_CSR_SR);
-	regmap_write(sai->regmap, FSL_SAI_RCSR(ofs), FSL_SAI_CSR_SR);
-	/* Clear SR bit to finish the reset */
-	regmap_write(sai->regmap, FSL_SAI_TCSR(ofs), 0);
-	regmap_write(sai->regmap, FSL_SAI_RCSR(ofs), 0);
-
 	regmap_update_bits(sai->regmap, FSL_SAI_TCR1(ofs),
 			   FSL_SAI_CR1_RFW_MASK(sai->soc_data->fifo_depth),
 			   sai->soc_data->fifo_depth - FSL_SAI_MAXBURST_TX);
-- 
2.27.0

Re: [PATCH] ASoC: fsl_sai: remove reset code from dai_probe

From: Mark Brown <broonie@kernel.org>
Date: 2021-03-16 13:00:47

On Tue, Mar 16, 2021 at 05:27:06PM +0800, Shengjiu Wang wrote:
From: Viorel Suman <redacted>

SAI software reset is done in runtime resume,
there is no need to do it in fsl_sai_dai_probe.
People can disable runtime PM in their configurations - do you not still
need a reset on probe in case there's no runtime PM?  It'd probably make
sense to factor the rest code out itno a function though.

Re: [PATCH] ASoC: fsl_sai: remove reset code from dai_probe

From: Shengjiu Wang <shengjiu.wang@gmail.com>
Date: 2021-03-16 13:34:28

On Tue, Mar 16, 2021 at 9:01 PM Mark Brown [off-list ref] wrote:
On Tue, Mar 16, 2021 at 05:27:06PM +0800, Shengjiu Wang wrote:
quoted
From: Viorel Suman <redacted>

SAI software reset is done in runtime resume,
there is no need to do it in fsl_sai_dai_probe.
People can disable runtime PM in their configurations - do you not still
need a reset on probe in case there's no runtime PM?  It'd probably make
sense to factor the rest code out itno a function though.
Right, didn't consider the case of disable runtime PM.
Will move the reset code to a function.

Best regards
wang shengjiu

RE: [PATCH] ASoC: fsl_sai: remove reset code from dai_probe

From: Viorel Suman <hidden>
Date: 2021-03-16 13:43:32

On Tue, Mar 16, 2021 at 05:27:06PM +0800, Shengjiu Wang wrote:
quoted
From: Viorel Suman <redacted>

SAI software reset is done in runtime resume, there is no need to do
it in fsl_sai_dai_probe.
People can disable runtime PM in their configurations - do you not still need a
reset on probe in case there's no runtime PM?  It'd probably make sense to
factor the rest code out itno a function though.
Hi Mark, Shengjiu,

To me it makes sense to manage the clocks and reset from the same place.
Currently we have the clocks management moved completely into runtime PM
fsl_sai_runtime_resume and fsl_sai_runtime_suspend callbacks. 

/Viorel

Re: [PATCH] ASoC: fsl_sai: remove reset code from dai_probe

From: Mark Brown <broonie@kernel.org>
Date: 2021-03-16 13:51:33

On Tue, Mar 16, 2021 at 01:42:40PM +0000, Viorel Suman wrote:
To me it makes sense to manage the clocks and reset from the same place.
Currently we have the clocks management moved completely into runtime PM
fsl_sai_runtime_resume and fsl_sai_runtime_suspend callbacks. 
Usually the pattern is to have probe() leave everything powered up then
let runtime PM power things down if it's enabled, you can often do the
power up by having an open coded call to the resume callback in probe().

Re: [PATCH] ASoC: fsl_sai: remove reset code from dai_probe

From: Shengjiu Wang <shengjiu.wang@gmail.com>
Date: 2021-03-19 04:12:48

Hi Mark

On Tue, Mar 16, 2021 at 9:51 PM Mark Brown [off-list ref] wrote:
On Tue, Mar 16, 2021 at 01:42:40PM +0000, Viorel Suman wrote:
quoted
To me it makes sense to manage the clocks and reset from the same place.
Currently we have the clocks management moved completely into runtime PM
fsl_sai_runtime_resume and fsl_sai_runtime_suspend callbacks.
Usually the pattern is to have probe() leave everything powered up then
let runtime PM power things down if it's enabled, you can often do the
power up by having an open coded call to the resume callback in probe().
It seems some drivers very depend on runtime PM, if the CONFIG_PM=n,
the drivers should not work.  What's the strategy for this?
Do we need to support both cases, or only one case is also acceptable?

Best regards
Wang Shengjiu
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help