AnsweredAssumed Answered

TLV320AIC3256 and MX6DL on Linux 4.9 kernel question

Question asked by GregT on Apr 23, 2018
Latest reply on May 12, 2018 by GregT

Hello,

 

I'm converting an audio driver composed of two modules from linux 3.0 to the latest linux 4.9 for the MX6 and having some difficulties.  Attached are the two versions of the file.  The first three are the linux 3.0 and the second three are for the linux 4.9.  The codec is a TLV320aic3256 connected to an MX6DL. I tried to minimize the differences and the 4.9 does compile and I can insmod it and have it recognize and initialize the TLV320AIC3256 but get no audio when running aplay.  One of the main issues I'm trying to resolve is how to enable the SSI2 using the device tree that was done in a board file on the linux 3.0 kernel.  I noticed in the CCGR 0x20c470c that the SSI2 clock was not enabled. The  board file has some code below.  Below that are my device tree entries.  Has anyone converted a board file into a device tree for the MX6DL SSI?

 

static struct imx_ssi_platform_data mx6_gpb_ssi_pdata = {
.flags = IMX_SSI_DMA | IMX_SSI_SYN,
};

static struct mxc_audio_platform_data mx6_gpb_audio_data = {
.ssi_num = 1,
.src_port = 2,
.ext_port = 6,
.init = mx6_gpb_aic3256_init,
.hp_gpio = -1,
};

 

mxc_register_device(&mx6_gpb_audio_device, &mx6_gpb_audio_data);

imx6q_add_imx_ssi(0, &mx6_gpb_ssi_pdata);

 

ssi2_clk = clk_get_sys("imx-ssi.1", NULL); // ssi2 is imx-ssi.1 (confusing huh)
if (IS_ERR(ssi2_clk)) {
pr_err("Error can't get ssi2_clk clock imx-ssi.1\n");
}

 

 

//// DEVICE TREE ENTRIES 

pinctrl_audmux: audmuxgrp {
fsl,pins = <
MX6QDL_PAD_DI0_PIN15__AUD6_TXC 0x130b0
MX6QDL_PAD_DI0_PIN3__AUD6_TXFS 0x130b0
MX6QDL_PAD_DI0_PIN2__AUD6_TXD 0x120b0
MX6QDL_PAD_DI0_PIN4__AUD6_RXD 0x130b0
MX6QDL_PAD_CSI0_MCLK__CCM_CLKO1 0x130b0
>;
};

 

sound {
compatible = "fsl,imx-audio-tlv320aic3256";
model = "tlv320aic3256";
cpu-dai = <&ssi2>;
ssi-controller = <&ssi2>;
sysclk = <4096000>;
audio-codec = <&tlv320aic3256>;
mux-int-port = <2>;
mux-ext-port = <6>;
};

 

soundmux {
compatible = "fsl,imx-audio-tlv320aic3256", "fsl,imx31-audmux";
reg = <0x021d8000 0x4000>;
};

 

tlv320aic3256: codec@18 {
compatible = "ti,aic3256";
reg = <0x18>;
ldoin-supply = <&reg_3p3v>;
iov-supply = <&reg_3p3v>;
sysclk = <4096000>;
clocks = <&clks 201>;
clock-names = "mclk";
resetn-gpio = GP_AUDIO_EN;
};

 

&ssi2 {
fsl,mode = "i2s-slave";
codec-handle = <&tlv320aic3256>;
status = "okay";
};

Outcomes