aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2010-10-22 11:15:47 -0400
committerTakashi Iwai <tiwai@suse.de>2010-10-22 11:15:47 -0400
commit62b7e5e09bcb854ff05e6ee1aa161f8283dc36ee (patch)
tree2e1c90dca82b9c45963b485da0fb6d2cc3fbde47 /sound
parenta74ccea51d4314632a81d568d59bf885e5b09d93 (diff)
ALSA: hda - Add workarounds for CT-IBG controllers
Creative IBG controllers require the playback stream-tags to be started from 1, instead of capture+1. Otherwise the stream stalls. Reported-by: Wai Yew CHAY <wychay@ctl.creative.com> Cc: <stable@kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/hda/hda_codec.c5
-rw-r--r--sound/pci/hda/hda_intel.c9
2 files changed, 11 insertions, 3 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index ee134a25092c..13c1e7703c49 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -1216,6 +1216,7 @@ void snd_hda_codec_setup_stream(struct hda_codec *codec, hda_nid_t nid,
1216 struct hda_codec *c; 1216 struct hda_codec *c;
1217 struct hda_cvt_setup *p; 1217 struct hda_cvt_setup *p;
1218 unsigned int oldval, newval; 1218 unsigned int oldval, newval;
1219 int type;
1219 int i; 1220 int i;
1220 1221
1221 if (!nid) 1222 if (!nid)
@@ -1254,10 +1255,12 @@ void snd_hda_codec_setup_stream(struct hda_codec *codec, hda_nid_t nid,
1254 p->dirty = 0; 1255 p->dirty = 0;
1255 1256
1256 /* make other inactive cvts with the same stream-tag dirty */ 1257 /* make other inactive cvts with the same stream-tag dirty */
1258 type = get_wcaps_type(get_wcaps(codec, nid));
1257 list_for_each_entry(c, &codec->bus->codec_list, list) { 1259 list_for_each_entry(c, &codec->bus->codec_list, list) {
1258 for (i = 0; i < c->cvt_setups.used; i++) { 1260 for (i = 0; i < c->cvt_setups.used; i++) {
1259 p = snd_array_elem(&c->cvt_setups, i); 1261 p = snd_array_elem(&c->cvt_setups, i);
1260 if (!p->active && p->stream_tag == stream_tag) 1262 if (!p->active && p->stream_tag == stream_tag &&
1263 get_wcaps_type(get_wcaps(codec, p->nid)) == type)
1261 p->dirty = 1; 1264 p->dirty = 1;
1262 } 1265 }
1263 } 1266 }
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index ee445bc6e810..21aa9b0e28f6 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -1652,7 +1652,7 @@ static int azx_pcm_prepare(struct snd_pcm_substream *substream)
1652 struct azx_dev *azx_dev = get_azx_dev(substream); 1652 struct azx_dev *azx_dev = get_azx_dev(substream);
1653 struct hda_pcm_stream *hinfo = apcm->hinfo[substream->stream]; 1653 struct hda_pcm_stream *hinfo = apcm->hinfo[substream->stream];
1654 struct snd_pcm_runtime *runtime = substream->runtime; 1654 struct snd_pcm_runtime *runtime = substream->runtime;
1655 unsigned int bufsize, period_bytes, format_val; 1655 unsigned int bufsize, period_bytes, format_val, stream_tag;
1656 int err; 1656 int err;
1657 1657
1658 azx_stream_reset(chip, azx_dev); 1658 azx_stream_reset(chip, azx_dev);
@@ -1694,7 +1694,12 @@ static int azx_pcm_prepare(struct snd_pcm_substream *substream)
1694 else 1694 else
1695 azx_dev->fifo_size = 0; 1695 azx_dev->fifo_size = 0;
1696 1696
1697 return snd_hda_codec_prepare(apcm->codec, hinfo, azx_dev->stream_tag, 1697 stream_tag = azx_dev->stream_tag;
1698 /* CA-IBG chips need the playback stream starting from 1 */
1699 if (chip->driver_type == AZX_DRIVER_CTX &&
1700 stream_tag > chip->capture_streams)
1701 stream_tag -= chip->capture_streams;
1702 return snd_hda_codec_prepare(apcm->codec, hinfo, stream_tag,
1698 azx_dev->format_val, substream); 1703 azx_dev->format_val, substream);
1699} 1704}
1700 1705