Lines Matching refs:pcm_idx

83 	int pcm_idx; /* which pcm is attached. -1 means no pcm is attached */  member
278 int pcm_idx; in hinfo_to_pcm_index() local
280 for (pcm_idx = 0; pcm_idx < spec->pcm_used; pcm_idx++) in hinfo_to_pcm_index()
281 if (get_pcm_rec(spec, pcm_idx)->stream == hinfo) in hinfo_to_pcm_index()
282 return pcm_idx; in hinfo_to_pcm_index()
308 int pcm_idx) in pcm_idx_to_pin() argument
315 if (per_pin->pcm_idx == pcm_idx) in pcm_idx_to_pin()
341 int pcm_idx; in hdmi_eld_ctl_info() local
345 pcm_idx = kcontrol->private_value; in hdmi_eld_ctl_info()
347 per_pin = pcm_idx_to_pin(spec, pcm_idx); in hdmi_eld_ctl_info()
368 int pcm_idx; in hdmi_eld_ctl_get() local
371 pcm_idx = kcontrol->private_value; in hdmi_eld_ctl_get()
373 per_pin = pcm_idx_to_pin(spec, pcm_idx); in hdmi_eld_ctl_get()
409 static int hdmi_create_eld_ctl(struct hda_codec *codec, int pcm_idx, in hdmi_create_eld_ctl() argument
419 kctl->private_value = pcm_idx; in hdmi_create_eld_ctl()
429 get_hdmi_pcm(spec, pcm_idx)->eld_ctl = kctl; in hdmi_create_eld_ctl()
1196 int cvt_idx, pcm_idx; in hdmi_pcm_open_no_pin() local
1200 pcm_idx = hinfo_to_pcm_index(codec, hinfo); in hdmi_pcm_open_no_pin()
1201 if (pcm_idx < 0) in hdmi_pcm_open_no_pin()
1214 set_bit(pcm_idx, &spec->pcm_in_use); in hdmi_pcm_open_no_pin()
1244 int pin_idx, cvt_idx, pcm_idx; in hdmi_pcm_open() local
1251 pcm_idx = hinfo_to_pcm_index(codec, hinfo); in hdmi_pcm_open()
1252 if (pcm_idx < 0) in hdmi_pcm_open()
1273 set_bit(pcm_idx, &spec->pcm_in_use); in hdmi_pcm_open()
1290 snd_hda_spdif_ctls_assign(codec, pcm_idx, per_cvt->cvt_nid); in hdmi_pcm_open()
1307 snd_hda_spdif_ctls_unassign(codec, pcm_idx); in hdmi_pcm_open()
1385 per_pin->pcm_idx = idx; in hdmi_attach_hda_pcm()
1398 idx = per_pin->pcm_idx; in hdmi_detach_hda_pcm()
1399 per_pin->pcm_idx = -1; in hdmi_detach_hda_pcm()
1428 if (per_pin->pcm_idx < 0 || per_pin->pcm_idx >= spec->pcm_used) in hdmi_pcm_setup_pin()
1430 pcm = get_pcm_rec(spec, per_pin->pcm_idx); in hdmi_pcm_setup_pin()
1433 if (!test_bit(per_pin->pcm_idx, &spec->pcm_in_use)) in hdmi_pcm_setup_pin()
1450 snd_hda_spdif_ctls_assign(codec, per_pin->pcm_idx, hinfo->nid); in hdmi_pcm_setup_pin()
1464 if (per_pin->pcm_idx >= 0 && per_pin->pcm_idx < spec->pcm_used) in hdmi_pcm_reset_pin()
1465 snd_hda_spdif_ctls_unassign(per_pin->codec, per_pin->pcm_idx); in hdmi_pcm_reset_pin()
1479 if (per_pin->pcm_idx >= 0) in pin_idx_to_pcm_jack()
1480 return spec->pcm_rec[per_pin->pcm_idx].jack; in pin_idx_to_pcm_jack()
1499 int pcm_idx; in update_eld() local
1520 pcm_idx = per_pin->pcm_idx; in update_eld()
1538 if (pcm_idx == -1) in update_eld()
1539 pcm_idx = per_pin->pcm_idx; in update_eld()
1575 if (eld_changed && pcm_idx >= 0) in update_eld()
1579 &get_hdmi_pcm(spec, pcm_idx)->eld_ctl->id); in update_eld()
1921 per_pin->pcm_idx = -1; in hdmi_add_pin()
2157 int cvt_idx, pin_idx, pcm_idx; in hdmi_pcm_close() local
2165 pcm_idx = hinfo_to_pcm_index(codec, hinfo); in hdmi_pcm_close()
2166 if (snd_BUG_ON(pcm_idx < 0)) { in hdmi_pcm_close()
2181 snd_hda_spdif_ctls_unassign(codec, pcm_idx); in hdmi_pcm_close()
2182 clear_bit(pcm_idx, &spec->pcm_in_use); in hdmi_pcm_close()
2225 static int hdmi_get_spk_alloc(struct hdac_device *hdac, int pcm_idx) in hdmi_get_spk_alloc() argument
2229 struct hdmi_spec_per_pin *per_pin = pcm_idx_to_pin(spec, pcm_idx); in hdmi_get_spk_alloc()
2237 static void hdmi_get_chmap(struct hdac_device *hdac, int pcm_idx, in hdmi_get_chmap() argument
2242 struct hdmi_spec_per_pin *per_pin = pcm_idx_to_pin(spec, pcm_idx); in hdmi_get_chmap()
2251 static void hdmi_set_chmap(struct hdac_device *hdac, int pcm_idx, in hdmi_set_chmap() argument
2256 struct hdmi_spec_per_pin *per_pin = pcm_idx_to_pin(spec, pcm_idx); in hdmi_set_chmap()
2268 static bool is_hdmi_pcm_attached(struct hdac_device *hdac, int pcm_idx) in is_hdmi_pcm_attached() argument
2272 struct hdmi_spec_per_pin *per_pin = pcm_idx_to_pin(spec, pcm_idx); in is_hdmi_pcm_attached()
2318 static int generic_hdmi_build_jack(struct hda_codec *codec, int pcm_idx) in generic_hdmi_build_jack() argument
2323 int pcmdev = get_pcm_rec(spec, pcm_idx)->device; in generic_hdmi_build_jack()
2334 spec->pcm_rec[pcm_idx].jack = jack; in generic_hdmi_build_jack()
2335 jack->private_data = &spec->pcm_rec[pcm_idx]; in generic_hdmi_build_jack()
2344 int pin_idx, pcm_idx; in generic_hdmi_build_controls() local
2346 for (pcm_idx = 0; pcm_idx < spec->pcm_used; pcm_idx++) { in generic_hdmi_build_controls()
2347 if (!get_pcm_rec(spec, pcm_idx)->pcm) { in generic_hdmi_build_controls()
2349 set_bit(pcm_idx, &spec->pcm_bitmap); in generic_hdmi_build_controls()
2353 err = generic_hdmi_build_jack(codec, pcm_idx); in generic_hdmi_build_controls()
2365 snd_hda_spdif_ctls_unassign(codec, pcm_idx); in generic_hdmi_build_controls()
2367 dev = get_pcm_rec(spec, pcm_idx)->device; in generic_hdmi_build_controls()
2370 err = hdmi_create_eld_ctl(codec, pcm_idx, dev); in generic_hdmi_build_controls()
2385 for (pcm_idx = 0; pcm_idx < spec->pcm_used; pcm_idx++) { in generic_hdmi_build_controls()
2388 pcm = get_pcm_rec(spec, pcm_idx); in generic_hdmi_build_controls()
2391 err = snd_hdac_add_chmap_ctls(pcm->pcm, pcm_idx, &spec->chmap); in generic_hdmi_build_controls()
2464 int pin_idx, pcm_idx; in generic_hdmi_free() local
2479 for (pcm_idx = 0; pcm_idx < spec->pcm_used; pcm_idx++) { in generic_hdmi_free()
2480 if (spec->pcm_rec[pcm_idx].jack == NULL) in generic_hdmi_free()
2482 snd_device_free(codec->card, spec->pcm_rec[pcm_idx].jack); in generic_hdmi_free()