linux alsa-stream
2020-12-01 10:15:43 0 举报
linux alsa注册流程
作者其他创作
大纲/内容
struct snd_soc_dai_link
dapm->component
struct snd_device *dev
struct device *dev
......
snd_soc_add_component_controls
注意这里的source和sink指向的dapm要相等
struct snd_soc_pcm_runtime *rtd
找到相应规则的wsource
func:snd_soc_dapm_add_route
of_node&nameboth equal
struct snd_soc_dapm_widget *wsink
func:snd_soc_dapm_link_dai_widgets
0
cpu_dai->component->codec
soc_bind_dai_link
struct snd_soc_dapm_context *dapm
struct snd_soc_component
int num_dapm_widgets;
struct snd_soc_dapm_route *route
dai_link->init
dai->driver->playback.stream_name
template.id = snd_soc_dapm_dai_in;template.name = dai->driver->playback.stream_name; template.sname = dai->driver->playback.stream_name;
func:snd_soc_cnew
调用num_links-1次
struct snd_soc_platform_driver
dai->driver->probe(dai)
parent
struct device_node *cpu_of_node;const char *cpu_dai_name;
2
func:snd_soc_register_dais
soc_new_pcm
card->num_rtd++
each list member
func:soc_probe_dai
NULL
compoent
func:soc_probe_link_components
struct snd_soc_dai_link *dai_link;int num_links;
struct snd_soc_dai_driver
num_links-1
num_links-3
dai_link=array
struct snd_soc_component_driver
0~num_links-1
dapm_widgets存在
struct snd_kcontrol *kcontrol
func:snd_soc_register_platform
of_node
const struct snd_soc_dapm_widget *of_dapm_widgets;int num_of_dapm_widgets
struct snd_soc_platform
struct snd_card *snd_card
struct snd_soc_dapm_widget
_regmap_read
each struct snd_soc_dai-codec = codec
cpi_dai/codec_dais
遍历card-wdigets链表的所有的 struct snd_soc_dapm_widget
route->control
func:snd_card_new
component->read
rtd-codec_dai = component -daI_list的某一个成员
struct snd_soc_dapm_path *path
dai->driver->probe
number-1
DTS
rtd-platform = struct snd_soc_platform
dai_link
snd_soc_dapm_new_dai_widgets
func:snd_ctl_add
func:snd_soc_dapm_add_path
truct snd_soc_dapm_context *dapm
struct snd_soc_dai
route->connected
struct snd_soc_codec_driver *codec_drv
rtd-cpu_dai = = component -daI_list的某一个成员
struct device_node *codec_of_nodeconst char *codec_name;
num_links-2
_regmap_write
private_data指的是snd_soc_component *component结构体
1
each dai struct add to itself component dai_list
func:snd_soc_register_codec
func:snd_soc_dapm_new_control_unlocked
dai-playback_widget = w;
add list to devices
func:soc_probe_link_dais
struct snd_soc_dapm_widget wsource= w
找到相应规则的wsink
dai->driver->capture.stream_name
component->controls
struct device_node *platform_of_node;const char *platform_name;
int num_dapm_routes
num_rtd
func:snd_soc_dapm_add_routes
template.id = snd_soc_dapm_dai_out; template.name = dai->driver->capture.stream_name; template.sname = dai->driver->capture.stream_name;
struct snd_soc_dai *dai
调用num_dapm_routes次
func:snd_device_new
priv = dai
const struct snd_soc_dapm_widget *dapm_widgets;int num_dapm_widgets;
struct snd_soc_codec
func:snd_ctl_create
number个
dai_link->init(rtd)
[cpi_dai/codec_dais/platform]-component
path->node[SND_SOC_DAPM_DIR_IN] = wsource; path->node[SND_SOC_DAPM_DIR_OUT] = wsink;
func:snd_soc_dapm_connect_dai_link_widgets
SNDRV_DEV_CONTROL
component->routes
struct snd_soc_dai_link array[num_links]
根据snd_kcontrol_new *kcontrol的private_value中的参数配置寄存器
func:snd_soc_register_component
kctl->private_value = ncontrol->private_value; kctl->private_data = private_data;
struct snd_soc_dapm_widget wsink = w
path->name = e->texts[i];
细节请点击上面黑图struct snd_soc_dapm_widget
struct snd_soc_pcm_runtime *rtd;int num_links;可写为==》struct snd_soc_pcm_runtime rtd[num_links]
platform drivers
func:soc_probe_component
func:snd_soc_dapm_new_controls
func:snd_soc_add_platform
struct list_head dai_list
dai-capture_widget = w;
struct snd_soc_dapm_widget *wsource
!dai_link->params
调用num_dapm_widgets次
struct snd_soc_card
收藏
0 条评论
下一页