完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
基于RK3288 平台 Simple card声卡添加及调试
Simple card即简单通用的machine driver, 如果simple-card框架足够满足需求,建议优先使用simple card框架,简单,方便,且易用. 一、 添加声卡 1. 添加codec driver,比如添加:sound/soc/codec/es8323.c 2. 修改sound/soc/codec/Kconfig以及Makefile加入驱动编译。 sound/soc/codec/Kconfig: 添加 select SND_SOC_ES8323 if I2C config SND_SOC_ES8323 tristate "Everest Semi ES8323 CODEC" depends on I2C sound/soc/codec/Makefile: 添加 snd-soc-es8323-objs := es8323.o obj-$(CONFIG_SND_SOC_ES8323) += snd-soc-es8323.o 3. menuconfig中enable simple card以及codec make menuconfig Device Drivers ---> Sound card support ---> Advanced Linux Sound Architecture ---> ALSA for SoC audio support ---> ASoC support for Rockchip CODEC drivers ---> <*> Everest Semi ES8323 CODEC 4. 产品的DTS中添加Simple Card Node 二、修改DTS文件 1 添加sound card 和 spdif(可选添加,用不到不用添加) 2 添加:&i2c2(es8323 mclk)和&i2s(es8323 I2S通信) 3 添加&sound 注意,需要增加内容如下: { sound: sound { status = "okay"; compatible = "simple-audio-card"; simple-audio-card,format = "i2s"; simple-audio-card,name = "rockchip,firefly-codec"; simple-audio-card,mclk-fs = <512>; simple-audio-card,widgets = "Microphone", "Microphone Jack", "Headphone", "Headphone Jack"; simple-audio-card,routing = "MIC1", "Microphone Jack", "MIC2", "Microphone Jack", "Microphone Jack", "micbias1", "Headphone Jack", "HPOL", "Headphone Jack", "HPOR"; simple-audio-card,dai-link@0 { format = "i2s"; cpu { sound-dai = <&i2s>; }; codec { sound-dai = <&es8323>; }; }; simple-audio-card,dai-link@1 { format = "i2s"; cpu { sound-dai = <&i2s>; }; codec { sound-dai = <&hdmi>; }; }; }; spdif_out: spdif-out { status = "okay"; compatible = "linux,spdif-dit"; #sound-dai-cells = <0>; }; spdif-sound { status = "okay"; compatible = "simple-audio-card"; simple-audio-card,name = "ROCKCHIP,SPDIF"; simple-audio-card,cpu { sound-dai = <&spdif>; }; simple-audio-card,codec { sound-dai = <&spdif_out>; }; } &i2c2 { status = "okay"; es8323: es8323@10 { status = "okay"; compatible = "everest,es8323"; reg = <0x10>; spk-con-gpio = <&gpio5 12 GPIO_ACTIVE_LOW>; // hp-det-gpio = <&gpio7 15 GPIO_ACTIVE_LOW>; clock-names = "mclk"; clocks = <&cru SCLK_I2S0_OUT>; pinctrl-names = "default"; pinctrl-0 = <&i2s0_mclk>; #sound-dai-cells = <0>; }; }; 需要注意的是,如上es8323的clocks即mclk, upstream代码遵循谁使用clk谁申请的原则,所以后续自己添加的codec driver,如果有使用 外部clk作为mclk,需要做同样的适配。 &i2s { #sound-dai-cells = <0>; status = "okay"; }; &sound { status = "okay"; }; 注意要去掉以下内容,否则声卡驱动无法挂载 &es8323 { // aux-det-gpio = <&gpio2 15 GPIO_ACTIVE_HIGH>; spk-ctl-gpio = <&gpio7 2 GPIO_ACTIVE_HIGH>; }; 三、总结 1 屏幕不亮的问题 调试中发现屏幕 背光是亮的,但是屏幕不亮,把vcc_sys_5v: vcc-sys-5v,gpio GPIO0_B5 修改为GPIO7_A3屏幕就亮了。 如下所示: vcc_sys_5v: vcc-sys-5v{ compatible = "regulator-fixed"; enable-active-high; gpio = <&gpio7 3 GPIO_ACTIVE_HIGH>; pinctrl-names = "default"; pinctrl-0 = <&pwr5v_en>; regulator-name = "vcc_sys_5v"; regulator-min-microvolt = <5000000>; regulator-max-microvolt = <5000000>; regulator-always-on; regulator-boot-on; }; vcc-sys { pwr5v_en: pwr5v-en { rockchip,pins = <7 3 RK_FUNC_GPIO &pcfg_output_high>; }; }; 2 调试中声卡总是挂载不上去:在dts中去掉以下内容后就可以了。因为在I2C2中已经设置过 &es8323 { // aux-det-gpio = <&gpio2 15 GPIO_ACTIVE_HIGH>; spk-ctl-gpio = <&gpio7 2 GPIO_ACTIVE_HIGH>; }; |
|
|
|
你正在撰写答案
如果你是对答案或其他答案精选点评或询问,请使用“评论”功能。
基于米尔瑞芯微RK3576核心板/开发板的人脸疲劳检测应用方案
626 浏览 0 评论
887 浏览 1 评论
784 浏览 1 评论
1997 浏览 1 评论
3242 浏览 1 评论
浏览过的版块 |
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-23 22:36 , Processed in 0.542118 second(s), Total 73, Slave 56 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号