Device tree configuration for SGTL5000 audio codec

Noted @amrbekhit. Will do so

Dear @amrbekhit,

we could get our hands in a SGTL5000 breakout board and we could test some configurations, and I believe we got a working solution.

In the dts you sent us, you don’t need to set all of the SAI3 node but just only the newly set pinctrl:

 &sai3 {
     #sound-dai-cells = <0>;
     pinctrl-names = "default";
     pinctrl-0 = <&pinctrl_sai3>;
     status = "okay";
 };

With this we got the following:

root@colibri-imx6ull:~# dmesg | grep sgtl
[    2.347243] sgtl5000 0-000a: sgtl5000 revision 0x11
[    2.359041] sgtl5000 0-000a: Using internal LDO instead of VDDD: check ER1
[    2.430388] imx-sgtl5000 sound: sgtl5000 <-> 2030000.sai mapping ok
[    5.915902]   #0: imx-audio-sgtl5000

Kindly try and let us know.

I’ve also changed the pinmux values of the pins to the ones used in the Apalis iMX6:

pinctrl_sai3: sai3grp {
             fsl,pins = <
                 MX6UL_PAD_LCD_DATA13__SAI3_TX_BCLK 0x130b0  //X1 54 - SCK
                 MX6UL_PAD_LCD_ENABLE__SAI3_TX_SYNC 0x130b0  //x1 52 - WS
                 MX6UL_PAD_LCD_DATA15__SAI3_TX_DATA 0x130b0  //X1 64 - SDIN
                 MX6UL_PAD_LCD_DATA14__SAI3_RX_DATA 0x130b0  //X1 66 - SDOUT
                 MX6UL_PAD_LCD_DATA09__SAI3_MCLK 0x130b0 	//X1 48
             >;
         };

Thanks and regards, Alvaro.

@alvaro.tx Thanks very much for your help, it’s working now. In addition to the wiring issue, it looks like the fsl,sai-mclk-direction-output; entry in the device tree was causing issues.

Dear @amrbekhit , many thanks for the positive confirmation! Not sure if you will be using any internal clocks at the end, but it should be possible with the proper configuration.