根据传入参数,进入到devm_snd_soc_register_component函数分析。其中devm是一种资源管理的方式,不用考虑资源释放,内核会内部做好资源回收。然后进入snd_soc_register_component函数。 int snd_soc_register_component(struct device *dev, const struct snd_soc_component_driver *cmpnt_drv, struct snd_soc_dai_drive...
ret= snd_soc_component_initialize(&codec->component,&codec_drv->component_driver, dev);if(ret)gotoerr_free; 申请snd_soc_codec 并设置 component 参数 然后初始化component,让我们进入到初始化函数中看看 staticintsnd_soc_component_initialize(structsnd_soc_component *component,conststructsnd_soc_component...
这个就是我们cpu dai驱动,就是i2s驱动对应我们声卡 cpu_dai_name snd_soc_component_driver在注册s3c2412_i2s_dai时使用其中的名字 */ static const struct snd_soc_component_driver s3c2412_i2s_component = { .name = "s3c2412-i2s", }; static struct snd_soc_dai_driver s3c2412_i2s_dai = { .pr...
int snd_card_free(struct snd_card * card); /* 注册声卡 */ int snd_card_register(struct snd_card * card); /* 创建声卡设备部件, 通常由 snd_pcm_new 和 snd_card_new 自动完成 */ int snd_device_new(struct snd_card *, enum snd_device_type type, void *device_data, struct snd_device...
* @cmpnt_drv: Component driver * @dai_drv: DAI driver * @num_dai: Number of DAIs to register * * Register a component with automatic unregistration when the device is * unregistered. */ /* 进入devm_snd_soc_register_component函数 */ ...
通过devm_snd_soc_register_component注册一个component组件。传入的参数分别是snd_soc_component_driver和snd_soc_dai_driver。 代码语言:javascript 复制 static struct snd_soc_dai_driver s3c24xx_i2s_dai = { .probe = s3c24xx_i2s_probe, .suspend = s3c24xx_i2s_suspend, .resume = s3c24xx_i2s_resume...
snd_soc_component_driver在注册s3c2412_i2s_dai时使⽤其中的名字 */ static const struct snd_soc_component_driver s3c2412_i2s_component = { .name = "s3c2412-i2s",};static struct snd_soc_dai_driver s3c2412_i2s_dai = { .probe = s3c2412_i2s_probe,.remove = s3c2412_i2s_remove,.play...
Machine driver: Registers a sound card by binding the platform and codec components. ASoC uses a common structure, snd_soc_component_driver, which represents both a platform and a codec component. It finally depends on which interfaces the drivers implement. For example, a platform component...
snd_soc_register_component 在Kubernetes(K8S)中,snd_soc_register_component是用于注册一个新的音频组件的函数。在本文中,我将向你解释如何使用snd_soc_register_component,让你了解整个流程并给出代码示例。 首先,让我们看一下使用snd_soc_register_component函数的流程: | 步骤 | 操作 ...
此函数会在component_list链表中先找到相同的name,然后在component->dai_list中查找是否有相同的dai_name。此处的component_list是在注册codec和platform中的时候设置的。会在codec和platform的时候会详细介绍。在此处找到注册的cpu_dai之后,存在snd_soc_pcm_runtime中的cpu_dai中。