Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1419657 > unrolled thread

[PATCH v3 1/2] ASoC: msm8916: Add codec Device Tree bindings.

Started bySrinivas Kandagatla <srinivas.kandagatla@linaro.org>
First post2016-06-10 20:20 +0200
Last post2016-06-15 11:20 +0200
Articles 5 — 3 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH v3 1/2] ASoC: msm8916: Add codec Device Tree bindings. Srinivas Kandagatla <srinivas.kandagatla@linaro.org> - 2016-06-10 20:20 +0200
    Re: [PATCH v3 1/2] ASoC: msm8916: Add codec Device Tree bindings. Mark Brown <broonie@kernel.org> - 2016-06-14 17:30 +0200
      Re: [PATCH v3 1/2] ASoC: msm8916: Add codec Device Tree bindings. Srinivas Kandagatla <srinivas.kandagatla@linaro.org> - 2016-06-15 11:20 +0200
    Re: [PATCH v3 1/2] ASoC: msm8916: Add codec Device Tree bindings. Kenneth Westfield <kwestfie@codeaurora.org> - 2016-06-14 18:20 +0200
      Re: [PATCH v3 1/2] ASoC: msm8916: Add codec Device Tree bindings. Srinivas Kandagatla <srinivas.kandagatla@linaro.org> - 2016-06-15 11:20 +0200

#1419657 — [PATCH v3 1/2] ASoC: msm8916: Add codec Device Tree bindings.

FromSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Date2016-06-10 20:20 +0200
Subject[PATCH v3 1/2] ASoC: msm8916: Add codec Device Tree bindings.
Message-ID<rIzce-86w-25@gated-at.bofh.it>
This patch adds DT bindings required for msm8916 codec which is
integrated in msm8916 and apq8016 SOCs.

Codec IP is divided into two parts, first analog which is integrated
in pmic pm8916 and secondly digital part which is integrated into
application processor. Codec register controls are also split across
pmic an lpass. Analog part is controlled via spmi bus to pmic, registers
on the Application processor are memory mapped.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
 .../devicetree/bindings/sound/qcom,msm8916-wcd.txt | 103 +++++++++++++++++++++
 1 file changed, 103 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/qcom,msm8916-wcd.txt

