完善资料让更多小伙伴认识你,还能领取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>; }; |
|
|
|
你正在撰写答案
如果你是对答案或其他答案精选点评或询问,请使用“评论”功能。
1944 浏览 1 评论
synopsys 的design ware:DW_fpv_div,浮点数除法器,默认32位下,想提升覆盖率(TMAX),如果用功能case去提升覆盖率呢?
2435 浏览 1 评论
RK3588 GStreamer调试四路鱼眼摄像头四宫格显示报错
5221 浏览 1 评论
【飞凌嵌入式OK3576-C开发板体验】RKNN神经网络-YOLO图像识别
254 浏览 0 评论
【飞凌嵌入式OK3576-C开发板体验】SSH远程登录网络配置及CAN通讯
1336 浏览 0 评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-23 13:38 , Processed in 0.460344 second(s), Total 40, Slave 34 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号