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

Commit fa7c7254 authored by Rohit Kumar's avatar Rohit Kumar
Browse files

ASoC: msm: Add support for sdm670 soundcard



Add compatible string for sdm670 soundcard in
machine driver.

CRs-Fixed: 2071065
Change-Id: I72ffc74a0b5b4535baa3c8aaf12a9363e5bc7e68
Signed-off-by: default avatarRohit Kumar <rohitkr@codeaurora.org>
parent 70be28c9
Loading
Loading
Loading
Loading
+253 −0
Original line number Diff line number Diff line
@@ -2579,3 +2579,256 @@ Example:
		qcom,wsa-aux-dev-prefix = "SpkrLeft", "SpkrRight",
					  "SpkrLeft", "SpkrRight";
	};

* SDM670 ASoC Machine driver

Required properties:
- compatible : "qcom,sdm670-asoc-snd"
- qcom,model : The user-visible name of this sound card.
- qcom,msm-hs-micbias-type : This property is used to recognize the headset
  micbias type, internal or external.
- qcom,msm-mbhc-hphl-swh: This property is used to distinguish headset HPHL
switch type on target typically the switch type will be normally open or
normally close, value for this property 0 for normally close and 1 for
normally open.
-  qcom,msm-mbhc-gnd-swh: This property is used to distinguish headset GND
switch type on target typically the switch type will be normally open or
normally close, value for this property 0 for normally close and 1 for
normally open.
- qcom,audio-routing : A list of the connections between audio components.
- qcom,msm-gpios : Lists down all the gpio sets that are supported.
- qcom,pinctrl-names : Lists all the possible combinations of the gpio sets
mentioned in qcom,msm-gpios.
- pinctrl-names : The combinations of gpio sets from above that are supported in
the flavor.
- pinctrl-# : Pinctrl states as mentioned in pinctrl-names.

Optional properties:
- qcom,cdc-us-euro-gpios : GPIO on which gnd/mic swap signal is coming.
- qcom,msm-micbias1-ext-cap : Boolean. Enable micbias1 external
capacitor mode.
- qcom,msm-micbias2-ext-cap : Boolean. Enable micbias2 external
capacitor mode.
- qcom,wsa-disable : Boolean. Disables WSA speaker dailinks from sound node.
- qcom,msm-spk-ext-pa : GPIO which enables external speaker pa.
- qcom,msm-mclk-freq : This property is used to inform machine driver about
mclk frequency needs to be configured for internal and external PA.
- 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.
- 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".
- 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,cdc-pdm-gpios : phandle for pdm gpios.
- qcom,cdc-comp-gpios : phandle for compander gpios.
- qcom,cdc-dmic-gpios : phandle for Digital mic clk and data gpios.
- qcom,cdc-sdw-gpios : phandle for soundwire clk and data gpios.
- qcom,msm-mbhc-moist-cfg: This property is used to set moisture detection
		threshold values for different codecs. First parameter is V(voltage)
		second one is i(current), third one is r (resistance). Depending on the
		codec set corresponding element in array and set others to 0.

