summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 1e6c489bca15..0b2a26e2c5f1 100644
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -2524,18 +2524,32 @@ static int intel_pin2port(void *audio_ptr, int pin_nid)
2524 return -1; 2524 return -1;
2525} 2525}
2526 2526
2527static int intel_port2pin(struct hda_codec *codec, int port)
2528{
2529 struct hdmi_spec *spec = codec->spec;
2530
2531 if (!spec->port_num) {
2532 /* we assume only from port-B to port-D */
2533 if (port < 1 || port > 3)
2534 return 0;
2535 /* intel port is 1-based */
2536 return port + intel_base_nid(codec) - 1;
2537 }
2538
2539 if (port < 1 || port > spec->port_num)
2540 return 0;
2541 return spec->port_map[port - 1];
2542}
2543
2527static void intel_pin_eld_notify(void *audio_ptr, int port, int pipe) 2544static void intel_pin_eld_notify(void *audio_ptr, int port, int pipe)
2528{ 2545{
2529 struct hda_codec *codec = audio_ptr; 2546 struct hda_codec *codec = audio_ptr;
2530 int pin_nid; 2547 int pin_nid;
2531 int dev_id = pipe; 2548 int dev_id = pipe;
2532 2549
2533 /* we assume only from port-B to port-D */ 2550 pin_nid = intel_port2pin(codec, port);
2534 if (port < 1 || port > 3) 2551 if (!pin_nid)
2535 return; 2552 return;
2536
2537 pin_nid = port + intel_base_nid(codec) - 1; /* intel port is 1-based */
2538
2539 /* skip notification during system suspend (but not in runtime PM); 2553 /* skip notification during system suspend (but not in runtime PM);
2540 * the state will be updated at resume 2554 * the state will be updated at resume
2541 */ 2555 */