|
移植sgtl5000到rk3288板子上的痛苦经历,求思路
发表于 2015-6-26 09:33:59
浏览:27216
|
回复:10
打印
只看该作者
[复制链接]
楼主
我们现在需要移植sgtl5000到瑞星微rk3288板子(我们参考firefly-rk3288设计的板子)上,现在sound/codec/sgtl5000.c是有的,但是sound/rockchip/rk_sgtl5000(codec的machine相关驱动)是没有的。
因为之前我们公司飞思卡尔平台上的sgtl5000是成功播放声音的。所以我把之前飞思卡尔版本内核(3.01作左右的版本)的imx-sgtl5000.c 直接当成sound/rockchip/rk_sgtl5000用,这个文件也做了些细微修改,修改主要是适配从Linux内核3.01到3.10的变化。不过核心的配置I2S,codec寄存器的我没改。
然后的移植还有个工作,飞思卡尔平台上的是SSI总线吧,这个也可以配成I2S模式,我比较下sound/imx/imx-ssi.c 和 sound/rockchip/rk30_i2s.c (codec的platform驱动比较),感觉rk30_i2s.c应该对于rk_wm8960,rk_es8323都是独立的,也不需要针对sgtl5000再做什么改动吧。
然后移植代码修改完,编译后的andorid内核启动后,显示声卡已经被加载。
dmesg | grep -i sgtl
<4>[ 1.502494] sgtl5000_i2c_probe begin
<4>[ 1.502516] sgtl5000_i2c_probe end
<4>[ 1.503217] imx_sgtl5000_probe enteredddd
<4>[ 1.503359] sgtl5000_probe here
<3>[ 1.548906] sgtl5000 2-000a: ASoC: no sink widget found for Capture Mux
<3>[ 1.548916] sgtl5000 2-000a: ASoC: Failed to add route LINE_IN -> LINE_IN
-> Capture Mux
<3>[ 1.548924] sgtl5000 2-000a: ASoC: no sink widget found for Mic Bias
<3>[ 1.548932] sgtl5000 2-000a: ASoC: Failed to add route MIC_IN -> direct ->
Mic Bias
<3>[ 1.548940] sgtl5000 2-000a: ASoC: no source widget found for Mic Bias
<3>[ 1.548948] sgtl5000 2-000a: ASoC: Failed to add route Mic Bias -> MIC_IN
-> Capture Mux
<3>[ 1.548956] sgtl5000 2-000a: ASoC: no source widget found for Capture Mux
<3>[ 1.548963] sgtl5000 2-000a: ASoC: Failed to add route Capture Mux -> dire
ct -> ADC
<3>[ 1.548971] sgtl5000 2-000a: ASoC: no source widget found for ADC
<3>[ 1.548978] sgtl5000 2-000a: ASoC: Failed to add route ADC -> ADC -> DAP_I
N
<3>[ 1.548986] sgtl5000 2-000a: ASoC: no sink widget found for DAP_IN
<3>[ 1.548993] sgtl5000 2-000a: ASoC: Failed to add route AIFIN -> I2S_IN ->
DAP_IN
<3>[ 1.549001] sgtl5000 2-000a: ASoC: no source widget found for ADC
<3>[ 1.549008] sgtl5000 2-000a: ASoC: Failed to add route ADC -> ADC -> MIX_M
UX
<3>[ 1.549016] sgtl5000 2-000a: ASoC: no sink widget found for MIX_MUX
<3>[ 1.549023] sgtl5000 2-000a: ASoC: Failed to add route AIFIN -> I2S_IN ->
MIX_MUX
<3>[ 1.549031] sgtl5000 2-000a: ASoC: no source widget found for DAP_IN
<3>[ 1.549038] sgtl5000 2-000a: ASoC: Failed to add route DAP_IN -> direct ->
DAP_MIXER
<3>[ 1.549046] sgtl5000 2-000a: ASoC: no source widget found for MIX_MUX
<3>[ 1.549054] sgtl5000 2-000a: ASoC: Failed to add route MIX_MUX -> Mixer Ch
annel -> DAP_MIXER
<3>[ 1.549062] sgtl5000 2-000a: ASoC: no source widget found for ADC
<3>[ 1.549070] sgtl5000 2-000a: ASoC: Failed to add route ADC -> ADC -> I2S_O
UT
<3>[ 1.549077] sgtl5000 2-000a: ASoC: no sink widget found for I2S_OUT
<3>[ 1.549085] sgtl5000 2-000a: ASoC: Failed to add route AIFIN -> I2S_IN ->
I2S_OUT
<3>[ 1.549092] sgtl5000 2-000a: ASoC: no source widget found for DAP_MIXER
<3>[ 1.549100] sgtl5000 2-000a: ASoC: Failed to add route DAP_MIXER -> DAP ->
I2S_OUT
<3>[ 1.549108] sgtl5000 2-000a: ASoC: no source widget found for I2S_OUT
<3>[ 1.549115] sgtl5000 2-000a: ASoC: Failed to add route I2S_OUT -> direct -
> AIFOUT
<3>[ 1.549123] sgtl5000 2-000a: ASoC: no source widget found for ADC
<3>[ 1.549130] sgtl5000 2-000a: ASoC: Failed to add route ADC -> ADC -> DAC_I
N
<3>[ 1.549138] sgtl5000 2-000a: ASoC: no sink widget found for DAC_IN
<3>[ 1.549146] sgtl5000 2-000a: ASoC: Failed to add route AIFIN -> I2S_IN ->
DAC_IN
<3>[ 1.549154] sgtl5000 2-000a: ASoC: no source widget found for DAP_MIXER
<3>[ 1.549161] sgtl5000 2-000a: ASoC: Failed to add route DAP_MIXER -> DAP ->
DAC_IN
<3>[ 1.549168] sgtl5000 2-000a: ASoC: no source widget found for DAC_IN
<3>[ 1.549176] sgtl5000 2-000a: ASoC: Failed to add route DAC_IN -> direct ->
DAC
<3>[ 1.549183] sgtl5000 2-000a: ASoC: no source widget found for DAC
<3>[ 1.549190] sgtl5000 2-000a: ASoC: Failed to add route DAC -> DAC -> Headp
hone Mux
<3>[ 1.549198] sgtl5000 2-000a: ASoC: no source widget found for DAC
<3>[ 1.549205] sgtl5000 2-000a: ASoC: Failed to add route DAC -> direct -> LO
<3>[ 1.549213] sgtl5000 2-000a: ASoC: no sink widget found for Headphone Mux
<3>[ 1.549221] sgtl5000 2-000a: ASoC: Failed to add route LINE_IN -> LINE_IN
-> Headphone Mux
<3>[ 1.549229] sgtl5000 2-000a: ASoC: no source widget found for Headphone Mu
x
<3>[ 1.549237] sgtl5000 2-000a: ASoC: Failed to add route Headphone Mux -> di
rect -> HP
<3>[ 1.549244] sgtl5000 2-000a: ASoC: no source widget found for LO
<3>[ 1.549251] sgtl5000 2-000a: ASoC: Failed to add route LO -> direct -> LIN
E_OUT
<3>[ 1.549259] sgtl5000 2-000a: ASoC: no source widget found for HP
<3>[ 1.549266] sgtl5000 2-000a: ASoC: Failed to add route HP -> direct -> HP_
OUT
<6>[ 1.549303] sgtl5000 2-000a: read 2 => 60
<6>[ 1.549314] sgtl5000 2-000a: read 2 => 60
<6>[ 1.549997] rockchip-sgtl5000 rockchip-sgtl5000.25: sgtl5000 <-> rockchip
-i2s.0 mapping ok
<6>[ 1.550322] input: sgtl5000-audio Headphone Jack as /devices/rockchip-sgtl
5000.25/sound/card0/input1
<6> #0: sgtl5000-audio
然后用i2c相关工具读写codec从设备地址0x0a没有失败:
i2c_test /dev/i2c-2 0x0a
但是执行tingplay /data/shasha.wav 时,显示error play sample ,然后这个命名就退出了。
我用dmesg | grep -i i2c 看到:
<3>[ 94.832661] rockchip_i2c ff660000.i2c: SCL was hold by slave
<3>[ 94.832861] rockchip_i2c ff660000.i2c: Addr[0x000a] wait event timeout, st
ate: 3, is_busy: 1, error: 0, complete_what: 0x2, ipd: 0x80
我们的板子是分载板和核心板的,sgtl5000是焊在载板上,核心板有飞思卡尔和rk3288两个不同板子,载板不变,核心板换成飞思卡尔的就可以成功驱动sgtl5000播放出声音。但是换成3288板子就出现上面错误。
还有3288核心板之前搭配wm8960我们移植成功了,说明我们3288核心板的i2s部分也可以工作的。
所以我觉得板子I2C通信出的问题可能跟软件有关。
我想问问 如果出现i2c 通信错误比如上面那个,该怎样调试解决啊?大家有没有思路啊?谢谢指点。 |
|