2016/4/7

imx6 sabresd soud, ssi, audmux dtd

sabresd

imx6dl-sabresd.dts:
  
  imx6qdl.dtsi:
    ssi1.2.3  "fsl.imx6q-ssi","fsl-imx21-ssi"
    audmux    "fsl,imx6q-audmux","fsl,imx31-audmux"
    iomuxc
      pinctrl_audmux_1 (AUD4)
      pinctrl_audmux_2 (AUD3)
      pinctrl_audmux_3 (AUD5)
  
  imx6qdl-sabresd.dtsi:
    sound ssi2       "fsl,imx6q-sabresd-wm8962","fsl,imx-audio-wm8962"
    ssi2 i2s-slave
    audmux pinctrl_audmux_2
 
大概相關的幾個 node


driver code 相關

實際設定 AUDMUX 的地方在 sound/soc/fsl/imx-wm8962.c:
static int imx_wm8962_probe(struct platform_device *pdev)
{
       .....
       .....

        of_property_read_u32(np, "mux-int-port", &int_port);
        of_property_read_u32(np, "mux-ext-port", &ext_port);
        
        int_port--;
        ext_port--;
        ret = imx_audmux_v2_configure_port(int_port,
                        IMX_AUDMUX_V2_PTCR_SYN |
                        IMX_AUDMUX_V2_PTCR_TFSEL(ext_port) |
                        IMX_AUDMUX_V2_PTCR_TCSEL(ext_port) |
                        IMX_AUDMUX_V2_PTCR_TFSDIR |
                        IMX_AUDMUX_V2_PTCR_TCLKDIR,
                        IMX_AUDMUX_V2_PDCR_RXDSEL(ext_port));
       ....


所以要看這個drver ("imx-audio-wm8962") 的 dtb..
imx6qdl-sabresd.dtsi
        sound {
                compatible = "fsl,imx6q-sabresd-wm8962",
                           "fsl,imx-audio-wm8962";
                model = "wm8962-audio";
                cpu-dai = <&ssi2>;
                audio-codec = <&codec>;
                audio-routing =
                        "Headphone Jack", "HPOUTL",
                        "Headphone Jack", "HPOUTR",
                        "Ext Spk", "SPKOUTL",
                        "Ext Spk", "SPKOUTR",
                        "MICBIAS", "AMIC",
                        "IN3R", "MICBIAS",
                        "DMIC", "MICBIAS",
                        "DMICDAT", "DMIC";
                mux-int-port = <2>;
                mux-ext-port = <3>;
                hp-det-gpios = <&gpio7 8 1>;
                mic-det-gpios = <&gpio1 9 1>;
        };
有 mux-int-port, mux-ext-port 兩個 value

cpu-dai 是 ssi2 ,所以mux-int-port 就是 2
audmux 用的是 pinctrl_audmux_2:
&audmux {
        pinctrl-names = "default"; 
        pinctrl-0 = <&pinctrl_audmux_2>;
        status = "okay";
};
這個 pinctrl 就是..
                pinctrl_audmux_2: audmux-2 {
                        fsl,pins = <
                                MX6QDL_PAD_CSI0_DAT7__AUD3_RXD  0x130b0
                                MX6QDL_PAD_CSI0_DAT4__AUD3_TXC  0x130b0
                                MX6QDL_PAD_CSI0_DAT5__AUD3_TXD  0x110b0
                                MX6QDL_PAD_CSI0_DAT6__AUD3_TXFS 0x130b0
                        >;
                }; 
對應 AUD3, 所以 mux-ext-port 是 3

沒有留言:

張貼留言