Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit aa07e38b authored by Mark Brown's avatar Mark Brown
Browse files

Merge branch 'asoc-4.22' into asoc-5.0

parents bfeffd15 540f1ba7
Loading
Loading
Loading
Loading
+0 −123
Original line number Diff line number Diff line
Audio-Graph-SCU-Card:

Audio-Graph-SCU-Card is "Audio-Graph-Card" + "ALSA DPCM".

It is based on common bindings for device graphs.
see ${LINUX}/Documentation/devicetree/bindings/graph.txt

Basically, Audio-Graph-SCU-Card property is same as
Simple-Card / Simple-SCU-Card / Audio-Graph-Card.
see ${LINUX}/Documentation/devicetree/bindings/sound/simple-card.txt
    ${LINUX}/Documentation/devicetree/bindings/sound/simple-scu-card.txt
    ${LINUX}/Documentation/devicetree/bindings/sound/audio-graph-card.txt

Below are same as Simple-Card / Audio-Graph-Card.

- label
- dai-format
- frame-master
- bitclock-master
- bitclock-inversion
- frame-inversion
- dai-tdm-slot-num
- dai-tdm-slot-width
- clocks / system-clock-frequency

Below are same as Simple-SCU-Card.

- convert-rate
- convert-channels
- prefix
- routing

Required properties:

- compatible				: "audio-graph-scu-card";
- dais					: list of CPU DAI port{s}

Example 1. Sampling Rate Conversion

	sound_card {
		compatible = "audio-graph-scu-card";

		label = "sound-card";
		prefix = "codec";
		routing = "codec Playback", "DAI0 Playback",
			  "DAI0 Capture",   "codec Capture";
		convert-rate = <48000>;

		dais = <&cpu_port>;
	};

	audio-codec {
		...

		port {
			codec_endpoint: endpoint {
				remote-endpoint = <&cpu_endpoint>;
			};
		};
	};

	dai-controller {
		...
		cpu_port: port {
			cpu_endpoint: endpoint {
				remote-endpoint = <&codec_endpoint>;

				dai-format = "left_j";
				...
			};
		};
	};

Example 2. 2 CPU 1 Codec (Mixing)

	sound_card {
		compatible = "audio-graph-scu-card";

		label = "sound-card";
		routing = "codec Playback", "DAI0 Playback",
			  "codec Playback", "DAI1 Playback",
			  "DAI0 Capture",   "codec Capture";

		dais = <&cpu_port0
			&cpu_port1>;
	};

	audio-codec {
		...

		audio-graph-card,prefix = "codec";
		audio-graph-card,convert-rate = <48000>;
		port {
			codec_endpoint0: endpoint {
				remote-endpoint = <&cpu_endpoint0>;
			};
			codec_endpoint1: endpoint {
				remote-endpoint = <&cpu_endpoint1>;
			};
		};
	};

	dai-controller {
		...
		ports {
			cpu_port0: port {
				cpu_endpoint0: endpoint {
					remote-endpoint = <&codec_endpoint0>;

					dai-format = "left_j";
					...
				};
			};
			cpu_port1: port {
				cpu_endpoint1: endpoint {
					remote-endpoint = <&codec_endpoint1>;

					dai-format = "left_j";
					...
				};
			};
		};
	};
+22 −0
Original line number Diff line number Diff line
Cirrus Logic CS4341 audio DAC

This device supports both I2C and SPI (configured with pin strapping
on the board).

Required properties:
  - compatible: "cirrus,cs4341a"
  - reg : the I2C address of the device for I2C, the chip select
          number for SPI.

For required properties on I2C-bus, please consult
Documentation/devicetree/bindings/i2c/i2c.txt
For required properties on SPI-bus, please consult
Documentation/devicetree/bindings/spi/spi-bus.txt

Example:
	codec: cs4341@0 {
		#sound-dai-cells = <0>;
		compatible = "cirrus,cs4341a";
		reg = <0>;
		spi-max-frequency = <6000000>;
	};
+17 −0
Original line number Diff line number Diff line
@@ -45,6 +45,23 @@ Optional properties:
- fck_parent : Should contain a valid clock name which will be used as parent
	       for the McASP fck

Optional GPIO support:
If any McASP pin need to be used as GPIO then the McASP node must have:
...
  gpio-controller
  #gpio-cells = <2>;
...

When requesting a GPIO, the first parameter is the PIN index in McASP_P*
registers.
For example to request the AXR2 pin of mcasp8:
function-gpios = <&mcasp8 2 0>;

