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

Commit aefa88fa authored by Phani Kumar Uppalapati's avatar Phani Kumar Uppalapati
Browse files

ARM: dts: msm: Add audio device tree overlays for SDM845



Add support for device tree overlays for audio. Move
all WCD and WSA related device tree nodes to corresponding
overlay dtsi file and add the dtsi file in
corresponding dts overlay file.

CRs-Fixed: 2068887
Change-Id: I74332a490ec7c791b39870e97500b324e6bf870d
Signed-off-by: default avatarPhani Kumar Uppalapati <phaniu@codeaurora.org>
parent 80e2ccd6
Loading
Loading
Loading
Loading
+182 −0
Original line number Diff line number Diff line
/*
 * Copyright (c) 2017, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
 * only version 2 as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */

#include "sdm845-wcd.dtsi"
#include "msm-wsa881x.dtsi"
#include <dt-bindings/clock/qcom,audio-ext-clk.h>

&snd_934x {
	qcom,audio-routing =
		"AIF4 VI", "MCLK",
		"RX_BIAS", "MCLK",
		"MADINPUT", "MCLK",
		"hifi amp", "LINEOUT1",
		"hifi amp", "LINEOUT2",
		"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",
		"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,msm-mbhc-hphl-swh = <1>;
	qcom,msm-mbhc-gnd-swh = <1>;
	qcom,hph-en0-gpio = <&tavil_hph_en0>;
	qcom,hph-en1-gpio = <&tavil_hph_en1>;
	qcom,tavil-mclk-clk-freq = <9600000>;

	asoc-codec = <&stub_codec>;
	asoc-codec-names = "msm-stub-codec.1";

	qcom,usbc-analog-en1-gpio = <&wcd_usbc_analog_en1_gpio>;
	qcom,usbc-analog-en2-gpio = <&tlmm 51 0>;
	pinctrl-names = "aud_active", "aud_sleep";
	pinctrl-0 = <&wcd_usbc_analog_en2_active>;
	pinctrl-1 = <&wcd_usbc_analog_en2_idle>;

	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";
};

&soc {
	wcd_usbc_analog_en1_gpio: msm_cdc_pinctrl@49 {
		compatible = "qcom,msm-cdc-pinctrl";
		pinctrl-names = "aud_active", "aud_sleep";
		pinctrl-0 = <&wcd_usbc_analog_en1_active>;
		pinctrl-1 = <&wcd_usbc_analog_en1_idle>;
	};

	wcd9xxx_intc: wcd9xxx-irq {
		status = "ok";
		compatible = "qcom,wcd9xxx-irq";
		interrupt-controller;
		#interrupt-cells = <1>;
		interrupt-parent = <&tlmm>;
		qcom,gpio-connect = <&tlmm 54 0>;
		pinctrl-names = "default";
		pinctrl-0 = <&wcd_intr_default>;
	};

	clock_audio_lnbb: audio_ext_clk_lnbb {
		status = "ok";
		compatible = "qcom,audio-ref-clk";
		clock-names = "osr_clk";
		clocks = <&clock_rpmh RPMH_LN_BB_CLK2>;
		qcom,node_has_rpm_clock;
		#clock-cells = <1>;
	};

	wcd_rst_gpio: msm_cdc_pinctrl@64 {
		compatible = "qcom,msm-cdc-pinctrl";
		qcom,cdc-rst-n-gpio = <&tlmm 64 0>;
		pinctrl-names = "aud_active", "aud_sleep";
		pinctrl-0 = <&cdc_reset_active>;
		pinctrl-1 = <&cdc_reset_sleep>;
	};

	qocm,wcd-dsp-glink {
		compatible = "qcom,wcd-dsp-glink";
	};

	qcom,wcd-dsp-mgr {
		compatible = "qcom,wcd-dsp-mgr";
		qcom,wdsp-components = <&wcd934x_cdc 0>,
				       <&wcd_spi_0 1>,
				       <&glink_spi_xprt_wdsp 2>;
		qcom,img-filename = "cpe_9340";
	};
};

&slim_aud {
	wcd934x_cdc: tavil_codec {
		compatible = "qcom,tavil-slim-pgd";
		elemental-addr = [00 01 50 02 17 02];

		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 31>;

		qcom,wcd-rst-gpio-node = <&wcd_rst_gpio>;

		clock-names = "wcd_clk";
		clocks = <&clock_audio_lnbb AUDIO_PMIC_LNBB_CLK>;

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

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

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

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

		cdc-vddpx-1-supply = <&pm8998_s4>;
		qcom,cdc-vddpx-1-voltage = <1800000 1800000>;
		qcom,cdc-vddpx-1-current = <10000>;

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

		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-slim-ifd = "tavil-slim-ifd";
		qcom,cdc-slim-ifd-elemental-addr = [00 00 50 02 17 02];
		qcom,cdc-dmic-sample-rate = <4800000>;
		qcom,cdc-mad-dmic-rate = <600000>;

		qcom,wdsp-cmpnt-dev-name = "tavil_codec";

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

	};
};
+1 −162
Original line number Diff line number Diff line
@@ -12,9 +12,6 @@
 */

#include "msm-audio-lpass.dtsi"
#include "sdm845-wcd.dtsi"
#include "msm-wsa881x.dtsi"
#include <dt-bindings/clock/qcom,audio-ext-clk.h>