diff --git a/Documentation/devicetree/bindings/sound/qcom,msm8916-wcd.txt b/Documentation/devicetree/bindings/sound/qcom,msm8916-wcd.txt
new file mode 100644
index 0000000..0559c1f
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/qcom,msm8916-wcd.txt
@@ -0,0 +1,103 @@
+msm8916 audio CODEC audio CODEC
+
+Codec IP is divided into two parts, first analog which is integrated in pmic pm8916
+and secondly digital part which is integrated into application processor. Codec register
+controls are also split across pmic an lpass. Analog part is controlled via spmi bus to pmic.
+
+## Bindings for codec core on pmic:
+
+Required properties
+ - compatible = "qcom,msm8916-pmic-wcd-codec";
+ - reg: represents the slave base address provided to the peripheral.
+ - interrupt-parent : The parent interrupt controller.
+ - interrupts: List of interrupts in given SPMI peripheral.
+ - interrupt-names: Names specified to above list of interrupts in same
+		    order. List of supported interrupt names are:
+  "spk_cnp_int" - Speaker click and pop interrupt
+  "spk_clip_int" - Speaker clip interrupt
+  "spk_ocp_int" - Speaker over current protect interrupt.
+  "ins_rem_det1" - jack insert removal detect interrupt 1.
+  "but_rel_det" - button release interrupt
+  "but_press_det" - button press event
+  "ins_rem_det" - jack insert removal detect interrup
+  "mbhc_int"	- multi button headset interrupt.
+  "ear_ocp_int" - Earphone over current protect interrupt.
+  "hphr_ocp_int" - Headphone R over current protect interrupt.
+  "hphl_ocp_det" - Headphone L over current protect interrupt
+  "ear_cnp_int" - earphone cnp interrupt.
+  "hphr_cnp_int" - hphr click and pop interrupt.
+  "hphl_cnp_int" - hphl click and pop interrupt
+
+ - clocks: Handle to mclk.
+ - clock-names: should be "mclk".
+ - vddio-supply: phandle to VDD_CDC_IO regulator device tree node.
+ - vdd-tx-rx-supply: phandle to VDD_CDC_TX/RX/CX regulator device tree node.
+ - vdd-micbias-supply: phandle of VDD_MICBIAS supply's regulator device tree
+			    node.
+- qcom,lpass-codec-core: phandle to syscon node of lpass code core.
+
+Optional Properties:
+- qcom,micbias1-ext-cap: present if micbias1 has external capacitor connected.
+- qcom,micbias2-ext-cap: present if micbias2 has external capacitor connected.
+
+## Bindings codec core on lpass:
+
+Required properties
+ - compatible: should be "qcom,msm8916-lpass-codec" followed by "syscon".
+ - reg: represents the lpass codec core register map.
+
+Example:
+
+spmi_bus {
+	...
+	msm8916_wcd_codec@f000{
+		compatible = "qcom,msm8916-pmic-wcd-codec";
+		reg = <0xf000 0x200>;
+		reg-names = "pmic-codec-core";
+		clocks = <&gcc GCC_CODEC_DIGCODEC_CLK>;
+		clock-names = "mclk";
+		interrupt-parent = <&spmi_bus>;
+		interrupts = <0x1 0xf0 0x0 IRQ_TYPE_NONE>,
+			     <0x1 0xf0 0x1 IRQ_TYPE_NONE>,
+			     <0x1 0xf0 0x2 IRQ_TYPE_NONE>,
+			     <0x1 0xf0 0x3 IRQ_TYPE_NONE>,
+			     <0x1 0xf0 0x4 IRQ_TYPE_NONE>,
+			     <0x1 0xf0 0x5 IRQ_TYPE_NONE>,
+			     <0x1 0xf0 0x6 IRQ_TYPE_NONE>,
+			     <0x1 0xf0 0x7 IRQ_TYPE_NONE>,
+			     <0x1 0xf1 0x0 IRQ_TYPE_NONE>,
+			     <0x1 0xf1 0x1 IRQ_TYPE_NONE>,
+			     <0x1 0xf1 0x2 IRQ_TYPE_NONE>,
+			     <0x1 0xf1 0x3 IRQ_TYPE_NONE>,
+			     <0x1 0xf1 0x4 IRQ_TYPE_NONE>,
+			     <0x1 0xf1 0x5 IRQ_TYPE_NONE>;
+		interrupt-names = "spk_cnp_int",
+				  "spk_clip_int",
+				  "spk_ocp_int",
+				  "ins_rem_det1",
+				  "but_rel_det",
+				  "but_press_det",
+				  "ins_rem_det",
+				  "mbhc_int",
+				  "ear_ocp_int",
+				  "hphr_ocp_int",
+				  "hphl_ocp_det",
+				  "ear_cnp_int",
+				  "hphr_cnp_int",
+				  "hphl_cnp_int";
+		vddio-supply = <&pm8916_l5>;
+		vdd-tx-rx-supply = <&pm8916_l5>;
+		vdd-micbias-supply = <&pm8916_l13>;
+		qcom,lpass-codec-core = <&lpass_codec_core>;
+		#sound-dai-cells = <1>;
+	};
+};
+
+soc {
+	...
+	lpass_codec_core: lpass-codec{
+		compatible = "qcom,msm8916-lpass-codec", "syscon";
+		reg = <0x0771c000 0x400>;
+	};
+
+};
-- 
2.8.3

[toc] | [next] | [standalone]


#1422012

FromMark Brown <broonie@kernel.org>
Date2016-06-14 17:30 +0200
Message-ID<rJYrT-6Cf-17@gated-at.bofh.it>
In reply to#1419657

[Multipart message — attachments visible in raw view] — view raw

On Fri, Jun 10, 2016 at 07:18:44PM +0100, Srinivas Kandagatla wrote:

> +Codec IP is divided into two parts, first analog which is integrated in pmic pm8916
> +and secondly digital part which is integrated into application processor. Codec register
> +controls are also split across pmic an lpass. Analog part is controlled via spmi bus to pmic.

Please keep things wrapped at less than 80 columns.

