免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1021 | 回复: 0
打印 上一主题 下一主题

uda1341声卡驱动在linux-2.6.22.6上的移植步骤 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2011-01-10 09:00 |只看该作者 |倒序浏览

移植步骤:
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内核中dmabug
2.6.22
内核中dma通道的映射有问题。通道映射不正确的话,uda1341就没有输出。
   修改arch/arm/plat-s3c24xx/dma.cs3c2410_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

您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP