Hi JorgeCas,
Sorry I used the wrong driver before.
Here I attach my changed DTS tree
&i2c2 {
clock-frequency = <400000>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_i2c2>;
status = "okay";
codec: tlv320aic3101@18 {
#sound-dai-cells = <0>;
compatible = "ti,tlv320aic3x";
reg = <0x18>;
AVDD-supply = <&buck4>;
IOVDD-supply = <&buck5>;
DRVDD-supply = <®_audio_pwr>;
DVDD-supply = <&buck5>;
};
};
Then I tried to add TLV320AIC3101 in /sound/soc/fsl/fsl-asoc-card.c
--- a/sound/soc/fsl/fsl-asoc-card.c
+++ b/sound/soc/fsl/fsl-asoc-card.c
@@ -807,6 +807,15 @@ static int fsl_asoc_card_probe(struct platform_device *pdev)
codec_dai_name = "tlv320aic32x4-hifi";
priv->dai_fmt |= SND_SOC_DAIFMT_CBP_CFP;
priv->card_type = CARD_TLV320AIC32X4;
+ } else if (of_device_is_compatible(np, "fsl,imx-audio-tlv320aic3x")) {
+ codec_dai_name = "tlv320aic3x-hifi";
+ priv->dai_fmt |= SND_SOC_DAIFMT_CBS_CFS;
+ priv->dai_link[1].dpcm_capture = 0;
+ priv->dai_link[2].dpcm_capture = 0;
+ priv->cpu_priv.sysclk_dir[TX] = SND_SOC_CLOCK_OUT;
+ priv->cpu_priv.sysclk_dir[RX] = SND_SOC_CLOCK_OUT;
+ 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-tlv320aic31xx")) {
codec_dai_name = "tlv320dac31xx-hifi";
priv->dai_fmt |= SND_SOC_DAIFMT_CBS_CFS;
@@ -1186,6 +1195,7 @@ static const struct of_device_id fsl_asoc_card_dt_ids[] = {
{ .compatible = "fsl,imx-audio-cs42888", },
{ .compatible = "fsl,imx-audio-cs427x", },
{ .compatible = "fsl,imx-audio-tlv320aic32x4", },
+ { .compatible = "fsl,imx-audio-tlv320aic3x", },
{ .compatible = "fsl,imx-audio-tlv320aic31xx", },
{ .compatible = "fsl,imx-audio-sgtl5000", },
{ .compatible = "fsl,imx-audio-wm8962", },
Device Tree
sound-tlv320aic310x {
compatible = "fsl,imx-audio-tlv320aic3x";
model = "tlv320aic3x-hifi";
audio-cpu = <&sai3>;
audio-codec = <&codec>;
audio-routing =
"Headphone Jack", "HPLOUT",
"Headphone Jack", "HPROUT";
mclk-id = <2>;
};
The sound card can also be detected after turning on.
$ cat /proc/asound/cards
0 [audiohdmi ]: audio-hdmi - audio-hdmi
audio-hdmi
1 [tlv320aic3xhifi]: tlv320aic3x-hif - tlv320aic3x-hifi
tlv320aic3x-hifi
When I am trying to play audio
$ aplay -D hw:0 /usr/share/sounds/alsa/Front_Left.wav
I am getting following error :
Playing WAVE '/usr/share/sounds/alsa/Front_Left.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Mono
aplay: set_params:1358: Channels count non available
Where did the error occur?
please help me
Best Regards
Peter