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

Commit ee5c3428 authored by Viraja Kommaraju's avatar Viraja Kommaraju
Browse files

ARM: dts: msm: Add support for external codec



APQ8009 MTP have WCD9326 external codec over i2s. Add sound node
and pincontrol for this platform.

Change-Id: Iac64a251801245e10d7f51b127983237f3617aa5
Signed-off-by: default avatarViraja Kommaraju <virajak@codeaurora.org>
parent d5d001db
Loading
Loading
Loading
Loading
+219 −1
Original line number Original line Diff line number Diff line
@@ -11,6 +11,224 @@
 * GNU General Public License for more details.
 * GNU General Public License for more details.
 */
 */


&audio_codec_mtp {
	status = "disabled";
};

&pm8916_tombak_dig {
	status = "disabled";
};

&pm8916_tombak_analog {
	status = "disabled";
};

&soc {
&soc {
	sound-9335 {
		compatible = "qcom,msm8x16-audio-codec";
		qcom,model = "msm8x16-tasha9326-snd-card";
		qcom,msm-snd-card-id = <1>;
		qcom,msm-codec-type = "external";
		qcom,msm-mbhc-hphl-swh = <0>;
		qcom,msm-mbhc-gnd-swh = <0>;
		qcom,msm-mclk-freq = <9600000>;
		qcom,msm-hs-micbias-type = "internal";
		qcom,audio-routing =
			"AIF4 VI", "MCLK",
			"RX_BIAS", "MCLK",
			"MADINPUT", "MCLK",
			"AMIC2", "MIC BIAS2",
			"MIC BIAS2", "Headset Mic",
			"AMIC3", "MIC BIAS2",
			"MIC BIAS2", "ANCRight Headset Mic",
			"AMIC4", "MIC BIAS2",
			"MIC BIAS2", "ANCLeft Headset Mic",
			"AMIC5", "MIC BIAS3",
			"MIC BIAS3", "Handset Mic",
			"AMIC6", "MIC BIAS4",
			"MIC BIAS4", "Analog Mic6",
			"DMIC0", "MIC BIAS1",
			"MIC BIAS1", "Digital Mic0",
			"DMIC1", "MIC BIAS1",
			"MIC BIAS1", "Digital Mic1",
			"DMIC2", "MIC BIAS2",
			"MIC BIAS3", "Digital Mic2",
			"DMIC3", "MIC BIAS2",
			"MIC BIAS3", "Digital Mic3",
			"DMIC4", "MIC BIAS2",
			"MIC BIAS4", "Digital Mic4",
			"DMIC5", "MIC BIAS4",
			"MIC BIAS4", "Digital Mic5",
			"SpkrLeft IN", "SPK1 OUT",
			"SpkrRight IN", "SPK2 OUT";

		qcom,msm-gpios =
			"pri_i2s",
			"quat_i2s",
			"us_eu_gpio";
		qcom,pinctrl-names =
			"all_off",
			"pri_i2s_act",
			"quat_i2s_act",
			"pri_i2s_quat_i2s_act",
			"us_eu_gpio_act",
			"pri_i2s_us_eu_gpio_act",
			"quat_i2s_us_eu_gpio_act",
			"pri_i2s_pri_i2s_us_eu_gpio_act";
		pinctrl-names =
			"all_off",
			"pri_i2s_act",
			"quat_i2s_act",
			"pri_i2s_quat_i2s_act",
			"us_eu_gpio_act",
			"pri_i2s_us_eu_gpio_act",
			"quat_i2s_us_eu_gpio_act",
			"pri_i2s_pri_i2s_us_eu_gpio_act";
		pinctrl-0 = <&pri_mi2s_sleep &quat_mi2s_sleep &quat_mi2s_din_sleep &cross_conn_det_sus>;
		pinctrl-1 = <&pri_mi2s_active &quat_mi2s_sleep &quat_mi2s_din_sleep &cross_conn_det_sus>;
		pinctrl-2 = <&pri_mi2s_sleep &quat_mi2s_active &quat_mi2s_din_active &cross_conn_det_sus>;
		pinctrl-3 = <&pri_mi2s_active &quat_mi2s_active &quat_mi2s_din_active &cross_conn_det_sus>;
		pinctrl-4 = <&pri_mi2s_sleep &quat_mi2s_sleep &quat_mi2s_din_sleep &cross_conn_det_act>;
		pinctrl-5 = <&pri_mi2s_active &quat_mi2s_sleep &quat_mi2s_din_sleep &cross_conn_det_act>;
		pinctrl-6 = <&pri_mi2s_sleep &quat_mi2s_active &quat_mi2s_din_active &cross_conn_det_act>;
		pinctrl-7 = <&pri_mi2s_active &quat_mi2s_active &quat_mi2s_din_active &cross_conn_det_act>;
		qcom,cdc-us-euro-gpios = <&msm_gpio 97 0>;

		asoc-platform = <&pcm0>, <&pcm1>, <&voip>, <&voice>,
				<&loopback>, <&compress>, <&hostless>,
				<&afe>, <&lsm>, <&routing>, <&cpe>, <&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-cpe-lsm",
				"msm-pcm-lpa";
		asoc-cpu =  <&dai_pri_auxpcm>, <&dai_hdmi>,<&dai_mi2s0>,
				<&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>, <&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>,
				<&bt_sco_rx>,
				<&bt_sco_tx>, <&int_fm_rx>, <&int_fm_tx>;
		asoc-cpu-names = "msm-dai-q6-auxpcm.1", "msm-dai-q6-hdmi.8",
				 "msm-dai-q6-mi2s.0",
				"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.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.12288", "msm-dai-q6-dev.12289",
				"msm-dai-q6-dev.12292", "msm-dai-q6-dev.12293";
		asoc-codec = <&stub_codec>;
		asoc-codec-names = "msm-stub-codec.1";
		qcom,max-aux-codec = <2>;
		qcom,aux-codec = "wsa881x.21170213", "wsa881x.21170214";
		qcom,aux-codec-prefix = "SpkrLeft", "SpkrRight";
	};
	cpe: qcom,msm-cpe-lsm {
		compatible = "qcom,msm-cpe-lsm";
	};

	wcd9xxx_intc: wcd9xxx-irq {
		compatible = "qcom,wcd9xxx-irq";
		interrupt-controller;
		#interrupt-cells = <1>;
		interrupt-parent = <&msm_gpio>;
		interrupts = <64 0>;
		interrupt-names = "cdc-int";
	};

	clock_audio: audio_ext_clk {
		compatible = "qcom,audio-ref-clk";
		qcom,codec-mclk-clk-freq = <9600000>;
		qcom,lpass-clock = <1>;
		pinctrl-names = "i2s_mclk_sleep",
				"i2s_mclk_active";
		pinctrl-0 = <&i2s_mclk_sleep>;
		pinctrl-1 = <&i2s_mclk_active>;
		#clock-cells = <1>;
	};

	i2c@78b8000 {
		wcd9xxx_codec@d {
			compatible = "qcom,tasha-i2c-pgd";
			reg = <0x0d>;

			interrupt-parent = <&wcd9xxx_intc>;
			interrupts = <0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
				17 18 19 20 21 22 23 24 25 26 27 28 29
				30>;


			qcom,cdc-reset-gpio = <&msm_gpio 17 0>;

			cdc-vdd-buck-supply = <&pm8916_s4>;
			qcom,cdc-vdd-buck-voltage = <1800000 1800000>;
			qcom,cdc-vdd-buck-current = <650000>;

			cdc-buck-sido-supply = <&pm8916_s4>;
			qcom,cdc-buck-sido-voltage = <1800000 1800000>;
			qcom,cdc-buck-sido-current = <250000>;

			cdc-vdd-tx-h-supply = <&pm8916_l5>;
			qcom,cdc-vdd-tx-h-voltage = <1800000 1800000>;
			qcom,cdc-vdd-tx-h-current = <25000>;

			cdc-vdd-rx-h-supply = <&pm8916_l5>;
			qcom,cdc-vdd-rx-h-voltage = <1800000 1800000>;
			qcom,cdc-vdd-rx-h-current = <25000>;

			cdc-vdd-px-supply = <&pm8916_l5>;
			qcom,cdc-vdd-px-voltage = <1800000 1800000>;
			qcom,cdc-vdd-px-current = <10000>;

			qcom,cdc-static-supplies =
				"cdc-vdd-buck",
				"cdc-buck-sido",
				"cdc-vdd-tx-h",
				"cdc-vdd-rx-h",
				"cdc-vdd-px";

			qcom,cdc-micbias1-mv = <1800>;
			qcom,cdc-micbias2-mv = <1800>;
			qcom,cdc-micbias3-mv = <1800>;
			qcom,cdc-micbias4-mv = <1800>;

			qcom,cdc-mclk-clk-rate = <9600000>;
			qcom,cdc-dmic-sample-rate = <4800000>;
			qcom,cdc-variant = "WCD9335";

			clock-names = "wcd_clk";
			clocks = <&clock_audio clk_audio_ap_clk>;

			swr_master {
				compatible = "qcom,swr-wcd";
				#address-cells = <2>;
				#size-cells = <0>;
				wsa881x@21170214 {
					compatible = "qcom,wsa881x";
					reg = <0x00 0x21170214>;
					pinctrl-names = "wsa_spkr_sd_act",
							"wsa_spkr_sd_sus";
					pinctrl-0 = <&wsa_spkr_sd_act>;
					pinctrl-1 = <&wsa_spkr_sd_sus>;
				};

				wsa881x@21170213 {
					compatible = "qcom,wsa881x";
					reg = <0x00 0x21170213>;
					pinctrl-names = "wsa_spkr_sd_act",
							"wsa_spkr_sd_sus";
					pinctrl-0 = <&wsa_spkr_sd_act>;
					pinctrl-1 = <&wsa_spkr_sd_sus>;
				};
			};
		};
	};
};
};
+80 −0
Original line number Original line Diff line number Diff line
@@ -1301,5 +1301,85 @@
				bias-pull-up;		/* PULL UP*/
				bias-pull-up;		/* PULL UP*/
			};
			};
		};
		};

		pmx_i2s_mclk {
			qcom,pins = <&gp 59>;
			qcom,num-grp-pins = <1>;
			qcom,pin-func = <2>;
			label = "i2s_mclk";
			i2s_mclk_active: i2s_mclk_active {
				drive-strength = <8>;   /* 8 MA */
				bias-disable;           /* No PULL */
				output-high;
			};
			i2s_mclk_sleep: i2s_mclk_sleep {
				drive-strength = <2>;   /* 2 MA */
				bias-pull-down;	        /* PULL DOWN */
			};
		};

		pmx_pri_mi2s {
			qcom,pins = <&gp 60>, <&gp 61>, <&gp 62>, <&gp 63>;
			qcom,num-grp-pins = <4>;
			qcom,pin-func = <2>;
			label = "pri_mi2s";
			pri_mi2s_active: pri_mi2s_active {
				drive-strength = <8>;   /* 8 MA */
				bias-disable;           /* No PULL */
				output-high;
			};
			pri_mi2s_sleep: pri_mi2s_sleep {
				drive-strength = <2>;   /* 2 MA */
				bias-pull-down;	        /* PULL DOWN */
			};
		};

		pmx_quat_mi2s {
			qcom,pins = <&gp 0>, <&gp 1>;
			qcom,num-grp-pins = <2>;
			qcom,pin-func = <2>;
			label = "quat_mi2s";
			quat_mi2s_active: quat_mi2s_active {
				drive-strength = <8>;   /* 8 MA */
				bias-disable;           /* No PULL */
				output-high;
			};
			quat_mi2s_sleep: quat_mi2s_sleep {
				drive-strength = <2>;   /* 2 MA */
				bias-pull-down;	        /* PULL DOWN */
			};
		};

		pmx_quat_mi2s_din {
			qcom,pins = <&gp 2>, <&gp 3>;
			qcom,num-grp-pins = <2>;
			qcom,pin-func = <2>;
			label = "quat_mi2s_din";
			quat_mi2s_din_active: quat_mi2s_din_active {
				drive-strength = <8>;   /* 8 MA */
				bias-disable;	        /* No PULL */
			};
			quat_mi2s_din_sleep: quat_mi2s_din_sleep {
				drive-strength = <2>;   /* 2 MA */
				bias-pull-down;	        /* PULL DOWN */
			};
		};

		wsa-spkr-sd {
			qcom,pins = <&gp 72>, <&gp 73>;
			qcom,num-grp-pins = <2>;
			qcom,pin-func = <0>;
			label = "wsa-spkr-sd";
			wsa_spkr_sd_act: lines_on {
					 drive-strength = <8>;
					 output-high;
					 bias-pull-down;
			};
			wsa_spkr_sd_sus: lines_off {
					 drive-strength = <2>;
					 output-low;
					 bias-disable;
			};
		};
	};
	};
};
};
+2 −2
Original line number Original line Diff line number Diff line
@@ -1381,8 +1381,8 @@
		dai_mi2s3: qcom,msm-dai-q6-mi2s-quat {
		dai_mi2s3: qcom,msm-dai-q6-mi2s-quat {
			compatible = "qcom,msm-dai-q6-mi2s";
			compatible = "qcom,msm-dai-q6-mi2s";
			qcom,msm-dai-q6-mi2s-dev-id = <3>;
			qcom,msm-dai-q6-mi2s-dev-id = <3>;
			qcom,msm-mi2s-rx-lines = <1>;
			qcom,msm-mi2s-rx-lines = <0>;
			qcom,msm-mi2s-tx-lines = <2>;
			qcom,msm-mi2s-tx-lines = <3>;
		};
		};


		dai_mi2s2: qcom,msm-dai-q6-mi2s-tert {
		dai_mi2s2: qcom,msm-dai-q6-mi2s-tert {