Example:
	 sound {
		compatible = "qcom,sdm670-asoc-snd";
		qcom,model = "sdm670-snd-card";
		qcom,msm-mclk-freq = <9600000>;
		qcom,msm-mbhc-hphl-swh = <0>;
		qcom,msm-mbhc-gnd-swh = <0>;
		qcom,msm-hs-micbias-type = "internal";
		qcom,msm-micbias1-ext-cap;
		qcom,audio-routing =
			"RX_BIAS", "MCLK",
			"SPK_RX_BIAS", "MCLK",
			"INT_LDO_H", "MCLK",
			"MIC BIAS External", "Handset Mic",
			"MIC BIAS Internal2", "Headset Mic",
			"MIC BIAS External", "Secondary Mic",
			"AMIC1", "MIC BIAS External",
			"AMIC2", "MIC BIAS Internal2",
			"AMIC3", "MIC BIAS External";
		qcom,cdc-us-euro-gpios = <&msm_gpio 63 0>;
		qcom,cdc-pdm-gpios = <&cdc_pdm_gpios>;
		qcom,cdc-comp-gpios = <&cdc_comp_gpios>;
		qcom,cdc-dmic-gpios = <&cdc_dmic_gpios>;
		qcom,cdc-sdw-gpios = <&cdc_sdw_gpios>;
		asoc-platform = <&pcm0>, <&pcm1>, <&voip>, <&voice>,
				<&loopback>, <&compress>, <&hostless>,
				<&afe>, <&lsm>, <&routing>, <&lpa>;
		asoc-platform-names = "msm-pcm-dsp.0", "msm-pcm-dsp.1",
				"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-pcm-lpa";
		asoc-cpu = <&dai_pri_auxpcm>, <&dai_hdmi>,
				<&dai_mi2s0>, <&dai_mi2s1>, <&dai_mi2s2>, <&dai_mi2s3>,
				<&sb_0_rx>, <&sb_0_tx>, <&sb_1_rx>, <&sb_1_tx>,
				<&sb_3_rx>, <&sb_3_tx>, <&sb_4_rx>, <&sb_4_tx>,
				<&bt_sco_rx>, <&bt_sco_tx>, <&int_fm_rx>, <&int_fm_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>;
		asoc-cpu-names = "msm-dai-q6-auxpcm.1", "msm-dai-q6-hdmi.8",
				"msm-dai-q6-mi2s.0", "msm-dai-q6-mi2s.1",
				"msm-dai-q6-mi2s.2", "msm-dai-q6-mi2s.3",
				"msm-dai-q6-dev.16384", "msm-dai-q6-dev.16385",
				"msm-dai-q6-dev.16386", "msm-dai-q6-dev.16387",
				"msm-dai-q6-dev.16390", "msm-dai-q6-dev.16391",
				"msm-dai-q6-dev.16392", "msm-dai-q6-dev.16393",
				"msm-dai-q6-dev.12288", "msm-dai-q6-dev.12289",
				"msm-dai-q6-dev.12292", "msm-dai-q6-dev.12293",
				"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";
		asoc-codec = <&stub_codec>;
		asoc-codec-names = "msm-stub-codec.1";
		qcom,wsa-max-devs = <2>;
		qcom,wsa-devs = <&wsa881x_211>, <&wsa881x_212>,
				<&wsa881x_213>, <&wsa881x_214>;
		qcom,wsa-aux-dev-prefix = "SpkrRight", "SpkrLeft",
					  "SpkrRight", "SpkrLeft";
	};

* SDM670 ASoC Slimbus Machine driver

Required properties:
- compatible : "qcom,sdm670-asoc-snd-tasha" for tasha codec,
		"qcom,sdm670-asoc-snd-tavil" for tavil codec.
- qcom,model : The user-visible name of this sound card.
- qcom,msm-mclk-freq : MCLK frequency value for external codec
- qcom,msm-gpios : Lists down all the gpio sets that are supported.
- qcom,pinctrl-names : Lists all the possible combinations of the gpio sets
mentioned in qcom,msm-gpios. Say we have 2^N combinations for N GPIOs,
this would list all the 2^N combinations.
- pinctrl-names : The combinations of gpio sets from above that are supported in
the flavor. This can be sometimes same as qcom, pinctrl-names i.e with 2^N
combinations or will have less incase if some combination is not supported.
- pinctrl-# : Pinctrl states as mentioned in pinctrl-names.
- 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:
- qcom,cdc-us-euro-gpios : GPIO on which gnd/mic swap signal is coming.
- 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

