AnsweredAssumed Answered

Audio codec interfacing issue with NXP's i.mx6ULL EVK SAI3

Question asked by Sri Shan on May 20, 2018
Latest reply on May 28, 2018 by Sri Shan

Dear Technical support team,

 

Firstly I would like to thank for all your quick responses for my queries posted adn really appreciate the same.

 

I am using NXP i.MX6ULL EVK with NXP's fsl-yocto-L4.9.11_1.0.0.tar yocto BSP's, and trying to interface with TLV320AIC3105 using SAI3 interface, as part of the initial audio codec bringup am unable to get the playback up and running (unable to get MCLK, BCLK, LRCLK and data on SAI_TXD_LCD_DATA15), with SAI3 port being configured as I2S port to TLV320AIC3105 with I2C2 as the control interface

 

I have even tried following the below community links which uses SSI interfaces, I also tried using WM8960 as the reference it didn't help me,

 

https://community.nxp.com/thread/323017
https://community.nxp.com/thread/380454
https://community.nxp.com/thread/454745
https://community.nxp.com/thread/462200
https://community.nxp.com/message/970452?commentID=970452#comment-970452
http://lists.infradead.org/pipermail/linux-arm-kernel/2014-September/286072.html

 

Mainly I am unable to verify the i2c read/write transfers to TLV320AIC3105 with 4.7k pullup resistors being added

 

1. Could you please let me know how the i2c controller module/ i2c adapter driver can be tested?, I tried the attached devmem2 it failed to work

 

root@imx6ull14x14evk:/# devmem2 0x21A0000
/dev/mem opened.
Error at line 86, file devmem2.c (1) [Operation not permitted]
root@imx6ull14x14evk:/#

 

whereas, I was able to access other register using devmem for example as shown below
root@imx6ull14x14evk:/# devmem2 0x21EC08C w 0x00008200
/dev/mem opened.
Memory mapped at address 0x76f80000.
Value at address 0x21EC08C (0x76f8008c): 0x8000
Written 0x8200; readback 0x8000  

 

2. As part of the first stage bringup can the I2c read/write can be verified with just only the reset and i2c_scl and i2c SDA using i2c tools -  ie., i2cdetect, i2cset, i2cget, i2cdump without connecting MCLK, BCLK, LRCLK, and DATA_IN and DATA_out from processor?

 

3. If we are interfacing when only with SAI3 interface, do we really need to consider asrc-controller = <&asrc>; and gpr = <&gpr 4 0x100000 0x100000>; related configuration?? as I have not included this configuration in my DTS and machine driver file?

 

4. Where can I find SAI related register info in I.mX6ull technical refernce manual?

 

5. When I type amixer I see, "amixer: Mixer default load error: No such device or address" may I know whay am seeing this issue?

 

6.  Could you please help me to provide with solutions for the issue numbers listed below?

 

7. Could you please verify the machine driver file attached and confirm whether that works for fsl-yocto-L4.9.11?

 

I have hereby attached the device tree file, machine driver file and codec driver file and the portion of the schematics and devmem2 appln for directly read and write to the I2C2 controller module and SAI3 controller module

 


DT configuration:

 

    pinctrl_sai3: sai3grp {
        fsl,pins = <
            MX6UL_PAD_LCD_DATA13__SAI3_TX_BCLK      0x130b0
            MX6UL_PAD_LCD_DATA12__SAI3_TX_SYNC      0x130b0
            MX6UL_PAD_LCD_DATA15__SAI3_TX_DATA      0x110b0
            MX6UL_PAD_LCD_DATA14__SAI3_RX_DATA      0x130b0
            MX6UL_PAD_LCD_DATA09__SAI3_MCLK            0x130b0
        >;
    };

 


    pinctrl_i2c2: i2c2grp {
        fsl,pins = <
            MX6UL_PAD_UART5_TX_DATA__I2C2_SCL 0x4001b8b0
            MX6UL_PAD_UART5_RX_DATA__I2C2_SDA 0x4001b8b0
        >;
    };

 

/*TO BE CHECKED LATER*/
        reg_3p3v: regulator@2 {
            compatible = "regulator-fixed";
            reg = <2>;
            regulator-name = "3P3V";
            regulator-min-microvolt = <3300000>;
            regulator-max-microvolt = <3300000>;
            regulator-boot-on;
            regulator-always-on;
        };

 

        reg_1p8v: regulator@3 {
            compatible = "regulator-fixed";
            reg = <0>;
            regulator-name = "1P8V";
            regulator-min-microvolt = <1800000>;
            regulator-max-microvolt = <1800000>;
            regulator-boot-on;
            regulator-always-on;
        };
    };

 

    sound {
        compatible = "fsl,imx-audio-tlv320";
        model = "imx-tlv320";
        cpu-dai = <&sai3>;
        audio-codec = <&tlv320aic3105>;
        /*asrc-controller = <&asrc>;*/        /*TO BE CHECKED LATER */
        /*codec-master;*/                     /*TO BE CHECKED LATER */
        /*gpr = <&gpr 4 0x100000 0x100000>;*/     /*TO BE CHECKED LATER */
        audio-routing =

 

                "Headphone Jack",    "HPLOUT",
                "Headphone Jack",    "HPROUT",
                "LINE1L",        "Mic Jack",
                "LINE2L",        "Mic Jack";

 

        /*mux-int-port = <2>;*/            /*TO BE CHECKED LATER */
        /*mux-ext-port = <5>; */        /*TO BE CHECKED LATER */
    };

 

