Re: [RFC PATCH] ASoC: fsl: Add Audio Mixer CPU DAI driver

From: Viorel Suman
Date: Thu Jan 03 2019 - 08:48:22 EST


Hi Rob,

On Vi, 2018-12-28 at 17:32 -0600, Rob Herring wrote:
> On Tue, Dec 18, 2018 at 04:30:01PM +0000, Viorel Suman wrote:
> >
> > This patch implements Audio Mixer CPU DAI driver for NXP iMX8 SOCs.
> > The Audio Mixer is a on-chip functional module that allows mixing
> > of
> > two audio streams into a single audio stream.
> >
> > Audio Mixer datasheet is available here:
> > https://www.nxp.com/docs/en/reference-manual/IMX8DQXPRM.pdf
> >
> > Signed-off-by: Viorel Suman <viorel.suman@xxxxxxx>
> > ---
> > Â.../devicetree/bindings/sound/fsl,amix.txtÂÂÂÂÂÂÂÂÂ|ÂÂ45 ++
> This should be a separate patch.

Ok, thank you, will split this into several patches.

>
> >
> > Âsound/soc/fsl/KconfigÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ|ÂÂÂ7 +
> > Âsound/soc/fsl/MakefileÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ|ÂÂÂ3 +
> > Âsound/soc/fsl/fsl_amix.cÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ| 554
> > +++++++++++++++++++++
> > Âsound/soc/fsl/fsl_amix.hÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ| 101 ++++
> > Â5 files changed, 710 insertions(+)
> > Âcreate mode 100644
> > Documentation/devicetree/bindings/sound/fsl,amix.txt
> > Âcreate mode 100644 sound/soc/fsl/fsl_amix.c
> > Âcreate mode 100644 sound/soc/fsl/fsl_amix.h
> >
> > diff --git a/Documentation/devicetree/bindings/sound/fsl,amix.txt
> > b/Documentation/devicetree/bindings/sound/fsl,amix.txt
> > new file mode 100644
> > index 0000000..049144f
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/sound/fsl,amix.txt
> > @@ -0,0 +1,45 @@
> > +NXP Audio Mixer (AMIX).
> > +
> > +The Audio Mixer is a on-chip functional module that allows mixing
> > of two
> > +audio streams into a single audio stream. Audio Mixer has two
> > input serial
> > +audio interfaces. These are driven by two Synchronous Audio
> > interface
> > +modules (SAI). Each input serial interface carries 8 audio
> > channels in its
> > +frame in TDM manner. Mixer mixes audio samples of corresponding
> > channels
> > +from two interfaces into a single sample. Before mixing, audio
> > samples of
> > +two inputs can be attenuated based on configuration. The output of
> > the
> > +Audio Mixer is also a serial audio interface. Like input
> > interfaces it has
> > +the same TDM frame format. This output is used to drive the serial
> > DAC TDM
> > +interface of audio codec and also sent to the external pins along
> > with the
> > +receive path of normal audio SAI module for readback by the CPU.
> > +
> > +The output of Audio mixer can be selected from any of the three
> > streams
> > + - serial audio input 1
> > + - serial audio input 2
> > + - Mixed audio
> > +
> > +Mixing operation is independent of audio sample rate but the two
> > audio
> > +input streams must have same audio sample rate with same number of
> > channels
> > +in TDM frame to be eligible for mixing.
> > +
> > +Device driver required properties:
> > +=================================
> > +ÂÂ- compatible : Compatible list, contains
> > "fsl,imx8qm-amix"
> > +
> > +ÂÂ- reg : Offset and length of the register
> > set for the device.
> > +
> > +ÂÂ- clocks : Must contain an entry for each entry
> > in clock-names.
> > +
> > +ÂÂ- clock-names : Must include the "ipg" for
> > register access.
> Humm, no audio related clocks?

Right, no audio related clocks - Audio Mixer operates on the clocks
supplied by input Synchronous Audio Interfaces.

> Â
>
> >
> > +
> > +ÂÂ- power-domains : Must contain the phandle to the AMIX
> > power domain node
> > +
> > +Device driver configuration example:
> > +======================================
> > +ÂÂamix: amix@59840000 {
> > +ÂÂÂÂcompatible = "fsl,imx8qm-amix";
> > +ÂÂÂÂreg = <0x0 0x59840000 0x0 0x10000>;
> > +ÂÂÂÂclocks = <&clk IMX8QXP_AUD_AMIX_IPG>;
> > +ÂÂÂÂclock-names = "ipg";
> > +ÂÂÂÂpower-domains = <&pd_amix>;
> > +ÂÂ};
> > +

Regards,
Viorel