Lines Matching full: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
166 * for the first time where same PCM is attached to multiple in hdac_hdmi_jack_report()
169 if (pcm->jack_event == 0) { in hdac_hdmi_jack_report()
171 "jack report for pcm=%d\n", 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()
180 * is the only last connected device when same PCM is attached 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()
446 struct hdac_hdmi_pcm *pcm; in hdac_hdmi_set_tdm_slot() local
452 pcm = hdac_hdmi_get_pcm_from_cvt(hdmi, dai_map->cvt); in hdac_hdmi_set_tdm_slot()
454 if (pcm) in hdac_hdmi_set_tdm_slot()
455 pcm->stream_tag = (tx_mask << 4); in hdac_hdmi_set_tdm_slot()
465 struct hdac_hdmi_pcm *pcm; in hdac_hdmi_set_hw_params() local
474 pcm = hdac_hdmi_get_pcm_from_cvt(hdmi, dai_map->cvt); in hdac_hdmi_set_hw_params()
475 if (!pcm) in hdac_hdmi_set_hw_params()
478 pcm->format = format; in hdac_hdmi_set_hw_params()
479 pcm->channels = params_channels(hparams); in hdac_hdmi_set_hw_params()
512 * Query pcm list and return port to which stream is routed.
525 struct hdac_hdmi_pcm *pcm; in hdac_hdmi_get_port_from_cvt() local
529 list_for_each_entry(pcm, &hdmi->pcm_list, head) { in hdac_hdmi_get_port_from_cvt()
530 if (pcm->cvt == cvt) { in hdac_hdmi_get_port_from_cvt()
531 if (list_empty(&pcm->port_list)) in hdac_hdmi_get_port_from_cvt()
534 list_for_each_entry(port, &pcm->port_list, head) { in hdac_hdmi_get_port_from_cvt()
535 mutex_lock(&pcm->lock); in hdac_hdmi_get_port_from_cvt()
538 mutex_unlock(&pcm->lock); in hdac_hdmi_get_port_from_cvt()
631 struct hdac_hdmi_pcm *pcm; in hdac_hdmi_pcm_close() local
635 pcm = hdac_hdmi_get_pcm_from_cvt(hdmi, dai_map->cvt); in hdac_hdmi_pcm_close()
637 if (pcm) { in hdac_hdmi_pcm_close()
638 mutex_lock(&pcm->lock); in hdac_hdmi_pcm_close()
639 pcm->chmap_set = false; in hdac_hdmi_pcm_close()
640 memset(pcm->chmap, 0, sizeof(pcm->chmap)); in hdac_hdmi_pcm_close()
641 pcm->channels = 0; in hdac_hdmi_pcm_close()
642 mutex_unlock(&pcm->lock); in hdac_hdmi_pcm_close()
671 "Failed to query pcm params for nid %d: %d\n", in hdac_hdmi_query_cvt_params()
716 struct hdac_hdmi_pcm *pcm = NULL; in hdac_hdmi_get_pcm() local
719 list_for_each_entry(pcm, &hdmi->pcm_list, head) { in hdac_hdmi_get_pcm()
720 if (list_empty(&pcm->port_list)) in hdac_hdmi_get_pcm()
723 list_for_each_entry(p, &pcm->port_list, head) { in hdac_hdmi_get_pcm()
725 return pcm; in hdac_hdmi_get_pcm()
767 struct hdac_hdmi_pcm *pcm; in hdac_hdmi_pin_output_widget_event() local
772 pcm = hdac_hdmi_get_pcm(hdev, port); in hdac_hdmi_pin_output_widget_event()
773 if (!pcm) in hdac_hdmi_pin_output_widget_event()
790 return hdac_hdmi_setup_audio_infoframe(hdev, pcm, port); in hdac_hdmi_pin_output_widget_event()
813 struct hdac_hdmi_pcm *pcm; in hdac_hdmi_cvt_output_widget_event() local
818 pcm = hdac_hdmi_get_pcm_from_cvt(hdmi, cvt); in hdac_hdmi_cvt_output_widget_event()
819 if (!pcm) in hdac_hdmi_cvt_output_widget_event()
835 AC_VERB_SET_CHANNEL_STREAMID, pcm->stream_tag); in hdac_hdmi_cvt_output_widget_event()
837 AC_VERB_SET_STREAM_FORMAT, pcm->format); in hdac_hdmi_cvt_output_widget_event()
903 struct hdac_hdmi_pcm *pcm = NULL; in hdac_hdmi_set_pin_port_mux() local
914 list_for_each_entry(pcm, &hdmi->pcm_list, head) { in hdac_hdmi_set_pin_port_mux()
915 if (list_empty(&pcm->port_list)) in hdac_hdmi_set_pin_port_mux()
918 list_for_each_entry_safe(p, p_next, &pcm->port_list, head) { in hdac_hdmi_set_pin_port_mux()
921 hdac_hdmi_jack_report_sync(pcm, port, false); in hdac_hdmi_set_pin_port_mux()
931 list_for_each_entry(pcm, &hdmi->pcm_list, head) { in hdac_hdmi_set_pin_port_mux()
932 if (!strcmp(cvt_name, pcm->cvt->name)) { in hdac_hdmi_set_pin_port_mux()
933 list_add_tail(&port->head, &pcm->port_list); in hdac_hdmi_set_pin_port_mux()
935 hdac_hdmi_jack_report_sync(pcm, port, true); in hdac_hdmi_set_pin_port_mux()
1250 struct hdac_hdmi_pcm *pcm; in hdac_hdmi_present_sense() local
1291 pcm = hdac_hdmi_get_pcm(hdev, port); in hdac_hdmi_present_sense()
1303 if (pcm) { in hdac_hdmi_present_sense()
1304 hdac_hdmi_jack_report(pcm, port, false); in hdac_hdmi_present_sense()
1313 if (pcm) { in hdac_hdmi_present_sense()
1314 hdac_hdmi_jack_report(pcm, port, true); in hdac_hdmi_present_sense()
1324 if (eld_changed && pcm) in hdac_hdmi_present_sense()
1328 &pcm->eld_ctl->id); in hdac_hdmi_present_sense()
1432 struct hdac_hdmi_pcm *pcm; in hdac_hdmi_eld_ctl_info() local
1439 pcm = get_hdmi_pcm_from_id(hdmi, kcontrol->id.device); in hdac_hdmi_eld_ctl_info()
1440 if (!pcm) { in hdac_hdmi_eld_ctl_info()
1441 dev_dbg(component->dev, "%s: no pcm, device %d\n", __func__, in hdac_hdmi_eld_ctl_info()
1446 if (list_empty(&pcm->port_list)) { in hdac_hdmi_eld_ctl_info()
1454 list_for_each_entry(port, &pcm->port_list, head) { in hdac_hdmi_eld_ctl_info()
1473 struct hdac_hdmi_pcm *pcm; in hdac_hdmi_eld_ctl_get() local
1479 pcm = get_hdmi_pcm_from_id(hdmi, kcontrol->id.device); in hdac_hdmi_eld_ctl_get()
1480 if (!pcm) { in hdac_hdmi_eld_ctl_get()
1481 dev_dbg(component->dev, "%s: no pcm, device %d\n", __func__, in hdac_hdmi_eld_ctl_get()
1486 if (list_empty(&pcm->port_list)) { in hdac_hdmi_eld_ctl_get()
1494 list_for_each_entry(port, &pcm->port_list, head) { in hdac_hdmi_eld_ctl_get()
1520 static int hdac_hdmi_create_eld_ctl(struct snd_soc_component *component, struct hdac_hdmi_pcm *pcm) in hdac_hdmi_create_eld_ctl() argument
1530 .device = pcm->pcm_id, in hdac_hdmi_create_eld_ctl()
1533 /* add ELD ctl with the device number corresponding to the PCM stream */ in hdac_hdmi_create_eld_ctl()
1538 pcm->eld_ctl = kctl; in hdac_hdmi_create_eld_ctl()
1756 if (rtd->pcm && (rtd->pcm->device == device)) in hdac_hdmi_get_pcm_from_id()
1757 return rtd->pcm; in hdac_hdmi_get_pcm_from_id()
1888 struct hdac_hdmi_pcm *pcm; in hdac_hdmi_jack_init() local
1893 * this is a new PCM device, create new pcm and in hdac_hdmi_jack_init()
1894 * add to the pcm list in hdac_hdmi_jack_init()
1896 pcm = devm_kzalloc(&hdev->dev, sizeof(*pcm), GFP_KERNEL); in hdac_hdmi_jack_init()
1897 if (!pcm) in hdac_hdmi_jack_init()
1899 pcm->pcm_id = device; in hdac_hdmi_jack_init()
1900 pcm->cvt = hdmi->dai_map[dai->id].cvt; in hdac_hdmi_jack_init()
1901 pcm->jack_event = 0; in hdac_hdmi_jack_init()
1902 pcm->jack = jack; in hdac_hdmi_jack_init()
1903 mutex_init(&pcm->lock); in hdac_hdmi_jack_init()
1904 INIT_LIST_HEAD(&pcm->port_list); in hdac_hdmi_jack_init()
1910 "chmap control add failed with err: %d for pcm: %d\n", in hdac_hdmi_jack_init()
1917 err = hdac_hdmi_create_eld_ctl(component, pcm); in hdac_hdmi_jack_init()
1920 "eld control add failed with err: %d for pcm: %d\n", in hdac_hdmi_jack_init()
1925 list_add_tail(&pcm->head, &hdmi->pcm_list); in hdac_hdmi_jack_init()
2068 struct hdac_hdmi_pcm *pcm = get_hdmi_pcm_from_id(hdmi, pcm_idx); in hdac_hdmi_get_chmap() local
2070 memcpy(chmap, pcm->chmap, ARRAY_SIZE(pcm->chmap)); in hdac_hdmi_get_chmap()
2077 struct hdac_hdmi_pcm *pcm = get_hdmi_pcm_from_id(hdmi, pcm_idx); in hdac_hdmi_set_chmap() local
2080 if (!pcm) in hdac_hdmi_set_chmap()
2083 if (list_empty(&pcm->port_list)) in hdac_hdmi_set_chmap()
2086 mutex_lock(&pcm->lock); in hdac_hdmi_set_chmap()
2087 pcm->chmap_set = true; in hdac_hdmi_set_chmap()
2088 memcpy(pcm->chmap, chmap, ARRAY_SIZE(pcm->chmap)); in hdac_hdmi_set_chmap()
2089 list_for_each_entry(port, &pcm->port_list, head) in hdac_hdmi_set_chmap()
2091 hdac_hdmi_setup_audio_infoframe(hdev, pcm, port); in hdac_hdmi_set_chmap()
2092 mutex_unlock(&pcm->lock); in hdac_hdmi_set_chmap()
2098 struct hdac_hdmi_pcm *pcm = get_hdmi_pcm_from_id(hdmi, pcm_idx); in is_hdac_hdmi_pcm_attached() local
2100 if (!pcm) in is_hdac_hdmi_pcm_attached()
2103 if (list_empty(&pcm->port_list)) in is_hdac_hdmi_pcm_attached()
2112 struct hdac_hdmi_pcm *pcm = get_hdmi_pcm_from_id(hdmi, pcm_idx); in hdac_hdmi_get_spk_alloc() local
2115 if (!pcm) in hdac_hdmi_get_spk_alloc()
2118 if (list_empty(&pcm->port_list)) in hdac_hdmi_get_spk_alloc()
2121 port = list_first_entry(&pcm->port_list, struct hdac_hdmi_port, head); in hdac_hdmi_get_spk_alloc()