summaryrefslogtreecommitdiff
path: root/sound/pci
diff options
context:
space:
mode:
authorJaroslav Kysela <perex@perex.cz>2017-02-15 19:09:43 +0300
committerTakashi Iwai <tiwai@suse.de>2017-02-15 23:24:44 +0300
commitdf56c3dbae0e6df0edcca2e778810a3d8c994f4e (patch)
treeaaf39f7d22d2c0dc133040fee3c842c7256a5cf0 /sound/pci
parente7480b34ad1ab84a63540b2c884cb92c0764ab74 (diff)
downloadlinux-df56c3dbae0e6df0edcca2e778810a3d8c994f4e.tar.xz
ALSA: hda - add sanity check to force the separate stream tags
It seems that newer Intel chipsets have more than 15 I/O streams (total). This patch forces the separate stream tags, when this hardware is detected to avoid SDxCTL.STRM field overflow and an unexpected behaviour. Signed-off-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci')
-rw-r--r--sound/pci/hda/hda_intel.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index 7d77bb504a16..16108f0eb688 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -1778,6 +1778,14 @@ static int azx_first_init(struct azx *chip)
chip->playback_index_offset = chip->capture_streams;
chip->num_streams = chip->playback_streams + chip->capture_streams;
+ /* sanity check for the SDxCTL.STRM field overflow */
+ if (chip->num_streams > 15 &&
+ (chip->driver_caps & AZX_DCAPS_SEPARATE_STREAM_TAG) == 0) {
+ dev_warn(chip->card->dev, "number of I/O streams is %d, "
+ "forcing separate stream tags", chip->num_streams);
+ chip->driver_caps |= AZX_DCAPS_SEPARATE_STREAM_TAG;
+ }
+
/* initialize streams */
err = azx_init_streams(chip);
if (err < 0)