1. 定义并添加声卡设备到系统平台设备初始化列表中
修改arch/arm/plat-s3c24xx/devs.c,添加如下内容
#include
#include
/* UDA1341 */
static struct s3c24xx_uda134x_platform_data s3c24xx_uda134x_data = {
.l3_clk = S3C2410_GPB4,
.l3_data = S3C2410_GPB3,
.l3_mode = S3C2410_GPB2,
.model = UDA134X_UDA1341,
};
struct platform_device s3c_device_uda134x = {
.name = "s3c24xx_uda134x",
.dev = {
.platform_data = &s3c24xx_uda134x_data,
}
};
EXPORT_SYMBOL(s3c_device_uda134x);
修改 arch/arm/plat-s3c/include/plat/devs.h,添加如下内容
extern struct platform_device s3c_device_uda134x;
修改vi arch/arm/mach-s3c2440/mach-smdk2440.c,找到*smdk2440_devices[],添加&s3c_device_uda134x
static struct platform_device *smdk2440_devices[] __initdata = {
&s3c_device_usb,
&s3c_device_lcd,
&s3c_device_wdt,
&s3c_device_i2c0,
&s3c_device_iis,
&s3c_device_rtc,
&s3c_device_dm9000,
&s3c_device_uda134x, //加上这一句
};
2、
配置内核
Device Drivers --->
Sound card support --->
Advanced Linux Sound Architecture --->
OSS Mixer API
OSS PCM (digital audio) API
[*] OSS PCM (digital audio) API - Include plugin system
[*] Support old ALSA API
[*] Verbose procfs contents
[*] Verbose printk
[*] Generic sound devices --->
ALSA for SoC audio support --->
SoC Audio for the Samsung S3C24XX chips
SoC I2S Audio support UDA134X wired to a S3C24XX
3、
make zImage
4、播放出理卡的现像
先获取 1.0.18a 的声卡驱动,可以下载 Linux-2.6.29.xxx 的内核源码;
然后复制 "Linux-2.6.29.xxx/sound/" 目录和 "Linux-2.6.29.xxx/include/sound/" 目录到 Linux-2.6.30.4 内核中替换掉对应的目录;
复制 "Linux-2.6.29.xxx/include/asm-arm/plat-s3c24xx" 目录到 "Linux-2.6.30.4/include/asm-arm/" 目录下;
复制 "Linux-2.6.29.xxx/arch/arm/mach-s3c2410/include/mach/audio.h" 文件到 "Linux-2.6.30.4/arch/arm/mach-s3c2410/include/mach/" 目录下。
在 "Linux-2.6.30.4/include/linux/proc_fs.h" 文件的第70行添加如下内容:
struct module *owner;
因为在 "Linux-2.6.30.4/sound/core/info.c" 文件的 159 和 982 行用到了 struct proc_dir_entry 结构体的 owner 成员变量。
5)
# make clean 最好执行一次
# make zImage
OK!
此资料来来: