/dts-v1/;
/plugin/;

/* Device Tree Overlay for I2S audio output to Raspberry Pi
*/

/ {
    compatible = "brcm,bcm2708";

    fragment@0 {
        target = <&sound>;
        __overlay__ {

            compatible = "simple-audio-card";
            simple-audio-card,name = "Spectrum Next DAC";
			
            status="okay";

            playback_link: simple-audio-card,dai-link@1 {
                format = "i2s";
				
                bitclock-master = <&codec_out>;
                frame-master = <&codec_out>;

                p_cpu_dai: cpu {
                    sound-dai = <&i2s>;

					/* TDM slot configuration - BCLK ratio: 64 x Fs (2 x 32 bit) */
                    dai-tdm-slot-num = <2>;
                    dai-tdm-slot-width = <32>;

                };

                p_codec_dai: codec {
                    sound-dai = <&codec_out>;
                };
            };
        };
    };

    fragment@1 {
        target-path = "/";
        __overlay__ {
            codec_out: spdif-transmitter {
                #address-cells = <0>;
                #size-cells = <0>;
                #sound-dai-cells = <0>;
                compatible = "linux,spdif-dit";
                status = "okay";
            };
        };
    };

    fragment@2 {
        target = <&i2s>;
        __overlay__ {
            #sound-dai-cells = <0>;
            status = "okay";
        };
    };
};
