天天看點

linux2.26.32.8 s3c2440 移植uda1341聲霸卡驅動

1、驅動使用到的核心檔案主要有以下幾個:

The main source code is located at:

sound/soc/codecs/uda134x.c             --  UDA134x codec driver

sound/soc/s3c24xx/s3c24xx-i2s.c         --  S3C24xx I2S driver

sound/soc/s3c24xx/s3c24xx_uda134x.c   -- S3C24xx based board specific configuration for UDA134x

2、修改arch/arm/mach-s3c2440/mach-smdk2440.c

增加包含頭檔案:#include <sound/s3c24xx_uda134x.h>

增加代碼:

static struct s3c24xx_uda134x_platform_data s3c24xx_uda134x_data = {

        .l3_clk = S3C2410_GPB(4),

        .l3_data = S3C2410_GPB(3),

        .l3_mode = S3C2410_GPB(2),

    //    .power = NULL,

        .model = UDA134X_UDA1341,

};

static struct platform_device s3c24xx_uda134x = {

        .name = "s3c24xx_uda134x",

        .dev = {

                .platform_data    = &s3c24xx_uda134x_data,

        }

};

//written by yichi 2010.02.14 19:47:30

修改smdk2440_devices,增加紅色部分:

static struct platform_device *smdk2440_devices[] __initdata = {

    &s3c_device_usb,

    &s3c_device_lcd,

    &s3c_device_wdt,

    &s3c_device_i2c0,

    &s3c_device_iis,

    &s3c24xx_uda134x, //written by yichi 2010.02.14 19:49:13

};

3、編譯後加載運作時輸出:

Advanced Linux Sound Architecture Driver Version 1.0.21.                       

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)   

4、需要了解的是,ALSA本身并不會生成/dev/dsp節點,那是OSS驅動的東西。

要在你的系統裡使用/dev/dsp節點,你必須確定選中了ALSA的“OSS 模拟”選項。它可以通過在核心配置中的

"Sound card support" ---> "Advanced Linux Sound Architecture" --> "OSS PCM (digital audio) API"

配置。

繼續閱讀