@@ -81,6 +81,7 @@ struct hdac_hdmi_eld {
struct hdac_hdmi_pin {
struct list_head head;
hda_nid_t nid;
+ bool is_mst_capable;
struct hdac_hdmi_port *ports;
int num_ports;
struct hdac_ext_device *edev;
@@ -1057,6 +1058,7 @@ static void hdac_hdmi_present_sense(struct hdac_hdmi_pin *pin,
struct hdac_hdmi_priv *hdmi = edev->private_data;
struct hdac_hdmi_pcm *pcm;
int size = 0;
+ int port_id;
if (!hdmi)
return;
@@ -1064,7 +1066,9 @@ static void hdac_hdmi_present_sense(struct hdac_hdmi_pin *pin,
mutex_lock(&hdmi->pin_mutex);
port->eld.monitor_present = false;
- size = snd_hdac_acomp_get_eld(&edev->hdac, pin->nid, -1,
+ port_id = (pin->is_mst_capable)? port->id: -1;
+
+ size = snd_hdac_acomp_get_eld(&edev->hdac, pin->nid, port_id,
&port->eld.monitor_present, port->eld.eld_buffer,
ELD_MAX_SIZE);
@@ -1154,6 +1158,7 @@ static int hdac_hdmi_add_pin(struct hdac_ext_device *edev, hda_nid_t nid)
return -ENOMEM;
pin->nid = nid;
+ pin->is_mst_capable = false;
pin->edev = edev;
ret = hdac_hdmi_add_ports(hdmi, pin);
if (ret < 0)
@@ -1352,6 +1357,7 @@ static void hdac_hdmi_eld_notify_cb(void *aptr, int dport, int pipe)
struct hdac_hdmi_pin *pin = NULL;
struct hdac_hdmi_port *port = NULL;
struct snd_soc_codec *codec = edev->scodec;
+ int i;
/* Don't know how this mapping is derived */
hda_nid_t pin_nid = dport + 0x04;
@@ -1377,13 +1383,23 @@ static void hdac_hdmi_eld_notify_cb(void *aptr, int dport, int pipe)
continue;
if (pipe == -1) {
+ pin->is_mst_capable = false;
/* if not MST, default is port[0] */
port = &pin->ports[0];
- break;
+ goto out;
+ } else {
+ for (i=0; i < pin->num_ports; i++) {
+ pin->is_mst_capable = true;
+ if (pin->ports[i].id == pipe) {
+ port = &pin->ports[i];
+ goto out;
+ }
+ }
}
}
- if (port)
+out:
+ if (pin && port)
hdac_hdmi_present_sense(pin, port);
}