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

Commit de8271c7 authored by Banajit Goswami's avatar Banajit Goswami Committed by Gerrit - the friendly Code Review server
Browse files

ASoC: wcd: add audio codec drivers for MSM targets



Add snapshot of audio codec drivers for MSM targets from msm-4.4
kernel at the below commit level-

commit c03f0ace8a36 ("msm: ipa: enable suspend pipe for ODU")
(Kernel TIP as on 12-06-2016)

Change-Id: I80408bd56d3183fdedad427d28f857911e1d7738
Signed-off-by: default avatarBanajit Goswami <bgoswami@codeaurora.org>
parent 0530e2ff
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;
			};
		};
	};
+42 −0
Original line number Diff line number Diff line
@@ -404,6 +404,12 @@ Required properties:

 - compatible :                            "qcom,wcd-dsp-glink"

* msm_ext_disp_audio_codec_rx

Required properties:

 - compatible :                            "qcom,msm-ext-disp-audio-codec-rx"

Example:

	qcom,msm-pcm {
@@ -680,6 +686,10 @@ Example:
		compatible = "qcom,wcd-dsp-glink";
	};

	msm_ext_disp_audio_codec_rx {
		compatible = "qcom,msm-ext-disp-audio-codec-rx";
	};


* MSM8916 ASoC Machine driver

@@ -2343,3 +2353,35 @@ Example:
		asoc-codec-names = "msm-stub-codec.1";
		qcom,wsa-max-devs = <0>;
	};

* WCD DSP manager driver

Required properties:
- compatible : "qcom,wcd-dsp-mgr"
- qcom,wdsp-components : This is phandle list containing the references to the
			 components of the manager driver. Manager driver will
			 register to component framework with these phandles.
- qcom,img-filename : String property to provide the dsp image file name that is
		     to be read from file system and downloaded to dsp memory
Optional properties:
- qcom,wdsp-cmpnt-dev-name : Property that manager driver will parse, but defined
			     in the child's DT entry that is given to manager driver
			     with phandle. This property will be used by the manager
			     driver in case the manager driver cannot match child's
			     of_node pointer to registered phandle.

Example:

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

Example of child node that would have qcom,wdsp-cmpnt-dev-name property

	wcd934x_cdc: tavil_codec {
		qcom,wdsp-cmpnt-dev-name = "tavil_codec";
	};
+37 −0
Original line number Diff line number Diff line
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:

tavil_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>;
	};
};
+640 −0

File added.

Preview size limit exceeded, changes collapsed.

+88 −0
Original line number Diff line number Diff line
wsa881x Audio CODEC

wsa881x Audio CODEC can support either I2C interface or Soundwire interface.
In Analog mode, this codec will operate as I2C slave device and
interacts with I2C controller for status, control and interrupt management.
The wsa881x device nodes will be represented as child nodes to I2C
master device node in the devicetree. Currently, the below devicetree
bindings are for I2C mode only and does not include soundwire mode.

Required properties:

 - compatible : "qcom,wsa881x-i2c-codec"
 - reg : Unique device ID of I2C slave device.

Optional properties:
- 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
list all 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.

* wsa_intc

Required properties:

 - compatible :                            "qcom,wsa-irq"
 - interrupt-controller :                  Mark this device node as an
					   interrupt controller
 - #interrupt-cells :                      Should be 1
 - interrupt-parent :                      Parent interrupt controller
 - interrupts :                            Interrupt number on the parent
                                           interrupt controller
 - interrupt-names :                       Name of interrupt on the parent
                                           interrupt controller
Example:

wsa881x-i2c-codec@0e {
	compatible = "qcom,wsa881x-i2c-codec";
	reg = <0x0e>;
	qcom,msm-gpios = "wsa_clk",
			"wsa_reset";
	qcom,pinctrl-names = "all_off",
				"wsa_clk",
				"wsa_active",
				"wsa_clk_active";
	pinctrl-names = "all_off",
			"wsa_clk",
			"wsa_active",
			"wsa_clk_active";
	pinctrl-0 = <&wsa_clk_off &wsa_suspend>;
	pinctrl-1 = <&wsa_clk_on &wsa_suspend>;
	pinctrl-2 = <&wsa_clk_off &wsa_active>;
	pinctrl-3 = <&wsa_clk_on &wsa_active>;
};

wsa881x-i2c-codec@44 {
	compatible = "qcom,wsa881x-i2c-codec";
	reg = <0x44>;
};

wsa881x-i2c-codec@0f {
	compatible = "qcom,wsa881x-i2c-codec";
	reg = <0x0f>;
	qcom,msm-gpios = "wsa_clk",
			"wsa_reset";
	qcom,pinctrl-names = "all_off",
				"wsa_clk",
				"wsa_active",
				"wsa_clk_active";
	pinctrl-names = "all_off",
			"wsa_active",
			"wsa_clk_active";
	pinctrl-0 = <&wsa_clk_off &wsa_suspend>;
	pinctrl-1 = <&wsa_clk_off &wsa_active>;
	pinctrl-2 = <&wsa_clk_on &wsa_active>;
};

wsa_intc: wsa-irq {
	compatible = "qcom,wsa-irq";
	interrupt-controller;
	#interrupt-cells = <1>;
	interrupt-parent = <&msm_gpio>;
	interrupts = <97 0>;
	interrupt-names = "wsa-int";
};
Loading