*参照元 [#tdb5e881] #backlinks *説明 [#c481bc85] -パス: [[linux-4.4.1/sound/soc/soc-dapm.c]] -FIXME: これは何? --説明 **引数 [#ue235fb3] -struct snd_soc_dapm_widget *w -- --[[linux-4.4.1/snd_soc_dapm_widget]] **返り値 [#ecbec460] -int -- **参考 [#ibbad244] *実装 [#u5cd9897] /* create new dapm mux control */ static int dapm_new_mux(struct snd_soc_dapm_widget *w) { struct snd_soc_dapm_context *dapm = w->dapm; enum snd_soc_dapm_direction dir; struct snd_soc_dapm_path *path; const char *type; int ret; - --[[linux-4.4.1/snd_soc_dapm_context]] --[[linux-4.4.1/snd_soc_dapm_direction]] --[[linux-4.4.1/snd_soc_dapm_path]] switch (w->id) { case snd_soc_dapm_mux: dir = SND_SOC_DAPM_DIR_OUT; type = "mux"; break; case snd_soc_dapm_demux: dir = SND_SOC_DAPM_DIR_IN; type = "demux"; break; default: return -EINVAL; } if (w->num_kcontrols != 1) { dev_err(dapm->dev, "ASoC: %s %s has incorrect number of controls\n", type, w->name); return -EINVAL; } - --[[linux-4.4.1/dev_err()]] if (list_empty(&w->edges[dir])) { dev_err(dapm->dev, "ASoC: %s %s has no paths\n", type, w->name); return -EINVAL; } - --[[linux-4.4.1/list_empty()]] ret = dapm_create_or_share_kcontrol(w, 0); if (ret < 0) return ret; - --[[linux-4.4.1/dapm_create_or_share_kcontrol()]] snd_soc_dapm_widget_for_each_path(w, dir, path) { if (path->name) dapm_kcontrol_add_path(w->kcontrols[0], path); } - --[[linux-4.4.1/snd_soc_dapm_widget_for_each_path()]] --[[linux-4.4.1/dapm_kcontrol_add_path()]] -path->name を設定している箇所は下記 --[[linux-4.4.1/snd_soc_dapm_add_path()]] --[[linux-4.4.1/dapm_connect_mux()]] --他にもある? return 0; } *コメント [#w8eea531]