The SPDIF transmitter is a self-clocking, serial, unidirectional interface for the interconnection of digital audio equipment for consumer and professional applications, using linear PCM coded audio samples.

You can refer to rk3288-based board which has SPDIF interface related hardware design ,such as rk3288-firefly board.

By following simple configuration, you can make spdif work normall in your own board.

1、Ensure that the config file has the below option to ensure that the SPDIF related code can be compiled into kernel zImage.


2、Enable the SPDIF node in DTS file of target board:

sound {
        compatible = "simple-audio-card";
        simple-audio-card,name = "SPDIF";
        simple-audio-card,dai-link@1 {
            cpu { sound-dai = <&spdif>; };
            codec { sound-dai = <&spdif_out>; };

    spdif_out: spdif-out {
        compatible = "linux,spdif-dit";
        #sound-dai-cells = <0>;

        &spdif {
          status = "okay";

3、Test,Rebuild and Flash kernel, we can use aplay command in the console

root@linaro-alip:~# aplay -l                                                         
**** List of PLAYBACK Hardware Devices ****
card 0: SPDIF [SPDIF], device 0: ff8b0000.sound-dit-hifi dit-hifi-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0

You can download the test audio from your network, or through the link we provide: password: waty

root@linaro-alip:~# aplay 250Hz_44100Hz_16bit_30sec.wav 
Playing WAVE '250Hz_44100Hz_16bit_30sec.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Mono

Now you will hear the sound on the SPDIF device.