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

Commit be7a7aa6 authored by Vidyakumar Athota's avatar Vidyakumar Athota
Browse files

Documentation: sound: add audio codec documentation



Add missing audio codec documentation for SDM855.

Change-Id: I6975164b5025b3b2a48bdfa7a6102cb302260100
Signed-off-by: default avatarVidyakumar Athota <vathota@codeaurora.org>
parent ae58cec1
Loading
Loading
Loading
Loading
+138 −0
Original line number Diff line number Diff line
Qualcomm Technologies, Inc. WCD GPIO block

This binding describes the GPIO block found in the WCD934X series of
audio codec's from QTI.

- compatible:
	Usage: required
	Value type: <string>
	Definition: must be "qcom,wcd-pinctrl"

- qcom,num-gpios:
	Usage: required
	Value type: <u32>
	Definition: Number of GPIO's supported by the controller

- gpio-controller:
	Usage: required
	Value type: <none>
	Definition: Mark the device node as a GPIO controller

- #gpio-cells:
	Usage: required
	Value type: <u32>
	Definition: Must be 2;
		    the first cell will be used to define gpio number and the
		    second denotes the flags for this gpio

Please refer to ../gpio/gpio.txt for a general description of GPIO bindings.

Please refer to pinctrl-bindings.txt in this directory for details of the
common pinctrl bindings used by client devices, including the meaning of the
phrase "pin configuration node".

The pin configuration nodes act as a container for an arbitrary number of
subnodes. Each of these subnodes represents some desired configuration for a
pin or a list of pins. This configuration can include the
mux function to select on those pin(s), and various pin configuration
parameters, as listed below.


SUBNODES:

The name of each subnode is not important; all subnodes should be enumerated
and processed purely based on their content.

Each subnode only affects those parameters that are explicitly listed. In
other words, a subnode that lists a mux function but no pin configuration
parameters implies no information about any pin configuration parameters.
Similarly, a pin subnode that describes a pullup parameter implies no
information about e.g. the mux function.

The following generic properties as defined in pinctrl-bindings.txt are valid
to specify in a pin configuration subnode:

- pins:
	Usage: required
	Value type: <string-array>
	Definition: List of gpio pins affected by the properties specified in
		    this subnode.  Valid pins are:
		    gpio1-gpio5 for wcd9360

- bias-disable:
	Usage: optional
	Value type: <none>
	Definition: The specified pins should be configured as no pull.

- bias-pull-down:
	Usage: optional
	Value type: <none>
	Definition: The specified pins should be configured as pull down.

- bias-pull-up:
	Usage: optional
	Value type: <empty>
	Definition: The specified pins should be configured as pull up.

- qcom,pull-up-strength:
	Usage: optional
	Value type: <u32>
	Definition: Specifies the strength to use for pull up, if selected.

- bias-high-impedance:
	Usage: optional
	Value type: <none>
	Definition: The specified pins will put in high-Z mode and disabled.

- input-enable:
	Usage: optional
	Value type: <none>
	Definition: The specified pins are put in input mode.

- output-high:
	Usage: optional
	Value type: <none>
	Definition: The specified pins are configured in output mode, driven
		    high.

- output-low:
	Usage: optional
	Value type: <none>
	Definition: The specified pins are configured in output mode, driven
		    low.

- qcom,drive-strength:
	Usage: optional
	Value type: <u32>
	Definition: Selects the drive strength for the specified pins.

Example:

	wcd: wcd_pinctrl@5 {
		compatible = "qcom,wcd-pinctl";
		qcom,num-gpios = <5>;
		gpio-controller;
		#gpio-cells = <2>;

		spkr_1_wcd_en_active: spkr_1_wcd_en_active {
			mux {
				pins = "gpio2";
			};

			config {
				pins = "gpio2";
				output-high;
			};
		};

		spkr_1_wcd_en_sleep: spkr_1_wcd_en_sleep {
			mux {
				pins = "gpio2";
			};

			config {
				pins = "gpio2";
				input-enable;
			};
		};
	};
+146 −8
Original line number Diff line number Diff line
Qualcomm Technologies Inc Audio devices for ALSA sound SoC
Qualcomm Technologies, Inc. Audio devices for ALSA sound SoC

* msm-pcm

