移植步骤: 1.获取声卡驱动s3c2440-uda1341.c
2.将s3c2440-uda1341.c复制到sound/oss/目录下
3.修改oss目录下的kconfig vi sound/oss/Kconfig 添加 config S3C2440_UDA1341 tristate "S3C2440 UDA1341 driver" depends on SOUND_PRIME!=n && SOUND && ARM && ARCH_S3C2440 help
4.修改oss目录下的makefile vi sound/oss/Makefile 增加 obj-$(CONFIG_S3C2440_UDA1341) += s3c2440-uda1341.o
5.修改增加内存映射,以使内核知道该虚拟地址可用,而且对应的物理地址是我们的声卡。修改/arch/arm/mach-s3c2440/mach-smdk2440.c如下: static struct map_desc smdk2410_iodesc[] __initdata = {
.virtual = 0xf0d00000,
.pfn = 0x55000000 >> PAGE_SHIFT,
.length = SZ_1M,
.type = MT_DEVICE, // 声卡内存映射
};
6.由于需要用到bitfield.h的头文件,而2.6的内核没有这个头文件,所以需要从2.4.18内核中的include/asm/arch/bitfield.h获取并把头文件复制到2.6.22.6的同目录下
7.修复2.6.22内核中dma的bug 2.6.22内核中dma通道的映射有问题。通道映射不正确的话,uda1341就没有输出。 修改arch/arm/plat-s3c24xx/dma.c的s3c2410_dma_map_channel函数中修改如下: static struct s3c2410_dma_chan *s3c2410_dma_map_channel(int channel) { struct s3c24xx_dma_order_ch *ord = NULL; struct s3c24xx_dma_map *ch_map; struct s3c2410_dma_chan *dmach; int ch; if (dma_sel.map == NULL || channel > dma_sel.map_size) return NULL; ch_map = dma_sel.map + channel; /* first, try the board mapping */ #if 0 //这里 if (dma_order) { ord = &dma_order->channels[channel]; for (ch = 0; ch list[ch])) continue; if (s3c2410_chans[ord->list[ch]].in_use == 0) { ch = ord->list[ch] & ~DMA_CH_VALID; goto found; } } if (ord->flags & DMA_CH_NEVER) return NULL; } #endif //这里 /* second, search the channel map for first free */ 就是注释掉一段代码就行了。 然后,还是同一个文档中,修改这个函数:s3c2410_dma_enqueue 这个函数的结尾: } else if (chan->state == S3C2410_DMA_IDLE) { if (chan->flags & S3C2410_DMAF_AUTOSTART) { s3c2410_dma_ctrl(channel, S3C2410_DMAOP_START); //修改的只有这一行 } } local_irq_restore(flags); return 0; } 上面注释的那行,把第一个参数chan->number,换成了现在的channel。
8. make menuconfig 选择Device driver->sound->sound card support->open sound system->uda1341(一,二两项)
add by eabi010.cublog.cn
|