arm64: dts: apq8016-sbc: add analog audio support with multicodec
authorSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Thu, 20 Oct 2016 14:20:49 +0000 (15:20 +0100)
committerAndy Gross <andy.gross@linaro.org>
Sun, 13 Nov 2016 04:56:07 +0000 (22:56 -0600)
This patch add support to Analog audio both Playback and Capture via
msm8916 WCD muti codec.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi
arch/arm64/boot/dts/qcom/msm8916.dtsi
arch/arm64/boot/dts/qcom/pm8916.dtsi

index 1483a959b49e46aa2f2ea0ba14c74947da1e3410..08bd5ebafb4ee78e0d01b75113187994e6991048 100644 (file)
@@ -15,6 +15,7 @@
 #include "pm8916.dtsi"
 #include "apq8016-sbc-soc-pins.dtsi"
 #include "apq8016-sbc-pmic-pins.dtsi"
+#include <dt-bindings/sound/apq8016-lpass.h>
 
 / {
        aliases {
                                vddio-supply = <&pm8916_l6>;
                        };
                };
+
+               lpass_codec: codec{
+                       status = "okay";
+               };
+
+               /*
+               Internal Codec
+                       playback - Primary MI2S
+                       capture - Ter MI2S
+
+               External Primary:
+                       playback - secondary MI2S
+                       capture - Quat MI2S
+
+               External Secondary:
+                       playback - Quat MI2S
+                       capture - Quat MI2S
+
+               */
+
+                sound: sound {
+                        compatible = "qcom,apq8016-sbc-sndcard";
+                        reg = <0x07702000 0x4>, <0x07702004 0x4>;
+                        reg-names = "mic-iomux", "spkr-iomux";
+
+                        status = "okay";
+                        pinctrl-0 = <&cdc_pdm_lines_act &ext_sec_tlmm_lines_act &ext_mclk_tlmm_lines_act>;
+                        pinctrl-1 = <&cdc_pdm_lines_sus &ext_sec_tlmm_lines_sus &ext_mclk_tlmm_lines_sus>;
+                        pinctrl-names = "default", "sleep";
+                        qcom,model = "DB410c";
+                        qcom,audio-routing =
+                                "AMIC2", "MIC BIAS Internal2",
+                                "AMIC3", "MIC BIAS External1";
+
+                        internal-codec-playback-dai-link@0 {            /* I2S - Internal codec */
+                                link-name = "WCD";
+                                cpu { /* PRIMARY */
+                                        sound-dai = <&lpass MI2S_PRIMARY>;
+                                };
+                                codec {
+                                        sound-dai = <&lpass_codec 0>, <&wcd_codec 0>;
+                                };
+                        };
+
+                        internal-codec-capture-dai-link@0 {             /* I2S - Internal codec */
+                                link-name = "WCD-Capture";
+                                cpu { /* PRIMARY */
+                                        sound-dai = <&lpass MI2S_TERTIARY>;
+                                };
+                                codec {
+                                        sound-dai = <&lpass_codec 1>, <&wcd_codec 1>;
+                                };
+                        };
+                };
        };
 
        usb2513 {
        };
 };
 
+&wcd_codec {
+        status = "okay";
+        clocks = <&gcc GCC_CODEC_DIGCODEC_CLK>;
+        clock-names = "mclk";
+};
+
 &smd_rpm_regulators {
        vdd_l1_l2_l3-supply = <&pm8916_s3>;
        vdd_l5-supply = <&pm8916_s3>;
index 04cde24f9786bf292285196d6feb2057bd077250..4221b7d2c0cea9fbc8ad30db109b83f8ae3f1815 100644 (file)
                        reg-names = "lpass-lpaif";
                };
 
+                lpass_codec: codec{
+                       compatible = "qcom,msm8916-wcd-digital-codec";
+                       reg = <0x0771c000 0x400>;
+                       clocks = <&gcc GCC_ULTAUDIO_AHBFABRIC_IXFABRIC_CLK>,
+                                <&gcc GCC_CODEC_DIGCODEC_CLK>;
+                       clock-names = "ahbix-clk", "mclk";
+                       #sound-dai-cells = <1>;
+                };
+
                sdhc_1: sdhci@07824000 {
                        compatible = "qcom,sdhci-msm-v4";
                        reg = <0x07824900 0x11c>, <0x07824000 0x800>;
index f71679b15d544f1ed88860fe7022e67730e00644..53deebf9f515da8c85a662d482ae361e626846de 100644 (file)
        };
 
        pm8916_1: pm8916@1 {
-               compatible = "qcom,spmi-pmic";
+               compatible = "qcom,pm8916", "qcom,spmi-pmic";
                reg = <0x1 SPMI_USID>;
                #address-cells = <1>;
                #size-cells = <0>;
+
+                wcd_codec: codec@f000 {
+                       compatible = "qcom,pm8916-wcd-analog-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 = "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_det",
+                                        "cdc_ear_cnp_int",
+                                        "cdc_hphr_cnp_int",
+                                        "cdc_hphl_cnp_int";
+                      vdd-cdc-io-supply = <&pm8916_l5>;
+                      vdd-cdc-tx-rx-cx-supply = <&pm8916_l5>;
+                      vdd-micbias-supply = <&pm8916_l13>;
+                      #sound-dai-cells = <1>;
+
+                };
+
        };
 };