Or to request the ACLKR pin of mcasp8:
function-gpios = <&mcasp8 29 0>;

For generic gpio information, please refer to bindings/gpio/gpio.txt

Example:

mcasp0: mcasp0@1d00000 {
+23 −0
Original line number Diff line number Diff line
* Rockchip Rk3328 internal codec

Required properties:

- compatible: "rockchip,rk3328-codec"
- reg: physical base address of the controller and length of memory mapped
  region.
- rockchip,grf: the phandle of the syscon node for GRF register.
- clocks: a list of phandle + clock-specifer pairs, one for each entry in clock-names.
- clock-names: should be "pclk".
- spk-depop-time-ms: speak depop time msec.

Example for rk3328 internal codec:

codec: codec@ff410000 {
	compatible = "rockchip,rk3328-codec";
	reg = <0x0 0xff410000 0x0 0x1000>;
	rockchip,grf = <&grf>;
	clocks = <&cru PCLK_ACODEC>;
	clock-names = "pclk";
	spk-depop-time-ms = 100;
	status = "disabled";
};
+0 −94
Original line number Diff line number Diff line
ASoC Simple SCU Sound Card

Simple SCU Sound Card is "Simple Sound Card" + "ALSA DPCM".
For example, you can use this driver if you want to exchange sampling rate convert,
Mixing, etc...

Required properties:

- compatible				: "simple-scu-audio-card"
					  "renesas,rsrc-card"
Optional properties:

- simple-audio-card,name		: see simple-audio-card.txt
- simple-audio-card,cpu			: see simple-audio-card.txt
- simple-audio-card,codec		: see simple-audio-card.txt

Optional subnode properties:

- simple-audio-card,format		: see simple-audio-card.txt
- simple-audio-card,frame-master	: see simple-audio-card.txt
- simple-audio-card,bitclock-master	: see simple-audio-card.txt
- simple-audio-card,bitclock-inversion	: see simple-audio-card.txt
- simple-audio-card,frame-inversion	: see simple-audio-card.txt
- simple-audio-card,convert-rate	: platform specified sampling rate convert
- simple-audio-card,convert-channels	: platform specified converted channel size (2 - 8 ch)
- simple-audio-card,prefix		: see routing
- simple-audio-card,widgets		: Please refer to widgets.txt.
- simple-audio-card,routing		: A list of the connections between audio components.
					  Each entry is a pair of strings, the first being the connection's sink,
					  the second being the connection's source. Valid names for sources.
					  use audio-prefix if some components is using same sink/sources naming.
					  it can be used if compatible was "renesas,rsrc-card";

Required CPU/CODEC subnodes properties:

- sound-dai				: see simple-audio-card.txt

Optional CPU/CODEC subnodes properties:

- clocks / system-clock-frequency	: see simple-audio-card.txt

Example 1. Sampling Rate Conversion

sound {
	compatible = "simple-scu-audio-card";

	simple-audio-card,name = "rsnd-ak4643";
	simple-audio-card,format = "left_j";
	simple-audio-card,bitclock-master = <&sndcodec>;
	simple-audio-card,frame-master = <&sndcodec>;

	simple-audio-card,convert-rate = <48000>;

	simple-audio-card,prefix = "ak4642";
	simple-audio-card,routing = "ak4642 Playback", "DAI0 Playback",
			"DAI0 Capture", "ak4642 Capture";

	sndcpu: simple-audio-card,cpu {
		sound-dai = <&rcar_sound>;
	};

	sndcodec: simple-audio-card,codec {
		sound-dai = <&ak4643>;
		system-clock-frequency = <11289600>;
	};
};

Example 2. 2 CPU 1 Codec (Mixing)

sound {
	compatible = "simple-scu-audio-card";

	simple-audio-card,name = "rsnd-ak4643";
	simple-audio-card,format = "left_j";
	simple-audio-card,bitclock-master = <&dpcmcpu>;
	simple-audio-card,frame-master = <&dpcmcpu>;

	simple-audio-card,routing = "ak4642 Playback", "DAI0 Playback",
			"ak4642 Playback", "DAI1 Playback";

	dpcmcpu: cpu@0 {
		sound-dai = <&rcar_sound 0>;
	};

	cpu@1 {
		sound-dai = <&rcar_sound 1>;
	};

	codec {
		prefix = "ak4642";
		sound-dai = <&ak4643>;
		clocks = <&audio_clock>;
	};
};
Loading