Home Home > GIT Browse > SLE15-SP1
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2019-07-19 14:20:49 +0200
committerTakashi Iwai <tiwai@suse.de>2019-07-19 14:34:28 +0200
commita74cc0a24e1010d639e59b2329fc2b03d0352f8d (patch)
tree728cc31fb9915950d146f7047f34eb3b7e69e391
parente861008e61bef561ffb7b59c060f762267ada14e (diff)
ALSA: hda/hdmi - Fix i915 reverse port/pin mapping
(bsc#1111666). suse-commit: 93c949a507a027a0550491e200d7b8b0533a0859
-rw-r--r--sound/pci/hda/patch_hdmi.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
index 9a2342fc31e5..e1c172767c96 100644
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -2528,18 +2528,32 @@ static int intel_pin2port(void *audio_ptr, int pin_nid)
return -1;
}
+static int intel_port2pin(struct hda_codec *codec, int port)
+{
+ struct hdmi_spec *spec = codec->spec;
+
+ if (!spec->port_num) {
+ /* we assume only from port-B to port-D */
+ if (port < 1 || port > 3)
+ return 0;
+ /* intel port is 1-based */
+ return port + intel_base_nid(codec) - 1;
+ }
+
+ if (port < 1 || port > spec->port_num)
+ return 0;
+ return spec->port_map[port - 1];
+}
+
static void intel_pin_eld_notify(void *audio_ptr, int port, int pipe)
{
struct hda_codec *codec = audio_ptr;
int pin_nid;
int dev_id = pipe;
- /* we assume only from port-B to port-D */
- if (port < 1 || port > 3)
+ pin_nid = intel_port2pin(codec, port);
+ if (!pin_nid)
return;
-
- pin_nid = port + intel_base_nid(codec) - 1; /* intel port is 1-based */
-
/* skip notification during system suspend (but not in runtime PM);
* the state will be updated at resume
*/