Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* imx8mn: Trying to get EASRC to work
@ 2023-06-16 19:39 Fabio Estevam
  2023-06-16 20:42 ` Fabio Estevam
  0 siblings, 1 reply; 2+ messages in thread
From: Fabio Estevam @ 2023-06-16 19:39 UTC (permalink / raw)
  To: shengjiu.wang, broonie, daniel.baluta; +Cc: alsa-devel

Hi,

I am working on an imx8mn-based board with an ES9080 codec and I am 
trying to get
EASCR to work. (The ES9080 driver is not upstreamed yet).

Audio playback works fine via simple-audio-card and here are my changes 
to
get EASRC to work:


-	sound-ess {
-		compatible = "simple-audio-card";
-		simple-audio-card,name = "ess-audio";
-		simple-audio-card,format = "left_j";
-		simple-audio-card,frame-master = <&s2cpu>;
-		simple-audio-card,bitclock-master = <&s2cpu>;
-
-		s2cpu: simple-audio-card,cpu {
-			sound-dai = <&sai2>;
-			dai-tdm-slot-num = <8>;
-			dai-tdm-slot-width = <32>;
-		};
-
-		simple-audio-card,codec {
-			sound-dai = <&es9080>;
-		};
+	sound-es9080 {
+		compatible = "fsl,imx-audio-es9080";
+		model = "es9080-with-easrc";
+		audio-cpu = <&sai2>;
+		audio-codec = <&es9080>;
+		audio-asrc = <&easrc>;
  	};
  };

diff --git a/sound/soc/fsl/fsl-asoc-card.c 
b/sound/soc/fsl/fsl-asoc-card.c
index 8d14b5593658..27b8f2c0cd65 100644
--- a/sound/soc/fsl/fsl-asoc-card.c
+++ b/sound/soc/fsl/fsl-asoc-card.c
@@ -624,6 +624,14 @@ static int fsl_asoc_card_probe(struct 
platform_device *pdev)
  		codec_dai_name = "sgtl5000";
  		priv->codec_priv.mclk_id = SGTL5000_SYSCLK;
  		priv->dai_fmt |= SND_SOC_DAIFMT_CBP_CFP;
+	} else if (of_device_is_compatible(np, "fsl,imx-audio-es9080")) {
+		codec_dai_name = "es9080";
+		priv->dai_fmt |= SND_SOC_DAIFMT_CBC_CFC;
+		priv->dai_link[1].dpcm_capture = 0;
+		priv->dai_link[2].dpcm_capture = 0;
+		priv->cpu_priv.slot_width = 32;
+		priv->card.dapm_routes = audio_map_tx;
+		priv->card.num_dapm_routes = ARRAY_SIZE(audio_map_tx);
  	} else if (of_device_is_compatible(np, "fsl,imx-audio-tlv320aic32x4")) 
{
  		codec_dai_name = "tlv320aic32x4-hifi";
  		priv->dai_fmt |= SND_SOC_DAIFMT_CBP_CFP;
@@ -902,6 +910,7 @@ static const struct of_device_id 
fsl_asoc_card_dt_ids[] = {
  	{ .compatible = "fsl,imx-audio-tlv320aic32x4", },
  	{ .compatible = "fsl,imx-audio-tlv320aic31xx", },
  	{ .compatible = "fsl,imx-audio-sgtl5000", },
+	{ .compatible = "fsl,imx-audio-es9080", },
  	{ .compatible = "fsl,imx-audio-wm8962", },
  	{ .compatible = "fsl,imx-audio-wm8960", },
  	{ .compatible = "fsl,imx-audio-mqs", },

The es9080-with-easrc card is registered, but after running 
'speaker-test' no
audio output is present.

Is there a way to use the EASRC driver with the simple-audio-card 
without
touching fsl-asoc-card.c? That would be preferable.

Would you have any suggestions as to what may be missing to get EASRC to 
work?

Thanks,

Fabio Estevam

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: imx8mn: Trying to get EASRC to work
  2023-06-16 19:39 imx8mn: Trying to get EASRC to work Fabio Estevam
@ 2023-06-16 20:42 ` Fabio Estevam
  0 siblings, 0 replies; 2+ messages in thread
From: Fabio Estevam @ 2023-06-16 20:42 UTC (permalink / raw)
  To: shengjiu.wang, broonie, daniel.baluta; +Cc: alsa-devel

On 16/06/2023 16:39, Fabio Estevam wrote:
> Hi,
> 
> I am working on an imx8mn-based board with an ES9080 codec and I am
> trying to get
> EASCR to work. (The ES9080 driver is not upstreamed yet).
> 
> Audio playback works fine via simple-audio-card and here are my changes 
> to
> get EASRC to work:
> 
> 
> -	sound-ess {
> -		compatible = "simple-audio-card";
> -		simple-audio-card,name = "ess-audio";
> -		simple-audio-card,format = "left_j";
> -		simple-audio-card,frame-master = <&s2cpu>;
> -		simple-audio-card,bitclock-master = <&s2cpu>;
> -
> -		s2cpu: simple-audio-card,cpu {
> -			sound-dai = <&sai2>;
> -			dai-tdm-slot-num = <8>;

fsl-asoc-card does not take the number of slots into account.

I have sent a patch adding support for it.

Now I can get audio output and will be running more tests.

Thanks

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-06-16 20:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-16 19:39 imx8mn: Trying to get EASRC to work Fabio Estevam
2023-06-16 20:42 ` Fabio Estevam

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox