13426310867 发表于 2023-8-9 15:00:48

ROC-RK3308B-CC-PLUS_Buildroot_v1.5.0a 使用外部codec platform_name 为空

在DTS中增加:
                es7210_sound: es7210-sound {
                        status = "okay";
                        compatible = "simple-audio-card";
                        simple-audio-card,format = "i2s";
                        simple-audio-card,name = "rockchip,es7210";
                        simple-audio-card,mclk-fs = <256>;
                        simple-audio-card,cpu {
                                        sound-dai = <&i2s_8ch_0>;
                                };
                        simple-audio-card,codec {
                                        sound-dai = <&es7210>;
                                };                       
                };


&i2s_8ch_0 {
        status = "okay";
        rockchip,no-dmaengine;
        #sound-dai-cells = <0>;
};


&i2s_8ch_1 {
        status = "okay";
        #sound-dai-cells = <0>;
        rockchip,no-dmaengine;
        pinctrl-names = "default";
        pinctrl-0 = <&i2s_8ch_1_m0_sclktx
                     &i2s_8ch_1_m0_lrcktx
                     &i2s_8ch_1_m0_sdo0
                     &i2s_8ch_1_m0_mclk>;
};



&i2c3 {
        status = "okay";
        pinctrl-0 = <&i2c3m1_xfer>;
        clock-frequency = <100000>;
       
        es7210: es7210@41 {
                #sound-dai-cells = <0>;
                compatible = "MicArray_3";
                reg = <0x41>;
                clocks = <&cru SCLK_I2S0_8CH_TX_OUT>;
                clock-names = "mclk";
                pinctrl-names = "default";

        };
};

驱动等已正常编译加载,但无法正常生成声卡,log提示platform name 为空,仔细跟踪后发现没有调用过snd_soc_register_platform函数,不知道在哪里增加这部分。
[    1.591878] snd-soc-dummy snd-soc-dummy: snd_soc_dummy_probe
[    1.591899] snd-soc-dummy snd-soc-dummy: codec register snd-soc-dummy
[    1.591923] snd-soc-dummy snd-soc-dummy: ASoC: dai register snd-soc-dummy #1
[    1.591939] snd-soc-dummy snd-soc-dummy: ASoC: Registered DAI 'snd-soc-dummy-dai'
[    1.591954] snd-soc-dummy snd-soc-dummy: ASoC: Registered codec 'snd-soc-dummy'
[    1.591967] snd-soc-dummy snd-soc-dummy: ASoC: platform register snd-soc-dummy
[    1.591981] snd-soc-dummy snd-soc-dummy: ASoC: snd_soc_add_platform '(null)'
[    1.591997] snd-soc-dummy snd-soc-dummy: ASoC: Registered platform 'snd-soc-dummy'
[    1.592658] asoc-simple-card es7210-sound: New simple-card: rockchip,es7210
[    1.592697] asoc-simple-card es7210-sound: Revert to legacy daifmt parsing
[    1.594614] rockchip-i2s-tdm ff300000.i2s: devm_snd_soc_register_component
[    1.594653] rockchip-i2s-tdm ff300000.i2s: ASoC: dai register ff300000.i2s #1
[    1.594671] rockchip-i2s-tdm ff300000.i2s: ASoC: Registered DAI 'ff300000.i2s'
[    1.595501] rockchip-i2s-tdm ff310000.i2s: devm_snd_soc_register_component
[    1.595535] rockchip-i2s-tdm ff310000.i2s: ASoC: dai register ff310000.i2s #1
[    1.595553] rockchip-i2s-tdm ff310000.i2s: ASoC: Registered DAI 'ff310000.i2s'


[    1.623008] es7210_modinit enter
[    1.623106] mmc_host mmc0: Bus speed (slot 0) = 147456000Hz (slot req 150000000Hz, actual 147456000HZ div = 0)
[    1.623174] begin->>>>>>>>>>es7210_i2c_probe!
[    1.623186] i2c info: i2c flags = 0 i2c addr=41 i2c name=MicArray_3
[    1.623194] i2c info:device id = MicArray_3
[    1.623209] es7210 3-0041: codec register 3-0041
[    1.623243] es7210 3-0041: ASoC: dai register 3-0041 #1
[    1.623255] es7210 3-0041: ASoC: Registered DAI 'ES7210 4CH ADC 3'
[    1.623269] es7210 3-0041: ASoC: Registered codec 'es7210.3-0041'
[    1.623656] asoc-simple-card es7210-sound: New simple-card: rockchip,es7210
[    1.623691] asoc-simple-card es7210-sound: Revert to legacy daifmt parsing
[    1.623889] asoc-simple-card es7210-sound:   name : ff300000.i2s-ES7210 4CH ADC 3
[    1.623904] asoc-simple-card es7210-sound:   format : 4001
[    1.623915] asoc-simple-card es7210-sound:   cpu : ff300000.i2s / 50176000
[    1.623926] asoc-simple-card es7210-sound:   codec : ES7210 4CH ADC 3 / 50176000
[    1.623939] of_get_named_gpiod_flags: can't parse 'simple-audio-card,hp-det-gpio' property of node '/es7210-sound'
[    1.623950] of_get_named_gpiod_flags: can't parse 'simple-audio-card,mic-det-gpio' property of node '/es7210-sound'
[    1.623971] asoc-simple-card es7210-sound: ASoC: binding ff300000.i2s-ES7210 4CH ADC 3 at idx 0
[    1.623985] asoc-simple-card es7210-sound: platform_name: (null)
[    1.623997] asoc-simple-card es7210-sound: platform_name: (null) platform->component.name:snd-soc-dummy
[    1.624009] asoc-simple-card es7210-sound: ASoC: platform (null) not registered



页: [1]
查看完整版本: ROC-RK3308B-CC-PLUS_Buildroot_v1.5.0a 使用外部codec platform_name 为空