]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/2.6.36.2/alsa-hda-add-workarounds-for-ct-ibg-controllers.patch
fixes for 4.19
[thirdparty/kernel/stable-queue.git] / releases / 2.6.36.2 / alsa-hda-add-workarounds-for-ct-ibg-controllers.patch
1 From 62b7e5e09bcb854ff05e6ee1aa161f8283dc36ee Mon Sep 17 00:00:00 2001
2 From: Takashi Iwai <tiwai@suse.de>
3 Date: Fri, 22 Oct 2010 17:15:47 +0200
4 Subject: ALSA: hda - Add workarounds for CT-IBG controllers
5
6 From: Takashi Iwai <tiwai@suse.de>
7
8 commit 62b7e5e09bcb854ff05e6ee1aa161f8283dc36ee upstream.
9
10 Creative IBG controllers require the playback stream-tags to be started
11 from 1, instead of capture+1. Otherwise the stream stalls.
12
13 Reported-by: Wai Yew CHAY <wychay@ctl.creative.com>
14 Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16
17 ---
18 sound/pci/hda/hda_codec.c | 5 ++++-
19 sound/pci/hda/hda_intel.c | 9 +++++++--
20 2 files changed, 11 insertions(+), 3 deletions(-)
21
22 --- a/sound/pci/hda/hda_codec.c
23 +++ b/sound/pci/hda/hda_codec.c
24 @@ -1216,6 +1216,7 @@ void snd_hda_codec_setup_stream(struct h
25 struct hda_codec *c;
26 struct hda_cvt_setup *p;
27 unsigned int oldval, newval;
28 + int type;
29 int i;
30
31 if (!nid)
32 @@ -1254,10 +1255,12 @@ void snd_hda_codec_setup_stream(struct h
33 p->dirty = 0;
34
35 /* make other inactive cvts with the same stream-tag dirty */
36 + type = get_wcaps_type(get_wcaps(codec, nid));
37 list_for_each_entry(c, &codec->bus->codec_list, list) {
38 for (i = 0; i < c->cvt_setups.used; i++) {
39 p = snd_array_elem(&c->cvt_setups, i);
40 - if (!p->active && p->stream_tag == stream_tag)
41 + if (!p->active && p->stream_tag == stream_tag &&
42 + get_wcaps_type(get_wcaps(codec, p->nid)) == type)
43 p->dirty = 1;
44 }
45 }
46 --- a/sound/pci/hda/hda_intel.c
47 +++ b/sound/pci/hda/hda_intel.c
48 @@ -1647,7 +1647,7 @@ static int azx_pcm_prepare(struct snd_pc
49 struct azx_dev *azx_dev = get_azx_dev(substream);
50 struct hda_pcm_stream *hinfo = apcm->hinfo[substream->stream];
51 struct snd_pcm_runtime *runtime = substream->runtime;
52 - unsigned int bufsize, period_bytes, format_val;
53 + unsigned int bufsize, period_bytes, format_val, stream_tag;
54 int err;
55
56 azx_stream_reset(chip, azx_dev);
57 @@ -1689,7 +1689,12 @@ static int azx_pcm_prepare(struct snd_pc
58 else
59 azx_dev->fifo_size = 0;
60
61 - return snd_hda_codec_prepare(apcm->codec, hinfo, azx_dev->stream_tag,
62 + stream_tag = azx_dev->stream_tag;
63 + /* CA-IBG chips need the playback stream starting from 1 */
64 + if (chip->driver_type == AZX_DRIVER_CTX &&
65 + stream_tag > chip->capture_streams)
66 + stream_tag -= chip->capture_streams;
67 + return snd_hda_codec_prepare(apcm->codec, hinfo, stream_tag,
68 azx_dev->format_val, substream);
69 }
70