Platform: Rockchip
OS: Android 6.0
Kernel: 3.10.92
之前平台用的RT5631, 由于此IC将要停产,所以需要替换为RT5640.
RT5640和RT3224在硬件和软件上完全兼容, 而RK配置RT3224时用是RT3261的驱动,有点绕.
以下是添加步骤:
1. 开启对应宏
kernel/arch/arm/configs/rockchip_defconfig:
CONFIG_SND_RK_SOC_RT3224=y
这样, rt3261.c和rk_rt3261就会被编译进去.
2.dts中添加配置
kernel/arch/arm/boot/dts/rk3288-eco.dts
Codec device添加:
device name是 “rockchip-rt3261”.
+ rockchip-rt3224 {
+ compatible = "rockchip-rt3261";
+ dais {
+ dai0 {
+ audio-codec = <&rt3261>;
+ audio-controller = <&i2s>;
+ format = "i2s";
+ //continuous-clock;
+ //bitclock-inversion;
+ //frame-inversion;
+ //bitclock-master;
+ //frame-master;
+ };
+ dai1 {
+ audio-codec = <&rt3261>;
+ audio-controller = <&i2s>;
+ format = "dsp_a";
+ //continuous-clock;
+ bitclock-inversion;
+ //frame-inversion;
+ //bitclock-master;
+ //frame-master;
+ };
+ };
+ };
这样rk_rt3261.c的driver就会匹配上,最终注册Machine driver.
I2C设备添加:
地址是0x1C, device name是”rt3261”.
&i2c2 {
......
+ rt3261: rt3261@1c {
+ compatible = "rt3261";
+ reg = <0x1c>;
+
+ spk-num= <2>;
+ modem-input-mode = <1>;
+ lout-to-modem_mode = <1>;
+ spk-amplify = <2>;
+ playback-if1-data_control = <0>;
+ playback-if2-data_control = <0>;
+ status = "okay";
+ };
};
这样rt3261.c中的i2c driver就会匹配上,最终注册Codec driver.