Skip to content

Commit 3140aaf

Browse files
committed
ALSA: hda/hdmi - Fix i915 reverse port/pin mapping
The recent fix for Icelake HDMI codec introduced the mapping from pin NID to the i915 gfx port number. However, it forgot the reverse mapping from the port number to the pin NID that is used in the ELD notifier callback. As a result, it's processed to a wrong widget and gives a warning like snd_hda_codec_hdmi hdaudioC0D2: HDMI: pin nid 5 not registered This patch corrects it with a proper reverse mapping function. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=204133 Fixes: b0d8bc5 ("ALSA: hda: hdmi - add Icelake support") Reviewed-by: Kai Vehmanen <[email protected]> Cc: <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
1 parent eb41771 commit 3140aaf

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

sound/pci/hda/patch_hdmi.c

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2524,18 +2524,32 @@ static int intel_pin2port(void *audio_ptr, int pin_nid)
25242524
return -1;
25252525
}
25262526

2527+
static 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+
25272544
static void intel_pin_eld_notify(void *audio_ptr, int port, int pipe)
25282545
{
25292546
struct hda_codec *codec = audio_ptr;
25302547
int pin_nid;
25312548
int dev_id = pipe;
25322549

2533-
/* we assume only from port-B to port-D */
2534-
if (port < 1 || port > 3)
2550+
pin_nid = intel_port2pin(codec, port);
2551+
if (!pin_nid)
25352552
return;
2536-
2537-
pin_nid = port + intel_base_nid(codec) - 1; /* intel port is 1-based */
2538-
25392553
/* skip notification during system suspend (but not in runtime PM);
25402554
* the state will be updated at resume
25412555
*/

0 commit comments

Comments
 (0)