Lines Matching refs:pcm
147 struct hdac_hdmi_pcm *pcm; in hdac_hdmi_get_pcm_from_cvt() local
149 list_for_each_entry(pcm, &hdmi->pcm_list, head) { in hdac_hdmi_get_pcm_from_cvt()
150 if (pcm->cvt == cvt) in hdac_hdmi_get_pcm_from_cvt()
151 return pcm; in hdac_hdmi_get_pcm_from_cvt()
157 static void hdac_hdmi_jack_report(struct hdac_hdmi_pcm *pcm, in hdac_hdmi_jack_report() argument
169 if (pcm->jack_event == 0) { in hdac_hdmi_jack_report()
172 pcm->pcm_id); in hdac_hdmi_jack_report()
173 snd_soc_jack_report(pcm->jack, SND_JACK_AVOUT, in hdac_hdmi_jack_report()
176 pcm->jack_event++; in hdac_hdmi_jack_report()
183 if (pcm->jack_event == 1) in hdac_hdmi_jack_report()
184 snd_soc_jack_report(pcm->jack, 0, SND_JACK_AVOUT); in hdac_hdmi_jack_report()
185 if (pcm->jack_event > 0) in hdac_hdmi_jack_report()
186 pcm->jack_event--; in hdac_hdmi_jack_report()
207 static void hdac_hdmi_jack_report_sync(struct hdac_hdmi_pcm *pcm, in hdac_hdmi_jack_report_sync() argument
210 hdac_hdmi_jack_report(pcm, port, is_connect); in hdac_hdmi_jack_report_sync()
285 struct hdac_hdmi_pcm *pcm; in get_hdmi_pcm_from_id() local
287 list_for_each_entry(pcm, &hdmi->pcm_list, head) { in get_hdmi_pcm_from_id()
288 if (pcm->pcm_id == pcm_idx) in get_hdmi_pcm_from_id()
289 return pcm; in get_hdmi_pcm_from_id()
357 struct hdac_hdmi_pcm *pcm, struct hdac_hdmi_port *port) in hdac_hdmi_setup_audio_infoframe() argument
364 struct hdac_hdmi_cvt *cvt = pcm->cvt; in hdac_hdmi_setup_audio_infoframe()
373 pcm->channels, pcm->chmap_set, true, pcm->chmap); in hdac_hdmi_setup_audio_infoframe()
379 pcm->channels, pcm->chmap, pcm->chmap_set); in hdac_hdmi_setup_audio_infoframe()
445 struct hdac_hdmi_pcm *pcm; in hdac_hdmi_set_stream() local
457 pcm = hdac_hdmi_get_pcm_from_cvt(hdmi, dai_map->cvt); in hdac_hdmi_set_stream()
459 if (pcm) in hdac_hdmi_set_stream()
460 pcm->stream_tag = (hstream->stream_tag << 4); in hdac_hdmi_set_stream()
470 struct hdac_hdmi_pcm *pcm; in hdac_hdmi_set_hw_params() local
479 pcm = hdac_hdmi_get_pcm_from_cvt(hdmi, dai_map->cvt); in hdac_hdmi_set_hw_params()
480 if (!pcm) in hdac_hdmi_set_hw_params()
483 pcm->format = format; in hdac_hdmi_set_hw_params()
484 pcm->channels = params_channels(hparams); in hdac_hdmi_set_hw_params()
530 struct hdac_hdmi_pcm *pcm; in hdac_hdmi_get_port_from_cvt() local
534 list_for_each_entry(pcm, &hdmi->pcm_list, head) { in hdac_hdmi_get_port_from_cvt()
535 if (pcm->cvt == cvt) { in hdac_hdmi_get_port_from_cvt()
536 if (list_empty(&pcm->port_list)) in hdac_hdmi_get_port_from_cvt()
539 list_for_each_entry(port, &pcm->port_list, head) { in hdac_hdmi_get_port_from_cvt()
540 mutex_lock(&pcm->lock); in hdac_hdmi_get_port_from_cvt()
543 mutex_unlock(&pcm->lock); in hdac_hdmi_get_port_from_cvt()
636 struct hdac_hdmi_pcm *pcm; in hdac_hdmi_pcm_close() local
640 pcm = hdac_hdmi_get_pcm_from_cvt(hdmi, dai_map->cvt); in hdac_hdmi_pcm_close()
642 if (pcm) { in hdac_hdmi_pcm_close()
643 mutex_lock(&pcm->lock); in hdac_hdmi_pcm_close()
644 pcm->chmap_set = false; in hdac_hdmi_pcm_close()
645 memset(pcm->chmap, 0, sizeof(pcm->chmap)); in hdac_hdmi_pcm_close()
646 pcm->channels = 0; in hdac_hdmi_pcm_close()
647 mutex_unlock(&pcm->lock); in hdac_hdmi_pcm_close()
721 struct hdac_hdmi_pcm *pcm; in hdac_hdmi_get_pcm() local
724 list_for_each_entry(pcm, &hdmi->pcm_list, head) { in hdac_hdmi_get_pcm()
725 if (list_empty(&pcm->port_list)) in hdac_hdmi_get_pcm()
728 list_for_each_entry(p, &pcm->port_list, head) { in hdac_hdmi_get_pcm()
730 return pcm; in hdac_hdmi_get_pcm()
772 struct hdac_hdmi_pcm *pcm; in hdac_hdmi_pin_output_widget_event() local
777 pcm = hdac_hdmi_get_pcm(hdev, port); in hdac_hdmi_pin_output_widget_event()
778 if (!pcm) in hdac_hdmi_pin_output_widget_event()
795 return hdac_hdmi_setup_audio_infoframe(hdev, pcm, port); in hdac_hdmi_pin_output_widget_event()
818 struct hdac_hdmi_pcm *pcm; in hdac_hdmi_cvt_output_widget_event() local
823 pcm = hdac_hdmi_get_pcm_from_cvt(hdmi, cvt); in hdac_hdmi_cvt_output_widget_event()
824 if (!pcm) in hdac_hdmi_cvt_output_widget_event()
840 AC_VERB_SET_CHANNEL_STREAMID, pcm->stream_tag); in hdac_hdmi_cvt_output_widget_event()
842 AC_VERB_SET_STREAM_FORMAT, pcm->format); in hdac_hdmi_cvt_output_widget_event()
908 struct hdac_hdmi_pcm *pcm; in hdac_hdmi_set_pin_port_mux() local
919 list_for_each_entry(pcm, &hdmi->pcm_list, head) { in hdac_hdmi_set_pin_port_mux()
920 if (list_empty(&pcm->port_list)) in hdac_hdmi_set_pin_port_mux()
923 list_for_each_entry_safe(p, p_next, &pcm->port_list, head) { in hdac_hdmi_set_pin_port_mux()
926 hdac_hdmi_jack_report_sync(pcm, port, false); in hdac_hdmi_set_pin_port_mux()
936 list_for_each_entry(pcm, &hdmi->pcm_list, head) { in hdac_hdmi_set_pin_port_mux()
937 if (!strcmp(cvt_name, pcm->cvt->name)) { in hdac_hdmi_set_pin_port_mux()
938 list_add_tail(&port->head, &pcm->port_list); in hdac_hdmi_set_pin_port_mux()
940 hdac_hdmi_jack_report_sync(pcm, port, true); in hdac_hdmi_set_pin_port_mux()
1255 struct hdac_hdmi_pcm *pcm; in hdac_hdmi_present_sense() local
1296 pcm = hdac_hdmi_get_pcm(hdev, port); in hdac_hdmi_present_sense()
1308 if (pcm) { in hdac_hdmi_present_sense()
1309 hdac_hdmi_jack_report(pcm, port, false); in hdac_hdmi_present_sense()
1318 if (pcm) { in hdac_hdmi_present_sense()
1319 hdac_hdmi_jack_report(pcm, port, true); in hdac_hdmi_present_sense()
1329 if (eld_changed && pcm) in hdac_hdmi_present_sense()
1333 &pcm->eld_ctl->id); in hdac_hdmi_present_sense()
1437 struct hdac_hdmi_pcm *pcm; in hdac_hdmi_eld_ctl_info() local
1444 pcm = get_hdmi_pcm_from_id(hdmi, kcontrol->id.device); in hdac_hdmi_eld_ctl_info()
1445 if (!pcm) { in hdac_hdmi_eld_ctl_info()
1451 if (list_empty(&pcm->port_list)) { in hdac_hdmi_eld_ctl_info()
1459 list_for_each_entry(port, &pcm->port_list, head) { in hdac_hdmi_eld_ctl_info()
1478 struct hdac_hdmi_pcm *pcm; in hdac_hdmi_eld_ctl_get() local
1484 pcm = get_hdmi_pcm_from_id(hdmi, kcontrol->id.device); in hdac_hdmi_eld_ctl_get()
1485 if (!pcm) { in hdac_hdmi_eld_ctl_get()
1491 if (list_empty(&pcm->port_list)) { in hdac_hdmi_eld_ctl_get()
1499 list_for_each_entry(port, &pcm->port_list, head) { in hdac_hdmi_eld_ctl_get()
1525 static int hdac_hdmi_create_eld_ctl(struct snd_soc_component *component, struct hdac_hdmi_pcm *pcm) in hdac_hdmi_create_eld_ctl() argument
1535 .device = pcm->pcm_id, in hdac_hdmi_create_eld_ctl()
1543 pcm->eld_ctl = kctl; in hdac_hdmi_create_eld_ctl()
1761 if (rtd->pcm && (rtd->pcm->device == device)) in hdac_hdmi_get_pcm_from_id()
1762 return rtd->pcm; in hdac_hdmi_get_pcm_from_id()
1893 struct hdac_hdmi_pcm *pcm; in hdac_hdmi_jack_init() local
1901 pcm = devm_kzalloc(&hdev->dev, sizeof(*pcm), GFP_KERNEL); in hdac_hdmi_jack_init()
1902 if (!pcm) in hdac_hdmi_jack_init()
1904 pcm->pcm_id = device; in hdac_hdmi_jack_init()
1905 pcm->cvt = hdmi->dai_map[dai->id].cvt; in hdac_hdmi_jack_init()
1906 pcm->jack_event = 0; in hdac_hdmi_jack_init()
1907 pcm->jack = jack; in hdac_hdmi_jack_init()
1908 mutex_init(&pcm->lock); in hdac_hdmi_jack_init()
1909 INIT_LIST_HEAD(&pcm->port_list); in hdac_hdmi_jack_init()
1922 err = hdac_hdmi_create_eld_ctl(component, pcm); in hdac_hdmi_jack_init()
1930 list_add_tail(&pcm->head, &hdmi->pcm_list); in hdac_hdmi_jack_init()
2072 struct hdac_hdmi_pcm *pcm = get_hdmi_pcm_from_id(hdmi, pcm_idx); in hdac_hdmi_get_chmap() local
2074 memcpy(chmap, pcm->chmap, ARRAY_SIZE(pcm->chmap)); in hdac_hdmi_get_chmap()
2081 struct hdac_hdmi_pcm *pcm = get_hdmi_pcm_from_id(hdmi, pcm_idx); in hdac_hdmi_set_chmap() local
2084 if (!pcm) in hdac_hdmi_set_chmap()
2087 if (list_empty(&pcm->port_list)) in hdac_hdmi_set_chmap()
2090 mutex_lock(&pcm->lock); in hdac_hdmi_set_chmap()
2091 pcm->chmap_set = true; in hdac_hdmi_set_chmap()
2092 memcpy(pcm->chmap, chmap, ARRAY_SIZE(pcm->chmap)); in hdac_hdmi_set_chmap()
2093 list_for_each_entry(port, &pcm->port_list, head) in hdac_hdmi_set_chmap()
2095 hdac_hdmi_setup_audio_infoframe(hdev, pcm, port); in hdac_hdmi_set_chmap()
2096 mutex_unlock(&pcm->lock); in hdac_hdmi_set_chmap()
2102 struct hdac_hdmi_pcm *pcm = get_hdmi_pcm_from_id(hdmi, pcm_idx); in is_hdac_hdmi_pcm_attached() local
2104 if (!pcm) in is_hdac_hdmi_pcm_attached()
2107 if (list_empty(&pcm->port_list)) in is_hdac_hdmi_pcm_attached()
2116 struct hdac_hdmi_pcm *pcm = get_hdmi_pcm_from_id(hdmi, pcm_idx); in hdac_hdmi_get_spk_alloc() local
2119 if (!pcm) in hdac_hdmi_get_spk_alloc()
2122 if (list_empty(&pcm->port_list)) in hdac_hdmi_get_spk_alloc()
2125 port = list_first_entry(&pcm->port_list, struct hdac_hdmi_port, head); in hdac_hdmi_get_spk_alloc()