嵌入式爱好者

查看: 5941|回复: 1

求助关于ok2440的uda1341音频驱动放到ALSA结构下的问题

[复制链接]

1

主题

1

帖子

1

积分

扫一扫,手机访问本帖
发表于 2010-11-1 15:04:12 | 显示全部楼层 |阅读模式
我们采用ok2440板子做开发,通过修改kconfig配置文件,将uda1341音频驱动配置到ALSA SOC下,编译后重新烧写,单启动信息显示找不到声卡,请问是什么原因?相关启动信息如下:
...
usbcore: registered new interface driver usbhid
usbhid: v2.6:USB HID core driver
Advanced Linux Sound Architecture Driver Version 1.0.18rc3.
ASoC version 0.13.2
ALSA device list:
  No soundcards found.
TCP cubic registered
NET: Registered protocol family 17
....

跟踪发现初始化函数s3c24xx_uda134x_init已经调用,并且platform_driver_register的返回值表明driver已经注册成功,但启动时的跟踪信息显示并没有进入driver的probe函数s3c24xx_uda134x_probe。请问大虾们这是什么原因?是哪里还需要配置么?相关结构体及函数信息如下:

ok2440的linux为2.6.28版本,里面只有模拟OSS的驱动文件,没有ALSA下的uda134x.c等驱动文件,驱动文件是从其它地方弄过来的。

static int s3c24xx_uda134x_probe(struct platform_device *pdev)
{
        int ret;

        printk(KERN_INFO "S3C24XX_UDA134X SoC Audio driver\n");

        s3c24xx_uda134x_l3_pins = pdev->dev.platform_data;
        if (s3c24xx_uda134x_l3_pins == NULL) {
                printk(KERN_ERR "S3C24XX_UDA134X SoC Audio: "
                       "unable to find platform data\n");
                return -ENODEV;
        }
        s3c24xx_uda134x.power = s3c24xx_uda134x_l3_pins->power;
        s3c24xx_uda134x.model = s3c24xx_uda134x_l3_pins->model;

        if (s3c24xx_uda134x_setup_pin(s3c24xx_uda134x_l3_pins->l3_data,
                                      "data") < 0)
                return -EBUSY;
        if (s3c24xx_uda134x_setup_pin(s3c24xx_uda134x_l3_pins->l3_clk,
                                      "clk") < 0) {
                gpio_free(s3c24xx_uda134x_l3_pins->l3_data);
                return -EBUSY;
        }
        if (s3c24xx_uda134x_setup_pin(s3c24xx_uda134x_l3_pins->l3_mode,
                                      "mode") < 0) {
                gpio_free(s3c24xx_uda134x_l3_pins->l3_data);
                gpio_free(s3c24xx_uda134x_l3_pins->l3_clk);
                return -EBUSY;
        }

        s3c24xx_uda134x_snd_device = platform_device_alloc("soc-audio", -1);
        if (!s3c24xx_uda134x_snd_device) {
                printk(KERN_ERR "S3C24XX_UDA134X SoC Audio: "
                       "Unable to register\n");
                return -ENOMEM;
        }

        platform_set_drvdata(s3c24xx_uda134x_snd_device,
                             &s3c24xx_uda134x_snd_devdata);
        s3c24xx_uda134x_snd_devdata.dev = &s3c24xx_uda134x_snd_device->dev;
        ret = platform_device_add(s3c24xx_uda134x_snd_device);
        if (ret) {
                printk(KERN_ERR "S3C24XX_UDA134X SoC Audio: Unable to add\n");
                platform_device_put(s3c24xx_uda134x_snd_device);
        }

        return ret;
}

static struct platform_driver s3c24xx_uda134x_driver = {
        .probe  = s3c24xx_uda134x_probe,
        .remove = s3c24xx_uda134x_remove,
        .driver = {
                .name = "s3c24xx_uda134x",
                .owner = THIS_MODULE,
        },
};

static int __init s3c24xx_uda134x_init(void)
{
               return platform_driver_register(&s3c24xx_uda134x_driver);
}

module_init(s3c24xx_uda134x_init);
module_exit(s3c24xx_uda134x_exit);

我们项目很着急,请各位高手贡献一下...多谢了!
回复

使用道具 举报

eastwarm 该用户已被删除
发表于 2011-3-3 17:16:08 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复 支持 反对

使用道具 举报

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

本版积分规则

QQ|小黑屋| 飞凌嵌入式 ( 冀ICP备12004394号-1 )

GMT+8, 2024-7-3 12:40

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

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