> + - interrupt-parent : The parent interrupt controller.
> + - interrupts: List of interrupts in given SPMI peripheral.
> + - interrupt-names: Names specified to above list of interrupts in same
> +		    order. List of supported interrupt names are:
> +  "spk_cnp_int" - Speaker click and pop interrupt

Please format this more clearly so these don't look like properties,
more indentation would be good.

> + - vddio-supply: phandle to VDD_CDC_IO regulator device tree node.
> + - vdd-tx-rx-supply: phandle to VDD_CDC_TX/RX/CX regulator device tree node.

You should name the supplies with the same name as the datasheet uses.

[toc] | [prev] | [next] | [standalone]


#1422808

FromSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Date2016-06-15 11:20 +0200
Message-ID<rKf9n-F4-1@gated-at.bofh.it>
In reply to#1422012
Thanks for review comments,

On 14/06/16 16:23, Mark Brown wrote:
> On Fri, Jun 10, 2016 at 07:18:44PM +0100, Srinivas Kandagatla wrote:
>
>> +Codec IP is divided into two parts, first analog which is integrated in pmic pm8916
>> +and secondly digital part which is integrated into application processor. Codec register
>> +controls are also split across pmic an lpass. Analog part is controlled via spmi bus to pmic.
>
> Please keep things wrapped at less than 80 columns.
Yep, will fix it in next version.
>
>> + - interrupt-parent : The parent interrupt controller.
>> + - interrupts: List of interrupts in given SPMI peripheral.
>> + - interrupt-names: Names specified to above list of interrupts in same
>> +		    order. List of supported interrupt names are:
>> +  "spk_cnp_int" - Speaker click and pop interrupt
>
> Please format this more clearly so these don't look like properties,
> more indentation would be good.
Ok, will do it in next version.
>
>> + - vddio-supply: phandle to VDD_CDC_IO regulator device tree node.
>> + - vdd-tx-rx-supply: phandle to VDD_CDC_TX/RX/CX regulator device tree node.
>
> You should name the supplies with the same name as the datasheet uses.
>
Yep, I will rename them to match the hw specs.

thanks,
srini

[toc] | [prev] | [next] | [standalone]


#1422056

FromKenneth Westfield <kwestfie@codeaurora.org>
Date2016-06-14 18:20 +0200
Message-ID<rJZeh-7cH-3@gated-at.bofh.it>
In reply to#1419657
On Fri, Jun 10, 2016 at 11:18:44AM -0700, Srinivas Kandagatla wrote:
> diff --git a/Documentation/devicetree/bindings/sound/qcom,msm8916-wcd.txt
> b/Documentation/devicetree/bindings/sound/qcom,msm8916-wcd.txt
> new file mode 100644
> index 0000000..0559c1f
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/sound/qcom,msm8916-wcd.txt
> @@ -0,0 +1,103 @@
> +msm8916 audio CODEC audio CODEC
> +
> +Codec IP is divided into two parts, first analog which is integrated in
> pmic pm8916
> +and secondly digital part which is integrated into application processor.
> Codec register
> +controls are also split across pmic an lpass. Analog part is controlled
> via spmi bus to pmic.

Cleaning up the description:

msm8916 audio CODEC

Codec IP is divided into two parts:
  * analog, which is integrated into pmic pm8916
  * digital, which is integrated into LPASS on the SOC
Codec registers are also split across pmic and LPASS.
Analog codec is controlled via spmi bus to pmic.

> +## Bindings for codec core on pmic:
> +
> +Required properties
> + - compatible = "qcom,msm8916-pmic-wcd-codec";

OK.  Looking at this again, I think its better just to drop the pmic.

> +  "spk_cnp_int" - Speaker click and pop interrupt
> +  "spk_clip_int" - Speaker clip interrupt
> +  "spk_ocp_int" - Speaker over current protect interrupt.
> +  "ins_rem_det1" - jack insert removal detect interrupt 1.
> +  "but_rel_det" - button release interrupt
> +  "but_press_det" - button press event
> +  "ins_rem_det" - jack insert removal detect interrup
> +  "mbhc_int"	- multi button headset interrupt.
> +  "ear_ocp_int" - Earphone over current protect interrupt.
> +  "hphr_ocp_int" - Headphone R over current protect interrupt.
> +  "hphl_ocp_det" - Headphone L over current protect interrupt
> +  "ear_cnp_int" - earphone cnp interrupt.
> +  "hphr_cnp_int" - hphr click and pop interrupt.
> +  "hphl_cnp_int" - hphl click and pop interrupt