&msm_audio_ion {
	iommus = <&apps_smmu 0x1821 0x0>;
@@ -31,7 +28,7 @@
		qcom,clk-mult = <10>;
	};

	sound-tavil {
	snd_934x: sound-tavil {
		compatible = "qcom,sdm845-asoc-snd-tavil";
		qcom,model = "sdm845-tavil-snd-card";
		qcom,wcn-btfm;
@@ -48,43 +45,6 @@
			    "lpaif_tert_mode_muxsel",
			    "lpaif_quat_mode_muxsel";

		qcom,audio-routing =
			"AIF4 VI", "MCLK",
			"RX_BIAS", "MCLK",
			"MADINPUT", "MCLK",
			"hifi amp", "LINEOUT1",
			"hifi amp", "LINEOUT2",
			"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",
			"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,msm-mbhc-hphl-swh = <1>;
		qcom,msm-mbhc-gnd-swh = <1>;
		qcom,hph-en0-gpio = <&tavil_hph_en0>;
		qcom,hph-en1-gpio = <&tavil_hph_en1>;
		qcom,tavil-mclk-clk-freq = <9600000>;

		qcom,usbc-analog-en1-gpio = <&wcd_usbc_analog_en1_gpio>;

		asoc-platform = <&pcm0>, <&pcm1>, <&pcm2>, <&voip>, <&voice>,
				<&loopback>, <&compress>, <&hostless>,
				<&afe>, <&lsm>, <&routing>, <&compr>,
@@ -136,65 +96,6 @@
				"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>;
		asoc-codec-names = "msm-stub-codec.1";
		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";

		qcom,usbc-analog-en2-gpio = <&tlmm 51 0>;
		pinctrl-names = "aud_active", "aud_sleep";
		pinctrl-0 = <&wcd_usbc_analog_en2_active>;
		pinctrl-1 = <&wcd_usbc_analog_en2_idle>;
	};

	wcd_usbc_analog_en1_gpio: msm_cdc_pinctrl@49 {
		compatible = "qcom,msm-cdc-pinctrl";
		pinctrl-names = "aud_active", "aud_sleep";
		pinctrl-0 = <&wcd_usbc_analog_en1_active>;
		pinctrl-1 = <&wcd_usbc_analog_en1_idle>;
	};

	wcd9xxx_intc: wcd9xxx-irq {
		status = "ok";
		compatible = "qcom,wcd9xxx-irq";
		interrupt-controller;
		#interrupt-cells = <1>;
		interrupt-parent = <&tlmm>;
		qcom,gpio-connect = <&tlmm 54 0>;
		pinctrl-names = "default";
		pinctrl-0 = <&wcd_intr_default>;
	};

	clock_audio_lnbb: audio_ext_clk_lnbb {
		status = "ok";
		compatible = "qcom,audio-ref-clk";
		clock-names = "osr_clk";
		clocks = <&clock_rpmh RPMH_LN_BB_CLK2>;
		qcom,node_has_rpm_clock;
		#clock-cells = <1>;
	};

	wcd_rst_gpio: msm_cdc_pinctrl@64 {
		compatible = "qcom,msm-cdc-pinctrl";
		qcom,cdc-rst-n-gpio = <&tlmm 64 0>;
		pinctrl-names = "aud_active", "aud_sleep";
		pinctrl-0 = <&cdc_reset_active>;
		pinctrl-1 = <&cdc_reset_sleep>;
	};

	qocm,wcd-dsp-glink {
		compatible = "qcom,wcd-dsp-glink";
	};

	qcom,wcd-dsp-mgr {
		compatible = "qcom,wcd-dsp-mgr";
		qcom,wdsp-components = <&wcd934x_cdc 0>,
				       <&wcd_spi_0 1>,
				       <&glink_spi_xprt_wdsp 2>;
		qcom,img-filename = "cpe_9340";
	};
};

@@ -203,66 +104,4 @@
		compatible = "qcom,msm-dai-slim";
		elemental-addr = [ff ff ff fe 17 02];
	};

	wcd934x_cdc: tavil_codec {
		compatible = "qcom,tavil-slim-pgd";
		elemental-addr = [00 01 50 02 17 02];

		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 31>;

		qcom,wcd-rst-gpio-node = <&wcd_rst_gpio>;

		clock-names = "wcd_clk";
		clocks = <&clock_audio_lnbb AUDIO_PMIC_LNBB_CLK>;

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

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

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

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

		cdc-vddpx-1-supply = <&pm8998_s4>;
		qcom,cdc-vddpx-1-voltage = <1800000 1800000>;
		qcom,cdc-vddpx-1-current = <10000>;

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

		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-slim-ifd = "tavil-slim-ifd";
		qcom,cdc-slim-ifd-elemental-addr = [00 00 50 02 17 02];
		qcom,cdc-dmic-sample-rate = <4800000>;
		qcom,cdc-mad-dmic-rate = <600000>;

		qcom,wdsp-cmpnt-dev-name = "tavil_codec";

		wcd_spi_0: wcd_spi {
			compatible = "qcom,wcd-spi-v2";
			qcom,master-bus-num = <0>;
			qcom,chip-select = <0>;
			qcom,max-frequency = <9600000>;
			qcom,mem-base-addr = <0x100000>;
		};
	};
};
+21 −0
Original line number Diff line number Diff line
/*
 * Copyright (c) 2017, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
 * only version 2 as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */

#include "sdm845-audio-overlay.dtsi"

&soc {
	sound-tavil {
		qcom,us-euro-gpios = <&tavil_us_euro_sw>;
	};
};
+1 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@
#include <dt-bindings/interrupt-controller/arm-gic.h>

#include "sdm845-cdp.dtsi"
#include "sdm845-cdp-audio-overlay.dtsi"

/ {
	model = "Qualcomm Technologies, Inc. SDM845 v1 CDP";
+0 −4
Original line number Diff line number Diff line
@@ -37,10 +37,6 @@
};

&soc {
	sound-tavil {
		qcom,us-euro-gpios = <&tavil_us_euro_sw>;
	};

	gpio_keys {
		compatible = "gpio-keys";
		label = "gpio-keys";
Loading