&i2c2 {
    clock_frequency = <100000>;
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_i2c2>;
    status = "okay";

 

    codec: wm8960@1a {
        compatible = "wlf,wm8960";
        reg = <0x1a>;
        clocks = <&clks IMX6UL_CLK_SAI2>;
        clock-names = "mclk";
        wlf,shared-lrclk;
    };

 

    tlv320aic3105: tlv320aic3x@18 {
        compatible = "ti,tlv320aic3x";
        reg = <0x18>;
        gpio-reset = <&gpio5 4 GPIO_ACTIVE_LOW>;
        clocks = <&clks IMX6UL_CLK_SAI3>;
        ai3x-micbias-vg = <2>;     /* MICBIAS_2_5V */
        /* clock-names = "mclk"; */                 /*TO BE CHECKED LATER*/
        status = "okay";

 

        clock-frequency = <12000000>;               /*TO BE CHECKED LATER*/
        /* Regulators */
        DRVDD-supply = <&reg_3p3v>;                 /*TO BE CHECKED LATER*/
        AVDD-supply = <&reg_3p3v>;                  /*TO BE CHECKED LATER*/
        IOVDD-supply = <&reg_3p3v>;                 /*TO BE CHECKED LATER*/
        DVDD-supply = <&reg_1p8v>;                  /*TO BE CHECKED LATER*/
    };

 

logs:

 

root@imx6ull14x14evk:/# i2cdetect -y -a -r 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00: 00 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- UU -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
root@imx6ull14x14evk:/# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: imxtlv320 [imx-tlv320], device 0: HiFi tlv320aic3x-hifi-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
root@imx6ull14x14evk:/#
root@imx6ull14x14evk:/# aplay -Dplughw:0,0 a2002011001-e02-8kHz.wav
Playing WAVE 'a2002011001-e02-8kHz.wav' : Signed 16 bit Little Entlv320aic3x-codec 1-0018: Unable to sync registers 0x1-0x2. -11 -------------------> ISSUE NO. 1
dian, Rate 8000 Hz, Stereo
aplay: pcm_write:2023: write error: Input/output error
root@imx6ull14x14evk:/#
root@imx6ull14x14evk:/# aplay a2002011001-e02-8kHz.wav                                                                                         
tlv320aic3x-codec 1-0018: Unable to sync registers 0x4-0x8. -6 -----------------------------------------------> ISSUE NO. 2
Playing WAVE 'a2002011001-e02-8kHz.wav' : Signed 16 bit Little Endian, Rate 8000 Hz, Stereo
^CAborted by signal Interrupt...
aplay: pcm_write:2023: write error: Interrupted system call
root@imx6ull14x14evk:/#
root@imx6ull14x14evk:/#
root@imx6ull14x14evk:/# amixer
amixer: Mixer default load error: No such device or address --------------------------------------------------------------> ISSUE NO. 3
root@imx6ull14x14evk:/#
root@imx6ull14x14evk:/# i2cget -f -y 1 0x18 0x5 --------------------------------------------------------------> ISSUE NO. 4
Error: Read failed
 
root@imx6ull14x14evk:/# cat /proc/asound/cards
 0 [imxtlv320      ]: imx-tlv320 - imx-tlv320
                      imx-tlv320
root@imx6ull14x14evk:/# cat /proc/asound/devices
  0: [ 0]   : control
 16: [ 0- 0]: digital audio playback                    
 24: [ 0- 0]: digital audio capture                     
 33:        : timer                                    
root@imx6ull14x14evk:/# cat /proc/asound/card0/id       
imxtlv320                                               
root@imx6ull14x14evk:/#
root@imx6ull14x14evk:/# i2cdump -f -y 1 0x18 --------------------------------------------------------------> ISSUE NO. 5
No size specified (using byte-data access)
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f    0123456789abcdef
00: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX    XXXXXXXXXXXXXXXX
10: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX    XXXXXXXXXXXXXXXX
20: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX    XXXXXXXXXXXXXXXX
30: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX    XXXXXXXXXXXXXXXX
40: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX    XXXXXXXXXXXXXXXX
50: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX    XXXXXXXXXXXXXXXX
60: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX    XXXXXXXXXXXXXXXX
70: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX    XXXXXXXXXXXXXXXX
80: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX    XXXXXXXXXXXXXXXX
90: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX    XXXXXXXXXXXXXXXX
a0: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX    XXXXXXXXXXXXXXXX
b0: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX    XXXXXXXXXXXXXXXX
c0: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX    XXXXXXXXXXXXXXXX
d0: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX    XXXXXXXXXXXXXXXX
e0: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX    XXXXXXXXXXXXXXXX
f0: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX    XXXXXXXXXXXXXXXX
root@imx6ull14x14evk:/#

 


Kindly do the needful, as early as possible, as I am stuck with this from past two weeks wondering whether I can really get clues from anywhere?
Eagerly Many thanks in advance,

Attachments

Outcomes