Re: [PATCH] ASoC: fsl_xcvr: refine the requested phy clock frequency

2023-11-23 Thread Iuliana Prodan

On 11/23/2023 3:14 AM, Shengjiu Wang wrote:

As the input phy clock frequency will divided by 2 by default
on i.MX8MP with the implementation of clk-imx8mp-audiomix driver,
So the requested frequency need to be updated.

The relation of phy clock is:
 sai_pll_ref_sel
sai_pll
   sai_pll_bypass
  sai_pll_out
 sai_pll_out_div2
earc_phy_cg

Signed-off-by: Shengjiu Wang 


Reviewed-by: Iuliana Prodan 

Thanks,
Iulia


---
  sound/soc/fsl/fsl_xcvr.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/fsl/fsl_xcvr.c b/sound/soc/fsl/fsl_xcvr.c
index 77f8e2394bf9..f0fb33d719c2 100644
--- a/sound/soc/fsl/fsl_xcvr.c
+++ b/sound/soc/fsl/fsl_xcvr.c
@@ -358,7 +358,7 @@ static int fsl_xcvr_en_aud_pll(struct fsl_xcvr *xcvr, u32 
freq)
struct device *dev = >pdev->dev;
int ret;
  
-	freq = xcvr->soc_data->spdif_only ? freq / 10 : freq;

+   freq = xcvr->soc_data->spdif_only ? freq / 5 : freq;
clk_disable_unprepare(xcvr->phy_clk);
ret = clk_set_rate(xcvr->phy_clk, freq);
if (ret < 0) {
@@ -409,7 +409,7 @@ static int fsl_xcvr_prepare(struct snd_pcm_substream 
*substream,
bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK;
u32 m_ctl = 0, v_ctl = 0;
u32 r = substream->runtime->rate, ch = substream->runtime->channels;
-   u32 fout = 32 * r * ch * 10 * 2;
+   u32 fout = 32 * r * ch * 10;
int ret = 0;
  
  	switch (xcvr->mode) {


Re: [PATCH] ASoC: fsl_sai: Fix pins setting for i.MX8QM platform

2023-04-19 Thread Iuliana Prodan

On 4/18/2023 12:42 PM, Chancel Liu wrote:

SAI on i.MX8QM platform supports the data lines up to 4. So the pins
setting should be corrected to 4.

Fixes: eba0f0077519 ("ASoC: fsl_sai: Enable combine mode soft")
Signed-off-by: Chancel Liu 
---


Reviewed-by: Iuliana Prodan 

Thanks,
Iulia


  sound/soc/fsl/fsl_sai.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c
index 07d13dca852e..abdaffb00fbd 100644
--- a/sound/soc/fsl/fsl_sai.c
+++ b/sound/soc/fsl/fsl_sai.c
@@ -1544,7 +1544,7 @@ static const struct fsl_sai_soc_data fsl_sai_imx8qm_data 
= {
.use_imx_pcm = true,
.use_edma = true,
.fifo_depth = 64,
-   .pins = 1,
+   .pins = 4,
.reg_offset = 0,
.mclk0_is_mclk1 = false,
.flags = 0,


Re: [PATCH] ASoC: fsl: Simplify an error message

2023-04-17 Thread Iuliana Prodan

On 4/16/2023 9:29 AM, Christophe JAILLET wrote:

dev_err_probe() already display the error code. There is no need to
duplicate it explicitly in the error message.

Signed-off-by: Christophe JAILLET 


Reviewed-by: Iuliana Prodan 

Thanks,
Iulia


---
  sound/soc/fsl/fsl-asoc-card.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/fsl/fsl-asoc-card.c b/sound/soc/fsl/fsl-asoc-card.c
index bffa1048d31e..40870668ee24 100644
--- a/sound/soc/fsl/fsl-asoc-card.c
+++ b/sound/soc/fsl/fsl-asoc-card.c
@@ -858,7 +858,7 @@ static int fsl_asoc_card_probe(struct platform_device *pdev)
  
  	ret = devm_snd_soc_register_card(>dev, >card);

if (ret) {
-   dev_err_probe(>dev, ret, "snd_soc_register_card failed: 
%d\n", ret);
+   dev_err_probe(>dev, ret, "snd_soc_register_card 
failed\n");
goto asrc_fail;
}
  


Re: [PATCH] ASoC: fsl_sai: fix getting version from VERID

2023-02-07 Thread Iuliana Prodan

On 2/7/2023 11:04 AM, Shengjiu Wang wrote:

The version information is at the bit31 ~ bit16 in the VERID
register, so need to right shift 16bit to get it, otherwise
the result of comparison "sai->verid.version >= 0x0301" is
wrong.

Fixes: 99c1e74f25d4 ("ASoC: fsl_sai: store full version instead of major/minor")
Signed-off-by: Shengjiu Wang 
---
  sound/soc/fsl/fsl_sai.c | 1 +
  1 file changed, 1 insertion(+)

diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c
index c365afd6c4ea..1b197478b3d9 100644
--- a/sound/soc/fsl/fsl_sai.c
+++ b/sound/soc/fsl/fsl_sai.c
@@ -1142,6 +1142,7 @@ static int fsl_sai_check_version(struct device *dev)
  
  	sai->verid.version = val &

(FSL_SAI_VERID_MAJOR_MASK | FSL_SAI_VERID_MINOR_MASK);
+   sai->verid.version >>= FSL_SAI_VERID_MINOR_SHIFT;
sai->verid.feature = val & FSL_SAI_VERID_FEATURE_MASK;
  
  	ret = regmap_read(sai->regmap, FSL_SAI_PARAM, );



I would put the version in one line, but probably is easier to read this 
way.
Also, please explain, in commit message, what and from where is 0x0301 - 
might worth adding a macro for this, in another commit, of course.

Otherwise,

Reviewed-by: Iuliana Prodan 



Re: [PATCH] ASoC: fsl_sai: initialize is_dsp_mode flag

2023-01-16 Thread Iuliana Prodan

On 1/16/2023 9:07 AM, Shengjiu Wang wrote:

Initialize is_dsp_mode flag in the beginning of function
fsl_sai_set_dai_fmt_tr().

When the DAIFMT is DAIFMT_DSP_B the first time, is_dsp_mode is
true, then the second time DAIFMT is DAIFMT_I2S, is_dsp_mode
still true, which is a wrong state. So need to initialize
is_dsp_mode flag every time.

Fixes: a3f7dcc9cc03 ("ASoC: fsl-sai: Add SND_SOC_DAIFMT_DSP_A/B support.")
Signed-off-by: Shengjiu Wang 


Reviewed-by: Iuliana Prodan 

Thanks,

Iulia


---
  sound/soc/fsl/fsl_sai.c | 1 +
  1 file changed, 1 insertion(+)

diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c
index 1c9be8a5dcb1..355ef29af48c 100644
--- a/sound/soc/fsl/fsl_sai.c
+++ b/sound/soc/fsl/fsl_sai.c
@@ -281,6 +281,7 @@ static int fsl_sai_set_dai_fmt_tr(struct snd_soc_dai 
*cpu_dai,
val_cr4 |= FSL_SAI_CR4_MF;
  
  	sai->is_pdm_mode = false;

+   sai->is_dsp_mode = false;
/* DAI mode */
switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
case SND_SOC_DAIFMT_I2S: