HDA fixes to multiple Intel platforms
cover HDA fixes to multiple Intel platforms
Hey,
here's a small set of HDA patches touching Intel specific code. First is an important bugfix to TGL platforms and latter are cleanups for code that is no longer needed.
Kai Vehmanen (3):
ALSA: hda: hdmi - fix port numbering for ICL and TGL platforms
ALSA: hda: hdmi - remove redundant code comments
ALSA: hda - remove forced polling workaround for CFL and CNL
sound/pci/hda/hda_intel.c | 6 ------ sound/pci/hda/patch_hdmi.c | 17 +++++++---------- 2 files changed, 7 insertions(+), 16 deletions(-)
Signature · 6 lines
2.17.1 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 1/3 ALSA: hda: hdmi - fix port numbering for ICL and TGL platforms
Semantics of port#0 differ between ICL and TGL:
ICL port#0 -> never used for HDAudio ICL port#1 -> should be mapped to first pin (0x04) TGL port#0 -> typically not used, but HW has the support, so should be mapped to first pin (0x04)
TGL port#1 -> should be mapped to 2nd pin (0x06)
Refactor the port mapping logic to allow to take the above differences into account. Fixes issues with HDAudio on some TGL platforms.
--- sound/pci/hda/patch_hdmi.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
sound/pci/hda/patch_hdmi.c +6 -6
@@ -2664,7 +2664,7 @@ static int intel_pin2port(void *audio_ptr, int pin_nid)*/ for (i =0 ; i < spec->port_num; i++) {if (pin_nid == spec->port_map[i]) -return i +1 ; +return i; }/* return -1 if pin number exceeds our expectation */
@@ -2684,9 +2684,9 @@ static int intel_port2pin(struct hda_codec *codec, int port)return port +intel_base_nid (codec) -1 ; } -if (port <1 || port > spec->port_num) +if (port <0 || port >= spec->port_num)return 0 ; -return spec->port_map[port -1 ]; +return spec->port_map[port]; }static void intel_pin_eld_notify (void *audio_ptr,int port,int pipe)
@@ -2838,9 +2838,9 @@ static int patch_i915_icl_hdmi(struct hda_codec *codec) {/* * pin to port mapping table where the value indicate the pin number and -* the index indicate the port number with 1 base. +* the index indicate the port number. */ -static const int map[] = {0x4 ,0x6 ,0x8 ,0xa ,0xb }; +static const int map[] = {0x0 ,0x4 ,0x6 ,0x8 ,0xa ,0xb };return intel_hsw_common_init (codec,0x02 , map,ARRAY_SIZE (map)); }
@@ -2849,7 +2849,7 @@ static int patch_i915_tgl_hdmi(struct hda_codec *codec) {/* * pin to port mapping table where the value indicate the pin number and -* the index indicate the port number with 1 base. +* the index indicate the port number. */ static const int map[] = {0x4 ,0x6 ,0x8 ,0xa ,0xb ,0xc ,0xd ,0xe ,0xf };
Signature · 6 lines
2.17.1 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 2/3 ALSA: hda: hdmi - remove redundant code comments
In reply to Kai VehmanenRemove unnecessary comments related to pin mapping on Intel platforms.
--- sound/pci/hda/patch_hdmi.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
sound/pci/hda/patch_hdmi.c +1 -4
@@ -2655,7 +2655,7 @@ static int intel_pin2port(void *audio_ptr, int pin_nid) base_nid =intel_base_nid (codec);if (WARN_ON (pin_nid < base_nid || pin_nid >= base_nid +3 ))return -1 ; -return pin_nid - base_nid +1 ;/* intel port is 1-based */ +return pin_nid - base_nid +1 ; }/*
@@ -2667,7 +2667,6 @@ static int intel_pin2port(void *audio_ptr, int pin_nid)return i; } -/* return -1 if pin number exceeds our expectation */ codec_info (codec,"Can't find the HDMI/DP port for pin %d\n" , pin_nid);return -1 ; }
@@ -2680,7 +2679,6 @@ static int intel_port2pin(struct hda_codec *codec, int port)/* 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 ; }
@@ -2856,7 +2854,6 @@ static int patch_i915_tgl_hdmi(struct hda_codec *codec)return intel_hsw_common_init (codec,0x02 , map,ARRAY_SIZE (map)); } -/* Intel Baytrail and Braswell; with eld notifier */ static int patch_i915_byt_hdmi (struct hda_codec *codec) {
Signature · 6 lines
2.17.1 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 3/3 ALSA: hda - remove forced polling workaround for CFL and CNL
In reply to Kai VehmanenRemove the workarounds added in commit fa763f1b2858 ("ALSA:
hda - Force polling mode on CNL for fixing codec communication") and commit a8d7bde23e71 ("ALSA: hda - Force polling mode on CFL for fixing codec communication").
The workarounds are no longer needed after the more generic change done in commit 2756d9143aa5 ("ALSA: hda - Fix intermittent CORB/RIRB stall on Intel chips"). This change applies to a larger set of hardware and covers CFL and CNL as well.
Similar change was already done to SOF DSP HDA driver with no regressions detected.
--- sound/pci/hda/hda_intel.c | 6 ------ 1 file changed, 6 deletions(-)
sound/pci/hda/hda_intel.c +0 -6
@@ -369,8 +369,6 @@ enum { ((pci)->device == 0x160c))#define IS_BXT (pci) ((pci)->vendor == 0x8086 && (pci)->device == 0x5a98) -#define IS_CFL (pci) ((pci)->vendor == 0x8086 && (pci)->device == 0xa348) -#define IS_CNL (pci) ((pci)->vendor == 0x8086 && (pci)->device == 0x9dc8)static char *driver_short_names[] = { [AZX_DRIVER_ICH ] ="HDA Intel" ,
@@ -1763,10 +1761,6 @@ static int azx_create(struct snd_card *card, struct pci_dev *pci,if (!azx_snoop (chip))azx_bus (chip)->dma_type =SNDRV_DMA_TYPE_DEV_UC ; -/* Workaround for a communication error on CFL (bko#199007) and CNL */ -if (IS_CFL (pci) ||IS_CNL (pci)) -azx_bus (chip)->polling_mode =1 ; -if (chip->driver_type ==AZX_DRIVER_NVIDIA ) {dev_dbg (chip->card->dev,"Enable delay in RIRB handling\n" ); chip->bus.needs_damn_long_delay =1 ;
Signature · 6 lines
2.17.1 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Takashi Iwai
AppliedQuoted 10 lines · Kai Vehmanen
Hey,
here's a small set of HDA patches touching Intel specific code. First is an important bugfix to TGL platforms and latter are cleanups for code that is no longer needed.Kai Vehmanen (3):
ALSA: hda: hdmi - fix port numbering for ICL and TGL platforms
ALSA: hda: hdmi - remove redundant code comments
ALSA: hda - remove forced polling workaround for CFL and CNL
Applied all three patches now. Thanks.
Takashi
_______________________________________________
Alsa-devel mailing list
[email protected]
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel