mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 10:00:17 +00:00
ALSA: hda/hdmi - Fix i915 reverse port/pin mapping
commit3140aafb22upstream. 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:b0d8bc50b9("ALSA: hda: hdmi - add Icelake support") Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
33b9b37da4
commit
1d14907314
@@ -2538,18 +2538,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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user