完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
一、es7243电路图。
二、修改的部分,解决没有mclk的问题。 commit b86b0275bf898fcc61abd48c776186e901bceac7 Author: xxx @192.168.2.82:xxx/xxx.git> Date: Mon Jun 7 10:02:10 2021 +0800 es7243 recording function is ok now . diff --git a/kernel/arch/arm64/boot/dts/rockchip/rk3328.dtsi b/kernel/arch/arm64/boot/dts/rockchip/rk3328.dtsi index db9df63..5d9cb89 100755 --- a/kernel/arch/arm64/boot/dts/rockchip/rk3328.dtsi +++ b/kernel/arch/arm64/boot/dts/rockchip/rk3328.dtsi @@ -242,8 +242,8 @@ compatible = "rockchip,rk3328-i2s", "rockchip,rk3066-i2s"; reg = <0x0 0xff010000 0x0 0x1000>; interrupts = - clocks = <&cru SCLK_I2S1>, <&cru HCLK_I2S1_8CH>; - clock-names = "i2s_clk", "i2s_hclk"; + clocks = <&cru SCLK_I2S1>, <&cru HCLK_I2S1_8CH>,<&cru SCLK_I2S1_OUT>; + clock-names = "i2s_clk", "i2s_hclk","i2s_mclk"; dmas = <&dmac 14>, <&dmac 15>; dma-names = "tx", "rx"; resets = <&cru SRST_I2S1>, <&cru SRST_I2S1_H>; @@ -1080,8 +1080,8 @@ compatible = "rockchip,rk3328-codec"; reg = <0x0 0xff410000 0x0 0x1000>; rockchip,grf = <&grf>; - clocks = <&cru PCLK_ACODEC>, <&cru SCLK_I2S1>; - clock-names = "pclk", "mclk"; + clocks = <&cru PCLK_ACODEC>, <&cru SCLK_I2S1>, <&cru SCLK_I2S1_OUT>; + clock-names = "pclk", "mclk","i2s1_mclk"; status = "disabled"; }; diff --git a/kernel/sound/soc/codecs/rk3328_codec.c b/kernel/sound/soc/codecs/rk3328_codec.c old mode 100644 new mode 100755 index 5a4184a..6c5cbde --- a/kernel/sound/soc/codecs/rk3328_codec.c +++ b/kernel/sound/soc/codecs/rk3328_codec.c @@ -42,6 +42,9 @@ #define RK3328_GRF_SOC_CON10 (0x0428) #define INITIAL_FREQ (11289600) +extern int es7243_standby(void); +extern int es7243_start(void); + struct rk3328_codec_priv { struct regmap *regmap; struct regmap *grf; @@ -50,6 +53,7 @@ struct rk3328_codec_priv { unsigned int sclk; int spk_depop_time; /* msec */ }; +struct clk *i2s1_mclk; static const struct reg_default rk3328_codec_reg_defaults[] = { { CODEC_RESET, 0x03 }, @@ -322,13 +326,29 @@ static int rk3328_hw_params(struct snd_pcm_substream *substream, static int rk3328_pcm_startup(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { - return rk3328_codec_open_playback(dai->component); + printk("rn rk3328_pcm_startup substream->stream=%d rn",substream->stream); + if(substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + return rk3328_codec_open_playback(dai->component); + else { + printk("%s--es7243_start---n",__func__); + clk_prepare_enable(i2s1_mclk); + clk_set_rate(i2s1_mclk, INITIAL_FREQ); + es7243_start(); + return 0; + } } static void rk3328_pcm_shutdown(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { - rk3328_codec_close_playback(dai->component); + printk("rn rk3328_pcm_shutdown substream->stream=%d rn",substream->stream); + if(substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + rk3328_codec_close_playback(dai->component); + else { + printk("%s--es7243_standbyn",__func__); + es7243_standby(); + clk_disable_unprepare(i2s1_mclk); + } } static const struct snd_soc_dai_ops rk3328_dai_ops = { @@ -473,9 +493,11 @@ static int rk3328_platform_probe(struct platform_device *pdev) rk3328_analog_output(rk3328, 0); rk3328->mclk = devm_clk_get(&pdev->dev, "mclk"); + i2s1_mclk = devm_clk_get(&pdev->dev, "i2s1_mclk"); if (IS_ERR(rk3328->mclk)) return PTR_ERR(rk3328->mclk); + ret = clk_prepare_enable(rk3328->mclk); if (ret) return ret; 三、测试命令 tinycap /sdcard/rec0.wav -D 0 -d 0 –c 2 –r 44100 –b 16 –p 1024 –n 3 四、es7243驱动在附件,下载地址 |
|
|
|
你正在撰写答案
如果你是对答案或其他答案精选点评或询问,请使用“评论”功能。
1906 浏览 1 评论
synopsys 的design ware:DW_fpv_div,浮点数除法器,默认32位下,想提升覆盖率(TMAX),如果用功能case去提升覆盖率呢?
2382 浏览 1 评论
RK3588 GStreamer调试四路鱼眼摄像头四宫格显示报错
5175 浏览 1 评论
【飞凌嵌入式OK3576-C开发板体验】RKNN神经网络-YOLO图像识别
254 浏览 0 评论
【飞凌嵌入式OK3576-C开发板体验】SSH远程登录网络配置及CAN通讯
1336 浏览 0 评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-22 05:57 , Processed in 0.521152 second(s), Total 43, Slave 34 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号