alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [alsa-devel] [PATCH 0/3] HDA fixes to multiple Intel platforms
@ 2019-11-15 12:44 Kai Vehmanen
  2019-11-15 12:44 ` [alsa-devel] [PATCH 1/3] ALSA: hda: hdmi - fix port numbering for ICL and TGL platforms Kai Vehmanen
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Kai Vehmanen @ 2019-11-15 12:44 UTC (permalink / raw)
  To: alsa-devel, tiwai; +Cc: yung-chuan.liao, pierre-louis.bossart, 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

 sound/pci/hda/hda_intel.c  |  6 ------
 sound/pci/hda/patch_hdmi.c | 17 +++++++----------
 2 files changed, 7 insertions(+), 16 deletions(-)

-- 
2.17.1

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [alsa-devel] [PATCH 1/3] ALSA: hda: hdmi - fix port numbering for ICL and TGL platforms
  2019-11-15 12:44 [alsa-devel] [PATCH 0/3] HDA fixes to multiple Intel platforms Kai Vehmanen
@ 2019-11-15 12:44 ` Kai Vehmanen
  2019-11-15 12:44 ` [alsa-devel] [PATCH 2/3] ALSA: hda: hdmi - remove redundant code comments Kai Vehmanen
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Kai Vehmanen @ 2019-11-15 12:44 UTC (permalink / raw)
  To: alsa-devel, tiwai
  Cc: Pan Xiuli, yung-chuan.liao, pierre-louis.bossart, kai.vehmanen

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.

Co-developed-by: Pan Xiuli <xiuli.pan@linux.intel.com>
Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
---
 sound/pci/hda/patch_hdmi.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
index 69d1a6e41f0d..dec90f931bae 100644
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -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};
 
-- 
2.17.1

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [alsa-devel] [PATCH 2/3] ALSA: hda: hdmi - remove redundant code comments
  2019-11-15 12:44 [alsa-devel] [PATCH 0/3] HDA fixes to multiple Intel platforms Kai Vehmanen
  2019-11-15 12:44 ` [alsa-devel] [PATCH 1/3] ALSA: hda: hdmi - fix port numbering for ICL and TGL platforms Kai Vehmanen
@ 2019-11-15 12:44 ` Kai Vehmanen
  2019-11-15 12:44 ` [alsa-devel] [PATCH 3/3] ALSA: hda - remove forced polling workaround for CFL and CNL Kai Vehmanen
  2019-11-15 13:20 ` [alsa-devel] [PATCH 0/3] HDA fixes to multiple Intel platforms Takashi Iwai
  3 siblings, 0 replies; 5+ messages in thread
From: Kai Vehmanen @ 2019-11-15 12:44 UTC (permalink / raw)
  To: alsa-devel, tiwai; +Cc: yung-chuan.liao, pierre-louis.bossart, kai.vehmanen

Remove unnecessary comments related to pin mapping on
Intel platforms.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
---
 sound/pci/hda/patch_hdmi.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
index dec90f931bae..d3768767625e 100644
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -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)
 {
-- 
2.17.1

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [alsa-devel] [PATCH 3/3] ALSA: hda - remove forced polling workaround for CFL and CNL
  2019-11-15 12:44 [alsa-devel] [PATCH 0/3] HDA fixes to multiple Intel platforms Kai Vehmanen
  2019-11-15 12:44 ` [alsa-devel] [PATCH 1/3] ALSA: hda: hdmi - fix port numbering for ICL and TGL platforms Kai Vehmanen
  2019-11-15 12:44 ` [alsa-devel] [PATCH 2/3] ALSA: hda: hdmi - remove redundant code comments Kai Vehmanen
@ 2019-11-15 12:44 ` Kai Vehmanen
  2019-11-15 13:20 ` [alsa-devel] [PATCH 0/3] HDA fixes to multiple Intel platforms Takashi Iwai
  3 siblings, 0 replies; 5+ messages in thread
From: Kai Vehmanen @ 2019-11-15 12:44 UTC (permalink / raw)
  To: alsa-devel, tiwai; +Cc: yung-chuan.liao, pierre-louis.bossart, kai.vehmanen

Remove 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.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
---
 sound/pci/hda/hda_intel.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index 8981109e3565..e76a0bb6d3cf 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -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;
-- 
2.17.1

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [alsa-devel] [PATCH 0/3] HDA fixes to multiple Intel platforms
  2019-11-15 12:44 [alsa-devel] [PATCH 0/3] HDA fixes to multiple Intel platforms Kai Vehmanen
                   ` (2 preceding siblings ...)
  2019-11-15 12:44 ` [alsa-devel] [PATCH 3/3] ALSA: hda - remove forced polling workaround for CFL and CNL Kai Vehmanen
@ 2019-11-15 13:20 ` Takashi Iwai
  3 siblings, 0 replies; 5+ messages in thread
From: Takashi Iwai @ 2019-11-15 13:20 UTC (permalink / raw)
  To: Kai Vehmanen; +Cc: alsa-devel, yung-chuan.liao, pierre-louis.bossart

On Fri, 15 Nov 2019 13:44:46 +0100,
Kai Vehmanen wrote:
> 
> 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
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-11-15 13:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-15 12:44 [alsa-devel] [PATCH 0/3] HDA fixes to multiple Intel platforms Kai Vehmanen
2019-11-15 12:44 ` [alsa-devel] [PATCH 1/3] ALSA: hda: hdmi - fix port numbering for ICL and TGL platforms Kai Vehmanen
2019-11-15 12:44 ` [alsa-devel] [PATCH 2/3] ALSA: hda: hdmi - remove redundant code comments Kai Vehmanen
2019-11-15 12:44 ` [alsa-devel] [PATCH 3/3] ALSA: hda - remove forced polling workaround for CFL and CNL Kai Vehmanen
2019-11-15 13:20 ` [alsa-devel] [PATCH 0/3] HDA fixes to multiple Intel platforms Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).