xref: /openbmc/linux/Documentation/devicetree/bindings/sound/fsl,asrc.txt (revision 4b4193256c8d3bc3a5397b5cd9494c2ad386317d)
13117bb31SNicolin ChenFreescale Asynchronous Sample Rate Converter (ASRC) Controller
23117bb31SNicolin Chen
33117bb31SNicolin ChenThe Asynchronous Sample Rate Converter (ASRC) converts the sampling rate of a
43117bb31SNicolin Chensignal associated with an input clock into a signal associated with a different
53117bb31SNicolin Chenoutput clock. The driver currently works as a Front End of DPCM with other Back
63117bb31SNicolin ChenEnds Audio controller such as ESAI, SSI and SAI. It has three pairs to support
73117bb31SNicolin Chenthree substreams within totally 10 channels.
83117bb31SNicolin Chen
93117bb31SNicolin ChenRequired properties:
103117bb31SNicolin Chen
118441f87eSShengjiu Wang  - compatible		: Compatible list, should contain one of the following
128441f87eSShengjiu Wang			  compatibles:
138441f87eSShengjiu Wang			  "fsl,imx35-asrc",
148441f87eSShengjiu Wang			  "fsl,imx53-asrc",
158441f87eSShengjiu Wang			  "fsl,imx8qm-asrc",
168441f87eSShengjiu Wang			  "fsl,imx8qxp-asrc",
173117bb31SNicolin Chen
183117bb31SNicolin Chen  - reg			: Offset and length of the register set for the device.
193117bb31SNicolin Chen
203117bb31SNicolin Chen  - interrupts		: Contains the spdif interrupt.
213117bb31SNicolin Chen
223117bb31SNicolin Chen  - dmas		: Generic dma devicetree binding as described in
233117bb31SNicolin Chen			  Documentation/devicetree/bindings/dma/dma.txt.
243117bb31SNicolin Chen
253117bb31SNicolin Chen  - dma-names		: Contains "rxa", "rxb", "rxc", "txa", "txb" and "txc".
263117bb31SNicolin Chen
273117bb31SNicolin Chen  - clocks		: Contains an entry for each entry in clock-names.
283117bb31SNicolin Chen
293117bb31SNicolin Chen  - clock-names		: Contains the following entries
303117bb31SNicolin Chen	"mem"		  Peripheral access clock to access registers.
313117bb31SNicolin Chen	"ipg"		  Peripheral clock to driver module.
323117bb31SNicolin Chen	"asrck_<0-f>"	  Clock sources for input and output clock.
3313b8a97aSShengjiu Wang	"spba"		  The spba clock is required when ASRC is placed as a
3413b8a97aSShengjiu Wang			  bus slave of the Shared Peripheral Bus and when two
3513b8a97aSShengjiu Wang			  or more bus masters (CPU, DMA or DSP) try to access
3613b8a97aSShengjiu Wang			  it. This property is optional depending on the SoC
3713b8a97aSShengjiu Wang			  design.
383117bb31SNicolin Chen
393117bb31SNicolin Chen   - fsl,asrc-rate	: Defines a mutual sample rate used by DPCM Back Ends.
403117bb31SNicolin Chen
413117bb31SNicolin Chen   - fsl,asrc-width	: Defines a mutual sample width used by DPCM Back Ends.
423117bb31SNicolin Chen
438441f87eSShengjiu Wang   - fsl,asrc-clk-map   : Defines clock map used in driver. which is required
448441f87eSShengjiu Wang			  by imx8qm/imx8qxp platform
458441f87eSShengjiu Wang			  <0> - select the map for asrc0 in imx8qm/imx8qxp
468441f87eSShengjiu Wang			  <1> - select the map for asrc1 in imx8qm/imx8qxp
478441f87eSShengjiu Wang
489ff3036aSFabio EstevamOptional properties:
499ff3036aSFabio Estevam
509ff3036aSFabio Estevam   - big-endian		: If this property is absent, the little endian mode
519ff3036aSFabio Estevam			  will be in use as default. Otherwise, the big endian
529ff3036aSFabio Estevam			  mode will be in use for all the device registers.
539ff3036aSFabio Estevam
54*b84b4c9aSShengjiu Wang   - fsl,asrc-format	: Defines a mutual sample format used by DPCM Back
55*b84b4c9aSShengjiu Wang			  Ends, which can replace the fsl,asrc-width.
56*b84b4c9aSShengjiu Wang			  The value is 2 (S16_LE), or 6 (S24_LE).
57*b84b4c9aSShengjiu Wang
583117bb31SNicolin ChenExample:
593117bb31SNicolin Chen
6048c926cdSMarco Franchiasrc: asrc@2034000 {
613117bb31SNicolin Chen	compatible = "fsl,imx53-asrc";
623117bb31SNicolin Chen	reg = <0x02034000 0x4000>;
633117bb31SNicolin Chen	interrupts = <0 50 IRQ_TYPE_LEVEL_HIGH>;
643117bb31SNicolin Chen	clocks = <&clks 107>, <&clks 107>, <&clks 0>,
653117bb31SNicolin Chen	       <&clks 0>, <&clks 0>, <&clks 0>, <&clks 0>,
663117bb31SNicolin Chen	       <&clks 0>, <&clks 0>, <&clks 0>, <&clks 0>,
673117bb31SNicolin Chen	       <&clks 0>, <&clks 0>, <&clks 0>, <&clks 0>,
683117bb31SNicolin Chen	       <&clks 107>, <&clks 0>, <&clks 0>;
693117bb31SNicolin Chen	clock-names = "mem", "ipg", "asrck0",
703117bb31SNicolin Chen		"asrck_1", "asrck_2", "asrck_3", "asrck_4",
713117bb31SNicolin Chen		"asrck_5", "asrck_6", "asrck_7", "asrck_8",
723117bb31SNicolin Chen		"asrck_9", "asrck_a", "asrck_b", "asrck_c",
733117bb31SNicolin Chen		"asrck_d", "asrck_e", "asrck_f";
743117bb31SNicolin Chen	dmas = <&sdma 17 23 1>, <&sdma 18 23 1>, <&sdma 19 23 1>,
753117bb31SNicolin Chen	     <&sdma 20 23 1>, <&sdma 21 23 1>, <&sdma 22 23 1>;
763117bb31SNicolin Chen	dma-names = "rxa", "rxb", "rxc",
773117bb31SNicolin Chen		"txa", "txb", "txc";
783117bb31SNicolin Chen	fsl,asrc-rate  = <48000>;
793117bb31SNicolin Chen	fsl,asrc-width = <16>;
803117bb31SNicolin Chen};
81