I2s-out overlay to enable i2s0

For whatever reason, I got it working now.
My DT so far:

   i2s_tdm: i2s@ff300000 {
            compatible = "rockchip,rk3308-i2s-tdm";
            reg = < 0x00 0xff300000 0x00 0x1000 >;
            interrupts = < 0x00 0x30 0x04 >;
            clocks = < 0x02 0x4c 0x02 0x4e 0x02 0xa4 0x02 0x6e 0x02 0x6f 0x02 0x03 0x02 0x04 >;
            clock-names = "mclk_tx\0mclk_rx\0hclk\0mclk_tx_src\0mclk_rx_src\0mclk_root0\0mclk_root1";
            dmas = < 0x25 0x00 0x25 0x01 >;
            dma-names = "tx\0rx";
            resets = < 0x02 0x89 0x02 0x8a >;
            reset-names = "tx-m\0rx-m";
            rockchip,cru = < 0x02 >;
            rockchip,grf = < 0x4b >;
            rockchip,mclk-calibrate;
            pinctrl-names = "default";
            pinctrl-0 = < 0x4e 0x4f 0x50 0x51 0x52 0x53 0x54 0x55 0x56 0x57 0x58 0x59 0x5a >;
            status = "okay";
            rockchip,clk-trm = <1>;
            rockchip,bclk-fs = <128>;
            #sound-dai-cells = <0>;
            phandle = < 0xbe >;
    };

   tdm_sound {
            compatible = "simple-audio-card";
            simple-audio-card,name = "rockpis-tdm";
            simple-audio-card,format = "dsp_b";
            simple-audio-card,mclk-fs = < 128 >;
            simple-audio-card,bitclock-master = <&tdm_snd_cpu>;
            simple-audio-card,frame-master = <&tdm_snd_cpu>;
            status = "okay";

            tdm_snd_cpu: simple-audio-card,cpu {
                dai-tdm-slot-num = <8>;
                dai-tdm-slot-width = <16>;
                sound-dai = <&i2s_tdm>;
            };

            tdm_snd_codec: simple-audio-card,codec {
                sound-dai = <&dummy_tdm_codec>;
            };
    };

    dummy_tdm_codec: dummy-codec {
            status = "okay";
            compatible = "rockchip,dummy-codec";
            #sound-dai-cells = < 0x00 >;
            phandle = < 0x139 >;
    };

I have check that with speaker-test -c 8 -s [1-8] to see that all channels run independently.
Saw on logic analyser:
Clock: 6.144 Mhz
Sync: 48Khz

Only the channels seems to mixed up between speaker-test and the position on tdm. but this can be changed by alsa settings.

Hurra. Now I have drink a box of beer and hopefully radxa pay it :smile::beers:

1 Like