我们采用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,
&quot;data&quot;) < 0)
return -EBUSY;
if (s3c24xx_uda134x_setup_pin(s3c24xx_uda134x_l3_pins->l3_clk,
&quot;clk&quot;) < 0) {
gpio_free(s3c24xx_uda134x_l3_pins->l3_data);
return -EBUSY;
}
if (s3c24xx_uda134x_setup_pin(s3c24xx_uda134x_l3_pins->l3_mode,
&quot;mode&quot;) < 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(&quot;soc-audio&quot;, -1);
if (!s3c24xx_uda134x_snd_device) {
printk(KERN_ERR &quot;S3C24XX_UDA134X SoC Audio: &quot;
&quot;Unable to register\n&quot;);
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 &quot;S3C24XX_UDA134X SoC Audio: Unable to add\n&quot;);
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 = &quot;s3c24xx_uda134x&quot;,
.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); |