MLK-16077-5: ARM64: dts: support wm8960 in imx8qxp mek board
authorShengjiu Wang <shengjiu.wang@freescale.com>
Tue, 25 Jul 2017 10:20:00 +0000 (18:20 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 20:33:53 +0000 (15:33 -0500)
Add sound card node for imx8qxp mek board

Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
Documentation/devicetree/bindings/sound/imx-audio-wm8960.txt [new file with mode: 0644]
arch/arm64/boot/dts/freescale/fsl-imx8qxp-mek.dts

diff --git a/Documentation/devicetree/bindings/sound/imx-audio-wm8960.txt b/Documentation/devicetree/bindings/sound/imx-audio-wm8960.txt
new file mode 100644 (file)
index 0000000..dd153b5
--- /dev/null
@@ -0,0 +1,68 @@
+Freescale i.MX audio complex with WM8960 codec
+
+Required properties:
+
+  - compatible         : "fsl,imx-audio-wm8960", "fsl,imx7d-evk-wm8960"
+
+  - model              : The user-visible name of this sound complex
+
+  - cpu-dai            : The phandle of CPU DAI
+
+  - audio-codec                : The phandle of the WM8960 audio codec
+
+  - audio-routing      : A list of the connections between audio components.
+                         Each entry is a pair of strings, the first being the
+                         connection's sink, the second being the connection's
+                         source. Valid names could be power supplies, WM8960
+                         pins, and the jacks on the board:
+
+                         Power supplies:
+                          * Mic Bias
+
+                         Board connectors:
+                          * Mic Jack
+                          * Headphone Jack
+                          * Ext Spk
+
+Optional properties:
+- hp-det-gpios : The gpio pin to detect plug in/out event that happens to
+  Headphone jack.
+- mic-det-gpios: The gpio pin to detect plug in/out event that happens to
+  Microphone jack.
+
+Example:
+
+       sound: sound {
+               compatible = "fsl,imx7d-evk-wm8960",
+                          "fsl,imx-audio-wm8960";
+               model = "wm8960-audio";
+               cpu-dai = <&sai1>;
+               audio-codec = <&wm8960>;
+               codec-master;
+               /*
+                * hp-det = <hp-det-pin hp-det-polarity>;
+                * hp-det-pin: JD1 JD2  or JD3
+                * hp-det-polarity = 0: hp detect high for headphone
+                * hp-det-polarity = 1: hp detect high for speaker
+                */
+               hp-det = <2 0>;
+               hp-det-gpios = <&gpio1 0 0>;
+               mic-det-gpios = <&gpio1 0 0>;
+               audio-routing =
+                       "Headphone Jack", "HP_L",
+                       "Headphone Jack", "HP_R",
+                       "Ext Spk", "SPK_LP",
+                       "Ext Spk", "SPK_LN",
+                       "Ext Spk", "SPK_RP",
+                       "Ext Spk", "SPK_RN",
+                       "LINPUT2", "Mic Jack",
+                       "LINPUT3", "Mic Jack",
+                       "RINPUT1", "Main MIC",
+                       "RINPUT2", "Main MIC",
+                       "Mic Jack", "MICB",
+                       "Main MIC", "MICB",
+                       "CPU-Playback", "ASRC-Playback",
+                       "Playback", "CPU-Playback",
+                       "ASRC-Capture", "CPU-Capture",
+                       "CPU-Capture", "Capture";
+       };
index 28eeb6c..9d17f2f 100644 (file)
                };
 
        };
