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

Commit 25a5fb85 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "qcom: wcd934x: add pinctrl driver for wcd934x"

parents 3225611f 8aa9aba2
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 wcd9340

- 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;
			};
		};
	};
+129 −0
Original line number Diff line number Diff line
@@ -109,6 +109,74 @@
					  "SpkrLeft", "SpkrRight";
	};

	sound-tavil {
		compatible = "qcom,msmcobalt-asoc-snd-tavil";
		qcom,model = "msmcobalt-tavil-snd-card";

		qcom,audio-routing =
			"RX_BIAS", "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",
			"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 = <0>;
		qcom,msm-mbhc-gnd-swh = <0>;
		qcom,tavil-mclk-clk-freq = <9600000>;
		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>,
				<&usb_audio_rx>, <&usb_audio_tx>;
		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",
				"msm-dai-q6-dev.28672", "msm-dai-q6-dev.28673";
		asoc-codec = <&stub_codec>;
		asoc-codec-names = "msm-stub-codec.1";
		qcom,wsa-max-devs = <0>;
	};

	cpe: qcom,msm-cpe-lsm {
		compatible = "qcom,msm-cpe-lsm";
	};
@@ -141,6 +209,15 @@
		#clock-cells = <1>;
	};

	clock_audio_lnbb: audio_ext_clk_lnbb {
		status = "ok";
		compatible = "qcom,audio-ref-clk";
		clock-names = "osr_clk";
		clocks = <&clock_gcc clk_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>;
@@ -208,4 +285,56 @@
		qcom,cdc-dmic-sample-rate = <4800000>;
		qcom,cdc-mad-dmic-rate = <600000>;
	};

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

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

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

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

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

		cdc-vddpx-1-supply = <&pmcobalt_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>;
	};
};
+32 −0
Original line number Diff line number Diff line
@@ -60,4 +60,36 @@
			};
		};
	};

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

			wsa881x_0211: wsa881x@20170211 {
				compatible = "qcom,wsa881x";
				reg = <0x00 0x20170211>;
				qcom,spkr-sd-n-node = <&wsa_spkr_sd1>;
			};

			wsa881x_0212: wsa881x@20170212 {
				compatible = "qcom,wsa881x";
				reg = <0x00 0x20170212>;
				qcom,spkr-sd-n-node = <&wsa_spkr_sd2>;
			};

			wsa881x_0213: wsa881x@21170213 {
				compatible = "qcom,wsa881x";
				reg = <0x00 0x21170213>;
				qcom,spkr-sd-n-node = <&wsa_spkr_sd1>;
			};

			wsa881x_0214: wsa881x@21170214 {
				compatible = "qcom,wsa881x";
				reg = <0x00 0x21170214>;
				qcom,spkr-sd-n-node = <&wsa_spkr_sd2>;
			};
		};
	};
};
+1 −0
Original line number Diff line number Diff line
@@ -1572,6 +1572,7 @@ config WCD934X_CODEC
	select MSM_CDC_SUPPLY
	select MSM_CDC_PINCTRL
	select REGMAP_ALLOW_WRITE_DEBUGFS
	select PINCTRL_WCD
	help
	  Enables the WCD9xxx codec core driver. The core driver provides
	  read/write capability to registers which are part of the
+7 −0
Original line number Diff line number Diff line
@@ -120,4 +120,11 @@ config PINCTRL_MSMFALCON
	  This is the pinctrl, pinmux, pinconf and gpiolib driver for the
	  Qualcomm TLMM block found in the Qualcomm MSMFALCON platform.

config PINCTRL_WCD
	tristate "Qualcomm Technologies, Inc WCD pin controller driver"
	depends on WCD934X_CODEC
	help
	  This is the pinctrl, pinmux, pinconf and gpiolib driver for the
	  WCD gpio controller block.

endif
Loading