Lines Matching defs:port
116 struct hdac_hdmi_port *port;
158 struct hdac_hdmi_port *port, bool is_connect)
160 struct hdac_device *hdev = port->pin->hdev;
162 port->is_connect = is_connect;
190 static void hdac_hdmi_port_dapm_update(struct hdac_hdmi_port *port)
192 if (port->is_connect)
193 snd_soc_dapm_enable_pin(port->dapm, port->jack_pin);
195 snd_soc_dapm_disable_pin(port->dapm, port->jack_pin);
196 snd_soc_dapm_sync(port->dapm);
201 struct hdac_hdmi_port *port;
203 port = container_of(work, struct hdac_hdmi_port, dapm_work);
204 hdac_hdmi_port_dapm_update(port);
208 struct hdac_hdmi_port *port, bool is_connect)
210 hdac_hdmi_jack_report(pcm, port, is_connect);
211 hdac_hdmi_port_dapm_update(port);
216 * Get the no devices that can be connected to a port on the Pin widget.
237 * Get the port entry select on the pin. Return the port entry
238 * id selected on the pin. Return 0 means the first port entry
242 struct hdac_hdmi_port *port)
244 return snd_hdac_codec_read(hdev, port->pin->nid,
249 * Sets the selected port entry for the configuring Pin widget verb.
250 * returns error if port set is not equal to port get otherwise success
253 struct hdac_hdmi_port *port)
257 if (!port->pin->mst_capable)
261 num_ports = hdac_hdmi_get_port_len(hdev, port->pin->nid);
268 if (num_ports + 1 < port->id)
271 snd_hdac_codec_write(hdev, port->pin->nid, 0,
272 AC_VERB_SET_DEVICE_SEL, port->id);
274 if (port->id != hdac_hdmi_port_select_get(hdev, port))
277 dev_dbg(&hdev->dev, "Selected the port=%d\n", port->id);
357 struct hdac_hdmi_pcm *pcm, struct hdac_hdmi_port *port)
361 struct hdac_hdmi_pin *pin = port->pin;
372 ca = snd_hdac_channel_allocation(hdev, port->eld.info.spk_alloc,
381 eld_buf = port->eld.eld_buffer;
491 struct hdac_hdmi_port *port)
500 if (hdac_hdmi_port_select_set(hdev, port) < 0)
503 port->num_mux_nids = snd_hdac_get_connections(hdev, pin->nid,
504 port->mux_nids, HDA_MAX_CONNECTIONS);
505 if (port->num_mux_nids == 0)
507 "No connections found for pin:port %d:%d\n",
508 pin->nid, port->id);
510 dev_dbg(&hdev->dev, "num_mux_nids %d for pin:port %d:%d\n",
511 port->num_mux_nids, pin->nid, port->id);
513 return port->num_mux_nids;
517 * Query pcm list and return port to which stream is routed.
519 * Also query connection list of the pin, to validate the cvt to port map.
522 * possibly, but not supported for now in driver. So return the first port
531 struct hdac_hdmi_port *port;
539 list_for_each_entry(port, &pcm->port_list, head) {
542 port->pin, port);
547 for (i = 0; i < port->num_mux_nids; i++) {
548 if (port->mux_nids[i] == cvt->nid &&
549 port->eld.monitor_present &&
550 port->eld.eld_valid)
551 return port;
567 struct hdac_hdmi_port *port;
572 port = hdac_hdmi_get_port_from_cvt(hdev, hdmi, cvt);
573 if (port && port->pin) {
574 snd_hdac_codec_write(hdev, port->pin->nid, 0,
577 __func__, cvt->name, port->pin->nid, cvt_idx);
595 struct hdac_hdmi_port *port;
601 port = hdac_hdmi_get_port_from_cvt(hdev, hdmi, cvt);
607 if (!port)
609 if ((!port->eld.monitor_present) ||
610 (!port->eld.eld_valid)) {
613 "Failed: present?:%d ELD valid?:%d pin:port: %d:%d\n",
614 port->eld.monitor_present, port->eld.eld_valid,
615 port->pin->nid, port->id);
620 dai_map->port = port;
623 port->eld.eld_buffer);
628 port->eld.eld_buffer);
650 if (dai_map->port)
651 dai_map->port = NULL;
718 struct hdac_hdmi_port *port)
729 if (p->id == port->id && port->pin == p->pin)
770 struct hdac_hdmi_port *port = w->priv;
777 pcm = hdac_hdmi_get_pcm(hdev, port);
782 if (hdac_hdmi_port_select_set(hdev, port) < 0)
787 hdac_hdmi_set_power_state(hdev, port->pin->nid, AC_PWRST_D0);
790 snd_hdac_codec_write(hdev, port->pin->nid, 0,
793 hdac_hdmi_set_amp(hdev, port->pin->nid, AMP_OUT_UNMUTE);
795 return hdac_hdmi_setup_audio_infoframe(hdev, pcm, port);
798 hdac_hdmi_set_amp(hdev, port->pin->nid, AMP_OUT_MUTE);
801 snd_hdac_codec_write(hdev, port->pin->nid, 0,
804 hdac_hdmi_set_power_state(hdev, port->pin->nid, AC_PWRST_D3);
870 struct hdac_hdmi_port *port = w->priv;
883 if (hdac_hdmi_port_select_set(hdev, port) < 0)
887 snd_hdac_codec_write(hdev, port->pin->nid, 0,
905 struct hdac_hdmi_port *port = w->priv;
915 if (port == NULL)
924 if (p == port && p->id == port->id &&
925 p->pin == port->pin) {
926 hdac_hdmi_jack_report_sync(pcm, port, false);
938 list_add_tail(&port->head, &pcm->port_list);
939 if (port->eld.monitor_present && port->eld.eld_valid) {
940 hdac_hdmi_jack_report_sync(pcm, port, true);
961 struct hdac_hdmi_port *port,
966 struct hdac_hdmi_pin *pin = port->pin;
985 snprintf(kc_name, NAME_SIZE, "Pin %d port %d Input",
986 pin->nid, port->id);
1023 snd_soc_dapm_mux, port, widget_name, NULL, kc, 1,
1058 * Pin-port widgets for num ports for Pins enumerated
1059 * Pin-port mux widgets to represent connenction list of pin widget
1061 * For each port, one Mux and One output widget is added
1065 * pin-port mux -> pin (based on num_ports)
1225 struct hdac_hdmi_port *port)
1229 ver = (port->eld.eld_buffer[DRM_ELD_VER] & DRM_ELD_VER_MASK)
1237 mnl = (port->eld.eld_buffer[DRM_ELD_CEA_EDID_VER_MNL] &
1245 port->eld.info.spk_alloc = port->eld.eld_buffer[DRM_ELD_SPEAKER];
1251 struct hdac_hdmi_port *port)
1264 * In case of non MST pin, get_eld info API expectes port
1268 port->eld.monitor_present = false;
1271 port_id = port->id;
1274 &port->eld.monitor_present,
1275 port->eld.eld_buffer,
1280 if (hdac_hdmi_parse_eld(hdev, port) < 0)
1284 eld_valid = port->eld.eld_valid;
1287 port->eld.eld_valid = true;
1288 port->eld.eld_size = size;
1290 port->eld.eld_valid = false;
1291 port->eld.eld_size = 0;
1294 eld_changed = (eld_valid != port->eld.eld_valid);
1296 pcm = hdac_hdmi_get_pcm(hdev, port);
1298 if (!port->eld.monitor_present || !port->eld.eld_valid) {
1300 dev_err(&hdev->dev, "%s: disconnect for pin:port %d:%d\n",
1301 __func__, pin->nid, port->id);
1309 hdac_hdmi_jack_report(pcm, port, false);
1310 schedule_work(&port->dapm_work);
1317 if (port->eld.monitor_present && port->eld.eld_valid) {
1319 hdac_hdmi_jack_report(pcm, port, true);
1320 schedule_work(&port->dapm_work);
1324 port->eld.eld_buffer, port->eld.eld_size, false);
1438 struct hdac_hdmi_port *port;
1452 dev_dbg(component->dev, "%s: empty port list, device %d\n",
1459 list_for_each_entry(port, &pcm->port_list, head) {
1460 eld = &port->eld;
1479 struct hdac_hdmi_port *port;
1492 dev_dbg(component->dev, "%s: empty port list, device %d\n",
1499 list_for_each_entry(port, &pcm->port_list, head) {
1500 eld = &port->eld;
1694 return pin - 4; /* map NID 0x05 -> port #1 */
1697 static void hdac_hdmi_eld_notify_cb(void *aptr, int port, int pipe)
1707 hda_nid_t pin_nid = port + 0x04;
1709 dev_dbg(&hdev->dev, "%s: for pin:%d port=%d\n", __func__,
1732 /* if not MST, default is port[0] */
2082 struct hdac_hdmi_port *port;
2093 list_for_each_entry(port, &pcm->port_list, head)
2095 hdac_hdmi_setup_audio_infoframe(hdev, pcm, port);
2117 struct hdac_hdmi_port *port;
2125 port = list_first_entry(&pcm->port_list, struct hdac_hdmi_port, head);
2127 if (!port || !port->eld.eld_valid)
2130 return port->eld.info.spk_alloc;