Please use labels that more closely match the HW spec:
  "cdc_spk_cnp_int"
  "cdc_spk_clip_int"
  "cdc_spk_ocp_int"
  "mbhc_ins_rem_det1"
  "mbhc_but_rel_det"
  "mbhc_but_press_det"
  "mbhc_ins_rem_det"
  "mbhc_switch_int"
  "cdc_ear_ocp_int"
  "cdc_hphr_ocp_int"
  "cdc_hphl_ocp_int"
  "cdc_ear_cnp_int"
  "cdc_hphr_cnp_int"
  "cdc_hphl_cnp_int"

-- 
Kenneth Westfield
Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, 
a Linux Foundation Collaborative Project

[toc] | [prev] | [next] | [standalone]


#1422811

FromSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Date2016-06-15 11:20 +0200
Message-ID<rKf9n-F4-15@gated-at.bofh.it>
In reply to#1422056
Thanks for review comments,
On 14/06/16 17:12, Kenneth Westfield wrote:
> On Fri, Jun 10, 2016 at 11:18:44AM -0700, Srinivas Kandagatla wrote:
>> diff --git a/Documentation/devicetree/bindings/sound/qcom,msm8916-wcd.txt
>> b/Documentation/devicetree/bindings/sound/qcom,msm8916-wcd.txt
>> new file mode 100644
>> index 0000000..0559c1f
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/sound/qcom,msm8916-wcd.txt
>> @@ -0,0 +1,103 @@
>> +msm8916 audio CODEC audio CODEC
>> +
>> +Codec IP is divided into two parts, first analog which is integrated in
>> pmic pm8916
>> +and secondly digital part which is integrated into application processor.
>> Codec register
>> +controls are also split across pmic an lpass. Analog part is controlled
>> via spmi bus to pmic.
>
> Cleaning up the description:
>
> msm8916 audio CODEC
>
> Codec IP is divided into two parts:
>    * analog, which is integrated into pmic pm8916
>    * digital, which is integrated into LPASS on the SOC
> Codec registers are also split across pmic and LPASS.
> Analog codec is controlled via spmi bus to pmic.
>
>> +## Bindings for codec core on pmic:
>> +
>> +Required properties
>> + - compatible = "qcom,msm8916-pmic-wcd-codec";
>
> OK.  Looking at this again, I think its better just to drop the pmic.
>
Yep..
>> +  "spk_cnp_int" - Speaker click and pop interrupt
>> +  "spk_clip_int" - Speaker clip interrupt
>> +  "spk_ocp_int" - Speaker over current protect interrupt.
>> +  "ins_rem_det1" - jack insert removal detect interrupt 1.
>> +  "but_rel_det" - button release interrupt
>> +  "but_press_det" - button press event
>> +  "ins_rem_det" - jack insert removal detect interrup
>> +  "mbhc_int"	- multi button headset interrupt.
>> +  "ear_ocp_int" - Earphone over current protect interrupt.
>> +  "hphr_ocp_int" - Headphone R over current protect interrupt.
>> +  "hphl_ocp_det" - Headphone L over current protect interrupt
>> +  "ear_cnp_int" - earphone cnp interrupt.
>> +  "hphr_cnp_int" - hphr click and pop interrupt.
>> +  "hphl_cnp_int" - hphl click and pop interrupt
>
> Please use labels that more closely match the HW spec:
>    "cdc_spk_cnp_int"
>    "cdc_spk_clip_int"
>    "cdc_spk_ocp_int"
>    "mbhc_ins_rem_det1"
>    "mbhc_but_rel_det"
>    "mbhc_but_press_det"
>    "mbhc_ins_rem_det"
>    "mbhc_switch_int"
>    "cdc_ear_ocp_int"
>    "cdc_hphr_ocp_int"
>    "cdc_hphl_ocp_int"
>    "cdc_ear_cnp_int"
>    "cdc_hphr_cnp_int"
>    "cdc_hphl_cnp_int"
>
Yes, we can do that to match the specs.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web