Chinaunix首页 | 论坛 | 博客
  • 博客访问: 314916
  • 博文数量: 135
  • 博客积分: 867
  • 博客等级: 准尉
  • 技术积分: 865
  • 用 户 组: 普通用户
  • 注册时间: 2012-03-15 14:50
文章分类

全部博文(135)

文章存档

2012年(135)

分类:

2012-03-31 09:32:30

XC2440开发板上使用的音频芯片是UDA1341,基于s3c2440的IIS总线,
硬件接法:L3MODE -> GPB2   L3DATA->GPB3   L3CLOCK->GPB4。
内核中的驱动文件为:sound/soc/codecs/uda134x.csound/soc/s3c24xx/s3c24xx_uda134x.c

我们需要在mach-xc2440.c文件中加入对uda1341的驱动支持:

加入uda134x头文件:
#include

在xc2440_devices[ ]平台设备结构体数组中加入audio设备和IIS总线设备:
  1. &xc2440_audio_device,
  2. &s3c_device_iis,

创建platform_device和platform_data:
  1. /* AUDIO */
  2. static struct s3c24xx_uda134x_platform_data xc2440_audio_pins = {
  3.     .l3_clk = S3C2410_GPB(4),
  4.     .l3_mode = S3C2410_GPB(2),
  5.     .l3_data = S3C2410_GPB(3),
  6.     .model = UDA134X_UDA1341,
  7. };

  8. static struct platform_device xc2440_audio_device = {
  9.     .name        = "s3c24xx_uda134x",
  10.     .id        = -1,
  11.     .dev        = {
  12.         .platform_data    = &xc2440_audio_pins,
  13.     },
  14. };

注意:
    从2.6.37内核开始,声卡驱动的框架有一些改动,需要构建codec和pcm设备,但注册设备时还是有问题,在2.6.38内核中已经解决了,但是没有声音,我还没有追踪原因。因为之前移植过2.6.36内核,声卡驱动是正常的,所以我就把2.6.36内核中的声卡驱动移植过来使用。
    下载2.6.36.x内核,替换2.6.37内核中的sound目录和include/sound,也可以使用光盘资料里带的“声卡驱动补丁”。

配置内核,支持声卡:
  1. Device Drivers --->
  2. <*> Sound card support --->
  3. <*> Advanced Linux Sound Architecture --->
  4. <*> OSS Mixer API
  5. <*> OSS PCM(digital audio) API
  6. [*] Support old ALSA API
  7. <*> Verbose procfs contents
  8. <*> ALSA for SoC audio support --->
  9. <*> SoC Audio for the Samsung S3CXXXX chips
  10. <*> 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)
阅读(912) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~