QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 3246|回复: 1

Alsa s3c2410 uda1341 driver

[复制链接]
发表于 2006-11-24 16:55:48 | 显示全部楼层 |阅读模式
# --- Download alsa s3c2410 uda1341 patch from http://www.evolware.org/chri/paciugo/asound.patch
#         save it as alsa-s3c2410-patch

patch -p1 < ./alsa-s3c2410-patch

# --- small patch by ltz to uda1341.c
@@ -234,7 +234,7 @@
        if (ret == 0) {
                unsigned char buf[2] ;

-                buf[0] = uda->regs.stat0 | STAT0;
+                buf[0] = uda->regs.stat0 | STAT0 | STAT0_DC_FILTER | STAT0_RST;                                ///by ltz

                buf[1] = uda->regs.stat1 | STAT1;
                if (conf->record) {
                        buf[1] |= STAT1_ADC_ON;
@@ -692,7 +692,7 @@

        /* reset UDA */
        buf[0] = uda->regs.stat0 | STAT0_RST;

-        buf[1] = uda->regs.stat0;
+        buf[1] = uda->regs.stat1;                                        ///by ltz

        l3_write(uda->l3_bus, UDA1341_STATUS, buf, 2);

# --- patch kernel's Makefile, add alsa s3c2410 driver dir here
vmlinux-dirs        := $(patsubst %/,%,$(filter %/, $(init-y) $(init-m) \
                     $(core-y) $(core-m) $(drivers-y) $(drivers-m) \
-                     $(net-y) $(net-m) $(libs-y) $(libs-m)))

+                     $(net-y) $(net-m) $(libs-y) $(libs-m))) \
+                         ThePathToYouAlsaDriver/local

# --- patch kernel source
#arch/arm/mach-s3c2410/devs.h
+               
+extern struct platform_device audio_dev'
+extern struct platform_device uda1341_dev;

#arch/arm/mach-s3c2410/devs.c
+struct platform_device audio_dev = {        /// add here for testing alsa driver
+       .name   = "akt50-sound",
+       .dev    = {
+               .parent         = &s3c_device_iis.dev,
+       },
+};
+EXPORT_SYMBOL(audio_dev);
+
+struct platform_device uda1341_dev = {        /// add here for testing alsa driver
+       .name   = "uda1341",
+       .dev    = {
+               .parent         = &audio_dev.dev,
+       },
+};
+EXPORT_SYMBOL(uda1341_dev);
+               

#patch mach-smdk2410.c
static struct platform_device *smdk2410_devices[] __initdata = {
        &s3c_device_ts,       
        &s3c_device_usb,
        &s3c_device_lcd,
        &s3c_device_wdt,
        /* &s3c_device_i2c, */
        &s3c_device_iis,

+        &audio_dev,                                /// add here for testing alsa driver
+        &uda1341_dev,
       
        &s3c_device_nand,
        &s3c_device_spi0,
        &s3c_device_rtc,
};

#kernel make menuconfig
<*> Sound card support
<*> Advanced Linux Sound Architecture
        <*>   OSS Mixer API
        <*>   OSS PCM (digital audio) API

#make zImage and upload the image to your board
#make modules and copy the *.ko to you board's /usr/lib/.
#sudo:
        insmod l3_core.ko
        insmod l3_algo_bit.ko
        insmod uda1341.ko
        insmod s3c24xx_iis.ko
        insmod akt50_sound.ko

#PATACH needed: I have test this driver on smdk2410 and find the play speed is 2 time faster than normal;
                                I also test s3c2410-uda1341-superlp's oss driver, the play speed is also too faster.
                                But why?
 楼主| 发表于 2006-12-25 17:45:34 | 显示全部楼层

Got it

Make a stupid mistake:
My sound file is only 1 channel and I mistake it to 2 channels, so the speed is 2 times faster
回复

使用道具 举报

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

本版积分规则

GMT+8, 2024-11-2 04:32 , Processed in 0.065747 second(s), 15 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表