18c2ecf20Sopenharmony_ciNXP Audio Mixer (AUDMIX).
28c2ecf20Sopenharmony_ci
38c2ecf20Sopenharmony_ciThe Audio Mixer is a on-chip functional module that allows mixing of two
48c2ecf20Sopenharmony_ciaudio streams into a single audio stream. Audio Mixer has two input serial
58c2ecf20Sopenharmony_ciaudio interfaces. These are driven by two Synchronous Audio interface
68c2ecf20Sopenharmony_cimodules (SAI). Each input serial interface carries 8 audio channels in its
78c2ecf20Sopenharmony_ciframe in TDM manner. Mixer mixes audio samples of corresponding channels
88c2ecf20Sopenharmony_cifrom two interfaces into a single sample. Before mixing, audio samples of
98c2ecf20Sopenharmony_citwo inputs can be attenuated based on configuration. The output of the
108c2ecf20Sopenharmony_ciAudio Mixer is also a serial audio interface. Like input interfaces it has
118c2ecf20Sopenharmony_cithe same TDM frame format. This output is used to drive the serial DAC TDM
128c2ecf20Sopenharmony_ciinterface of audio codec and also sent to the external pins along with the
138c2ecf20Sopenharmony_cireceive path of normal audio SAI module for readback by the CPU.
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_ciThe output of Audio Mixer can be selected from any of the three streams
168c2ecf20Sopenharmony_ci - serial audio input 1
178c2ecf20Sopenharmony_ci - serial audio input 2
188c2ecf20Sopenharmony_ci - mixed audio
198c2ecf20Sopenharmony_ci
208c2ecf20Sopenharmony_ciMixing operation is independent of audio sample rate but the two audio
218c2ecf20Sopenharmony_ciinput streams must have same audio sample rate with same number of channels
228c2ecf20Sopenharmony_ciin TDM frame to be eligible for mixing.
238c2ecf20Sopenharmony_ci
248c2ecf20Sopenharmony_ciDevice driver required properties:
258c2ecf20Sopenharmony_ci=================================
268c2ecf20Sopenharmony_ci  - compatible		: Compatible list, contains "fsl,imx8qm-audmix"
278c2ecf20Sopenharmony_ci
288c2ecf20Sopenharmony_ci  - reg			: Offset and length of the register set for the device.
298c2ecf20Sopenharmony_ci
308c2ecf20Sopenharmony_ci  - clocks		: Must contain an entry for each entry in clock-names.
318c2ecf20Sopenharmony_ci
328c2ecf20Sopenharmony_ci  - clock-names		: Must include the "ipg" for register access.
338c2ecf20Sopenharmony_ci
348c2ecf20Sopenharmony_ci  - power-domains	: Must contain the phandle to AUDMIX power domain node
358c2ecf20Sopenharmony_ci
368c2ecf20Sopenharmony_ci  - dais		: Must contain a list of phandles to AUDMIX connected
378c2ecf20Sopenharmony_ci			  DAIs. The current implementation requires two phandles
388c2ecf20Sopenharmony_ci			  to SAI interfaces to be provided, the first SAI in the
398c2ecf20Sopenharmony_ci			  list being used to route the AUDMIX output.
408c2ecf20Sopenharmony_ci
418c2ecf20Sopenharmony_ciDevice driver configuration example:
428c2ecf20Sopenharmony_ci======================================
438c2ecf20Sopenharmony_ci  audmix: audmix@59840000 {
448c2ecf20Sopenharmony_ci    compatible = "fsl,imx8qm-audmix";
458c2ecf20Sopenharmony_ci    reg = <0x0 0x59840000 0x0 0x10000>;
468c2ecf20Sopenharmony_ci    clocks = <&clk IMX8QXP_AUD_AUDMIX_IPG>;
478c2ecf20Sopenharmony_ci    clock-names = "ipg";
488c2ecf20Sopenharmony_ci    power-domains = <&pd_audmix>;
498c2ecf20Sopenharmony_ci    dais = <&sai4>, <&sai5>;
508c2ecf20Sopenharmony_ci  };
51