* [PATCH] ASoC: fsl_sai: remove reset code from dai_probe
@ 2021-03-16 9:27 Shengjiu Wang
2021-03-16 12:58 ` Mark Brown
0 siblings, 1 reply; 6+ messages in thread
From: Shengjiu Wang @ 2021-03-16 9:27 UTC (permalink / raw)
To: timur, nicoleotsuka, Xiubo.Lee, festevam, lgirdwood, broonie,
perex, tiwai, alsa-devel, linuxppc-dev, linux-kernel
From: Viorel Suman <viorel.suman@nxp.com>
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 <viorel.suman@nxp.com>
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
---
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
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] ASoC: fsl_sai: remove reset code from dai_probe
2021-03-16 9:27 [PATCH] ASoC: fsl_sai: remove reset code from dai_probe Shengjiu Wang
@ 2021-03-16 12:58 ` Mark Brown
2021-03-16 13:33 ` Shengjiu Wang
2021-03-16 13:42 ` Viorel Suman
0 siblings, 2 replies; 6+ messages in thread
From: Mark Brown @ 2021-03-16 12:58 UTC (permalink / raw)
To: Shengjiu Wang
Cc: timur, nicoleotsuka, Xiubo.Lee, festevam, lgirdwood, perex,
tiwai, alsa-devel, linuxppc-dev, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 422 bytes --]
On Tue, Mar 16, 2021 at 05:27:06PM +0800, Shengjiu Wang wrote:
> From: Viorel Suman <viorel.suman@nxp.com>
>
> 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.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 484 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] ASoC: fsl_sai: remove reset code from dai_probe
2021-03-16 12:58 ` Mark Brown
@ 2021-03-16 13:33 ` Shengjiu Wang
2021-03-16 13:42 ` Viorel Suman
1 sibling, 0 replies; 6+ messages in thread
From: Shengjiu Wang @ 2021-03-16 13:33 UTC (permalink / raw)
To: Mark Brown
Cc: Shengjiu Wang, alsa-devel, Timur Tabi, Xiubo Li, linuxppc-dev,
Takashi Iwai, Liam Girdwood, Nicolin Chen, Fabio Estevam,
linux-kernel
On Tue, Mar 16, 2021 at 9:01 PM Mark Brown <broonie@kernel.org> wrote:
>
> On Tue, Mar 16, 2021 at 05:27:06PM +0800, Shengjiu Wang wrote:
> > From: Viorel Suman <viorel.suman@nxp.com>
> >
> > 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
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [PATCH] ASoC: fsl_sai: remove reset code from dai_probe
2021-03-16 12:58 ` Mark Brown
2021-03-16 13:33 ` Shengjiu Wang
@ 2021-03-16 13:42 ` Viorel Suman
2021-03-16 13:49 ` Mark Brown
1 sibling, 1 reply; 6+ messages in thread
From: Viorel Suman @ 2021-03-16 13:42 UTC (permalink / raw)
To: Mark Brown, S.j. Wang
Cc: alsa-devel, timur, Xiubo.Lee, linuxppc-dev, tiwai, lgirdwood,
nicoleotsuka, festevam, linux-kernel
> On Tue, Mar 16, 2021 at 05:27:06PM +0800, Shengjiu Wang wrote:
> > From: Viorel Suman <viorel.suman@nxp.com>
> >
> > 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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] ASoC: fsl_sai: remove reset code from dai_probe
2021-03-16 13:42 ` Viorel Suman
@ 2021-03-16 13:49 ` Mark Brown
2021-03-19 4:10 ` Shengjiu Wang
0 siblings, 1 reply; 6+ messages in thread
From: Mark Brown @ 2021-03-16 13:49 UTC (permalink / raw)
To: Viorel Suman
Cc: S.j. Wang, alsa-devel, timur, Xiubo.Lee, linuxppc-dev, tiwai,
lgirdwood, nicoleotsuka, festevam, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 504 bytes --]
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().
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] ASoC: fsl_sai: remove reset code from dai_probe
2021-03-16 13:49 ` Mark Brown
@ 2021-03-19 4:10 ` Shengjiu Wang
0 siblings, 0 replies; 6+ messages in thread
From: Shengjiu Wang @ 2021-03-19 4:10 UTC (permalink / raw)
To: Mark Brown
Cc: Viorel Suman, alsa-devel, timur, Xiubo.Lee, festevam, S.j. Wang,
tiwai, lgirdwood, nicoleotsuka, linuxppc-dev, linux-kernel
Hi Mark
On Tue, Mar 16, 2021 at 9:51 PM Mark Brown <broonie@kernel.org> wrote:
>
> 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().
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
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2021-03-19 4:12 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-16 9:27 [PATCH] ASoC: fsl_sai: remove reset code from dai_probe Shengjiu Wang
2021-03-16 12:58 ` Mark Brown
2021-03-16 13:33 ` Shengjiu Wang
2021-03-16 13:42 ` Viorel Suman
2021-03-16 13:49 ` Mark Brown
2021-03-19 4:10 ` Shengjiu Wang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).