@@ -335,16 +335,16 @@ Required properties:

 - compatible :                            "qcom,audio-ref-clk"

 - qcom,audio-ref-clk-gpio  :               PMIC or APQ gpio that will be
 - qcom,codec-ext-clk-src:                  Clock source type like PMIC, LPASS
                                            requested to enable reference
                                            or external clock.

Optional properties:

 - qcom,node_has_rpm_clock:                 Boolean property used to indicate
                                            whether ref. clock can be enabled
                                            with a gpio toggle or Kernel clock
                                            API call.
 - qcom,codec-lpass-ext-clk-freq:           Property used to specify frequency.

 - qcom,codec-lpass-clk-id:                 Property used to specify LPASS clock
                                            ID value.

 - clock-names:                             Name of the PMIC clock that needs
                                            to be enabled for audio ref clock.
@@ -418,6 +418,7 @@ Required properties:
Required properties:

 - compatible :                            "qcom,wcd-dsp-glink"
 - qcom,wdsp-channels:                      List of wdsp supported channel names.

* msm_ext_disp_audio_codec_rx

@@ -662,10 +663,11 @@ Example:

	clock_audio: audio_ext_clk {
		compatible = "qcom,audio-ref-clk";
		qcom,audio-ref-clk-gpios = <&pm8994_gpios 15 0>;
		qcom,codec-ext-clk-src = <2>;
		qcom,codec-lpass-ext-clk-freq = <19200000>;
		qcom,codec-lpass-clk-id = <1>;
		clock-names = "osr_clk";
		clocks = <&clock_rpm clk_div_clk1>;
		qcom,node_has_rpm_clock;
		#clock-cells = <1>;
		pinctrl-names = "sleep", "active";
		pinctrl-0 = <&spkr_i2s_clk_sleep>;
@@ -1035,3 +1037,139 @@ Example of child node that would have qcom,wdsp-cmpnt-dev-name property
	wcd934x_cdc: tavil_codec {
		qcom,wdsp-cmpnt-dev-name = "tavil_codec";
	};

* SDM855 ASoC Machine driver

Required properties:
- compatible : "qcom,sdm855-asoc-snd-pahu"
- qcom,model : The user-visible name of this sound card.
- qcom,pahu-ext-clk-freq : External CLK frequency value for pahu codec
- qcom,audio-routing : A list of the connections between audio components.
- asoc-platform: This is phandle list containing the references to platform device
		 nodes that are used as part of the sound card dai-links.
- asoc-platform-names: This property contains list of platform names. The order of
		       the platform names should match to that of the phandle order
		       given in "asoc-platform".
- asoc-cpu: This is phandle list containing the references to cpu dai device nodes
	    that are used as part of the sound card dai-links.
- asoc-cpu-names: This property contains list of cpu dai names. The order of the
		  cpu dai names should match to that of the phandle order given
		  in "asoc-cpu". The cpu names are in the form of "%s.%d" form,
		  where the id (%d) field represents the back-end AFE port id that
		  this CPU dai is associated with.
- asoc-codec: This is phandle list containing the references to codec dai device
	      nodes that are used as part of the sound card dai-links.
- asoc-codec-names: This property contains list of codec dai names. The order of the
		    codec dai names should match to that of the phandle order given
		    in "asoc-codec".
Optional properties:
- clock-names : clock name defined for external clock.
- clocks : external clock defined for codec clock.
- qcom,wsa-max-devs : Maximum number of WSA881x devices present in the target
- qcom,wsa-devs : List of phandles for all possible WSA881x devices supported for the target
- qcom,wsa-aux-dev-prefix : Name prefix with Left/Right configuration for WSA881x device
- qcom,wcn-btfm : Property to specify if WCN BT/FM chip is used for the target

Example:

	sound-pahu {
		compatible = "qcom,sdm855-asoc-snd-pahu";
		qcom,model = "sdm855-pahu-snd-card";
		qcom,ext-disp-audio-rx;
		qcom,wcn-btfm;
		qcom,mi2s-audio-intf;
		qcom,auxpcm-audio-intf;
		qcom,msm-mi2s-master = <1>, <1>, <1>, <1>;

		reg = <0x1711a000 0x4>,
		      <0x1711b000 0x4>,
		      <0x1711c000 0x4>,
		      <0x1711d000 0x4>;
		reg-names = "lpaif_pri_mode_muxsel",
			    "lpaif_sec_mode_muxsel",
			    "lpaif_tert_mode_muxsel",
			    "lpaif_quat_mode_muxsel";

		qcom,audio-routing =
			"MADINPUT", "MCLK",
			"AMIC2", "MIC BIAS2",
			"AMIC3", "MIC BIAS2",
			"AMIC4", "MIC BIAS2",
			"AMIC5", "MIC BIAS3",
			"MIC BIAS3", "Handset Mic",
			"DMIC0", "MIC BIAS1",
			"MIC BIAS1", "Digital Mic0",
			"DMIC1", "MIC BIAS1",
			"MIC BIAS1", "Digital Mic1",
			"DMIC2", "MIC BIAS3",
			"MIC BIAS3", "Digital Mic2",
			"DMIC3", "MIC BIAS3",
			"MIC BIAS3", "Digital Mic3",
			"DMIC4", "MIC BIAS4",
			"MIC BIAS4", "Digital Mic4",
			"DMIC5", "MIC BIAS4",
			"MIC BIAS4", "Digital Mic5",
			"SpkrLeft IN", "SPK1 OUT",
			"SpkrRight IN", "SPK2 OUT";

		qcom,pahu-ext-clk-freq = <19200000>;
		asoc-platform = <&pcm0>, <&pcm1>, <&pcm2>, <&voip>, <&voice>,
				<&loopback>, <&compress>, <&hostless>,
				<&afe>, <&lsm>, <&routing>, <&cpe>, <&compr>,
				<&pcm_noirq>;
		asoc-platform-names = "msm-pcm-dsp.0", "msm-pcm-dsp.1",
				"msm-pcm-dsp.2", "msm-voip-dsp",
				"msm-pcm-voice", "msm-pcm-loopback",
				"msm-compress-dsp", "msm-pcm-hostless",
				"msm-pcm-afe", "msm-lsm-client",
				"msm-pcm-routing", "msm-cpe-lsm",
				"msm-compr-dsp", "msm-pcm-dsp-noirq";
		asoc-cpu = <&dai_hdmi>, <&dai_dp>,
				<&dai_mi2s0>, <&dai_mi2s1>,
				<&dai_mi2s2>, <&dai_mi2s3>,
				<&dai_pri_auxpcm>, <&dai_sec_auxpcm>,
				<&dai_tert_auxpcm>, <&dai_quat_auxpcm>,
				<&sb_0_rx>, <&sb_0_tx>, <&sb_1_rx>, <&sb_1_tx>,
				<&sb_2_rx>, <&sb_2_tx>, <&sb_3_rx>, <&sb_3_tx>,
				<&sb_4_rx>, <&sb_4_tx>, <&sb_5_tx>,
				<&afe_pcm_rx>, <&afe_pcm_tx>, <&afe_proxy_rx>,
				<&afe_proxy_tx>, <&incall_record_rx>,
				<&incall_record_tx>, <&incall_music_rx>,
				<&incall_music_2_rx>, <&sb_5_rx>, <&sb_6_rx>,
				<&sb_7_rx>, <&sb_7_tx>, <&sb_8_tx>,
				<&usb_audio_rx>, <&usb_audio_tx>,
				<&dai_pri_tdm_rx_0>, <&dai_pri_tdm_tx_0>,
				<&dai_sec_tdm_rx_0>, <&dai_sec_tdm_tx_0>,
				<&dai_tert_tdm_rx_0>, <&dai_tert_tdm_tx_0>,
				<&dai_quat_tdm_rx_0>, <&dai_quat_tdm_tx_0>;
		asoc-cpu-names = "msm-dai-q6-hdmi.8",  "msm-dai-q6-dp.24608",
				"msm-dai-q6-mi2s.0", "msm-dai-q6-mi2s.1",
				"msm-dai-q6-mi2s.2", "msm-dai-q6-mi2s.3",
				"msm-dai-q6-auxpcm.1", "msm-dai-q6-auxpcm.2",
				"msm-dai-q6-auxpcm.3", "msm-dai-q6-auxpcm.4",
				"msm-dai-q6-dev.16384", "msm-dai-q6-dev.16385",
				"msm-dai-q6-dev.16386", "msm-dai-q6-dev.16387",
				"msm-dai-q6-dev.16388", "msm-dai-q6-dev.16389",
				"msm-dai-q6-dev.16390", "msm-dai-q6-dev.16391",
				"msm-dai-q6-dev.16392", "msm-dai-q6-dev.16393",
				"msm-dai-q6-dev.16395", "msm-dai-q6-dev.224",
				"msm-dai-q6-dev.225", "msm-dai-q6-dev.241",
				"msm-dai-q6-dev.240", "msm-dai-q6-dev.32771",
				"msm-dai-q6-dev.32772", "msm-dai-q6-dev.32773",
				"msm-dai-q6-dev.32770", "msm-dai-q6-dev.16394",
				"msm-dai-q6-dev.16396", "msm-dai-q6-dev.16398",
				"msm-dai-q6-dev.16399", "msm-dai-q6-dev.16401",
				"msm-dai-q6-dev.28672", "msm-dai-q6-dev.28673",
				"msm-dai-q6-tdm.36864", "msm-dai-q6-tdm.36865",
				"msm-dai-q6-tdm.36880", "msm-dai-q6-tdm.36881",
				"msm-dai-q6-tdm.36896", "msm-dai-q6-tdm.36897",
				"msm-dai-q6-tdm.36912", "msm-dai-q6-tdm.36913";
		asoc-codec = <&stub_codec>, <&ext_disp_audio_codec>;
		asoc-codec-names = "msm-stub-codec.1",
				   "msm-ext-disp-audio-codec-rx";
		qcom,wsa-max-devs = <2>;
		qcom,wsa-devs = <&wsa881x_0211>, <&wsa881x_0212>,
				<&wsa881x_0213>, <&wsa881x_0214>;
		qcom,wsa-aux-dev-prefix = "SpkrLeft", "SpkrRight",
					  "SpkrLeft", "SpkrRight";
	};
+37 −0
Original line number Diff line number Diff line
Qualcomm Technologies, Inc. WCD audio codec SPI driver support

* wcd_spi

The wcd_spi device can be added as child device node to the audio codec device
node if the audio codec has SPI slave hardware. The codec driver upon probe will
create spi_device and perform spi_add_device. Note that the SPI framework does
not parse this DT node and hence the DT properties defined by SPI framework
cannot be used in wcd_spi device node.

Required properties:

- compatible : "qcom,wcd-spi-v2"

- qcom,master-bus-num : Bus number of the SPI master controller driver. This
			will be used to get a reference to the SPI master.

- qcom,chip-select : Specifies the chip select number used for spi device
		     registration.

- qcom,max-frequency : Specifies the max frequency of the SPI interface.

- qcom,mem-base-addr : Defines the memory base address from the SPI
		       memory map. This will be used as an offset to read
		       and write memory.

Example:

pahu_codec {
	wcd_spi_0: wcd_spi {
		compatible = "qcom,wcd-spi-v2";
		qcom,master-bus-num = <10>;
		qcom,chip-select = <0>;
		qcom,max-frequency = <24000000>;
		qcom,mem-base-addr = <0x100000>;
	};
};
+440 −0

File added.

Preview size limit exceeded, changes collapsed.

+31 −0
Original line number Diff line number Diff line
Qualcomm Technologies, Inc. WCD Codec SoundWire controller

Required properties:

- compatible : should be "qcom,swr-wcd"
- reg : Unique device ID(48 bits) of Soundwire slave device node.
	In the below example, wsa881x is soundwire slave device for
	which the swr-devid is <0x0 0x032000> where 0x03 represents
	device Unique_ID, 0x20 represents Part_Id1 and 0x00
	represents part_Id2.
- #address-cells = <2>;
- #size-cells = <0>;

Optional property:

 Example:
	swr_master {
		compatible = "qcom,swr-wcd";
		#address-cells = <2>;
		#size-cells = <0>;

		wsa881x@32000 {
			compatible = "qcom,wsa881x";
			reg = <0x00 0x032000>;
		};

		wsa881x@42000 {
			compatible = "qcom,wsa881x";
			reg = <0x00 0x042000>;
		};
	};