• snd_soc_register_card流程


    snd_soc_register_card
    
    	-->遍历dai link,创建 struct snd_soc_pcm_runtime 实例
    	-->snd_soc_instantiate_card
    		-->soc_bind_dai_link  			// 为每个dai link查找 相应的DAI实例(component_list)、codec DAI实例(component_list)、platform 实例(platform_list)、codec实例
    		-->snd_card_new					// 向ALSA注册sound card
    		-->snd_soc_dapm_new_controls	// 注册machine级别的 widgets
    		-->struct snd_soc_card->probe()函数
    		-->soc_probe_link_components	// 遍历每个pcm runtime实例
    			-->soc_probe_component		// cpu dai和codec dai都是以component实例注册。probe cpu dai component
    				-->snd_soc_dapm_new_controls	// 注册component widgets。
    					-->snd_soc_dapm_new_dai_widgets	// 遍历component上的每个dai实例,创建 dai widget实例
    				-->调用component的probe函数
    				-->snd_soc_add_component_controls	// 注册component 普通控件
    				-->snd_soc_dapm_add_routes			// 注册component 路由表
    			-->soc_probe_component    // probe codec dai component
    			-->soc_probe_component	// platform驱动注册时,把驱动信息例如widget,controls,routes等赋值给了platform实例包含的 component 实例
    					
    		-->soc_probe_link_dais	// 遍历每个dai link
    			-->cpu dai实例调用 probe()
    			-->codec dai实例调用 probe()
    			-->dai link实例调用 init()
    			-->soc_post_component_init // 为pcm runtime实例创建device对象
    			-->soc_new_pcm			// 创建PCM  逻辑设备,分FE和BE
    		
    		-->snd_soc_dapm_link_dai_widgets			// dai widget 和 stream widget 建立连接 
    		-->snd_soc_dapm_connect_dai_link_widgets	 // BE dai widget和 codec dai widget建立连接,codec dai widget和codec stream widget自动建立连接
    		-->snd_soc_add_card_controls		// 注册machine级别的 controls
    		-->snd_soc_dapm_add_routes			// 注册 machine级别的 routes
    		
    		-->snd_soc_dai_set_fmt				// 遍历每个dai link,调用 codec dai->driver->ops->set_fmt(dai_link->dai_fmt)
    		-->snd_soc_dai_set_fmt				// 遍历每个dai link,调用 cpu dai->driver->ops->set_fmt(dai_link->dai_fmt)
    		
    		-->struct snd_soc_card->late_probe()函数
    		-->snd_soc_dapm_new_widgets 	// 注册 DAPM kcontrols
    		-->snd_card_register			// 向ALSA 注册 snd card
    
  • 相关阅读:
    loj#2540. 「PKUWC2018」随机算法
    loj#2538. 「PKUWC2018」Slay the Spire
    loj#2537. 「PKUWC2018」Minimax
    CF662C Binary Table
    bzoj4589: Hard Nim
    【HDU5909】Tree Cutting(FWT)
    P3175 [HAOI2015]按位或
    P4389 付公主的背包
    P4233 射命丸文的笔记
    GFS分布式文件系统环境部署与管理
  • 原文地址:https://www.cnblogs.com/bobfly1984/p/13966132.html
Copyright © 2020-2023  润新知