Lines Matching full:pcm

148 	struct hdac_hdmi_pcm *pcm;  in hdac_hdmi_get_pcm_from_cvt()  local
150 list_for_each_entry(pcm, &hdmi->pcm_list, head) { in hdac_hdmi_get_pcm_from_cvt()
151 if (pcm->cvt == cvt) in hdac_hdmi_get_pcm_from_cvt()
152 return pcm; in hdac_hdmi_get_pcm_from_cvt()
158 static void hdac_hdmi_jack_report(struct hdac_hdmi_pcm *pcm, in hdac_hdmi_jack_report() argument
167 * for the first time where same PCM is attached to multiple in hdac_hdmi_jack_report()
170 if (pcm->jack_event == 0) { in hdac_hdmi_jack_report()
172 "jack report for pcm=%d\n", in hdac_hdmi_jack_report()
173 pcm->pcm_id); in hdac_hdmi_jack_report()
174 snd_soc_jack_report(pcm->jack, SND_JACK_AVOUT, in hdac_hdmi_jack_report()
177 pcm->jack_event++; in hdac_hdmi_jack_report()
181 * is the only last connected device when same PCM is attached in hdac_hdmi_jack_report()
184 if (pcm->jack_event == 1) in hdac_hdmi_jack_report()
185 snd_soc_jack_report(pcm->jack, 0, SND_JACK_AVOUT); in hdac_hdmi_jack_report()
186 if (pcm->jack_event > 0) in hdac_hdmi_jack_report()
187 pcm->jack_event--; in hdac_hdmi_jack_report()
208 static void hdac_hdmi_jack_report_sync(struct hdac_hdmi_pcm *pcm, in hdac_hdmi_jack_report_sync() argument
211 hdac_hdmi_jack_report(pcm, port, is_connect); in hdac_hdmi_jack_report_sync()
286 struct hdac_hdmi_pcm *pcm; in get_hdmi_pcm_from_id() local
288 list_for_each_entry(pcm, &hdmi->pcm_list, head) { in get_hdmi_pcm_from_id()
289 if (pcm->pcm_id == pcm_idx) in get_hdmi_pcm_from_id()
290 return pcm; in get_hdmi_pcm_from_id()
358 struct hdac_hdmi_pcm *pcm, struct hdac_hdmi_port *port) in hdac_hdmi_setup_audio_infoframe() argument
365 struct hdac_hdmi_cvt *cvt = pcm->cvt; in hdac_hdmi_setup_audio_infoframe()
374 pcm->channels, pcm->chmap_set, true, pcm->chmap); in hdac_hdmi_setup_audio_infoframe()
380 pcm->channels, pcm->chmap, pcm->chmap_set); in hdac_hdmi_setup_audio_infoframe()
446 struct hdac_hdmi_pcm *pcm; in hdac_hdmi_set_stream() local
458 pcm = hdac_hdmi_get_pcm_from_cvt(hdmi, dai_map->cvt); in hdac_hdmi_set_stream()
460 if (pcm) in hdac_hdmi_set_stream()
461 pcm->stream_tag = (hstream->stream_tag << 4); in hdac_hdmi_set_stream()
471 struct hdac_hdmi_pcm *pcm; in hdac_hdmi_set_hw_params() local
481 pcm = hdac_hdmi_get_pcm_from_cvt(hdmi, dai_map->cvt); in hdac_hdmi_set_hw_params()
482 if (!pcm) in hdac_hdmi_set_hw_params()
485 pcm->format = format; in hdac_hdmi_set_hw_params()
486 pcm->channels = params_channels(hparams); in hdac_hdmi_set_hw_params()
519 * Query pcm list and return port to which stream is routed.
532 struct hdac_hdmi_pcm *pcm; in hdac_hdmi_get_port_from_cvt() local
536 list_for_each_entry(pcm, &hdmi->pcm_list, head) { in hdac_hdmi_get_port_from_cvt()
537 if (pcm->cvt == cvt) { in hdac_hdmi_get_port_from_cvt()
538 if (list_empty(&pcm->port_list)) in hdac_hdmi_get_port_from_cvt()
541 list_for_each_entry(port, &pcm->port_list, head) { in hdac_hdmi_get_port_from_cvt()
542 mutex_lock(&pcm->lock); in hdac_hdmi_get_port_from_cvt()
545 mutex_unlock(&pcm->lock); in hdac_hdmi_get_port_from_cvt()
638 struct hdac_hdmi_pcm *pcm; in hdac_hdmi_pcm_close() local
642 pcm = hdac_hdmi_get_pcm_from_cvt(hdmi, dai_map->cvt); in hdac_hdmi_pcm_close()
644 if (pcm) { in hdac_hdmi_pcm_close()
645 mutex_lock(&pcm->lock); in hdac_hdmi_pcm_close()
646 pcm->chmap_set = false; in hdac_hdmi_pcm_close()
647 memset(pcm->chmap, 0, sizeof(pcm->chmap)); in hdac_hdmi_pcm_close()
648 pcm->channels = 0; in hdac_hdmi_pcm_close()
649 mutex_unlock(&pcm->lock); in hdac_hdmi_pcm_close()
679 "Failed to query pcm params for nid %d: %d\n", in hdac_hdmi_query_cvt_params()
724 struct hdac_hdmi_pcm *pcm; in hdac_hdmi_get_pcm() local
727 list_for_each_entry(pcm, &hdmi->pcm_list, head) { in hdac_hdmi_get_pcm()
728 if (list_empty(&pcm->port_list)) in hdac_hdmi_get_pcm()
731 list_for_each_entry(p, &pcm->port_list, head) { in hdac_hdmi_get_pcm()
733 return pcm; in hdac_hdmi_get_pcm()
775 struct hdac_hdmi_pcm *pcm; in hdac_hdmi_pin_output_widget_event() local
780 pcm = hdac_hdmi_get_pcm(hdev, port); in hdac_hdmi_pin_output_widget_event()
781 if (!pcm) in hdac_hdmi_pin_output_widget_event()
798 return hdac_hdmi_setup_audio_infoframe(hdev, pcm, port); in hdac_hdmi_pin_output_widget_event()
821 struct hdac_hdmi_pcm *pcm; in hdac_hdmi_cvt_output_widget_event() local
826 pcm = hdac_hdmi_get_pcm_from_cvt(hdmi, cvt); in hdac_hdmi_cvt_output_widget_event()
827 if (!pcm) in hdac_hdmi_cvt_output_widget_event()
843 AC_VERB_SET_CHANNEL_STREAMID, pcm->stream_tag); in hdac_hdmi_cvt_output_widget_event()
845 AC_VERB_SET_STREAM_FORMAT, pcm->format); in hdac_hdmi_cvt_output_widget_event()
911 struct hdac_hdmi_pcm *pcm; in hdac_hdmi_set_pin_port_mux() local
922 list_for_each_entry(pcm, &hdmi->pcm_list, head) { in hdac_hdmi_set_pin_port_mux()
923 if (list_empty(&pcm->port_list)) in hdac_hdmi_set_pin_port_mux()
926 list_for_each_entry_safe(p, p_next, &pcm->port_list, head) { in hdac_hdmi_set_pin_port_mux()
929 hdac_hdmi_jack_report_sync(pcm, port, false); in hdac_hdmi_set_pin_port_mux()
939 list_for_each_entry(pcm, &hdmi->pcm_list, head) { in hdac_hdmi_set_pin_port_mux()
940 if (!strcmp(cvt_name, pcm->cvt->name)) { in hdac_hdmi_set_pin_port_mux()
941 list_add_tail(&port->head, &pcm->port_list); in hdac_hdmi_set_pin_port_mux()
943 hdac_hdmi_jack_report_sync(pcm, port, true); in hdac_hdmi_set_pin_port_mux()
1258 struct hdac_hdmi_pcm *pcm; in hdac_hdmi_present_sense() local
1299 pcm = hdac_hdmi_get_pcm(hdev, port); in hdac_hdmi_present_sense()
1311 if (pcm) { in hdac_hdmi_present_sense()
1312 hdac_hdmi_jack_report(pcm, port, false); in hdac_hdmi_present_sense()
1321 if (pcm) { in hdac_hdmi_present_sense()
1322 hdac_hdmi_jack_report(pcm, port, true); in hdac_hdmi_present_sense()
1332 if (eld_changed && pcm) in hdac_hdmi_present_sense()
1336 &pcm->eld_ctl->id); in hdac_hdmi_present_sense()
1440 struct hdac_hdmi_pcm *pcm; in hdac_hdmi_eld_ctl_info() local
1447 pcm = get_hdmi_pcm_from_id(hdmi, kcontrol->id.device); in hdac_hdmi_eld_ctl_info()
1448 if (!pcm) { in hdac_hdmi_eld_ctl_info()
1449 dev_dbg(component->dev, "%s: no pcm, device %d\n", __func__, in hdac_hdmi_eld_ctl_info()
1454 if (list_empty(&pcm->port_list)) { in hdac_hdmi_eld_ctl_info()
1462 list_for_each_entry(port, &pcm->port_list, head) { in hdac_hdmi_eld_ctl_info()
1481 struct hdac_hdmi_pcm *pcm; in hdac_hdmi_eld_ctl_get() local
1487 pcm = get_hdmi_pcm_from_id(hdmi, kcontrol->id.device); in hdac_hdmi_eld_ctl_get()
1488 if (!pcm) { in hdac_hdmi_eld_ctl_get()
1489 dev_dbg(component->dev, "%s: no pcm, device %d\n", __func__, in hdac_hdmi_eld_ctl_get()
1494 if (list_empty(&pcm->port_list)) { in hdac_hdmi_eld_ctl_get()
1502 list_for_each_entry(port, &pcm->port_list, head) { in hdac_hdmi_eld_ctl_get()
1528 static int hdac_hdmi_create_eld_ctl(struct snd_soc_component *component, struct hdac_hdmi_pcm *pcm) in hdac_hdmi_create_eld_ctl() argument
1538 .device = pcm->pcm_id, in hdac_hdmi_create_eld_ctl()
1541 /* add ELD ctl with the device number corresponding to the PCM stream */ in hdac_hdmi_create_eld_ctl()
1546 pcm->eld_ctl = kctl; in hdac_hdmi_create_eld_ctl()
1764 if (rtd->pcm && (rtd->pcm->device == device)) in hdac_hdmi_get_pcm_from_id()
1765 return rtd->pcm; in hdac_hdmi_get_pcm_from_id()
1895 struct hdac_hdmi_pcm *pcm; in hdac_hdmi_jack_init() local
1900 * this is a new PCM device, create new pcm and in hdac_hdmi_jack_init()
1901 * add to the pcm list in hdac_hdmi_jack_init()
1903 pcm = devm_kzalloc(&hdev->dev, sizeof(*pcm), GFP_KERNEL); in hdac_hdmi_jack_init()
1904 if (!pcm) in hdac_hdmi_jack_init()
1906 pcm->pcm_id = device; in hdac_hdmi_jack_init()
1907 pcm->cvt = hdmi->dai_map[dai->id].cvt; in hdac_hdmi_jack_init()
1908 pcm->jack_event = 0; in hdac_hdmi_jack_init()
1909 pcm->jack = jack; in hdac_hdmi_jack_init()
1910 mutex_init(&pcm->lock); in hdac_hdmi_jack_init()
1911 INIT_LIST_HEAD(&pcm->port_list); in hdac_hdmi_jack_init()
1917 "chmap control add failed with err: %d for pcm: %d\n", in hdac_hdmi_jack_init()
1924 err = hdac_hdmi_create_eld_ctl(component, pcm); in hdac_hdmi_jack_init()
1927 "eld control add failed with err: %d for pcm: %d\n", in hdac_hdmi_jack_init()
1932 list_add_tail(&pcm->head, &hdmi->pcm_list); in hdac_hdmi_jack_init()
2074 struct hdac_hdmi_pcm *pcm = get_hdmi_pcm_from_id(hdmi, pcm_idx); in hdac_hdmi_get_chmap() local
2076 memcpy(chmap, pcm->chmap, ARRAY_SIZE(pcm->chmap)); in hdac_hdmi_get_chmap()
2083 struct hdac_hdmi_pcm *pcm = get_hdmi_pcm_from_id(hdmi, pcm_idx); in hdac_hdmi_set_chmap() local
2086 if (!pcm) in hdac_hdmi_set_chmap()
2089 if (list_empty(&pcm->port_list)) in hdac_hdmi_set_chmap()
2092 mutex_lock(&pcm->lock); in hdac_hdmi_set_chmap()
2093 pcm->chmap_set = true; in hdac_hdmi_set_chmap()
2094 memcpy(pcm->chmap, chmap, ARRAY_SIZE(pcm->chmap)); in hdac_hdmi_set_chmap()
2095 list_for_each_entry(port, &pcm->port_list, head) in hdac_hdmi_set_chmap()
2097 hdac_hdmi_setup_audio_infoframe(hdev, pcm, port); in hdac_hdmi_set_chmap()
2098 mutex_unlock(&pcm->lock); in hdac_hdmi_set_chmap()
2104 struct hdac_hdmi_pcm *pcm = get_hdmi_pcm_from_id(hdmi, pcm_idx); in is_hdac_hdmi_pcm_attached() local
2106 if (!pcm) in is_hdac_hdmi_pcm_attached()
2109 if (list_empty(&pcm->port_list)) in is_hdac_hdmi_pcm_attached()
2118 struct hdac_hdmi_pcm *pcm = get_hdmi_pcm_from_id(hdmi, pcm_idx); in hdac_hdmi_get_spk_alloc() local
2121 if (!pcm) in hdac_hdmi_get_spk_alloc()
2124 if (list_empty(&pcm->port_list)) in hdac_hdmi_get_spk_alloc()
2127 port = list_first_entry(&pcm->port_list, struct hdac_hdmi_port, head); in hdac_hdmi_get_spk_alloc()