XC2440开发板上使用的音频芯片是UDA1341,基于s3c2440的IIS总线,
硬件接法:L3MODE -> GPB2 L3DATA->GPB3 L3CLOCK->GPB4。
内核中的驱动文件为:sound/soc/codecs/uda134x.c和sound/soc/s3c24xx/s3c24xx_uda134x.c
我们需要在mach-xc2440.c文件中加入对uda1341的驱动支持:
加入uda134x头文件:
#include
在xc2440_devices[ ]平台设备结构体数组中加入audio设备和IIS总线设备:
- &xc2440_audio_device,
-
&s3c_device_iis,
创建platform_device和platform_data:
- /* AUDIO */
-
static struct s3c24xx_uda134x_platform_data xc2440_audio_pins = {
-
.l3_clk = S3C2410_GPB(4),
-
.l3_mode = S3C2410_GPB(2),
-
.l3_data = S3C2410_GPB(3),
-
.model = UDA134X_UDA1341,
-
};
-
-
static struct platform_device xc2440_audio_device = {
-
.name = "s3c24xx_uda134x",
-
.id = -1,
-
.dev = {
-
.platform_data = &xc2440_audio_pins,
-
},
-
};
注意:
从2.6.37内核开始,声卡驱动的框架有一些改动,需要构建codec和pcm设备,但注册设备时还是有问题,在2.6.38内核中已经解决了,但是没有声音,我还没有追踪原因。因为之前移植过2.6.36内核,声卡驱动是正常的,所以我就把2.6.36内核中的声卡驱动移植过来使用。
下载2.6.36.x内核,替换2.6.37内核中的sound目录和include/sound,也可以使用光盘资料里带的“声卡驱动补丁”。
配置内核,支持声卡:
- Device Drivers --->
- <*> Sound card support --->
- <*> Advanced Linux Sound Architecture --->
- <*> OSS Mixer API
- <*> OSS PCM(digital audio) API
- [*] Support old ALSA API
- <*> Verbose procfs contents
- <*> ALSA for SoC audio support --->
- <*> SoC Audio for the Samsung S3CXXXX chips
- <*> SoC I2S Audio support UDA134X wired to a S3C24XX
内核启动时打印的调试信息:
Advanced Linux Sound Architecture Driver Version 1.0.23.
No device for DAI UDA134X
No device for DAI s3c24xx-i2s
S3C24XX_UDA134X SoC Audio driver
UDA134X SoC Audio Codec
asoc: UDA134X <-> s3c24xx-i2s mapping ok
ALSA device list:
#0: S3C24XX_UDA134X (UDA134X)
阅读(4121) | 评论(0) | 转发(4) |