Lines Matching refs:pcm
151 struct hdac_hdmi_pcm *pcm = NULL; in hdac_hdmi_get_pcm_from_cvt() local
153 list_for_each_entry(pcm, &hdmi->pcm_list, head) { in hdac_hdmi_get_pcm_from_cvt()
154 if (pcm->cvt == cvt) in hdac_hdmi_get_pcm_from_cvt()
158 return pcm; in hdac_hdmi_get_pcm_from_cvt()
161 static void hdac_hdmi_jack_report(struct hdac_hdmi_pcm *pcm, in hdac_hdmi_jack_report() argument
177 if (pcm->jack_event == 0) { in hdac_hdmi_jack_report()
180 pcm->pcm_id); in hdac_hdmi_jack_report()
181 snd_soc_jack_report(pcm->jack, SND_JACK_AVOUT, in hdac_hdmi_jack_report()
184 pcm->jack_event++; in hdac_hdmi_jack_report()
191 if (pcm->jack_event == 1) in hdac_hdmi_jack_report()
192 snd_soc_jack_report(pcm->jack, 0, SND_JACK_AVOUT); in hdac_hdmi_jack_report()
193 if (pcm->jack_event > 0) in hdac_hdmi_jack_report()
194 pcm->jack_event--; in hdac_hdmi_jack_report()
271 struct hdac_hdmi_pcm *pcm; in get_hdmi_pcm_from_id() local
273 list_for_each_entry(pcm, &hdmi->pcm_list, head) { in get_hdmi_pcm_from_id()
274 if (pcm->pcm_id == pcm_idx) in get_hdmi_pcm_from_id()
275 return pcm; in get_hdmi_pcm_from_id()
343 struct hdac_hdmi_pcm *pcm, struct hdac_hdmi_port *port) in hdac_hdmi_setup_audio_infoframe() argument
350 struct hdac_hdmi_cvt *cvt = pcm->cvt; in hdac_hdmi_setup_audio_infoframe()
359 pcm->channels, pcm->chmap_set, true, pcm->chmap); in hdac_hdmi_setup_audio_infoframe()
365 pcm->channels, pcm->chmap, pcm->chmap_set); in hdac_hdmi_setup_audio_infoframe()
432 struct hdac_hdmi_pcm *pcm; in hdac_hdmi_set_tdm_slot() local
438 pcm = hdac_hdmi_get_pcm_from_cvt(hdmi, dai_map->cvt); in hdac_hdmi_set_tdm_slot()
440 if (pcm) in hdac_hdmi_set_tdm_slot()
441 pcm->stream_tag = (tx_mask << 4); in hdac_hdmi_set_tdm_slot()
453 struct hdac_hdmi_pcm *pcm; in hdac_hdmi_set_hw_params() local
473 pcm = hdac_hdmi_get_pcm_from_cvt(hdmi, dai_map->cvt); in hdac_hdmi_set_hw_params()
474 if (!pcm) in hdac_hdmi_set_hw_params()
477 pcm->format = format; in hdac_hdmi_set_hw_params()
478 pcm->channels = params_channels(hparams); in hdac_hdmi_set_hw_params()
524 struct hdac_hdmi_pcm *pcm; in hdac_hdmi_get_port_from_cvt() local
528 list_for_each_entry(pcm, &hdmi->pcm_list, head) { in hdac_hdmi_get_port_from_cvt()
529 if (pcm->cvt == cvt) { in hdac_hdmi_get_port_from_cvt()
530 if (list_empty(&pcm->port_list)) in hdac_hdmi_get_port_from_cvt()
533 list_for_each_entry(port, &pcm->port_list, head) { in hdac_hdmi_get_port_from_cvt()
534 mutex_lock(&pcm->lock); in hdac_hdmi_get_port_from_cvt()
537 mutex_unlock(&pcm->lock); in hdac_hdmi_get_port_from_cvt()
607 struct hdac_hdmi_pcm *pcm; in hdac_hdmi_pcm_close() local
611 pcm = hdac_hdmi_get_pcm_from_cvt(hdmi, dai_map->cvt); in hdac_hdmi_pcm_close()
613 if (pcm) { in hdac_hdmi_pcm_close()
614 mutex_lock(&pcm->lock); in hdac_hdmi_pcm_close()
615 pcm->chmap_set = false; in hdac_hdmi_pcm_close()
616 memset(pcm->chmap, 0, sizeof(pcm->chmap)); in hdac_hdmi_pcm_close()
617 pcm->channels = 0; in hdac_hdmi_pcm_close()
618 mutex_unlock(&pcm->lock); in hdac_hdmi_pcm_close()
692 struct hdac_hdmi_pcm *pcm = NULL; in hdac_hdmi_get_pcm() local
695 list_for_each_entry(pcm, &hdmi->pcm_list, head) { in hdac_hdmi_get_pcm()
696 if (list_empty(&pcm->port_list)) in hdac_hdmi_get_pcm()
699 list_for_each_entry(p, &pcm->port_list, head) { in hdac_hdmi_get_pcm()
701 return pcm; in hdac_hdmi_get_pcm()
743 struct hdac_hdmi_pcm *pcm; in hdac_hdmi_pin_output_widget_event() local
748 pcm = hdac_hdmi_get_pcm(hdev, port); in hdac_hdmi_pin_output_widget_event()
749 if (!pcm) in hdac_hdmi_pin_output_widget_event()
766 return hdac_hdmi_setup_audio_infoframe(hdev, pcm, port); in hdac_hdmi_pin_output_widget_event()
789 struct hdac_hdmi_pcm *pcm; in hdac_hdmi_cvt_output_widget_event() local
794 pcm = hdac_hdmi_get_pcm_from_cvt(hdmi, cvt); in hdac_hdmi_cvt_output_widget_event()
795 if (!pcm) in hdac_hdmi_cvt_output_widget_event()
811 AC_VERB_SET_CHANNEL_STREAMID, pcm->stream_tag); in hdac_hdmi_cvt_output_widget_event()
813 AC_VERB_SET_STREAM_FORMAT, pcm->format); in hdac_hdmi_cvt_output_widget_event()
871 struct hdac_hdmi_pcm *pcm = NULL; in hdac_hdmi_set_pin_port_mux() local
882 list_for_each_entry(pcm, &hdmi->pcm_list, head) { in hdac_hdmi_set_pin_port_mux()
883 if (list_empty(&pcm->port_list)) in hdac_hdmi_set_pin_port_mux()
886 list_for_each_entry_safe(p, p_next, &pcm->port_list, head) { in hdac_hdmi_set_pin_port_mux()
889 hdac_hdmi_jack_report(pcm, port, false); in hdac_hdmi_set_pin_port_mux()
899 list_for_each_entry(pcm, &hdmi->pcm_list, head) { in hdac_hdmi_set_pin_port_mux()
900 if (!strcmp(cvt_name, pcm->cvt->name)) { in hdac_hdmi_set_pin_port_mux()
901 list_add_tail(&port->head, &pcm->port_list); in hdac_hdmi_set_pin_port_mux()
903 hdac_hdmi_jack_report(pcm, port, true); in hdac_hdmi_set_pin_port_mux()
1216 struct hdac_hdmi_pcm *pcm; in hdac_hdmi_present_sense() local
1252 pcm = hdac_hdmi_get_pcm(hdev, port); in hdac_hdmi_present_sense()
1264 if (pcm) in hdac_hdmi_present_sense()
1265 hdac_hdmi_jack_report(pcm, port, false); in hdac_hdmi_present_sense()
1272 if (pcm) in hdac_hdmi_present_sense()
1273 hdac_hdmi_jack_report(pcm, port, true); in hdac_hdmi_present_sense()
1602 if (rtd->pcm && (rtd->pcm->device == device)) in hdac_hdmi_get_pcm_from_id()
1603 return rtd->pcm; in hdac_hdmi_get_pcm_from_id()
1734 struct hdac_hdmi_pcm *pcm; in hdac_hdmi_jack_init() local
1742 pcm = kzalloc(sizeof(*pcm), GFP_KERNEL); in hdac_hdmi_jack_init()
1743 if (!pcm) in hdac_hdmi_jack_init()
1745 pcm->pcm_id = device; in hdac_hdmi_jack_init()
1746 pcm->cvt = hdmi->dai_map[dai->id].cvt; in hdac_hdmi_jack_init()
1747 pcm->jack_event = 0; in hdac_hdmi_jack_init()
1748 pcm->jack = jack; in hdac_hdmi_jack_init()
1749 mutex_init(&pcm->lock); in hdac_hdmi_jack_init()
1750 INIT_LIST_HEAD(&pcm->port_list); in hdac_hdmi_jack_init()
1758 kfree(pcm); in hdac_hdmi_jack_init()
1763 list_add_tail(&pcm->head, &hdmi->pcm_list); in hdac_hdmi_jack_init()
1909 struct hdac_hdmi_pcm *pcm = get_hdmi_pcm_from_id(hdmi, pcm_idx); in hdac_hdmi_get_chmap() local
1911 memcpy(chmap, pcm->chmap, ARRAY_SIZE(pcm->chmap)); in hdac_hdmi_get_chmap()
1918 struct hdac_hdmi_pcm *pcm = get_hdmi_pcm_from_id(hdmi, pcm_idx); in hdac_hdmi_set_chmap() local
1921 if (!pcm) in hdac_hdmi_set_chmap()
1924 if (list_empty(&pcm->port_list)) in hdac_hdmi_set_chmap()
1927 mutex_lock(&pcm->lock); in hdac_hdmi_set_chmap()
1928 pcm->chmap_set = true; in hdac_hdmi_set_chmap()
1929 memcpy(pcm->chmap, chmap, ARRAY_SIZE(pcm->chmap)); in hdac_hdmi_set_chmap()
1930 list_for_each_entry(port, &pcm->port_list, head) in hdac_hdmi_set_chmap()
1932 hdac_hdmi_setup_audio_infoframe(hdev, pcm, port); in hdac_hdmi_set_chmap()
1933 mutex_unlock(&pcm->lock); in hdac_hdmi_set_chmap()
1939 struct hdac_hdmi_pcm *pcm = get_hdmi_pcm_from_id(hdmi, pcm_idx); in is_hdac_hdmi_pcm_attached() local
1941 if (!pcm) in is_hdac_hdmi_pcm_attached()
1944 if (list_empty(&pcm->port_list)) in is_hdac_hdmi_pcm_attached()
1953 struct hdac_hdmi_pcm *pcm = get_hdmi_pcm_from_id(hdmi, pcm_idx); in hdac_hdmi_get_spk_alloc() local
1956 if (!pcm) in hdac_hdmi_get_spk_alloc()
1959 if (list_empty(&pcm->port_list)) in hdac_hdmi_get_spk_alloc()
1962 port = list_first_entry(&pcm->port_list, struct hdac_hdmi_port, head); in hdac_hdmi_get_spk_alloc()
2061 struct hdac_hdmi_pcm *pcm, *pcm_next; in hdac_hdmi_dev_remove() local
2065 list_for_each_entry_safe(pcm, pcm_next, &hdmi->pcm_list, head) { in hdac_hdmi_dev_remove()
2066 pcm->cvt = NULL; in hdac_hdmi_dev_remove()
2067 if (list_empty(&pcm->port_list)) in hdac_hdmi_dev_remove()
2071 &pcm->port_list, head) in hdac_hdmi_dev_remove()
2074 list_del(&pcm->head); in hdac_hdmi_dev_remove()
2075 kfree(pcm); in hdac_hdmi_dev_remove()