+
+       sound: sound {
+               compatible = "fsl,imx7d-evk-wm8960",
+                          "fsl,imx-audio-wm8960";
+               model = "wm8960-audio";
+               cpu-dai = <&sai1>;
+               audio-codec = <&wm8960>;
+               asrc-controller = <&asrc0>;
+               codec-master;
+               /*
+                * hp-det = <hp-det-pin hp-det-polarity>;
+                * hp-det-pin: JD1 JD2  or JD3
+                * hp-det-polarity = 0: hp detect high for headphone
+                * hp-det-polarity = 1: hp detect high for speaker
+                */
+               hp-det = <2 0>;
+               hp-det-gpios = <&gpio1 0 0>;
+               mic-det-gpios = <&gpio1 0 0>;
+               audio-routing =
+                       "Headphone Jack", "HP_L",
+                       "Headphone Jack", "HP_R",
+                       "Ext Spk", "SPK_LP",
+                       "Ext Spk", "SPK_LN",
+                       "Ext Spk", "SPK_RP",
+                       "Ext Spk", "SPK_RN",
+                       "LINPUT2", "Mic Jack",
+                       "LINPUT3", "Mic Jack",
+                       "RINPUT1", "Main MIC",
+                       "RINPUT2", "Main MIC",
+                       "Mic Jack", "MICB",
+                       "Main MIC", "MICB",
+                       "CPU-Playback", "ASRC-Playback",
+                       "Playback", "CPU-Playback",
+                       "ASRC-Capture", "CPU-Capture",
+                       "CPU-Capture", "Capture";
+       };
+};
+
+&acm {
+       assigned-clocks = <&clk IMX8QXP_AUD_PLL0_DIV>,
+                       <&clk IMX8QXP_AUD_ACM_AUD_PLL_CLK0_DIV>,
+                       <&clk IMX8QXP_AUD_ACM_AUD_REC_CLK0_DIV>;
+       assigned-clock-rates = <786432000>, <24576000>, <24576000>;
+       status = "okay";
+};
+
+&asrc0 {
+       fsl,asrc-rate  = <48000>;
+       status = "okay";
 };
 
 &iomuxc {
                        >;
                };
 
+               pinctrl_cm40_i2c: cm40i2cgrp {
+                       fsl,pins = <
+                               SC_P_ADC_IN1_M40_I2C0_SDA       0x0600004c
+                               SC_P_ADC_IN0_M40_I2C0_SCL       0x0600004c
+                       >;
+               };
+
+               pinctrl_sai1: sai1grp {
+                       fsl,pins = <
+                               SC_P_SAI1_RXD_ADMA_SAI1_RXD     0x0600004c
+                               SC_P_SAI1_RXC_ADMA_SAI1_TXC     0x0600004c
+                               SC_P_SAI1_RXFS_ADMA_SAI1_TXFS   0x0600004c
+                               SC_P_SPI0_CS1_ADMA_SAI1_TXD     0x0600004c
+                               SC_P_SPI2_CS0_LSIO_GPIO1_IO00   0x0600004c
+                               SC_P_MCLK_OUT0_ADMA_ACM_MCLK_OUT0       0x0600004c
+                       >;
+               };
+
                pinctrl_usdhc1: usdhc1grp {
                        fsl,pins = <
                                SC_P_EMMC0_CLK_CONN_EMMC0_CLK           0x06000041
        };
 };
 
+&intmux_cm40 {
+       status = "okay";
+};
+
+&i2c0_cm40 {
+       #address-cells = <1>;
+       #size-cells = <0>;
+       clock-frequency = <100000>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_cm40_i2c>;
+       status = "okay";
+
+       wm8960: wm8960@1a {
+               compatible = "wlf,wm8960";
+               reg = <0x1a>;
+               clocks = <&clk IMX8QXP_AUD_MCLKOUT0>;
+               clock-names = "mclk";
+               wlf,shared-lrclk;
+               power-domains = <&pd_mclk_out0>;
+               assigned-clocks = <&clk IMX8QXP_AUD_MCLKOUT0>;
+               assigned-clock-rates = <12288000>;
+       };
+};
+
+&sai1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_sai1>;
+       status = "okay";
+};
+
 &usdhc1 {
        pinctrl-names = "default", "state_100mhz", "state_200mhz";
        pinctrl-0 = <&pinctrl_usdhc1>;