Example:

	sound-9335 {
	compatible = "qcom,sdm670-asoc-snd-tasha";
	qcom,model = "sdm670-tasha-snd-card";

	qcom,audio-routing =
		"RX_BIAS", "MCLK",
		"LDO_H", "MCLK",
		"AIF4 MAD", "MCLK",
		"ultrasound amp", "LINEOUT1",
		"ultrasound amp", "LINEOUT3",
		"AMIC1", "MIC BIAS1 Internal1",
		"MIC BIAS1 Internal1", "Handset Mic",
		"AMIC2", "MIC BIAS2 External",
		"MIC BIAS2 External", "Headset Mic",
		"AMIC3", "MIC BIAS2 External",
		"MIC BIAS2 External", "ANCRight Headset Mic",
		"AMIC4", "MIC BIAS2 External",
		"MIC BIAS2 External", "ANCLeft Headset Mic",
		"DMIC1", "MIC BIAS1 External",
		"MIC BIAS1 External", "Digital Mic1",
		"DMIC2", "MIC BIAS1 External",
		"MIC BIAS1 External", "Digital Mic2",
		"DMIC3", "MIC BIAS3 External",
		"MIC BIAS3 External", "Digital Mic3",
		"DMIC4", "MIC BIAS3 External",
		"MIC BIAS3 External", "Digital Mic4",
		"DMIC5", "MIC BIAS4 External",
		"MIC BIAS4 External", "Digital Mic5",
		"DMIC6", "MIC BIAS4 External",
		"MIC BIAS4 External", "Digital Mic6";

		qcom,msm-mbhc-hphl-swh = <0>;
		qcom,msm-mbhc-gnd-swh = <0>;
		qcom,msm-mclk-freq = <9600000>;
		qcom,msm-gpios =
			"slim",
			"us_eu_gpio";
		qcom,pinctrl-names =
			"all_off",
			"slim_act",
			"us_eu_gpio_act",
			"slim_us_eu_gpio_act";
		pinctrl-names =
			"all_off",
			"slim_act",
			"us_eu_gpio_act",
			"slim_us_eu_gpio_act";
		pinctrl-0 = <&cdc_slim_lines_sus &cross_conn_det_sus>;
		pinctrl-1 = <&cdc_slim_lines_act &cross_conn_det_sus>;
		pinctrl-2 = <&cdc_slim_lines_sus &cross_conn_det_act>;
		pinctrl-3 = <&cdc_slim_lines_act &cross_conn_det_act>;
		qcom,cdc-us-euro-gpios = <&msm_gpio 63 0>;
		asoc-platform = <&pcm0>, <&pcm1>, <&pcm2>, <&voip>, <&voice>,
				<&loopback>, <&compress>, <&hostless>,
				<&afe>, <&lsm>, <&routing>, <&cpe>, <&compr>;
		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";
		asoc-cpu = <&dai_hdmi>,
				<&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>;
		asoc-cpu-names = "msm-dai-q6-hdmi.8",
				"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";
		asoc-codec = <&stub_codec>;
		asoc-codec-names = "msm-stub-codec.1";
		qcom,wsa-max-devs = <2>;
		qcom,wsa-devs = <&wsa881x_211>, <&wsa881x_212>,
				<&wsa881x_213>, <&wsa881x_214>;
		qcom,wsa-aux-dev-prefix = "SpkrRight", "SpkrLeft",
					  "SpkrRight", "SpkrLeft";
	};
+6 −0
Original line number Diff line number Diff line
@@ -3027,6 +3027,12 @@ static const struct of_device_id sdm660_asoc_machine_of_match[] = {
	  .data = "tasha_codec"},
	{ .compatible = "qcom,sdm660-asoc-snd-tavil",
	  .data = "tavil_codec"},
	{ .compatible = "qcom,sdm670-asoc-snd",
	  .data = "internal_codec"},
	{ .compatible = "qcom,sdm670-asoc-snd-tasha",
	  .data = "tasha_codec"},
	{ .compatible = "qcom,sdm670-asoc-snd-tavil",
	  .data = "tavil_codec"},
	{},
};